aclocal.m4 revision bccedf53
1bccedf53Smrg# generated automatically by aclocal 1.7.9 -*- Autoconf -*- 2bccedf53Smrg 3bccedf53Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 4bccedf53Smrg# Free Software Foundation, Inc. 5bccedf53Smrg# This file is free software; the Free Software Foundation 6bccedf53Smrg# gives unlimited permission to copy and/or distribute it, 7bccedf53Smrg# with or without modifications, as long as this notice is preserved. 8bccedf53Smrg 9bccedf53Smrg# This program is distributed in the hope that it will be useful, 10bccedf53Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11bccedf53Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12bccedf53Smrg# PARTICULAR PURPOSE. 13bccedf53Smrg 14bccedf53Smrg# Do all the work for Automake. -*- Autoconf -*- 15bccedf53Smrg 16bccedf53Smrg# This macro actually does too much some checks are only needed if 17bccedf53Smrg# your package does certain things. But this isn't really a big deal. 18bccedf53Smrg 19bccedf53Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 20bccedf53Smrg# Free Software Foundation, Inc. 21bccedf53Smrg 22bccedf53Smrg# This program is free software; you can redistribute it and/or modify 23bccedf53Smrg# it under the terms of the GNU General Public License as published by 24bccedf53Smrg# the Free Software Foundation; either version 2, or (at your option) 25bccedf53Smrg# any later version. 26bccedf53Smrg 27bccedf53Smrg# This program is distributed in the hope that it will be useful, 28bccedf53Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 29bccedf53Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30bccedf53Smrg# GNU General Public License for more details. 31bccedf53Smrg 32bccedf53Smrg# You should have received a copy of the GNU General Public License 33bccedf53Smrg# along with this program; if not, write to the Free Software 34bccedf53Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 35bccedf53Smrg# 02111-1307, USA. 36bccedf53Smrg 37bccedf53Smrg# serial 10 38bccedf53Smrg 39bccedf53SmrgAC_PREREQ([2.54]) 40bccedf53Smrg 41bccedf53Smrg# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow 42bccedf53Smrg# the ones we care about. 43bccedf53Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 44bccedf53Smrg 45bccedf53Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 46bccedf53Smrg# AM_INIT_AUTOMAKE([OPTIONS]) 47bccedf53Smrg# ----------------------------------------------- 48bccedf53Smrg# The call with PACKAGE and VERSION arguments is the old style 49bccedf53Smrg# call (pre autoconf-2.50), which is being phased out. PACKAGE 50bccedf53Smrg# and VERSION should now be passed to AC_INIT and removed from 51bccedf53Smrg# the call to AM_INIT_AUTOMAKE. 52bccedf53Smrg# We support both call styles for the transition. After 53bccedf53Smrg# the next Automake release, Autoconf can make the AC_INIT 54bccedf53Smrg# arguments mandatory, and then we can depend on a new Autoconf 55bccedf53Smrg# release and drop the old call support. 56bccedf53SmrgAC_DEFUN([AM_INIT_AUTOMAKE], 57bccedf53Smrg[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 58bccedf53Smrg AC_REQUIRE([AC_PROG_INSTALL])dnl 59bccedf53Smrg# test to see if srcdir already configured 60bccedf53Smrgif test "`cd $srcdir && pwd`" != "`pwd`" && 61bccedf53Smrg test -f $srcdir/config.status; then 62bccedf53Smrg AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 63bccedf53Smrgfi 64bccedf53Smrg 65bccedf53Smrg# test whether we have cygpath 66bccedf53Smrgif test -z "$CYGPATH_W"; then 67bccedf53Smrg if (cygpath --version) >/dev/null 2>/dev/null; then 68bccedf53Smrg CYGPATH_W='cygpath -w' 69bccedf53Smrg else 70bccedf53Smrg CYGPATH_W=echo 71bccedf53Smrg fi 72bccedf53Smrgfi 73bccedf53SmrgAC_SUBST([CYGPATH_W]) 74bccedf53Smrg 75bccedf53Smrg# Define the identity of the package. 76bccedf53Smrgdnl Distinguish between old-style and new-style calls. 77bccedf53Smrgm4_ifval([$2], 78bccedf53Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 79bccedf53Smrg AC_SUBST([PACKAGE], [$1])dnl 80bccedf53Smrg AC_SUBST([VERSION], [$2])], 81bccedf53Smrg[_AM_SET_OPTIONS([$1])dnl 82bccedf53Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 83bccedf53Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 84bccedf53Smrg 85bccedf53Smrg_AM_IF_OPTION([no-define],, 86bccedf53Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 87bccedf53Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 88bccedf53Smrg 89bccedf53Smrg# Some tools Automake needs. 90bccedf53SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl 91bccedf53SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl 92bccedf53SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 93bccedf53SmrgAM_MISSING_PROG(AUTOCONF, autoconf) 94bccedf53SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 95bccedf53SmrgAM_MISSING_PROG(AUTOHEADER, autoheader) 96bccedf53SmrgAM_MISSING_PROG(MAKEINFO, makeinfo) 97bccedf53SmrgAM_MISSING_PROG(AMTAR, tar) 98bccedf53SmrgAM_PROG_INSTALL_SH 99bccedf53SmrgAM_PROG_INSTALL_STRIP 100bccedf53Smrg# We need awk for the "check" target. The system "awk" is bad on 101bccedf53Smrg# some platforms. 102bccedf53SmrgAC_REQUIRE([AC_PROG_AWK])dnl 103bccedf53SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl 104bccedf53SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl 105bccedf53Smrg 106bccedf53Smrg_AM_IF_OPTION([no-dependencies],, 107bccedf53Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC], 108bccedf53Smrg [_AM_DEPENDENCIES(CC)], 109bccedf53Smrg [define([AC_PROG_CC], 110bccedf53Smrg defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 111bccedf53SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX], 112bccedf53Smrg [_AM_DEPENDENCIES(CXX)], 113bccedf53Smrg [define([AC_PROG_CXX], 114bccedf53Smrg defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 115bccedf53Smrg]) 116bccedf53Smrg]) 117bccedf53Smrg 118bccedf53Smrg 119bccedf53Smrg# When config.status generates a header, we must update the stamp-h file. 120bccedf53Smrg# This file resides in the same directory as the config header 121bccedf53Smrg# that is generated. The stamp files are numbered to have different names. 122bccedf53Smrg 123bccedf53Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 124bccedf53Smrg# loop where config.status creates the headers, so we can generate 125bccedf53Smrg# our stamp files there. 126bccedf53SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 127bccedf53Smrg[# Compute $1's index in $config_headers. 128bccedf53Smrg_am_stamp_count=1 129bccedf53Smrgfor _am_header in $config_headers :; do 130bccedf53Smrg case $_am_header in 131bccedf53Smrg $1 | $1:* ) 132bccedf53Smrg break ;; 133bccedf53Smrg * ) 134bccedf53Smrg _am_stamp_count=`expr $_am_stamp_count + 1` ;; 135bccedf53Smrg esac 136bccedf53Smrgdone 137bccedf53Smrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) 138bccedf53Smrg 139bccedf53Smrg# Copyright 2002 Free Software Foundation, Inc. 140bccedf53Smrg 141bccedf53Smrg# This program is free software; you can redistribute it and/or modify 142bccedf53Smrg# it under the terms of the GNU General Public License as published by 143bccedf53Smrg# the Free Software Foundation; either version 2, or (at your option) 144bccedf53Smrg# any later version. 145bccedf53Smrg 146bccedf53Smrg# This program is distributed in the hope that it will be useful, 147bccedf53Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 148bccedf53Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 149bccedf53Smrg# GNU General Public License for more details. 150bccedf53Smrg 151bccedf53Smrg# You should have received a copy of the GNU General Public License 152bccedf53Smrg# along with this program; if not, write to the Free Software 153bccedf53Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 154bccedf53Smrg 155bccedf53Smrg# AM_AUTOMAKE_VERSION(VERSION) 156bccedf53Smrg# ---------------------------- 157bccedf53Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been 158bccedf53Smrg# generated from the m4 files accompanying Automake X.Y. 159bccedf53SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"]) 160bccedf53Smrg 161bccedf53Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION 162bccedf53Smrg# ------------------------------- 163bccedf53Smrg# Call AM_AUTOMAKE_VERSION so it can be traced. 164bccedf53Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. 165bccedf53SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 166bccedf53Smrg [AM_AUTOMAKE_VERSION([1.7.9])]) 167bccedf53Smrg 168bccedf53Smrg# Helper functions for option handling. -*- Autoconf -*- 169bccedf53Smrg 170bccedf53Smrg# Copyright 2001, 2002 Free Software Foundation, Inc. 171bccedf53Smrg 172bccedf53Smrg# This program is free software; you can redistribute it and/or modify 173bccedf53Smrg# it under the terms of the GNU General Public License as published by 174bccedf53Smrg# the Free Software Foundation; either version 2, or (at your option) 175bccedf53Smrg# any later version. 176bccedf53Smrg 177bccedf53Smrg# This program is distributed in the hope that it will be useful, 178bccedf53Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 179bccedf53Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 180bccedf53Smrg# GNU General Public License for more details. 181bccedf53Smrg 182bccedf53Smrg# You should have received a copy of the GNU General Public License 183bccedf53Smrg# along with this program; if not, write to the Free Software 184bccedf53Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 185bccedf53Smrg# 02111-1307, USA. 186bccedf53Smrg 187bccedf53Smrg# serial 2 188bccedf53Smrg 189bccedf53Smrg# _AM_MANGLE_OPTION(NAME) 190bccedf53Smrg# ----------------------- 191bccedf53SmrgAC_DEFUN([_AM_MANGLE_OPTION], 192bccedf53Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 193bccedf53Smrg 194bccedf53Smrg# _AM_SET_OPTION(NAME) 195bccedf53Smrg# ------------------------------ 196bccedf53Smrg# Set option NAME. Presently that only means defining a flag for this option. 197bccedf53SmrgAC_DEFUN([_AM_SET_OPTION], 198bccedf53Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 199bccedf53Smrg 200bccedf53Smrg# _AM_SET_OPTIONS(OPTIONS) 201bccedf53Smrg# ---------------------------------- 202bccedf53Smrg# OPTIONS is a space-separated list of Automake options. 203bccedf53SmrgAC_DEFUN([_AM_SET_OPTIONS], 204bccedf53Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 205bccedf53Smrg 206bccedf53Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 207bccedf53Smrg# ------------------------------------------- 208bccedf53Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 209bccedf53SmrgAC_DEFUN([_AM_IF_OPTION], 210bccedf53Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 211bccedf53Smrg 212bccedf53Smrg# 213bccedf53Smrg# Check to make sure that the build environment is sane. 214bccedf53Smrg# 215bccedf53Smrg 216bccedf53Smrg# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. 217bccedf53Smrg 218bccedf53Smrg# This program is free software; you can redistribute it and/or modify 219bccedf53Smrg# it under the terms of the GNU General Public License as published by 220bccedf53Smrg# the Free Software Foundation; either version 2, or (at your option) 221bccedf53Smrg# any later version. 222bccedf53Smrg 223bccedf53Smrg# This program is distributed in the hope that it will be useful, 224bccedf53Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 225bccedf53Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 226bccedf53Smrg# GNU General Public License for more details. 227bccedf53Smrg 228bccedf53Smrg# You should have received a copy of the GNU General Public License 229bccedf53Smrg# along with this program; if not, write to the Free Software 230bccedf53Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 231bccedf53Smrg# 02111-1307, USA. 232bccedf53Smrg 233bccedf53Smrg# serial 3 234bccedf53Smrg 235bccedf53Smrg# AM_SANITY_CHECK 236bccedf53Smrg# --------------- 237bccedf53SmrgAC_DEFUN([AM_SANITY_CHECK], 238bccedf53Smrg[AC_MSG_CHECKING([whether build environment is sane]) 239bccedf53Smrg# Just in case 240bccedf53Smrgsleep 1 241bccedf53Smrgecho timestamp > conftest.file 242bccedf53Smrg# Do `set' in a subshell so we don't clobber the current shell's 243bccedf53Smrg# arguments. Must try -L first in case configure is actually a 244bccedf53Smrg# symlink; some systems play weird games with the mod time of symlinks 245bccedf53Smrg# (eg FreeBSD returns the mod time of the symlink's containing 246bccedf53Smrg# directory). 247bccedf53Smrgif ( 248bccedf53Smrg set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` 249bccedf53Smrg if test "$[*]" = "X"; then 250bccedf53Smrg # -L didn't work. 251bccedf53Smrg set X `ls -t $srcdir/configure conftest.file` 252bccedf53Smrg fi 253bccedf53Smrg rm -f conftest.file 254bccedf53Smrg if test "$[*]" != "X $srcdir/configure conftest.file" \ 255bccedf53Smrg && test "$[*]" != "X conftest.file $srcdir/configure"; then 256bccedf53Smrg 257bccedf53Smrg # If neither matched, then we have a broken ls. This can happen 258bccedf53Smrg # if, for instance, CONFIG_SHELL is bash and it inherits a 259bccedf53Smrg # broken ls alias from the environment. This has actually 260bccedf53Smrg # happened. Such a system could not be considered "sane". 261bccedf53Smrg AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 262bccedf53Smrgalias in your environment]) 263bccedf53Smrg fi 264bccedf53Smrg 265bccedf53Smrg test "$[2]" = conftest.file 266bccedf53Smrg ) 267bccedf53Smrgthen 268bccedf53Smrg # Ok. 269bccedf53Smrg : 270bccedf53Smrgelse 271bccedf53Smrg AC_MSG_ERROR([newly created file is older than distributed files! 272bccedf53SmrgCheck your system clock]) 273bccedf53Smrgfi 274bccedf53SmrgAC_MSG_RESULT(yes)]) 275bccedf53Smrg 276bccedf53Smrg# -*- Autoconf -*- 277bccedf53Smrg 278bccedf53Smrg 279bccedf53Smrg# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. 280bccedf53Smrg 281bccedf53Smrg# This program is free software; you can redistribute it and/or modify 282bccedf53Smrg# it under the terms of the GNU General Public License as published by 283bccedf53Smrg# the Free Software Foundation; either version 2, or (at your option) 284bccedf53Smrg# any later version. 285bccedf53Smrg 286bccedf53Smrg# This program is distributed in the hope that it will be useful, 287bccedf53Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 288bccedf53Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 289bccedf53Smrg# GNU General Public License for more details. 290bccedf53Smrg 291bccedf53Smrg# You should have received a copy of the GNU General Public License 292bccedf53Smrg# along with this program; if not, write to the Free Software 293bccedf53Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 294bccedf53Smrg# 02111-1307, USA. 295bccedf53Smrg 296bccedf53Smrg# serial 3 297bccedf53Smrg 298bccedf53Smrg# AM_MISSING_PROG(NAME, PROGRAM) 299bccedf53Smrg# ------------------------------ 300bccedf53SmrgAC_DEFUN([AM_MISSING_PROG], 301bccedf53Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN]) 302bccedf53Smrg$1=${$1-"${am_missing_run}$2"} 303bccedf53SmrgAC_SUBST($1)]) 304bccedf53Smrg 305bccedf53Smrg 306bccedf53Smrg# AM_MISSING_HAS_RUN 307bccedf53Smrg# ------------------ 308bccedf53Smrg# Define MISSING if not defined so far and test if it supports --run. 309bccedf53Smrg# If it does, set am_missing_run to use it, otherwise, to nothing. 310bccedf53SmrgAC_DEFUN([AM_MISSING_HAS_RUN], 311bccedf53Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 312bccedf53Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" 313bccedf53Smrg# Use eval to expand $SHELL 314bccedf53Smrgif eval "$MISSING --run true"; then 315bccedf53Smrg am_missing_run="$MISSING --run " 316bccedf53Smrgelse 317bccedf53Smrg am_missing_run= 318bccedf53Smrg AC_MSG_WARN([`missing' script is too old or missing]) 319bccedf53Smrgfi 320bccedf53Smrg]) 321bccedf53Smrg 322bccedf53Smrg# AM_AUX_DIR_EXPAND 323bccedf53Smrg 324bccedf53Smrg# Copyright 2001 Free Software Foundation, Inc. 325bccedf53Smrg 326bccedf53Smrg# This program is free software; you can redistribute it and/or modify 327bccedf53Smrg# it under the terms of the GNU General Public License as published by 328bccedf53Smrg# the Free Software Foundation; either version 2, or (at your option) 329bccedf53Smrg# any later version. 330bccedf53Smrg 331bccedf53Smrg# This program is distributed in the hope that it will be useful, 332bccedf53Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 333bccedf53Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 334bccedf53Smrg# GNU General Public License for more details. 335bccedf53Smrg 336bccedf53Smrg# You should have received a copy of the GNU General Public License 337bccedf53Smrg# along with this program; if not, write to the Free Software 338bccedf53Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 339bccedf53Smrg# 02111-1307, USA. 340bccedf53Smrg 341bccedf53Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 342bccedf53Smrg# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 343bccedf53Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'. 344bccedf53Smrg# 345bccedf53Smrg# Of course, Automake must honor this variable whenever it calls a 346bccedf53Smrg# tool from the auxiliary directory. The problem is that $srcdir (and 347bccedf53Smrg# therefore $ac_aux_dir as well) can be either absolute or relative, 348bccedf53Smrg# depending on how configure is run. This is pretty annoying, since 349bccedf53Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top 350bccedf53Smrg# source directory, any form will work fine, but in subdirectories a 351bccedf53Smrg# relative path needs to be adjusted first. 352bccedf53Smrg# 353bccedf53Smrg# $ac_aux_dir/missing 354bccedf53Smrg# fails when called from a subdirectory if $ac_aux_dir is relative 355bccedf53Smrg# $top_srcdir/$ac_aux_dir/missing 356bccedf53Smrg# fails if $ac_aux_dir is absolute, 357bccedf53Smrg# fails when called from a subdirectory in a VPATH build with 358bccedf53Smrg# a relative $ac_aux_dir 359bccedf53Smrg# 360bccedf53Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 361bccedf53Smrg# are both prefixed by $srcdir. In an in-source build this is usually 362bccedf53Smrg# harmless because $srcdir is `.', but things will broke when you 363bccedf53Smrg# start a VPATH build or use an absolute $srcdir. 364bccedf53Smrg# 365bccedf53Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 366bccedf53Smrg# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 367bccedf53Smrg# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 368bccedf53Smrg# and then we would define $MISSING as 369bccedf53Smrg# MISSING="\${SHELL} $am_aux_dir/missing" 370bccedf53Smrg# This will work as long as MISSING is not called from configure, because 371bccedf53Smrg# unfortunately $(top_srcdir) has no meaning in configure. 372bccedf53Smrg# However there are other variables, like CC, which are often used in 373bccedf53Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir. 374bccedf53Smrg# 375bccedf53Smrg# Another solution, used here, is to always expand $ac_aux_dir to an 376bccedf53Smrg# absolute PATH. The drawback is that using absolute paths prevent a 377bccedf53Smrg# configured tree to be moved without reconfiguration. 378bccedf53Smrg 379bccedf53Smrg# Rely on autoconf to set up CDPATH properly. 380bccedf53SmrgAC_PREREQ([2.50]) 381bccedf53Smrg 382bccedf53SmrgAC_DEFUN([AM_AUX_DIR_EXPAND], [ 383bccedf53Smrg# expand $ac_aux_dir to an absolute path 384bccedf53Smrgam_aux_dir=`cd $ac_aux_dir && pwd` 385bccedf53Smrg]) 386bccedf53Smrg 387bccedf53Smrg# AM_PROG_INSTALL_SH 388bccedf53Smrg# ------------------ 389bccedf53Smrg# Define $install_sh. 390bccedf53Smrg 391bccedf53Smrg# Copyright 2001 Free Software Foundation, Inc. 392bccedf53Smrg 393bccedf53Smrg# This program is free software; you can redistribute it and/or modify 394bccedf53Smrg# it under the terms of the GNU General Public License as published by 395bccedf53Smrg# the Free Software Foundation; either version 2, or (at your option) 396bccedf53Smrg# any later version. 397bccedf53Smrg 398bccedf53Smrg# This program is distributed in the hope that it will be useful, 399bccedf53Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 400bccedf53Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 401bccedf53Smrg# GNU General Public License for more details. 402bccedf53Smrg 403bccedf53Smrg# You should have received a copy of the GNU General Public License 404bccedf53Smrg# along with this program; if not, write to the Free Software 405bccedf53Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 406bccedf53Smrg# 02111-1307, USA. 407bccedf53Smrg 408bccedf53SmrgAC_DEFUN([AM_PROG_INSTALL_SH], 409bccedf53Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 410bccedf53Smrginstall_sh=${install_sh-"$am_aux_dir/install-sh"} 411bccedf53SmrgAC_SUBST(install_sh)]) 412bccedf53Smrg 413bccedf53Smrg# AM_PROG_INSTALL_STRIP 414bccedf53Smrg 415bccedf53Smrg# Copyright 2001 Free Software Foundation, Inc. 416bccedf53Smrg 417bccedf53Smrg# This program is free software; you can redistribute it and/or modify 418bccedf53Smrg# it under the terms of the GNU General Public License as published by 419bccedf53Smrg# the Free Software Foundation; either version 2, or (at your option) 420bccedf53Smrg# any later version. 421bccedf53Smrg 422bccedf53Smrg# This program is distributed in the hope that it will be useful, 423bccedf53Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 424bccedf53Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 425bccedf53Smrg# GNU General Public License for more details. 426bccedf53Smrg 427bccedf53Smrg# You should have received a copy of the GNU General Public License 428bccedf53Smrg# along with this program; if not, write to the Free Software 429bccedf53Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 430bccedf53Smrg# 02111-1307, USA. 431bccedf53Smrg 432bccedf53Smrg# One issue with vendor `install' (even GNU) is that you can't 433bccedf53Smrg# specify the program used to strip binaries. This is especially 434bccedf53Smrg# annoying in cross-compiling environments, where the build's strip 435bccedf53Smrg# is unlikely to handle the host's binaries. 436bccedf53Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we 437bccedf53Smrg# always use install-sh in `make install-strip', and initialize 438bccedf53Smrg# STRIPPROG with the value of the STRIP variable (set by the user). 439bccedf53SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP], 440bccedf53Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 441bccedf53Smrg# Installed binaries are usually stripped using `strip' when the user 442bccedf53Smrg# run `make install-strip'. However `strip' might not be the right 443bccedf53Smrg# tool to use in cross-compilation environments, therefore Automake 444bccedf53Smrg# will honor the `STRIP' environment variable to overrule this program. 445bccedf53Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'. 446bccedf53Smrgif test "$cross_compiling" != no; then 447bccedf53Smrg AC_CHECK_TOOL([STRIP], [strip], :) 448bccedf53Smrgfi 449bccedf53SmrgINSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" 450bccedf53SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])]) 451bccedf53Smrg 452bccedf53Smrg# -*- Autoconf -*- 453bccedf53Smrg# Copyright (C) 2003 Free Software Foundation, Inc. 454bccedf53Smrg 455bccedf53Smrg# This program is free software; you can redistribute it and/or modify 456bccedf53Smrg# it under the terms of the GNU General Public License as published by 457bccedf53Smrg# the Free Software Foundation; either version 2, or (at your option) 458bccedf53Smrg# any later version. 459bccedf53Smrg 460bccedf53Smrg# This program is distributed in the hope that it will be useful, 461bccedf53Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 462bccedf53Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 463bccedf53Smrg# GNU General Public License for more details. 464bccedf53Smrg 465bccedf53Smrg# You should have received a copy of the GNU General Public License 466bccedf53Smrg# along with this program; if not, write to the Free Software 467bccedf53Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 468bccedf53Smrg# 02111-1307, USA. 469bccedf53Smrg 470bccedf53Smrg# serial 1 471bccedf53Smrg 472bccedf53Smrg# Check whether the underlying file-system supports filenames 473bccedf53Smrg# with a leading dot. For instance MS-DOS doesn't. 474bccedf53SmrgAC_DEFUN([AM_SET_LEADING_DOT], 475bccedf53Smrg[rm -rf .tst 2>/dev/null 476bccedf53Smrgmkdir .tst 2>/dev/null 477bccedf53Smrgif test -d .tst; then 478bccedf53Smrg am__leading_dot=. 479bccedf53Smrgelse 480bccedf53Smrg am__leading_dot=_ 481bccedf53Smrgfi 482bccedf53Smrgrmdir .tst 2>/dev/null 483bccedf53SmrgAC_SUBST([am__leading_dot])]) 484bccedf53Smrg 485bccedf53Smrg# serial 5 -*- Autoconf -*- 486bccedf53Smrg 487bccedf53Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. 488bccedf53Smrg 489bccedf53Smrg# This program is free software; you can redistribute it and/or modify 490bccedf53Smrg# it under the terms of the GNU General Public License as published by 491bccedf53Smrg# the Free Software Foundation; either version 2, or (at your option) 492bccedf53Smrg# any later version. 493bccedf53Smrg 494bccedf53Smrg# This program is distributed in the hope that it will be useful, 495bccedf53Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 496bccedf53Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 497bccedf53Smrg# GNU General Public License for more details. 498bccedf53Smrg 499bccedf53Smrg# You should have received a copy of the GNU General Public License 500bccedf53Smrg# along with this program; if not, write to the Free Software 501bccedf53Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 502bccedf53Smrg# 02111-1307, USA. 503bccedf53Smrg 504bccedf53Smrg 505bccedf53Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 506bccedf53Smrg# written in clear, in which case automake, when reading aclocal.m4, 507bccedf53Smrg# will think it sees a *use*, and therefore will trigger all it's 508bccedf53Smrg# C support machinery. Also note that it means that autoscan, seeing 509bccedf53Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 510bccedf53Smrg 511bccedf53Smrg 512bccedf53Smrg 513bccedf53Smrg# _AM_DEPENDENCIES(NAME) 514bccedf53Smrg# ---------------------- 515bccedf53Smrg# See how the compiler implements dependency checking. 516bccedf53Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC". 517bccedf53Smrg# We try a few techniques and use that to set a single cache variable. 518bccedf53Smrg# 519bccedf53Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 520bccedf53Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 521bccedf53Smrg# dependency, and given that the user is not expected to run this macro, 522bccedf53Smrg# just rely on AC_PROG_CC. 523bccedf53SmrgAC_DEFUN([_AM_DEPENDENCIES], 524bccedf53Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl 525bccedf53SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 526bccedf53SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl 527bccedf53SmrgAC_REQUIRE([AM_DEP_TRACK])dnl 528bccedf53Smrg 529bccedf53Smrgifelse([$1], CC, [depcc="$CC" am_compiler_list=], 530bccedf53Smrg [$1], CXX, [depcc="$CXX" am_compiler_list=], 531bccedf53Smrg [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 532bccedf53Smrg [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 533bccedf53Smrg [depcc="$$1" am_compiler_list=]) 534bccedf53Smrg 535bccedf53SmrgAC_CACHE_CHECK([dependency style of $depcc], 536bccedf53Smrg [am_cv_$1_dependencies_compiler_type], 537bccedf53Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 538bccedf53Smrg # We make a subdir and do the tests there. Otherwise we can end up 539bccedf53Smrg # making bogus files that we don't know about and never remove. For 540bccedf53Smrg # instance it was reported that on HP-UX the gcc test will end up 541bccedf53Smrg # making a dummy file named `D' -- because `-MD' means `put the output 542bccedf53Smrg # in D'. 543bccedf53Smrg mkdir conftest.dir 544bccedf53Smrg # Copy depcomp to subdir because otherwise we won't find it if we're 545bccedf53Smrg # using a relative directory. 546bccedf53Smrg cp "$am_depcomp" conftest.dir 547bccedf53Smrg cd conftest.dir 548bccedf53Smrg # We will build objects and dependencies in a subdirectory because 549bccedf53Smrg # it helps to detect inapplicable dependency modes. For instance 550bccedf53Smrg # both Tru64's cc and ICC support -MD to output dependencies as a 551bccedf53Smrg # side effect of compilation, but ICC will put the dependencies in 552bccedf53Smrg # the current directory while Tru64 will put them in the object 553bccedf53Smrg # directory. 554bccedf53Smrg mkdir sub 555bccedf53Smrg 556bccedf53Smrg am_cv_$1_dependencies_compiler_type=none 557bccedf53Smrg if test "$am_compiler_list" = ""; then 558bccedf53Smrg am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 559bccedf53Smrg fi 560bccedf53Smrg for depmode in $am_compiler_list; do 561bccedf53Smrg # Setup a source with many dependencies, because some compilers 562bccedf53Smrg # like to wrap large dependency lists on column 80 (with \), and 563bccedf53Smrg # we should not choose a depcomp mode which is confused by this. 564bccedf53Smrg # 565bccedf53Smrg # We need to recreate these files for each test, as the compiler may 566bccedf53Smrg # overwrite some of them when testing with obscure command lines. 567bccedf53Smrg # This happens at least with the AIX C compiler. 568bccedf53Smrg : > sub/conftest.c 569bccedf53Smrg for i in 1 2 3 4 5 6; do 570bccedf53Smrg echo '#include "conftst'$i'.h"' >> sub/conftest.c 571bccedf53Smrg : > sub/conftst$i.h 572bccedf53Smrg done 573bccedf53Smrg echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 574bccedf53Smrg 575bccedf53Smrg case $depmode in 576bccedf53Smrg nosideeffect) 577bccedf53Smrg # after this tag, mechanisms are not by side-effect, so they'll 578bccedf53Smrg # only be used when explicitly requested 579bccedf53Smrg if test "x$enable_dependency_tracking" = xyes; then 580bccedf53Smrg continue 581bccedf53Smrg else 582bccedf53Smrg break 583bccedf53Smrg fi 584bccedf53Smrg ;; 585bccedf53Smrg none) break ;; 586bccedf53Smrg esac 587bccedf53Smrg # We check with `-c' and `-o' for the sake of the "dashmstdout" 588bccedf53Smrg # mode. It turns out that the SunPro C++ compiler does not properly 589bccedf53Smrg # handle `-M -o', and we need to detect this. 590bccedf53Smrg if depmode=$depmode \ 591bccedf53Smrg source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ 592bccedf53Smrg depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 593bccedf53Smrg $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ 594bccedf53Smrg >/dev/null 2>conftest.err && 595bccedf53Smrg grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 596bccedf53Smrg grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && 597bccedf53Smrg ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 598bccedf53Smrg # icc doesn't choke on unknown options, it will just issue warnings 599bccedf53Smrg # (even with -Werror). So we grep stderr for any message 600bccedf53Smrg # that says an option was ignored. 601bccedf53Smrg if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else 602bccedf53Smrg am_cv_$1_dependencies_compiler_type=$depmode 603bccedf53Smrg break 604bccedf53Smrg fi 605bccedf53Smrg fi 606bccedf53Smrg done 607bccedf53Smrg 608bccedf53Smrg cd .. 609bccedf53Smrg rm -rf conftest.dir 610bccedf53Smrgelse 611bccedf53Smrg am_cv_$1_dependencies_compiler_type=none 612bccedf53Smrgfi 613bccedf53Smrg]) 614bccedf53SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 615bccedf53SmrgAM_CONDITIONAL([am__fastdep$1], [ 616bccedf53Smrg test "x$enable_dependency_tracking" != xno \ 617bccedf53Smrg && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 618bccedf53Smrg]) 619bccedf53Smrg 620bccedf53Smrg 621bccedf53Smrg# AM_SET_DEPDIR 622bccedf53Smrg# ------------- 623bccedf53Smrg# Choose a directory name for dependency files. 624bccedf53Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES 625bccedf53SmrgAC_DEFUN([AM_SET_DEPDIR], 626bccedf53Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 627bccedf53SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 628bccedf53Smrg]) 629bccedf53Smrg 630bccedf53Smrg 631bccedf53Smrg# AM_DEP_TRACK 632bccedf53Smrg# ------------ 633bccedf53SmrgAC_DEFUN([AM_DEP_TRACK], 634bccedf53Smrg[AC_ARG_ENABLE(dependency-tracking, 635bccedf53Smrg[ --disable-dependency-tracking Speeds up one-time builds 636bccedf53Smrg --enable-dependency-tracking Do not reject slow dependency extractors]) 637bccedf53Smrgif test "x$enable_dependency_tracking" != xno; then 638bccedf53Smrg am_depcomp="$ac_aux_dir/depcomp" 639bccedf53Smrg AMDEPBACKSLASH='\' 640bccedf53Smrgfi 641bccedf53SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 642bccedf53SmrgAC_SUBST([AMDEPBACKSLASH]) 643bccedf53Smrg]) 644bccedf53Smrg 645bccedf53Smrg# Generate code to set up dependency tracking. -*- Autoconf -*- 646bccedf53Smrg 647bccedf53Smrg# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. 648bccedf53Smrg 649bccedf53Smrg# This program is free software; you can redistribute it and/or modify 650bccedf53Smrg# it under the terms of the GNU General Public License as published by 651bccedf53Smrg# the Free Software Foundation; either version 2, or (at your option) 652bccedf53Smrg# any later version. 653bccedf53Smrg 654bccedf53Smrg# This program is distributed in the hope that it will be useful, 655bccedf53Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 656bccedf53Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 657bccedf53Smrg# GNU General Public License for more details. 658bccedf53Smrg 659bccedf53Smrg# You should have received a copy of the GNU General Public License 660bccedf53Smrg# along with this program; if not, write to the Free Software 661bccedf53Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 662bccedf53Smrg# 02111-1307, USA. 663bccedf53Smrg 664bccedf53Smrg#serial 2 665bccedf53Smrg 666bccedf53Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS 667bccedf53Smrg# ------------------------------ 668bccedf53SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 669bccedf53Smrg[for mf in $CONFIG_FILES; do 670bccedf53Smrg # Strip MF so we end up with the name of the file. 671bccedf53Smrg mf=`echo "$mf" | sed -e 's/:.*$//'` 672bccedf53Smrg # Check whether this is an Automake generated Makefile or not. 673bccedf53Smrg # We used to match only the files named `Makefile.in', but 674bccedf53Smrg # some people rename them; so instead we look at the file content. 675bccedf53Smrg # Grep'ing the first line is not enough: some people post-process 676bccedf53Smrg # each Makefile.in and add a new line on top of each file to say so. 677bccedf53Smrg # So let's grep whole file. 678bccedf53Smrg if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then 679bccedf53Smrg dirpart=`AS_DIRNAME("$mf")` 680bccedf53Smrg else 681bccedf53Smrg continue 682bccedf53Smrg fi 683bccedf53Smrg grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue 684bccedf53Smrg # Extract the definition of DEP_FILES from the Makefile without 685bccedf53Smrg # running `make'. 686bccedf53Smrg DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` 687bccedf53Smrg test -z "$DEPDIR" && continue 688bccedf53Smrg # When using ansi2knr, U may be empty or an underscore; expand it 689bccedf53Smrg U=`sed -n -e '/^U = / s///p' < "$mf"` 690bccedf53Smrg test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" 691bccedf53Smrg # We invoke sed twice because it is the simplest approach to 692bccedf53Smrg # changing $(DEPDIR) to its actual value in the expansion. 693bccedf53Smrg for file in `sed -n -e ' 694bccedf53Smrg /^DEP_FILES = .*\\\\$/ { 695bccedf53Smrg s/^DEP_FILES = // 696bccedf53Smrg :loop 697bccedf53Smrg s/\\\\$// 698bccedf53Smrg p 699bccedf53Smrg n 700bccedf53Smrg /\\\\$/ b loop 701bccedf53Smrg p 702bccedf53Smrg } 703bccedf53Smrg /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ 704bccedf53Smrg sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 705bccedf53Smrg # Make sure the directory exists. 706bccedf53Smrg test -f "$dirpart/$file" && continue 707bccedf53Smrg fdir=`AS_DIRNAME(["$file"])` 708bccedf53Smrg AS_MKDIR_P([$dirpart/$fdir]) 709bccedf53Smrg # echo "creating $dirpart/$file" 710bccedf53Smrg echo '# dummy' > "$dirpart/$file" 711bccedf53Smrg done 712bccedf53Smrgdone 713bccedf53Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS 714bccedf53Smrg 715bccedf53Smrg 716bccedf53Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS 717bccedf53Smrg# ----------------------------- 718bccedf53Smrg# This macro should only be invoked once -- use via AC_REQUIRE. 719bccedf53Smrg# 720bccedf53Smrg# This code is only required when automatic dependency tracking 721bccedf53Smrg# is enabled. FIXME. This creates each `.P' file that we will 722bccedf53Smrg# need in order to bootstrap the dependency handling code. 723bccedf53SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 724bccedf53Smrg[AC_CONFIG_COMMANDS([depfiles], 725bccedf53Smrg [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 726bccedf53Smrg [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 727bccedf53Smrg]) 728bccedf53Smrg 729bccedf53Smrg# Check to see how 'make' treats includes. -*- Autoconf -*- 730bccedf53Smrg 731bccedf53Smrg# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. 732bccedf53Smrg 733bccedf53Smrg# This program is free software; you can redistribute it and/or modify 734bccedf53Smrg# it under the terms of the GNU General Public License as published by 735bccedf53Smrg# the Free Software Foundation; either version 2, or (at your option) 736bccedf53Smrg# any later version. 737bccedf53Smrg 738bccedf53Smrg# This program is distributed in the hope that it will be useful, 739bccedf53Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 740bccedf53Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 741bccedf53Smrg# GNU General Public License for more details. 742bccedf53Smrg 743bccedf53Smrg# You should have received a copy of the GNU General Public License 744bccedf53Smrg# along with this program; if not, write to the Free Software 745bccedf53Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 746bccedf53Smrg# 02111-1307, USA. 747bccedf53Smrg 748bccedf53Smrg# serial 2 749bccedf53Smrg 750bccedf53Smrg# AM_MAKE_INCLUDE() 751bccedf53Smrg# ----------------- 752bccedf53Smrg# Check to see how make treats includes. 753bccedf53SmrgAC_DEFUN([AM_MAKE_INCLUDE], 754bccedf53Smrg[am_make=${MAKE-make} 755bccedf53Smrgcat > confinc << 'END' 756bccedf53Smrgam__doit: 757bccedf53Smrg @echo done 758bccedf53Smrg.PHONY: am__doit 759bccedf53SmrgEND 760bccedf53Smrg# If we don't find an include directive, just comment out the code. 761bccedf53SmrgAC_MSG_CHECKING([for style of include used by $am_make]) 762bccedf53Smrgam__include="#" 763bccedf53Smrgam__quote= 764bccedf53Smrg_am_result=none 765bccedf53Smrg# First try GNU make style include. 766bccedf53Smrgecho "include confinc" > confmf 767bccedf53Smrg# We grep out `Entering directory' and `Leaving directory' 768bccedf53Smrg# messages which can occur if `w' ends up in MAKEFLAGS. 769bccedf53Smrg# In particular we don't look at `^make:' because GNU make might 770bccedf53Smrg# be invoked under some other name (usually "gmake"), in which 771bccedf53Smrg# case it prints its new name instead of `make'. 772bccedf53Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then 773bccedf53Smrg am__include=include 774bccedf53Smrg am__quote= 775bccedf53Smrg _am_result=GNU 776bccedf53Smrgfi 777bccedf53Smrg# Now try BSD make style include. 778bccedf53Smrgif test "$am__include" = "#"; then 779bccedf53Smrg echo '.include "confinc"' > confmf 780bccedf53Smrg if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then 781bccedf53Smrg am__include=.include 782bccedf53Smrg am__quote="\"" 783bccedf53Smrg _am_result=BSD 784bccedf53Smrg fi 785bccedf53Smrgfi 786bccedf53SmrgAC_SUBST([am__include]) 787bccedf53SmrgAC_SUBST([am__quote]) 788bccedf53SmrgAC_MSG_RESULT([$_am_result]) 789bccedf53Smrgrm -f confinc confmf 790bccedf53Smrg]) 791bccedf53Smrg 792bccedf53Smrg# AM_CONDITIONAL -*- Autoconf -*- 793bccedf53Smrg 794bccedf53Smrg# Copyright 1997, 2000, 2001 Free Software Foundation, Inc. 795bccedf53Smrg 796bccedf53Smrg# This program is free software; you can redistribute it and/or modify 797bccedf53Smrg# it under the terms of the GNU General Public License as published by 798bccedf53Smrg# the Free Software Foundation; either version 2, or (at your option) 799bccedf53Smrg# any later version. 800bccedf53Smrg 801bccedf53Smrg# This program is distributed in the hope that it will be useful, 802bccedf53Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 803bccedf53Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 804bccedf53Smrg# GNU General Public License for more details. 805bccedf53Smrg 806bccedf53Smrg# You should have received a copy of the GNU General Public License 807bccedf53Smrg# along with this program; if not, write to the Free Software 808bccedf53Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 809bccedf53Smrg# 02111-1307, USA. 810bccedf53Smrg 811bccedf53Smrg# serial 5 812bccedf53Smrg 813bccedf53SmrgAC_PREREQ(2.52) 814bccedf53Smrg 815bccedf53Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION) 816bccedf53Smrg# ------------------------------------- 817bccedf53Smrg# Define a conditional. 818bccedf53SmrgAC_DEFUN([AM_CONDITIONAL], 819bccedf53Smrg[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 820bccedf53Smrg [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 821bccedf53SmrgAC_SUBST([$1_TRUE]) 822bccedf53SmrgAC_SUBST([$1_FALSE]) 823bccedf53Smrgif $2; then 824bccedf53Smrg $1_TRUE= 825bccedf53Smrg $1_FALSE='#' 826bccedf53Smrgelse 827bccedf53Smrg $1_TRUE='#' 828bccedf53Smrg $1_FALSE= 829bccedf53Smrgfi 830bccedf53SmrgAC_CONFIG_COMMANDS_PRE( 831bccedf53Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 832bccedf53Smrg AC_MSG_ERROR([conditional "$1" was never defined. 833bccedf53SmrgUsually this means the macro was only invoked conditionally.]) 834bccedf53Smrgfi])]) 835bccedf53Smrg 836bccedf53Smrg# Add --enable-maintainer-mode option to configure. 837bccedf53Smrg# From Jim Meyering 838bccedf53Smrg 839bccedf53Smrg# Copyright 1996, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. 840bccedf53Smrg 841bccedf53Smrg# This program is free software; you can redistribute it and/or modify 842bccedf53Smrg# it under the terms of the GNU General Public License as published by 843bccedf53Smrg# the Free Software Foundation; either version 2, or (at your option) 844bccedf53Smrg# any later version. 845bccedf53Smrg 846bccedf53Smrg# This program is distributed in the hope that it will be useful, 847bccedf53Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 848bccedf53Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 849bccedf53Smrg# GNU General Public License for more details. 850bccedf53Smrg 851bccedf53Smrg# You should have received a copy of the GNU General Public License 852bccedf53Smrg# along with this program; if not, write to the Free Software 853bccedf53Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 854bccedf53Smrg# 02111-1307, USA. 855bccedf53Smrg 856bccedf53Smrg# serial 2 857bccedf53Smrg 858bccedf53SmrgAC_DEFUN([AM_MAINTAINER_MODE], 859bccedf53Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) 860bccedf53Smrg dnl maintainer-mode is disabled by default 861bccedf53Smrg AC_ARG_ENABLE(maintainer-mode, 862bccedf53Smrg[ --enable-maintainer-mode enable make rules and dependencies not useful 863bccedf53Smrg (and sometimes confusing) to the casual installer], 864bccedf53Smrg USE_MAINTAINER_MODE=$enableval, 865bccedf53Smrg USE_MAINTAINER_MODE=no) 866bccedf53Smrg AC_MSG_RESULT([$USE_MAINTAINER_MODE]) 867bccedf53Smrg AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) 868bccedf53Smrg MAINT=$MAINTAINER_MODE_TRUE 869bccedf53Smrg AC_SUBST(MAINT)dnl 870bccedf53Smrg] 871bccedf53Smrg) 872bccedf53Smrg 873bccedf53SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) 874bccedf53Smrg 875bccedf53Smrg# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- 876bccedf53Smrg 877bccedf53Smrg# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. 878bccedf53Smrg 879bccedf53Smrg# This program is free software; you can redistribute it and/or modify 880bccedf53Smrg# it under the terms of the GNU General Public License as published by 881bccedf53Smrg# the Free Software Foundation; either version 2, or (at your option) 882bccedf53Smrg# any later version. 883bccedf53Smrg 884bccedf53Smrg# This program is distributed in the hope that it will be useful, 885bccedf53Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 886bccedf53Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 887bccedf53Smrg# GNU General Public License for more details. 888bccedf53Smrg 889bccedf53Smrg# You should have received a copy of the GNU General Public License 890bccedf53Smrg# along with this program; if not, write to the Free Software 891bccedf53Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 892bccedf53Smrg# 02111-1307, USA. 893bccedf53Smrg 894bccedf53SmrgAC_PREREQ([2.52]) 895bccedf53Smrg 896bccedf53Smrg# serial 6 897bccedf53Smrg 898bccedf53Smrg# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. 899bccedf53SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) 900bccedf53Smrg 901bccedf53Smrg# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 902bccedf53Smrg# 903bccedf53Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 904bccedf53Smrg# 905bccedf53Smrg# This program is free software; you can redistribute it and/or modify 906bccedf53Smrg# it under the terms of the GNU General Public License as published by 907bccedf53Smrg# the Free Software Foundation; either version 2 of the License, or 908bccedf53Smrg# (at your option) any later version. 909bccedf53Smrg# 910bccedf53Smrg# This program is distributed in the hope that it will be useful, but 911bccedf53Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 912bccedf53Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 913bccedf53Smrg# General Public License for more details. 914bccedf53Smrg# 915bccedf53Smrg# You should have received a copy of the GNU General Public License 916bccedf53Smrg# along with this program; if not, write to the Free Software 917bccedf53Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 918bccedf53Smrg# 919bccedf53Smrg# As a special exception to the GNU General Public License, if you 920bccedf53Smrg# distribute this file as part of a program that contains a 921bccedf53Smrg# configuration script generated by Autoconf, you may include it under 922bccedf53Smrg# the same distribution terms that you use for the rest of that program. 923bccedf53Smrg 924bccedf53Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION]) 925bccedf53Smrg# ---------------------------------- 926bccedf53SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG], 927bccedf53Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 928bccedf53Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 929bccedf53SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl 930bccedf53Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 931bccedf53Smrg AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 932bccedf53Smrgfi 933bccedf53Smrgif test -n "$PKG_CONFIG"; then 934bccedf53Smrg _pkg_min_version=m4_default([$1], [0.9.0]) 935bccedf53Smrg AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 936bccedf53Smrg if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 937bccedf53Smrg AC_MSG_RESULT([yes]) 938bccedf53Smrg else 939bccedf53Smrg AC_MSG_RESULT([no]) 940bccedf53Smrg PKG_CONFIG="" 941bccedf53Smrg fi 942bccedf53Smrg 943bccedf53Smrgfi[]dnl 944bccedf53Smrg])# PKG_PROG_PKG_CONFIG 945bccedf53Smrg 946bccedf53Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 947bccedf53Smrg# 948bccedf53Smrg# Check to see whether a particular set of modules exists. Similar 949bccedf53Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors. 950bccedf53Smrg# 951bccedf53Smrg# 952bccedf53Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of 953bccedf53Smrg# this or PKG_CHECK_MODULES is called, or make sure to call 954bccedf53Smrg# PKG_CHECK_EXISTS manually 955bccedf53Smrg# -------------------------------------------------------------- 956bccedf53SmrgAC_DEFUN([PKG_CHECK_EXISTS], 957bccedf53Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 958bccedf53Smrgif test -n "$PKG_CONFIG" && \ 959bccedf53Smrg AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 960bccedf53Smrg m4_ifval([$2], [$2], [:]) 961bccedf53Smrgm4_ifvaln([$3], [else 962bccedf53Smrg $3])dnl 963bccedf53Smrgfi]) 964bccedf53Smrg 965bccedf53Smrg 966bccedf53Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 967bccedf53Smrg# --------------------------------------------- 968bccedf53Smrgm4_define([_PKG_CONFIG], 969bccedf53Smrg[if test -n "$PKG_CONFIG"; then 970bccedf53Smrg if test -n "$$1"; then 971bccedf53Smrg pkg_cv_[]$1="$$1" 972bccedf53Smrg else 973bccedf53Smrg PKG_CHECK_EXISTS([$3], 974bccedf53Smrg [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], 975bccedf53Smrg [pkg_failed=yes]) 976bccedf53Smrg fi 977bccedf53Smrgelse 978bccedf53Smrg pkg_failed=untried 979bccedf53Smrgfi[]dnl 980bccedf53Smrg])# _PKG_CONFIG 981bccedf53Smrg 982bccedf53Smrg# _PKG_SHORT_ERRORS_SUPPORTED 983bccedf53Smrg# ----------------------------- 984bccedf53SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 985bccedf53Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 986bccedf53Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 987bccedf53Smrg _pkg_short_errors_supported=yes 988bccedf53Smrgelse 989bccedf53Smrg _pkg_short_errors_supported=no 990bccedf53Smrgfi[]dnl 991bccedf53Smrg])# _PKG_SHORT_ERRORS_SUPPORTED 992bccedf53Smrg 993bccedf53Smrg 994bccedf53Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 995bccedf53Smrg# [ACTION-IF-NOT-FOUND]) 996bccedf53Smrg# 997bccedf53Smrg# 998bccedf53Smrg# Note that if there is a possibility the first call to 999bccedf53Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an 1000bccedf53Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 1001bccedf53Smrg# 1002bccedf53Smrg# 1003bccedf53Smrg# -------------------------------------------------------------- 1004bccedf53SmrgAC_DEFUN([PKG_CHECK_MODULES], 1005bccedf53Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 1006bccedf53SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 1007bccedf53SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 1008bccedf53Smrg 1009bccedf53Smrgpkg_failed=no 1010bccedf53SmrgAC_MSG_CHECKING([for $1]) 1011bccedf53Smrg 1012bccedf53Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 1013bccedf53Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 1014bccedf53Smrg 1015bccedf53Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 1016bccedf53Smrgand $1[]_LIBS to avoid the need to call pkg-config. 1017bccedf53SmrgSee the pkg-config man page for more details.]) 1018bccedf53Smrg 1019bccedf53Smrgif test $pkg_failed = yes; then 1020bccedf53Smrg _PKG_SHORT_ERRORS_SUPPORTED 1021bccedf53Smrg if test $_pkg_short_errors_supported = yes; then 1022bccedf53Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` 1023bccedf53Smrg else 1024bccedf53Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` 1025bccedf53Smrg fi 1026bccedf53Smrg # Put the nasty error message in config.log where it belongs 1027bccedf53Smrg echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 1028bccedf53Smrg 1029bccedf53Smrg ifelse([$4], , [AC_MSG_ERROR(dnl 1030bccedf53Smrg[Package requirements ($2) were not met: 1031bccedf53Smrg 1032bccedf53Smrg$$1_PKG_ERRORS 1033bccedf53Smrg 1034bccedf53SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you 1035bccedf53Smrginstalled software in a non-standard prefix. 1036bccedf53Smrg 1037bccedf53Smrg_PKG_TEXT 1038bccedf53Smrg])], 1039bccedf53Smrg [$4]) 1040bccedf53Smrgelif test $pkg_failed = untried; then 1041bccedf53Smrg ifelse([$4], , [AC_MSG_FAILURE(dnl 1042bccedf53Smrg[The pkg-config script could not be found or is too old. Make sure it 1043bccedf53Smrgis in your PATH or set the PKG_CONFIG environment variable to the full 1044bccedf53Smrgpath to pkg-config. 1045bccedf53Smrg 1046bccedf53Smrg_PKG_TEXT 1047bccedf53Smrg 1048bccedf53SmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])], 1049bccedf53Smrg [$4]) 1050bccedf53Smrgelse 1051bccedf53Smrg $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 1052bccedf53Smrg $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 1053bccedf53Smrg AC_MSG_RESULT([yes]) 1054bccedf53Smrg ifelse([$3], , :, [$3]) 1055bccedf53Smrgfi[]dnl 1056bccedf53Smrg])# PKG_CHECK_MODULES 1057bccedf53Smrg 1058bccedf53Smrgdnl $Id: aclocal.m4,v 1.1.1.1 2008/07/30 04:40:26 mrg Exp $ 1059bccedf53Smrgdnl 1060bccedf53Smrgdnl Copyright 2005 Sun Microsystems, Inc. All rights reserved. 1061bccedf53Smrgdnl 1062bccedf53Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 1063bccedf53Smrgdnl documentation for any purpose is hereby granted without fee, provided that 1064bccedf53Smrgdnl the above copyright notice appear in all copies and that both that 1065bccedf53Smrgdnl copyright notice and this permission notice appear in supporting 1066bccedf53Smrgdnl documentation. 1067bccedf53Smrgdnl 1068bccedf53Smrgdnl The above copyright notice and this permission notice shall be included 1069bccedf53Smrgdnl in all copies or substantial portions of the Software. 1070bccedf53Smrgdnl 1071bccedf53Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 1072bccedf53Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 1073bccedf53Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 1074bccedf53Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 1075bccedf53Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 1076bccedf53Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 1077bccedf53Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 1078bccedf53Smrgdnl 1079bccedf53Smrgdnl Except as contained in this notice, the name of the copyright holders shall 1080bccedf53Smrgdnl not be used in advertising or otherwise to promote the sale, use or 1081bccedf53Smrgdnl other dealings in this Software without prior written authorization 1082bccedf53Smrgdnl from the copyright holders. 1083bccedf53Smrgdnl 1084bccedf53Smrg 1085bccedf53Smrg# XORG_PROG_RAWCPP() 1086bccedf53Smrg# ------------------ 1087bccedf53Smrg# Find cpp program and necessary flags for use in pre-processing text files 1088bccedf53Smrg# such as man pages and config files 1089bccedf53SmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 1090bccedf53SmrgAC_REQUIRE([AC_PROG_CPP]) 1091bccedf53SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 1092bccedf53Smrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 1093bccedf53Smrg 1094bccedf53Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 1095bccedf53Smrg# which is not the best choice for supporting other OS'es, but covers most 1096bccedf53Smrg# of the ones we need for now. 1097bccedf53SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 1098bccedf53SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?]) 1099bccedf53Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1100bccedf53Smrg AC_MSG_RESULT([no]) 1101bccedf53Smrgelse 1102bccedf53Smrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1103bccedf53Smrg RAWCPPFLAGS=-undef 1104bccedf53Smrg AC_MSG_RESULT([yes]) 1105bccedf53Smrg else 1106bccedf53Smrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 1107bccedf53Smrg fi 1108bccedf53Smrgfi 1109bccedf53Smrgrm -f conftest.$ac_ext 1110bccedf53Smrg 1111bccedf53SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 1112bccedf53SmrgAC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) 1113bccedf53Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 1114bccedf53Smrg AC_MSG_RESULT([no]) 1115bccedf53Smrgelse 1116bccedf53Smrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 1117bccedf53Smrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 1118bccedf53Smrg AC_MSG_RESULT([yes]) 1119bccedf53Smrg else 1120bccedf53Smrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 1121bccedf53Smrg fi 1122bccedf53Smrgfi 1123bccedf53Smrgrm -f conftest.$ac_ext 1124bccedf53SmrgAC_SUBST(RAWCPPFLAGS) 1125bccedf53Smrg]) # XORG_PROG_RAWCPP 1126bccedf53Smrg 1127bccedf53Smrg# XORG_MANPAGE_SECTIONS() 1128bccedf53Smrg# ----------------------- 1129bccedf53Smrg# Determine which sections man pages go in for the different man page types 1130bccedf53Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 1131bccedf53Smrg# Not sure if there's any better way than just hardcoding by OS name. 1132bccedf53Smrg# Override default settings by setting environment variables 1133bccedf53Smrg 1134bccedf53SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 1135bccedf53SmrgAC_REQUIRE([AC_CANONICAL_HOST]) 1136bccedf53Smrg 1137bccedf53Smrgif test x$APP_MAN_SUFFIX = x ; then 1138bccedf53Smrg case $host_os in 1139bccedf53Smrg linux*) APP_MAN_SUFFIX=1x ;; 1140bccedf53Smrg *) APP_MAN_SUFFIX=1 ;; 1141bccedf53Smrg esac 1142bccedf53Smrgfi 1143bccedf53Smrgif test x$APP_MAN_DIR = x ; then 1144bccedf53Smrg case $host_os in 1145bccedf53Smrg linux*) APP_MAN_DIR='$(mandir)/man1' ;; 1146bccedf53Smrg *) APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' ;; 1147bccedf53Smrg esac 1148bccedf53Smrgfi 1149bccedf53Smrg 1150bccedf53Smrgif test x$LIB_MAN_SUFFIX = x ; then 1151bccedf53Smrg case $host_os in 1152bccedf53Smrg linux*) LIB_MAN_SUFFIX=3x ;; 1153bccedf53Smrg *) LIB_MAN_SUFFIX=3 ;; 1154bccedf53Smrg esac 1155bccedf53Smrgfi 1156bccedf53Smrgif test x$LIB_MAN_DIR = x ; then 1157bccedf53Smrg case $host_os in 1158bccedf53Smrg linux*) LIB_MAN_DIR='$(mandir)/man3' ;; 1159bccedf53Smrg *) LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' ;; 1160bccedf53Smrg esac 1161bccedf53Smrgfi 1162bccedf53Smrg 1163bccedf53Smrgif test x$FILE_MAN_SUFFIX = x ; then 1164bccedf53Smrg case $host_os in 1165bccedf53Smrg linux*) FILE_MAN_SUFFIX=5x ;; 1166bccedf53Smrg solaris*) FILE_MAN_SUFFIX=4 ;; 1167bccedf53Smrg *) FILE_MAN_SUFFIX=5 ;; 1168bccedf53Smrg esac 1169bccedf53Smrgfi 1170bccedf53Smrgif test x$FILE_MAN_DIR = x ; then 1171bccedf53Smrg case $host_os in 1172bccedf53Smrg linux*) FILE_MAN_DIR='$(mandir)/man5' ;; 1173bccedf53Smrg *) FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' ;; 1174bccedf53Smrg esac 1175bccedf53Smrgfi 1176bccedf53Smrg 1177bccedf53Smrg# In Imake's linux.cf, the misc man suffix & dir was only changed for 1178bccedf53Smrg# LinuxDebian, not other Linuxes, so we leave it unchanged here 1179bccedf53Smrgif test x$MISC_MAN_SUFFIX = x ; then 1180bccedf53Smrg case $host_os in 1181bccedf53Smrg# linux*) MISC_MAN_SUFFIX=7x ;; 1182bccedf53Smrg solaris*) MISC_MAN_SUFFIX=5 ;; 1183bccedf53Smrg *) MISC_MAN_SUFFIX=7 ;; 1184bccedf53Smrg esac 1185bccedf53Smrgfi 1186bccedf53Smrgif test x$MISC_MAN_DIR = x ; then 1187bccedf53Smrg case $host_os in 1188bccedf53Smrg# linux*) MISC_MAN_DIR='$(mandir)/man7' ;; 1189bccedf53Smrg *) MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' ;; 1190bccedf53Smrg esac 1191bccedf53Smrgfi 1192bccedf53Smrg 1193bccedf53Smrg# In Imake's linux.cf, the driver man suffix & dir was only changed for 1194bccedf53Smrg# LinuxDebian, not other Linuxes, so we leave it unchanged here 1195bccedf53Smrgif test x$DRIVER_MAN_SUFFIX = x ; then 1196bccedf53Smrg case $host_os in 1197bccedf53Smrg# linux*) DRIVER_MAN_SUFFIX=4x ;; 1198bccedf53Smrg solaris*) DRIVER_MAN_SUFFIX=7 ;; 1199bccedf53Smrg *) DRIVER_MAN_SUFFIX=4 ;; 1200bccedf53Smrg esac 1201bccedf53Smrgfi 1202bccedf53Smrgif test x$DRIVER_MAN_DIR = x ; then 1203bccedf53Smrg case $host_os in 1204bccedf53Smrg# linux*) DRIVER_MAN_DIR='$(mandir)/man4' ;; 1205bccedf53Smrg *) DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' ;; 1206bccedf53Smrg esac 1207bccedf53Smrgfi 1208bccedf53Smrg 1209bccedf53Smrgif test x$ADMIN_MAN_SUFFIX = x ; then 1210bccedf53Smrg case $host_os in 1211bccedf53Smrg solaris*) ADMIN_MAN_SUFFIX=1m ;; 1212bccedf53Smrg *) ADMIN_MAN_SUFFIX=8 ;; 1213bccedf53Smrg esac 1214bccedf53Smrgfi 1215bccedf53Smrgif test x$ADMIN_MAN_DIR = x ; then 1216bccedf53Smrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 1217bccedf53Smrgfi 1218bccedf53Smrg 1219bccedf53Smrg 1220bccedf53SmrgAC_SUBST([APP_MAN_SUFFIX]) 1221bccedf53SmrgAC_SUBST([LIB_MAN_SUFFIX]) 1222bccedf53SmrgAC_SUBST([FILE_MAN_SUFFIX]) 1223bccedf53SmrgAC_SUBST([MISC_MAN_SUFFIX]) 1224bccedf53SmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 1225bccedf53SmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 1226bccedf53SmrgAC_SUBST([APP_MAN_DIR]) 1227bccedf53SmrgAC_SUBST([LIB_MAN_DIR]) 1228bccedf53SmrgAC_SUBST([FILE_MAN_DIR]) 1229bccedf53SmrgAC_SUBST([MISC_MAN_DIR]) 1230bccedf53SmrgAC_SUBST([DRIVER_MAN_DIR]) 1231bccedf53SmrgAC_SUBST([ADMIN_MAN_DIR]) 1232bccedf53Smrg]) # XORG_MANPAGE_SECTIONS 1233bccedf53Smrg 1234bccedf53Smrg# XORG_CHECK_LINUXDOC 1235bccedf53Smrg# ------------------- 1236bccedf53Smrg# Defines the variable MAKE_TEXT if the necessary tools and 1237bccedf53Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 1238bccedf53Smrg# Whether or not the necessary tools and files are found can be checked 1239bccedf53Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 1240bccedf53SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 1241bccedf53SmrgAC_CHECK_FILE( 1242bccedf53Smrg [$prefix/share/X11/sgml/defs.ent], 1243bccedf53Smrg [DEFS_ENT_PATH=$prefix/share/X11/sgml], 1244bccedf53Smrg [DEFS_ENT_PATH=] 1245bccedf53Smrg) 1246bccedf53Smrg 1247bccedf53SmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 1248bccedf53SmrgAC_PATH_PROG(PS2PDF, ps2pdf) 1249bccedf53Smrg 1250bccedf53SmrgAC_MSG_CHECKING([Whether to build documentation]) 1251bccedf53Smrg 1252bccedf53Smrgif test x$DEFS_ENT_PATH != x && test x$LINUXDOC != x ; then 1253bccedf53Smrg BUILDDOC=yes 1254bccedf53Smrgelse 1255bccedf53Smrg BUILDDOC=no 1256bccedf53Smrgfi 1257bccedf53Smrg 1258bccedf53SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 1259bccedf53Smrg 1260bccedf53SmrgAC_MSG_RESULT([$BUILDDOC]) 1261bccedf53Smrg 1262bccedf53SmrgAC_MSG_CHECKING([Whether to build pdf documentation]) 1263bccedf53Smrg 1264bccedf53Smrgif test x$PS2PDF != x ; then 1265bccedf53Smrg BUILDPDFDOC=yes 1266bccedf53Smrgelse 1267bccedf53Smrg BUILDPDFDOC=no 1268bccedf53Smrgfi 1269bccedf53Smrg 1270bccedf53SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 1271bccedf53Smrg 1272bccedf53SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 1273bccedf53Smrg 1274bccedf53SmrgMAKE_TEXT="SGML_SEARCH_PATH=$DEFS_ENT_PATH GROFF_NO_SGR=y $LINUXDOC -B txt" 1275bccedf53SmrgMAKE_PS="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 1276bccedf53SmrgMAKE_PDF="$PS2PDF" 1277bccedf53SmrgMAKE_HTML="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B html --split=0" 1278bccedf53Smrg 1279bccedf53SmrgAC_SUBST(MAKE_TEXT) 1280bccedf53SmrgAC_SUBST(MAKE_PS) 1281bccedf53SmrgAC_SUBST(MAKE_PDF) 1282bccedf53SmrgAC_SUBST(MAKE_HTML) 1283bccedf53Smrg]) # XORG_CHECK_LINUXDOC 1284bccedf53Smrg 1285bccedf53Smrg# XORG_CHECK_MALLOC_ZERO 1286bccedf53Smrg# ---------------------- 1287bccedf53Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 1288bccedf53Smrg# malloc(0) returns NULL. Packages should add one of these cflags to 1289bccedf53Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 1290bccedf53SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 1291bccedf53SmrgAC_ARG_ENABLE(malloc0returnsnull, 1292bccedf53Smrg AC_HELP_STRING([--enable-malloc0returnsnull], 1293bccedf53Smrg [malloc(0) returns NULL (default: auto)]), 1294bccedf53Smrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 1295bccedf53Smrg [MALLOC_ZERO_RETURNS_NULL=auto]) 1296bccedf53Smrg 1297bccedf53SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 1298bccedf53Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 1299bccedf53Smrg AC_RUN_IFELSE([ 1300bccedf53Smrgchar *malloc(); 1301bccedf53Smrgchar *realloc(); 1302bccedf53Smrgchar *calloc(); 1303bccedf53Smrgmain() { 1304bccedf53Smrg char *m0, *r0, *c0, *p; 1305bccedf53Smrg m0 = malloc(0); 1306bccedf53Smrg p = malloc(10); 1307bccedf53Smrg r0 = realloc(p,0); 1308bccedf53Smrg c0 = calloc(0); 1309bccedf53Smrg exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); 1310bccedf53Smrg}], 1311bccedf53Smrg [MALLOC_ZERO_RETURNS_NULL=yes], 1312bccedf53Smrg [MALLOC_ZERO_RETURNS_NULL=no]) 1313bccedf53Smrgfi 1314bccedf53SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 1315bccedf53Smrg 1316bccedf53Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 1317bccedf53Smrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 1318bccedf53Smrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 1319bccedf53Smrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 1320bccedf53Smrgelse 1321bccedf53Smrg MALLOC_ZERO_CFLAGS="" 1322bccedf53Smrg XMALLOC_ZERO_CFLAGS="" 1323bccedf53Smrg XTMALLOC_ZERO_CFLAGS="" 1324bccedf53Smrgfi 1325bccedf53Smrg 1326bccedf53SmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 1327bccedf53SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 1328bccedf53SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 1329bccedf53Smrg]) # XORG_CHECK_MALLOC_ZERO 1330bccedf53Smrg 1331bccedf53Smrgdnl Copyright 2005 Red Hat, Inc 1332bccedf53Smrgdnl 1333bccedf53Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 1334bccedf53Smrgdnl documentation for any purpose is hereby granted without fee, provided that 1335bccedf53Smrgdnl the above copyright notice appear in all copies and that both that 1336bccedf53Smrgdnl copyright notice and this permission notice appear in supporting 1337bccedf53Smrgdnl documentation. 1338bccedf53Smrgdnl 1339bccedf53Smrgdnl The above copyright notice and this permission notice shall be included 1340bccedf53Smrgdnl in all copies or substantial portions of the Software. 1341bccedf53Smrgdnl 1342bccedf53Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 1343bccedf53Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 1344bccedf53Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 1345bccedf53Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 1346bccedf53Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 1347bccedf53Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 1348bccedf53Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 1349bccedf53Smrgdnl 1350bccedf53Smrgdnl Except as contained in this notice, the name of the copyright holders shall 1351bccedf53Smrgdnl not be used in advertising or otherwise to promote the sale, use or 1352bccedf53Smrgdnl other dealings in this Software without prior written authorization 1353bccedf53Smrgdnl from the copyright holders. 1354bccedf53Smrgdnl 1355bccedf53Smrg 1356bccedf53Smrg# XORG_RELEASE_VERSION 1357bccedf53Smrg# -------------------- 1358bccedf53Smrg# Adds --with/without-release-string and changes the PACKAGE and 1359bccedf53Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If 1360bccedf53Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. 1361bccedf53Smrg 1362bccedf53SmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 1363bccedf53Smrg AC_ARG_WITH(release-version, 1364bccedf53Smrg AC_HELP_STRING([--with-release-version=STRING], 1365bccedf53Smrg [Use release version string in package name]), 1366bccedf53Smrg [RELEASE_VERSION="$withval"], 1367bccedf53Smrg [RELEASE_VERSION=""]) 1368bccedf53Smrg if test "x$RELEASE_VERSION" != "x"; then 1369bccedf53Smrg PACKAGE="$PACKAGE-$RELEASE_VERSION" 1370bccedf53Smrg PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" 1371bccedf53Smrg AC_MSG_NOTICE([Building with package name set to $PACKAGE]) 1372bccedf53Smrg fi 1373bccedf53Smrg]) 1374bccedf53Smrg 1375