aclocal.m4 revision 21c2f794
121c2f794Smrg# generated automatically by aclocal 1.10 -*- Autoconf -*- 221c2f794Smrg 321c2f794Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 421c2f794Smrg# 2005, 2006 Free Software Foundation, Inc. 521c2f794Smrg# This file is free software; the Free Software Foundation 621c2f794Smrg# gives unlimited permission to copy and/or distribute it, 721c2f794Smrg# with or without modifications, as long as this notice is preserved. 821c2f794Smrg 921c2f794Smrg# This program is distributed in the hope that it will be useful, 1021c2f794Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 1121c2f794Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 1221c2f794Smrg# PARTICULAR PURPOSE. 1321c2f794Smrg 1421c2f794Smrgm4_if(m4_PACKAGE_VERSION, [2.61],, 1521c2f794Smrg[m4_fatal([this file was generated for autoconf 2.61. 1621c2f794SmrgYou have another version of autoconf. If you want to use that, 1721c2f794Smrgyou should regenerate the build system entirely.], [63])]) 1821c2f794Smrg 1921c2f794Smrg# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. 2021c2f794Smrg# 2121c2f794Smrg# This file is free software; the Free Software Foundation 2221c2f794Smrg# gives unlimited permission to copy and/or distribute it, 2321c2f794Smrg# with or without modifications, as long as this notice is preserved. 2421c2f794Smrg 2521c2f794Smrg# AM_AUTOMAKE_VERSION(VERSION) 2621c2f794Smrg# ---------------------------- 2721c2f794Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been 2821c2f794Smrg# generated from the m4 files accompanying Automake X.Y. 2921c2f794Smrg# (This private macro should not be called outside this file.) 3021c2f794SmrgAC_DEFUN([AM_AUTOMAKE_VERSION], 3121c2f794Smrg[am__api_version='1.10' 3221c2f794Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 3321c2f794Smrgdnl require some minimum version. Point them to the right macro. 3421c2f794Smrgm4_if([$1], [1.10], [], 3521c2f794Smrg [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 3621c2f794Smrg]) 3721c2f794Smrg 3821c2f794Smrg# _AM_AUTOCONF_VERSION(VERSION) 3921c2f794Smrg# ----------------------------- 4021c2f794Smrg# aclocal traces this macro to find the Autoconf version. 4121c2f794Smrg# This is a private macro too. Using m4_define simplifies 4221c2f794Smrg# the logic in aclocal, which can simply ignore this definition. 4321c2f794Smrgm4_define([_AM_AUTOCONF_VERSION], []) 4421c2f794Smrg 4521c2f794Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION 4621c2f794Smrg# ------------------------------- 4721c2f794Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 4821c2f794Smrg# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. 4921c2f794SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 5021c2f794Smrg[AM_AUTOMAKE_VERSION([1.10])dnl 5121c2f794Smrg_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) 5221c2f794Smrg 5321c2f794Smrg# AM_AUX_DIR_EXPAND -*- Autoconf -*- 5421c2f794Smrg 5521c2f794Smrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 5621c2f794Smrg# 5721c2f794Smrg# This file is free software; the Free Software Foundation 5821c2f794Smrg# gives unlimited permission to copy and/or distribute it, 5921c2f794Smrg# with or without modifications, as long as this notice is preserved. 6021c2f794Smrg 6121c2f794Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 6221c2f794Smrg# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 6321c2f794Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'. 6421c2f794Smrg# 6521c2f794Smrg# Of course, Automake must honor this variable whenever it calls a 6621c2f794Smrg# tool from the auxiliary directory. The problem is that $srcdir (and 6721c2f794Smrg# therefore $ac_aux_dir as well) can be either absolute or relative, 6821c2f794Smrg# depending on how configure is run. This is pretty annoying, since 6921c2f794Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top 7021c2f794Smrg# source directory, any form will work fine, but in subdirectories a 7121c2f794Smrg# relative path needs to be adjusted first. 7221c2f794Smrg# 7321c2f794Smrg# $ac_aux_dir/missing 7421c2f794Smrg# fails when called from a subdirectory if $ac_aux_dir is relative 7521c2f794Smrg# $top_srcdir/$ac_aux_dir/missing 7621c2f794Smrg# fails if $ac_aux_dir is absolute, 7721c2f794Smrg# fails when called from a subdirectory in a VPATH build with 7821c2f794Smrg# a relative $ac_aux_dir 7921c2f794Smrg# 8021c2f794Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 8121c2f794Smrg# are both prefixed by $srcdir. In an in-source build this is usually 8221c2f794Smrg# harmless because $srcdir is `.', but things will broke when you 8321c2f794Smrg# start a VPATH build or use an absolute $srcdir. 8421c2f794Smrg# 8521c2f794Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 8621c2f794Smrg# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 8721c2f794Smrg# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 8821c2f794Smrg# and then we would define $MISSING as 8921c2f794Smrg# MISSING="\${SHELL} $am_aux_dir/missing" 9021c2f794Smrg# This will work as long as MISSING is not called from configure, because 9121c2f794Smrg# unfortunately $(top_srcdir) has no meaning in configure. 9221c2f794Smrg# However there are other variables, like CC, which are often used in 9321c2f794Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir. 9421c2f794Smrg# 9521c2f794Smrg# Another solution, used here, is to always expand $ac_aux_dir to an 9621c2f794Smrg# absolute PATH. The drawback is that using absolute paths prevent a 9721c2f794Smrg# configured tree to be moved without reconfiguration. 9821c2f794Smrg 9921c2f794SmrgAC_DEFUN([AM_AUX_DIR_EXPAND], 10021c2f794Smrg[dnl Rely on autoconf to set up CDPATH properly. 10121c2f794SmrgAC_PREREQ([2.50])dnl 10221c2f794Smrg# expand $ac_aux_dir to an absolute path 10321c2f794Smrgam_aux_dir=`cd $ac_aux_dir && pwd` 10421c2f794Smrg]) 10521c2f794Smrg 10621c2f794Smrg# AM_CONDITIONAL -*- Autoconf -*- 10721c2f794Smrg 10821c2f794Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 10921c2f794Smrg# Free Software Foundation, Inc. 11021c2f794Smrg# 11121c2f794Smrg# This file is free software; the Free Software Foundation 11221c2f794Smrg# gives unlimited permission to copy and/or distribute it, 11321c2f794Smrg# with or without modifications, as long as this notice is preserved. 11421c2f794Smrg 11521c2f794Smrg# serial 8 11621c2f794Smrg 11721c2f794Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION) 11821c2f794Smrg# ------------------------------------- 11921c2f794Smrg# Define a conditional. 12021c2f794SmrgAC_DEFUN([AM_CONDITIONAL], 12121c2f794Smrg[AC_PREREQ(2.52)dnl 12221c2f794Smrg ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 12321c2f794Smrg [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 12421c2f794SmrgAC_SUBST([$1_TRUE])dnl 12521c2f794SmrgAC_SUBST([$1_FALSE])dnl 12621c2f794Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl 12721c2f794Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl 12821c2f794Smrgif $2; then 12921c2f794Smrg $1_TRUE= 13021c2f794Smrg $1_FALSE='#' 13121c2f794Smrgelse 13221c2f794Smrg $1_TRUE='#' 13321c2f794Smrg $1_FALSE= 13421c2f794Smrgfi 13521c2f794SmrgAC_CONFIG_COMMANDS_PRE( 13621c2f794Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 13721c2f794Smrg AC_MSG_ERROR([[conditional "$1" was never defined. 13821c2f794SmrgUsually this means the macro was only invoked conditionally.]]) 13921c2f794Smrgfi])]) 14021c2f794Smrg 14121c2f794Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 14221c2f794Smrg# Free Software Foundation, Inc. 14321c2f794Smrg# 14421c2f794Smrg# This file is free software; the Free Software Foundation 14521c2f794Smrg# gives unlimited permission to copy and/or distribute it, 14621c2f794Smrg# with or without modifications, as long as this notice is preserved. 14721c2f794Smrg 14821c2f794Smrg# serial 9 14921c2f794Smrg 15021c2f794Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 15121c2f794Smrg# written in clear, in which case automake, when reading aclocal.m4, 15221c2f794Smrg# will think it sees a *use*, and therefore will trigger all it's 15321c2f794Smrg# C support machinery. Also note that it means that autoscan, seeing 15421c2f794Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 15521c2f794Smrg 15621c2f794Smrg 15721c2f794Smrg# _AM_DEPENDENCIES(NAME) 15821c2f794Smrg# ---------------------- 15921c2f794Smrg# See how the compiler implements dependency checking. 16021c2f794Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC". 16121c2f794Smrg# We try a few techniques and use that to set a single cache variable. 16221c2f794Smrg# 16321c2f794Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 16421c2f794Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 16521c2f794Smrg# dependency, and given that the user is not expected to run this macro, 16621c2f794Smrg# just rely on AC_PROG_CC. 16721c2f794SmrgAC_DEFUN([_AM_DEPENDENCIES], 16821c2f794Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl 16921c2f794SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 17021c2f794SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl 17121c2f794SmrgAC_REQUIRE([AM_DEP_TRACK])dnl 17221c2f794Smrg 17321c2f794Smrgifelse([$1], CC, [depcc="$CC" am_compiler_list=], 17421c2f794Smrg [$1], CXX, [depcc="$CXX" am_compiler_list=], 17521c2f794Smrg [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 17621c2f794Smrg [$1], UPC, [depcc="$UPC" am_compiler_list=], 17721c2f794Smrg [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 17821c2f794Smrg [depcc="$$1" am_compiler_list=]) 17921c2f794Smrg 18021c2f794SmrgAC_CACHE_CHECK([dependency style of $depcc], 18121c2f794Smrg [am_cv_$1_dependencies_compiler_type], 18221c2f794Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 18321c2f794Smrg # We make a subdir and do the tests there. Otherwise we can end up 18421c2f794Smrg # making bogus files that we don't know about and never remove. For 18521c2f794Smrg # instance it was reported that on HP-UX the gcc test will end up 18621c2f794Smrg # making a dummy file named `D' -- because `-MD' means `put the output 18721c2f794Smrg # in D'. 18821c2f794Smrg mkdir conftest.dir 18921c2f794Smrg # Copy depcomp to subdir because otherwise we won't find it if we're 19021c2f794Smrg # using a relative directory. 19121c2f794Smrg cp "$am_depcomp" conftest.dir 19221c2f794Smrg cd conftest.dir 19321c2f794Smrg # We will build objects and dependencies in a subdirectory because 19421c2f794Smrg # it helps to detect inapplicable dependency modes. For instance 19521c2f794Smrg # both Tru64's cc and ICC support -MD to output dependencies as a 19621c2f794Smrg # side effect of compilation, but ICC will put the dependencies in 19721c2f794Smrg # the current directory while Tru64 will put them in the object 19821c2f794Smrg # directory. 19921c2f794Smrg mkdir sub 20021c2f794Smrg 20121c2f794Smrg am_cv_$1_dependencies_compiler_type=none 20221c2f794Smrg if test "$am_compiler_list" = ""; then 20321c2f794Smrg am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 20421c2f794Smrg fi 20521c2f794Smrg for depmode in $am_compiler_list; do 20621c2f794Smrg # Setup a source with many dependencies, because some compilers 20721c2f794Smrg # like to wrap large dependency lists on column 80 (with \), and 20821c2f794Smrg # we should not choose a depcomp mode which is confused by this. 20921c2f794Smrg # 21021c2f794Smrg # We need to recreate these files for each test, as the compiler may 21121c2f794Smrg # overwrite some of them when testing with obscure command lines. 21221c2f794Smrg # This happens at least with the AIX C compiler. 21321c2f794Smrg : > sub/conftest.c 21421c2f794Smrg for i in 1 2 3 4 5 6; do 21521c2f794Smrg echo '#include "conftst'$i'.h"' >> sub/conftest.c 21621c2f794Smrg # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with 21721c2f794Smrg # Solaris 8's {/usr,}/bin/sh. 21821c2f794Smrg touch sub/conftst$i.h 21921c2f794Smrg done 22021c2f794Smrg echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 22121c2f794Smrg 22221c2f794Smrg case $depmode in 22321c2f794Smrg nosideeffect) 22421c2f794Smrg # after this tag, mechanisms are not by side-effect, so they'll 22521c2f794Smrg # only be used when explicitly requested 22621c2f794Smrg if test "x$enable_dependency_tracking" = xyes; then 22721c2f794Smrg continue 22821c2f794Smrg else 22921c2f794Smrg break 23021c2f794Smrg fi 23121c2f794Smrg ;; 23221c2f794Smrg none) break ;; 23321c2f794Smrg esac 23421c2f794Smrg # We check with `-c' and `-o' for the sake of the "dashmstdout" 23521c2f794Smrg # mode. It turns out that the SunPro C++ compiler does not properly 23621c2f794Smrg # handle `-M -o', and we need to detect this. 23721c2f794Smrg if depmode=$depmode \ 23821c2f794Smrg source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ 23921c2f794Smrg depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 24021c2f794Smrg $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ 24121c2f794Smrg >/dev/null 2>conftest.err && 24221c2f794Smrg grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 24321c2f794Smrg grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 24421c2f794Smrg grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && 24521c2f794Smrg ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 24621c2f794Smrg # icc doesn't choke on unknown options, it will just issue warnings 24721c2f794Smrg # or remarks (even with -Werror). So we grep stderr for any message 24821c2f794Smrg # that says an option was ignored or not supported. 24921c2f794Smrg # When given -MP, icc 7.0 and 7.1 complain thusly: 25021c2f794Smrg # icc: Command line warning: ignoring option '-M'; no argument required 25121c2f794Smrg # The diagnosis changed in icc 8.0: 25221c2f794Smrg # icc: Command line remark: option '-MP' not supported 25321c2f794Smrg if (grep 'ignoring option' conftest.err || 25421c2f794Smrg grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 25521c2f794Smrg am_cv_$1_dependencies_compiler_type=$depmode 25621c2f794Smrg break 25721c2f794Smrg fi 25821c2f794Smrg fi 25921c2f794Smrg done 26021c2f794Smrg 26121c2f794Smrg cd .. 26221c2f794Smrg rm -rf conftest.dir 26321c2f794Smrgelse 26421c2f794Smrg am_cv_$1_dependencies_compiler_type=none 26521c2f794Smrgfi 26621c2f794Smrg]) 26721c2f794SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 26821c2f794SmrgAM_CONDITIONAL([am__fastdep$1], [ 26921c2f794Smrg test "x$enable_dependency_tracking" != xno \ 27021c2f794Smrg && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 27121c2f794Smrg]) 27221c2f794Smrg 27321c2f794Smrg 27421c2f794Smrg# AM_SET_DEPDIR 27521c2f794Smrg# ------------- 27621c2f794Smrg# Choose a directory name for dependency files. 27721c2f794Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES 27821c2f794SmrgAC_DEFUN([AM_SET_DEPDIR], 27921c2f794Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 28021c2f794SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 28121c2f794Smrg]) 28221c2f794Smrg 28321c2f794Smrg 28421c2f794Smrg# AM_DEP_TRACK 28521c2f794Smrg# ------------ 28621c2f794SmrgAC_DEFUN([AM_DEP_TRACK], 28721c2f794Smrg[AC_ARG_ENABLE(dependency-tracking, 28821c2f794Smrg[ --disable-dependency-tracking speeds up one-time build 28921c2f794Smrg --enable-dependency-tracking do not reject slow dependency extractors]) 29021c2f794Smrgif test "x$enable_dependency_tracking" != xno; then 29121c2f794Smrg am_depcomp="$ac_aux_dir/depcomp" 29221c2f794Smrg AMDEPBACKSLASH='\' 29321c2f794Smrgfi 29421c2f794SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 29521c2f794SmrgAC_SUBST([AMDEPBACKSLASH])dnl 29621c2f794Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 29721c2f794Smrg]) 29821c2f794Smrg 29921c2f794Smrg# Generate code to set up dependency tracking. -*- Autoconf -*- 30021c2f794Smrg 30121c2f794Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 30221c2f794Smrg# Free Software Foundation, Inc. 30321c2f794Smrg# 30421c2f794Smrg# This file is free software; the Free Software Foundation 30521c2f794Smrg# gives unlimited permission to copy and/or distribute it, 30621c2f794Smrg# with or without modifications, as long as this notice is preserved. 30721c2f794Smrg 30821c2f794Smrg#serial 3 30921c2f794Smrg 31021c2f794Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS 31121c2f794Smrg# ------------------------------ 31221c2f794SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 31321c2f794Smrg[for mf in $CONFIG_FILES; do 31421c2f794Smrg # Strip MF so we end up with the name of the file. 31521c2f794Smrg mf=`echo "$mf" | sed -e 's/:.*$//'` 31621c2f794Smrg # Check whether this is an Automake generated Makefile or not. 31721c2f794Smrg # We used to match only the files named `Makefile.in', but 31821c2f794Smrg # some people rename them; so instead we look at the file content. 31921c2f794Smrg # Grep'ing the first line is not enough: some people post-process 32021c2f794Smrg # each Makefile.in and add a new line on top of each file to say so. 32121c2f794Smrg # Grep'ing the whole file is not good either: AIX grep has a line 32221c2f794Smrg # limit of 2048, but all sed's we know have understand at least 4000. 32321c2f794Smrg if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then 32421c2f794Smrg dirpart=`AS_DIRNAME("$mf")` 32521c2f794Smrg else 32621c2f794Smrg continue 32721c2f794Smrg fi 32821c2f794Smrg # Extract the definition of DEPDIR, am__include, and am__quote 32921c2f794Smrg # from the Makefile without running `make'. 33021c2f794Smrg DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 33121c2f794Smrg test -z "$DEPDIR" && continue 33221c2f794Smrg am__include=`sed -n 's/^am__include = //p' < "$mf"` 33321c2f794Smrg test -z "am__include" && continue 33421c2f794Smrg am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 33521c2f794Smrg # When using ansi2knr, U may be empty or an underscore; expand it 33621c2f794Smrg U=`sed -n 's/^U = //p' < "$mf"` 33721c2f794Smrg # Find all dependency output files, they are included files with 33821c2f794Smrg # $(DEPDIR) in their names. We invoke sed twice because it is the 33921c2f794Smrg # simplest approach to changing $(DEPDIR) to its actual value in the 34021c2f794Smrg # expansion. 34121c2f794Smrg for file in `sed -n " 34221c2f794Smrg s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 34321c2f794Smrg sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 34421c2f794Smrg # Make sure the directory exists. 34521c2f794Smrg test -f "$dirpart/$file" && continue 34621c2f794Smrg fdir=`AS_DIRNAME(["$file"])` 34721c2f794Smrg AS_MKDIR_P([$dirpart/$fdir]) 34821c2f794Smrg # echo "creating $dirpart/$file" 34921c2f794Smrg echo '# dummy' > "$dirpart/$file" 35021c2f794Smrg done 35121c2f794Smrgdone 35221c2f794Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS 35321c2f794Smrg 35421c2f794Smrg 35521c2f794Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS 35621c2f794Smrg# ----------------------------- 35721c2f794Smrg# This macro should only be invoked once -- use via AC_REQUIRE. 35821c2f794Smrg# 35921c2f794Smrg# This code is only required when automatic dependency tracking 36021c2f794Smrg# is enabled. FIXME. This creates each `.P' file that we will 36121c2f794Smrg# need in order to bootstrap the dependency handling code. 36221c2f794SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 36321c2f794Smrg[AC_CONFIG_COMMANDS([depfiles], 36421c2f794Smrg [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 36521c2f794Smrg [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 36621c2f794Smrg]) 36721c2f794Smrg 36821c2f794Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 36921c2f794Smrg# Free Software Foundation, Inc. 37021c2f794Smrg# 37121c2f794Smrg# This file is free software; the Free Software Foundation 37221c2f794Smrg# gives unlimited permission to copy and/or distribute it, 37321c2f794Smrg# with or without modifications, as long as this notice is preserved. 37421c2f794Smrg 37521c2f794Smrg# serial 8 37621c2f794Smrg 37721c2f794Smrg# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. 37821c2f794SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) 37921c2f794Smrg 38021c2f794Smrg# Do all the work for Automake. -*- Autoconf -*- 38121c2f794Smrg 38221c2f794Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 38321c2f794Smrg# 2005, 2006 Free Software Foundation, Inc. 38421c2f794Smrg# 38521c2f794Smrg# This file is free software; the Free Software Foundation 38621c2f794Smrg# gives unlimited permission to copy and/or distribute it, 38721c2f794Smrg# with or without modifications, as long as this notice is preserved. 38821c2f794Smrg 38921c2f794Smrg# serial 12 39021c2f794Smrg 39121c2f794Smrg# This macro actually does too much. Some checks are only needed if 39221c2f794Smrg# your package does certain things. But this isn't really a big deal. 39321c2f794Smrg 39421c2f794Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 39521c2f794Smrg# AM_INIT_AUTOMAKE([OPTIONS]) 39621c2f794Smrg# ----------------------------------------------- 39721c2f794Smrg# The call with PACKAGE and VERSION arguments is the old style 39821c2f794Smrg# call (pre autoconf-2.50), which is being phased out. PACKAGE 39921c2f794Smrg# and VERSION should now be passed to AC_INIT and removed from 40021c2f794Smrg# the call to AM_INIT_AUTOMAKE. 40121c2f794Smrg# We support both call styles for the transition. After 40221c2f794Smrg# the next Automake release, Autoconf can make the AC_INIT 40321c2f794Smrg# arguments mandatory, and then we can depend on a new Autoconf 40421c2f794Smrg# release and drop the old call support. 40521c2f794SmrgAC_DEFUN([AM_INIT_AUTOMAKE], 40621c2f794Smrg[AC_PREREQ([2.60])dnl 40721c2f794Smrgdnl Autoconf wants to disallow AM_ names. We explicitly allow 40821c2f794Smrgdnl the ones we care about. 40921c2f794Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 41021c2f794SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 41121c2f794SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl 41221c2f794Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then 41321c2f794Smrg # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 41421c2f794Smrg # is not polluted with repeated "-I." 41521c2f794Smrg AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 41621c2f794Smrg # test to see if srcdir already configured 41721c2f794Smrg if test -f $srcdir/config.status; then 41821c2f794Smrg AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 41921c2f794Smrg fi 42021c2f794Smrgfi 42121c2f794Smrg 42221c2f794Smrg# test whether we have cygpath 42321c2f794Smrgif test -z "$CYGPATH_W"; then 42421c2f794Smrg if (cygpath --version) >/dev/null 2>/dev/null; then 42521c2f794Smrg CYGPATH_W='cygpath -w' 42621c2f794Smrg else 42721c2f794Smrg CYGPATH_W=echo 42821c2f794Smrg fi 42921c2f794Smrgfi 43021c2f794SmrgAC_SUBST([CYGPATH_W]) 43121c2f794Smrg 43221c2f794Smrg# Define the identity of the package. 43321c2f794Smrgdnl Distinguish between old-style and new-style calls. 43421c2f794Smrgm4_ifval([$2], 43521c2f794Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 43621c2f794Smrg AC_SUBST([PACKAGE], [$1])dnl 43721c2f794Smrg AC_SUBST([VERSION], [$2])], 43821c2f794Smrg[_AM_SET_OPTIONS([$1])dnl 43921c2f794Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 44021c2f794Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, 44121c2f794Smrg [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 44221c2f794Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 44321c2f794Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 44421c2f794Smrg 44521c2f794Smrg_AM_IF_OPTION([no-define],, 44621c2f794Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 44721c2f794Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 44821c2f794Smrg 44921c2f794Smrg# Some tools Automake needs. 45021c2f794SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl 45121c2f794SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl 45221c2f794SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 45321c2f794SmrgAM_MISSING_PROG(AUTOCONF, autoconf) 45421c2f794SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 45521c2f794SmrgAM_MISSING_PROG(AUTOHEADER, autoheader) 45621c2f794SmrgAM_MISSING_PROG(MAKEINFO, makeinfo) 45721c2f794SmrgAM_PROG_INSTALL_SH 45821c2f794SmrgAM_PROG_INSTALL_STRIP 45921c2f794SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl 46021c2f794Smrg# We need awk for the "check" target. The system "awk" is bad on 46121c2f794Smrg# some platforms. 46221c2f794SmrgAC_REQUIRE([AC_PROG_AWK])dnl 46321c2f794SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl 46421c2f794SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl 46521c2f794Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 46621c2f794Smrg [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 46721c2f794Smrg [_AM_PROG_TAR([v7])])]) 46821c2f794Smrg_AM_IF_OPTION([no-dependencies],, 46921c2f794Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC], 47021c2f794Smrg [_AM_DEPENDENCIES(CC)], 47121c2f794Smrg [define([AC_PROG_CC], 47221c2f794Smrg defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 47321c2f794SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX], 47421c2f794Smrg [_AM_DEPENDENCIES(CXX)], 47521c2f794Smrg [define([AC_PROG_CXX], 47621c2f794Smrg defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 47721c2f794SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC], 47821c2f794Smrg [_AM_DEPENDENCIES(OBJC)], 47921c2f794Smrg [define([AC_PROG_OBJC], 48021c2f794Smrg defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl 48121c2f794Smrg]) 48221c2f794Smrg]) 48321c2f794Smrg 48421c2f794Smrg 48521c2f794Smrg# When config.status generates a header, we must update the stamp-h file. 48621c2f794Smrg# This file resides in the same directory as the config header 48721c2f794Smrg# that is generated. The stamp files are numbered to have different names. 48821c2f794Smrg 48921c2f794Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 49021c2f794Smrg# loop where config.status creates the headers, so we can generate 49121c2f794Smrg# our stamp files there. 49221c2f794SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 49321c2f794Smrg[# Compute $1's index in $config_headers. 49421c2f794Smrg_am_stamp_count=1 49521c2f794Smrgfor _am_header in $config_headers :; do 49621c2f794Smrg case $_am_header in 49721c2f794Smrg $1 | $1:* ) 49821c2f794Smrg break ;; 49921c2f794Smrg * ) 50021c2f794Smrg _am_stamp_count=`expr $_am_stamp_count + 1` ;; 50121c2f794Smrg esac 50221c2f794Smrgdone 50321c2f794Smrgecho "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) 50421c2f794Smrg 50521c2f794Smrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 50621c2f794Smrg# 50721c2f794Smrg# This file is free software; the Free Software Foundation 50821c2f794Smrg# gives unlimited permission to copy and/or distribute it, 50921c2f794Smrg# with or without modifications, as long as this notice is preserved. 51021c2f794Smrg 51121c2f794Smrg# AM_PROG_INSTALL_SH 51221c2f794Smrg# ------------------ 51321c2f794Smrg# Define $install_sh. 51421c2f794SmrgAC_DEFUN([AM_PROG_INSTALL_SH], 51521c2f794Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 51621c2f794Smrginstall_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} 51721c2f794SmrgAC_SUBST(install_sh)]) 51821c2f794Smrg 51921c2f794Smrg# Copyright (C) 2003, 2005 Free Software Foundation, Inc. 52021c2f794Smrg# 52121c2f794Smrg# This file is free software; the Free Software Foundation 52221c2f794Smrg# gives unlimited permission to copy and/or distribute it, 52321c2f794Smrg# with or without modifications, as long as this notice is preserved. 52421c2f794Smrg 52521c2f794Smrg# serial 2 52621c2f794Smrg 52721c2f794Smrg# Check whether the underlying file-system supports filenames 52821c2f794Smrg# with a leading dot. For instance MS-DOS doesn't. 52921c2f794SmrgAC_DEFUN([AM_SET_LEADING_DOT], 53021c2f794Smrg[rm -rf .tst 2>/dev/null 53121c2f794Smrgmkdir .tst 2>/dev/null 53221c2f794Smrgif test -d .tst; then 53321c2f794Smrg am__leading_dot=. 53421c2f794Smrgelse 53521c2f794Smrg am__leading_dot=_ 53621c2f794Smrgfi 53721c2f794Smrgrmdir .tst 2>/dev/null 53821c2f794SmrgAC_SUBST([am__leading_dot])]) 53921c2f794Smrg 54021c2f794Smrg# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- 54121c2f794Smrg# From Jim Meyering 54221c2f794Smrg 54321c2f794Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 54421c2f794Smrg# Free Software Foundation, Inc. 54521c2f794Smrg# 54621c2f794Smrg# This file is free software; the Free Software Foundation 54721c2f794Smrg# gives unlimited permission to copy and/or distribute it, 54821c2f794Smrg# with or without modifications, as long as this notice is preserved. 54921c2f794Smrg 55021c2f794Smrg# serial 4 55121c2f794Smrg 55221c2f794SmrgAC_DEFUN([AM_MAINTAINER_MODE], 55321c2f794Smrg[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) 55421c2f794Smrg dnl maintainer-mode is disabled by default 55521c2f794Smrg AC_ARG_ENABLE(maintainer-mode, 55621c2f794Smrg[ --enable-maintainer-mode enable make rules and dependencies not useful 55721c2f794Smrg (and sometimes confusing) to the casual installer], 55821c2f794Smrg USE_MAINTAINER_MODE=$enableval, 55921c2f794Smrg USE_MAINTAINER_MODE=no) 56021c2f794Smrg AC_MSG_RESULT([$USE_MAINTAINER_MODE]) 56121c2f794Smrg AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) 56221c2f794Smrg MAINT=$MAINTAINER_MODE_TRUE 56321c2f794Smrg AC_SUBST(MAINT)dnl 56421c2f794Smrg] 56521c2f794Smrg) 56621c2f794Smrg 56721c2f794SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) 56821c2f794Smrg 56921c2f794Smrg# Check to see how 'make' treats includes. -*- Autoconf -*- 57021c2f794Smrg 57121c2f794Smrg# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. 57221c2f794Smrg# 57321c2f794Smrg# This file is free software; the Free Software Foundation 57421c2f794Smrg# gives unlimited permission to copy and/or distribute it, 57521c2f794Smrg# with or without modifications, as long as this notice is preserved. 57621c2f794Smrg 57721c2f794Smrg# serial 3 57821c2f794Smrg 57921c2f794Smrg# AM_MAKE_INCLUDE() 58021c2f794Smrg# ----------------- 58121c2f794Smrg# Check to see how make treats includes. 58221c2f794SmrgAC_DEFUN([AM_MAKE_INCLUDE], 58321c2f794Smrg[am_make=${MAKE-make} 58421c2f794Smrgcat > confinc << 'END' 58521c2f794Smrgam__doit: 58621c2f794Smrg @echo done 58721c2f794Smrg.PHONY: am__doit 58821c2f794SmrgEND 58921c2f794Smrg# If we don't find an include directive, just comment out the code. 59021c2f794SmrgAC_MSG_CHECKING([for style of include used by $am_make]) 59121c2f794Smrgam__include="#" 59221c2f794Smrgam__quote= 59321c2f794Smrg_am_result=none 59421c2f794Smrg# First try GNU make style include. 59521c2f794Smrgecho "include confinc" > confmf 59621c2f794Smrg# We grep out `Entering directory' and `Leaving directory' 59721c2f794Smrg# messages which can occur if `w' ends up in MAKEFLAGS. 59821c2f794Smrg# In particular we don't look at `^make:' because GNU make might 59921c2f794Smrg# be invoked under some other name (usually "gmake"), in which 60021c2f794Smrg# case it prints its new name instead of `make'. 60121c2f794Smrgif test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then 60221c2f794Smrg am__include=include 60321c2f794Smrg am__quote= 60421c2f794Smrg _am_result=GNU 60521c2f794Smrgfi 60621c2f794Smrg# Now try BSD make style include. 60721c2f794Smrgif test "$am__include" = "#"; then 60821c2f794Smrg echo '.include "confinc"' > confmf 60921c2f794Smrg if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then 61021c2f794Smrg am__include=.include 61121c2f794Smrg am__quote="\"" 61221c2f794Smrg _am_result=BSD 61321c2f794Smrg fi 61421c2f794Smrgfi 61521c2f794SmrgAC_SUBST([am__include]) 61621c2f794SmrgAC_SUBST([am__quote]) 61721c2f794SmrgAC_MSG_RESULT([$_am_result]) 61821c2f794Smrgrm -f confinc confmf 61921c2f794Smrg]) 62021c2f794Smrg 62121c2f794Smrg# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 62221c2f794Smrg 62321c2f794Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 62421c2f794Smrg# Free Software Foundation, Inc. 62521c2f794Smrg# 62621c2f794Smrg# This file is free software; the Free Software Foundation 62721c2f794Smrg# gives unlimited permission to copy and/or distribute it, 62821c2f794Smrg# with or without modifications, as long as this notice is preserved. 62921c2f794Smrg 63021c2f794Smrg# serial 5 63121c2f794Smrg 63221c2f794Smrg# AM_MISSING_PROG(NAME, PROGRAM) 63321c2f794Smrg# ------------------------------ 63421c2f794SmrgAC_DEFUN([AM_MISSING_PROG], 63521c2f794Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN]) 63621c2f794Smrg$1=${$1-"${am_missing_run}$2"} 63721c2f794SmrgAC_SUBST($1)]) 63821c2f794Smrg 63921c2f794Smrg 64021c2f794Smrg# AM_MISSING_HAS_RUN 64121c2f794Smrg# ------------------ 64221c2f794Smrg# Define MISSING if not defined so far and test if it supports --run. 64321c2f794Smrg# If it does, set am_missing_run to use it, otherwise, to nothing. 64421c2f794SmrgAC_DEFUN([AM_MISSING_HAS_RUN], 64521c2f794Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 64621c2f794SmrgAC_REQUIRE_AUX_FILE([missing])dnl 64721c2f794Smrgtest x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" 64821c2f794Smrg# Use eval to expand $SHELL 64921c2f794Smrgif eval "$MISSING --run true"; then 65021c2f794Smrg am_missing_run="$MISSING --run " 65121c2f794Smrgelse 65221c2f794Smrg am_missing_run= 65321c2f794Smrg AC_MSG_WARN([`missing' script is too old or missing]) 65421c2f794Smrgfi 65521c2f794Smrg]) 65621c2f794Smrg 65721c2f794Smrg# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 65821c2f794Smrg# 65921c2f794Smrg# This file is free software; the Free Software Foundation 66021c2f794Smrg# gives unlimited permission to copy and/or distribute it, 66121c2f794Smrg# with or without modifications, as long as this notice is preserved. 66221c2f794Smrg 66321c2f794Smrg# AM_PROG_MKDIR_P 66421c2f794Smrg# --------------- 66521c2f794Smrg# Check for `mkdir -p'. 66621c2f794SmrgAC_DEFUN([AM_PROG_MKDIR_P], 66721c2f794Smrg[AC_PREREQ([2.60])dnl 66821c2f794SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl 66921c2f794Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, 67021c2f794Smrgdnl while keeping a definition of mkdir_p for backward compatibility. 67121c2f794Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. 67221c2f794Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of 67321c2f794Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own 67421c2f794Smrgdnl adjustment using top_builddir (which is defined more often than 67521c2f794Smrgdnl MKDIR_P). 67621c2f794SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl 67721c2f794Smrgcase $mkdir_p in 67821c2f794Smrg [[\\/$]]* | ?:[[\\/]]*) ;; 67921c2f794Smrg */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 68021c2f794Smrgesac 68121c2f794Smrg]) 68221c2f794Smrg 68321c2f794Smrg# Helper functions for option handling. -*- Autoconf -*- 68421c2f794Smrg 68521c2f794Smrg# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. 68621c2f794Smrg# 68721c2f794Smrg# This file is free software; the Free Software Foundation 68821c2f794Smrg# gives unlimited permission to copy and/or distribute it, 68921c2f794Smrg# with or without modifications, as long as this notice is preserved. 69021c2f794Smrg 69121c2f794Smrg# serial 3 69221c2f794Smrg 69321c2f794Smrg# _AM_MANGLE_OPTION(NAME) 69421c2f794Smrg# ----------------------- 69521c2f794SmrgAC_DEFUN([_AM_MANGLE_OPTION], 69621c2f794Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 69721c2f794Smrg 69821c2f794Smrg# _AM_SET_OPTION(NAME) 69921c2f794Smrg# ------------------------------ 70021c2f794Smrg# Set option NAME. Presently that only means defining a flag for this option. 70121c2f794SmrgAC_DEFUN([_AM_SET_OPTION], 70221c2f794Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 70321c2f794Smrg 70421c2f794Smrg# _AM_SET_OPTIONS(OPTIONS) 70521c2f794Smrg# ---------------------------------- 70621c2f794Smrg# OPTIONS is a space-separated list of Automake options. 70721c2f794SmrgAC_DEFUN([_AM_SET_OPTIONS], 70821c2f794Smrg[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 70921c2f794Smrg 71021c2f794Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 71121c2f794Smrg# ------------------------------------------- 71221c2f794Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 71321c2f794SmrgAC_DEFUN([_AM_IF_OPTION], 71421c2f794Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 71521c2f794Smrg 71621c2f794Smrg# Check to make sure that the build environment is sane. -*- Autoconf -*- 71721c2f794Smrg 71821c2f794Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 71921c2f794Smrg# Free Software Foundation, Inc. 72021c2f794Smrg# 72121c2f794Smrg# This file is free software; the Free Software Foundation 72221c2f794Smrg# gives unlimited permission to copy and/or distribute it, 72321c2f794Smrg# with or without modifications, as long as this notice is preserved. 72421c2f794Smrg 72521c2f794Smrg# serial 4 72621c2f794Smrg 72721c2f794Smrg# AM_SANITY_CHECK 72821c2f794Smrg# --------------- 72921c2f794SmrgAC_DEFUN([AM_SANITY_CHECK], 73021c2f794Smrg[AC_MSG_CHECKING([whether build environment is sane]) 73121c2f794Smrg# Just in case 73221c2f794Smrgsleep 1 73321c2f794Smrgecho timestamp > conftest.file 73421c2f794Smrg# Do `set' in a subshell so we don't clobber the current shell's 73521c2f794Smrg# arguments. Must try -L first in case configure is actually a 73621c2f794Smrg# symlink; some systems play weird games with the mod time of symlinks 73721c2f794Smrg# (eg FreeBSD returns the mod time of the symlink's containing 73821c2f794Smrg# directory). 73921c2f794Smrgif ( 74021c2f794Smrg set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` 74121c2f794Smrg if test "$[*]" = "X"; then 74221c2f794Smrg # -L didn't work. 74321c2f794Smrg set X `ls -t $srcdir/configure conftest.file` 74421c2f794Smrg fi 74521c2f794Smrg rm -f conftest.file 74621c2f794Smrg if test "$[*]" != "X $srcdir/configure conftest.file" \ 74721c2f794Smrg && test "$[*]" != "X conftest.file $srcdir/configure"; then 74821c2f794Smrg 74921c2f794Smrg # If neither matched, then we have a broken ls. This can happen 75021c2f794Smrg # if, for instance, CONFIG_SHELL is bash and it inherits a 75121c2f794Smrg # broken ls alias from the environment. This has actually 75221c2f794Smrg # happened. Such a system could not be considered "sane". 75321c2f794Smrg AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 75421c2f794Smrgalias in your environment]) 75521c2f794Smrg fi 75621c2f794Smrg 75721c2f794Smrg test "$[2]" = conftest.file 75821c2f794Smrg ) 75921c2f794Smrgthen 76021c2f794Smrg # Ok. 76121c2f794Smrg : 76221c2f794Smrgelse 76321c2f794Smrg AC_MSG_ERROR([newly created file is older than distributed files! 76421c2f794SmrgCheck your system clock]) 76521c2f794Smrgfi 76621c2f794SmrgAC_MSG_RESULT(yes)]) 76721c2f794Smrg 76821c2f794Smrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 76921c2f794Smrg# 77021c2f794Smrg# This file is free software; the Free Software Foundation 77121c2f794Smrg# gives unlimited permission to copy and/or distribute it, 77221c2f794Smrg# with or without modifications, as long as this notice is preserved. 77321c2f794Smrg 77421c2f794Smrg# AM_PROG_INSTALL_STRIP 77521c2f794Smrg# --------------------- 77621c2f794Smrg# One issue with vendor `install' (even GNU) is that you can't 77721c2f794Smrg# specify the program used to strip binaries. This is especially 77821c2f794Smrg# annoying in cross-compiling environments, where the build's strip 77921c2f794Smrg# is unlikely to handle the host's binaries. 78021c2f794Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we 78121c2f794Smrg# always use install-sh in `make install-strip', and initialize 78221c2f794Smrg# STRIPPROG with the value of the STRIP variable (set by the user). 78321c2f794SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP], 78421c2f794Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 78521c2f794Smrg# Installed binaries are usually stripped using `strip' when the user 78621c2f794Smrg# run `make install-strip'. However `strip' might not be the right 78721c2f794Smrg# tool to use in cross-compilation environments, therefore Automake 78821c2f794Smrg# will honor the `STRIP' environment variable to overrule this program. 78921c2f794Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'. 79021c2f794Smrgif test "$cross_compiling" != no; then 79121c2f794Smrg AC_CHECK_TOOL([STRIP], [strip], :) 79221c2f794Smrgfi 79321c2f794SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 79421c2f794SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])]) 79521c2f794Smrg 79621c2f794Smrg# Copyright (C) 2006 Free Software Foundation, Inc. 79721c2f794Smrg# 79821c2f794Smrg# This file is free software; the Free Software Foundation 79921c2f794Smrg# gives unlimited permission to copy and/or distribute it, 80021c2f794Smrg# with or without modifications, as long as this notice is preserved. 80121c2f794Smrg 80221c2f794Smrg# _AM_SUBST_NOTMAKE(VARIABLE) 80321c2f794Smrg# --------------------------- 80421c2f794Smrg# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. 80521c2f794Smrg# This macro is traced by Automake. 80621c2f794SmrgAC_DEFUN([_AM_SUBST_NOTMAKE]) 80721c2f794Smrg 80821c2f794Smrg# Check how to create a tarball. -*- Autoconf -*- 80921c2f794Smrg 81021c2f794Smrg# Copyright (C) 2004, 2005 Free Software Foundation, Inc. 81121c2f794Smrg# 81221c2f794Smrg# This file is free software; the Free Software Foundation 81321c2f794Smrg# gives unlimited permission to copy and/or distribute it, 81421c2f794Smrg# with or without modifications, as long as this notice is preserved. 81521c2f794Smrg 81621c2f794Smrg# serial 2 81721c2f794Smrg 81821c2f794Smrg# _AM_PROG_TAR(FORMAT) 81921c2f794Smrg# -------------------- 82021c2f794Smrg# Check how to create a tarball in format FORMAT. 82121c2f794Smrg# FORMAT should be one of `v7', `ustar', or `pax'. 82221c2f794Smrg# 82321c2f794Smrg# Substitute a variable $(am__tar) that is a command 82421c2f794Smrg# writing to stdout a FORMAT-tarball containing the directory 82521c2f794Smrg# $tardir. 82621c2f794Smrg# tardir=directory && $(am__tar) > result.tar 82721c2f794Smrg# 82821c2f794Smrg# Substitute a variable $(am__untar) that extract such 82921c2f794Smrg# a tarball read from stdin. 83021c2f794Smrg# $(am__untar) < result.tar 83121c2f794SmrgAC_DEFUN([_AM_PROG_TAR], 83221c2f794Smrg[# Always define AMTAR for backward compatibility. 83321c2f794SmrgAM_MISSING_PROG([AMTAR], [tar]) 83421c2f794Smrgm4_if([$1], [v7], 83521c2f794Smrg [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], 83621c2f794Smrg [m4_case([$1], [ustar],, [pax],, 83721c2f794Smrg [m4_fatal([Unknown tar format])]) 83821c2f794SmrgAC_MSG_CHECKING([how to create a $1 tar archive]) 83921c2f794Smrg# Loop over all known methods to create a tar archive until one works. 84021c2f794Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 84121c2f794Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools} 84221c2f794Smrg# Do not fold the above two line into one, because Tru64 sh and 84321c2f794Smrg# Solaris sh will not grok spaces in the rhs of `-'. 84421c2f794Smrgfor _am_tool in $_am_tools 84521c2f794Smrgdo 84621c2f794Smrg case $_am_tool in 84721c2f794Smrg gnutar) 84821c2f794Smrg for _am_tar in tar gnutar gtar; 84921c2f794Smrg do 85021c2f794Smrg AM_RUN_LOG([$_am_tar --version]) && break 85121c2f794Smrg done 85221c2f794Smrg am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 85321c2f794Smrg am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 85421c2f794Smrg am__untar="$_am_tar -xf -" 85521c2f794Smrg ;; 85621c2f794Smrg plaintar) 85721c2f794Smrg # Must skip GNU tar: if it does not support --format= it doesn't create 85821c2f794Smrg # ustar tarball either. 85921c2f794Smrg (tar --version) >/dev/null 2>&1 && continue 86021c2f794Smrg am__tar='tar chf - "$$tardir"' 86121c2f794Smrg am__tar_='tar chf - "$tardir"' 86221c2f794Smrg am__untar='tar xf -' 86321c2f794Smrg ;; 86421c2f794Smrg pax) 86521c2f794Smrg am__tar='pax -L -x $1 -w "$$tardir"' 86621c2f794Smrg am__tar_='pax -L -x $1 -w "$tardir"' 86721c2f794Smrg am__untar='pax -r' 86821c2f794Smrg ;; 86921c2f794Smrg cpio) 87021c2f794Smrg am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 87121c2f794Smrg am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 87221c2f794Smrg am__untar='cpio -i -H $1 -d' 87321c2f794Smrg ;; 87421c2f794Smrg none) 87521c2f794Smrg am__tar=false 87621c2f794Smrg am__tar_=false 87721c2f794Smrg am__untar=false 87821c2f794Smrg ;; 87921c2f794Smrg esac 88021c2f794Smrg 88121c2f794Smrg # If the value was cached, stop now. We just wanted to have am__tar 88221c2f794Smrg # and am__untar set. 88321c2f794Smrg test -n "${am_cv_prog_tar_$1}" && break 88421c2f794Smrg 88521c2f794Smrg # tar/untar a dummy directory, and stop if the command works 88621c2f794Smrg rm -rf conftest.dir 88721c2f794Smrg mkdir conftest.dir 88821c2f794Smrg echo GrepMe > conftest.dir/file 88921c2f794Smrg AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 89021c2f794Smrg rm -rf conftest.dir 89121c2f794Smrg if test -s conftest.tar; then 89221c2f794Smrg AM_RUN_LOG([$am__untar <conftest.tar]) 89321c2f794Smrg grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 89421c2f794Smrg fi 89521c2f794Smrgdone 89621c2f794Smrgrm -rf conftest.dir 89721c2f794Smrg 89821c2f794SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 89921c2f794SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])]) 90021c2f794SmrgAC_SUBST([am__tar]) 90121c2f794SmrgAC_SUBST([am__untar]) 90221c2f794Smrg]) # _AM_PROG_TAR 90321c2f794Smrg 90421c2f794Smrgdnl 90521c2f794Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved. 90621c2f794Smrgdnl 90721c2f794Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a 90821c2f794Smrgdnl copy of this software and associated documentation files (the 90921c2f794Smrgdnl "Software"), to deal in the Software without restriction, including 91021c2f794Smrgdnl without limitation the rights to use, copy, modify, merge, publish, 91121c2f794Smrgdnl distribute, and/or sell copies of the Software, and to permit persons 91221c2f794Smrgdnl to whom the Software is furnished to do so, provided that the above 91321c2f794Smrgdnl copyright notice(s) and this permission notice appear in all copies of 91421c2f794Smrgdnl the Software and that both the above copyright notice(s) and this 91521c2f794Smrgdnl permission notice appear in supporting documentation. 91621c2f794Smrgdnl 91721c2f794Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 91821c2f794Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 91921c2f794Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 92021c2f794Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 92121c2f794Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL 92221c2f794Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING 92321c2f794Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 92421c2f794Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 92521c2f794Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 92621c2f794Smrgdnl 92721c2f794Smrgdnl Except as contained in this notice, the name of a copyright holder 92821c2f794Smrgdnl shall not be used in advertising or otherwise to promote the sale, use 92921c2f794Smrgdnl or other dealings in this Software without prior written authorization 93021c2f794Smrgdnl of the copyright holder. 93121c2f794Smrg 93221c2f794Smrg# XORG_MACROS_VERSION(required-version) 93321c2f794Smrg# ------------------------------------- 93421c2f794Smrg# Minimum version: 1.1.0 93521c2f794Smrg# 93621c2f794Smrg# If you're using a macro added in Version 1.1 or newer, include this in 93721c2f794Smrg# your configure.ac with the minimum required version, such as: 93821c2f794Smrg# XORG_MACROS_VERSION(1.1) 93921c2f794Smrg# 94021c2f794Smrg# To force at least a version with this macro defined, also add: 94121c2f794Smrg# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])]) 94221c2f794Smrg# 94321c2f794Smrg# 94421c2f794Smrg# See the "minimum version" comment for each macro you use to see what 94521c2f794Smrg# version you require. 94621c2f794SmrgAC_DEFUN([XORG_MACROS_VERSION],[ 94721c2f794Smrg [XORG_MACROS_needed_version=$1 94821c2f794Smrg XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'` 94921c2f794Smrg XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`] 95021c2f794Smrg AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}]) 95121c2f794Smrg [XORG_MACROS_version=1.1.6 95221c2f794Smrg XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'` 95321c2f794Smrg XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`] 95421c2f794Smrg if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then 95521c2f794Smrg AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x]) 95621c2f794Smrg fi 95721c2f794Smrg if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then 95821c2f794Smrg AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer]) 95921c2f794Smrg fi 96021c2f794Smrg AC_MSG_RESULT([yes, $XORG_MACROS_version]) 96121c2f794Smrg]) # XORG_MACROS_VERSION 96221c2f794Smrg 96321c2f794Smrg# XORG_PROG_RAWCPP() 96421c2f794Smrg# ------------------ 96521c2f794Smrg# Minimum version: 1.0.0 96621c2f794Smrg# 96721c2f794Smrg# Find cpp program and necessary flags for use in pre-processing text files 96821c2f794Smrg# such as man pages and config files 96921c2f794SmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 97021c2f794SmrgAC_REQUIRE([AC_PROG_CPP]) 97121c2f794SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 97221c2f794Smrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 97321c2f794Smrg 97421c2f794Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 97521c2f794Smrg# which is not the best choice for supporting other OS'es, but covers most 97621c2f794Smrg# of the ones we need for now. 97721c2f794SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 97821c2f794SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?]) 97921c2f794Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 98021c2f794Smrg AC_MSG_RESULT([no]) 98121c2f794Smrgelse 98221c2f794Smrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 98321c2f794Smrg RAWCPPFLAGS=-undef 98421c2f794Smrg AC_MSG_RESULT([yes]) 98521c2f794Smrg else 98621c2f794Smrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 98721c2f794Smrg fi 98821c2f794Smrgfi 98921c2f794Smrgrm -f conftest.$ac_ext 99021c2f794Smrg 99121c2f794SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 99221c2f794SmrgAC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) 99321c2f794Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 99421c2f794Smrg AC_MSG_RESULT([no]) 99521c2f794Smrgelse 99621c2f794Smrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 99721c2f794Smrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 99821c2f794Smrg AC_MSG_RESULT([yes]) 99921c2f794Smrg else 100021c2f794Smrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 100121c2f794Smrg fi 100221c2f794Smrgfi 100321c2f794Smrgrm -f conftest.$ac_ext 100421c2f794SmrgAC_SUBST(RAWCPPFLAGS) 100521c2f794Smrg]) # XORG_PROG_RAWCPP 100621c2f794Smrg 100721c2f794Smrg# XORG_MANPAGE_SECTIONS() 100821c2f794Smrg# ----------------------- 100921c2f794Smrg# Minimum version: 1.0.0 101021c2f794Smrg# 101121c2f794Smrg# Determine which sections man pages go in for the different man page types 101221c2f794Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 101321c2f794Smrg# Not sure if there's any better way than just hardcoding by OS name. 101421c2f794Smrg# Override default settings by setting environment variables 101521c2f794Smrg 101621c2f794SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 101721c2f794SmrgAC_REQUIRE([AC_CANONICAL_HOST]) 101821c2f794Smrg 101921c2f794Smrgif test x$APP_MAN_SUFFIX = x ; then 102021c2f794Smrg APP_MAN_SUFFIX=1 102121c2f794Smrgfi 102221c2f794Smrgif test x$APP_MAN_DIR = x ; then 102321c2f794Smrg APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' 102421c2f794Smrgfi 102521c2f794Smrg 102621c2f794Smrgif test x$LIB_MAN_SUFFIX = x ; then 102721c2f794Smrg LIB_MAN_SUFFIX=3 102821c2f794Smrgfi 102921c2f794Smrgif test x$LIB_MAN_DIR = x ; then 103021c2f794Smrg LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' 103121c2f794Smrgfi 103221c2f794Smrg 103321c2f794Smrgif test x$FILE_MAN_SUFFIX = x ; then 103421c2f794Smrg case $host_os in 103521c2f794Smrg solaris*) FILE_MAN_SUFFIX=4 ;; 103621c2f794Smrg *) FILE_MAN_SUFFIX=5 ;; 103721c2f794Smrg esac 103821c2f794Smrgfi 103921c2f794Smrgif test x$FILE_MAN_DIR = x ; then 104021c2f794Smrg FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' 104121c2f794Smrgfi 104221c2f794Smrg 104321c2f794Smrgif test x$MISC_MAN_SUFFIX = x ; then 104421c2f794Smrg case $host_os in 104521c2f794Smrg solaris*) MISC_MAN_SUFFIX=5 ;; 104621c2f794Smrg *) MISC_MAN_SUFFIX=7 ;; 104721c2f794Smrg esac 104821c2f794Smrgfi 104921c2f794Smrgif test x$MISC_MAN_DIR = x ; then 105021c2f794Smrg MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' 105121c2f794Smrgfi 105221c2f794Smrg 105321c2f794Smrgif test x$DRIVER_MAN_SUFFIX = x ; then 105421c2f794Smrg case $host_os in 105521c2f794Smrg solaris*) DRIVER_MAN_SUFFIX=7 ;; 105621c2f794Smrg *) DRIVER_MAN_SUFFIX=4 ;; 105721c2f794Smrg esac 105821c2f794Smrgfi 105921c2f794Smrgif test x$DRIVER_MAN_DIR = x ; then 106021c2f794Smrg DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' 106121c2f794Smrgfi 106221c2f794Smrg 106321c2f794Smrgif test x$ADMIN_MAN_SUFFIX = x ; then 106421c2f794Smrg case $host_os in 106521c2f794Smrg solaris*) ADMIN_MAN_SUFFIX=1m ;; 106621c2f794Smrg *) ADMIN_MAN_SUFFIX=8 ;; 106721c2f794Smrg esac 106821c2f794Smrgfi 106921c2f794Smrgif test x$ADMIN_MAN_DIR = x ; then 107021c2f794Smrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 107121c2f794Smrgfi 107221c2f794Smrg 107321c2f794Smrg 107421c2f794SmrgAC_SUBST([APP_MAN_SUFFIX]) 107521c2f794SmrgAC_SUBST([LIB_MAN_SUFFIX]) 107621c2f794SmrgAC_SUBST([FILE_MAN_SUFFIX]) 107721c2f794SmrgAC_SUBST([MISC_MAN_SUFFIX]) 107821c2f794SmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 107921c2f794SmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 108021c2f794SmrgAC_SUBST([APP_MAN_DIR]) 108121c2f794SmrgAC_SUBST([LIB_MAN_DIR]) 108221c2f794SmrgAC_SUBST([FILE_MAN_DIR]) 108321c2f794SmrgAC_SUBST([MISC_MAN_DIR]) 108421c2f794SmrgAC_SUBST([DRIVER_MAN_DIR]) 108521c2f794SmrgAC_SUBST([ADMIN_MAN_DIR]) 108621c2f794Smrg]) # XORG_MANPAGE_SECTIONS 108721c2f794Smrg 108821c2f794Smrg# XORG_CHECK_LINUXDOC 108921c2f794Smrg# ------------------- 109021c2f794Smrg# Minimum version: 1.0.0 109121c2f794Smrg# 109221c2f794Smrg# Defines the variable MAKE_TEXT if the necessary tools and 109321c2f794Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 109421c2f794Smrg# Whether or not the necessary tools and files are found can be checked 109521c2f794Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 109621c2f794SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 109721c2f794SmrgXORG_SGML_PATH=$prefix/share/sgml 109821c2f794SmrgHAVE_DEFS_ENT= 109921c2f794Smrg 110021c2f794Smrgif test x"$cross_compiling" = x"yes" ; then 110121c2f794Smrg HAVE_DEFS_ENT=no 110221c2f794Smrgelse 110321c2f794Smrg AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes]) 110421c2f794Smrgfi 110521c2f794Smrg 110621c2f794SmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 110721c2f794SmrgAC_PATH_PROG(PS2PDF, ps2pdf) 110821c2f794Smrg 110921c2f794SmrgAC_MSG_CHECKING([Whether to build documentation]) 111021c2f794Smrg 111121c2f794Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then 111221c2f794Smrg BUILDDOC=yes 111321c2f794Smrgelse 111421c2f794Smrg BUILDDOC=no 111521c2f794Smrgfi 111621c2f794Smrg 111721c2f794SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 111821c2f794Smrg 111921c2f794SmrgAC_MSG_RESULT([$BUILDDOC]) 112021c2f794Smrg 112121c2f794SmrgAC_MSG_CHECKING([Whether to build pdf documentation]) 112221c2f794Smrg 112321c2f794Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then 112421c2f794Smrg BUILDPDFDOC=yes 112521c2f794Smrgelse 112621c2f794Smrg BUILDPDFDOC=no 112721c2f794Smrgfi 112821c2f794Smrg 112921c2f794SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 113021c2f794Smrg 113121c2f794SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 113221c2f794Smrg 113321c2f794SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt" 113421c2f794SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 113521c2f794SmrgMAKE_PDF="$PS2PDF" 113621c2f794SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" 113721c2f794Smrg 113821c2f794SmrgAC_SUBST(MAKE_TEXT) 113921c2f794SmrgAC_SUBST(MAKE_PS) 114021c2f794SmrgAC_SUBST(MAKE_PDF) 114121c2f794SmrgAC_SUBST(MAKE_HTML) 114221c2f794Smrg]) # XORG_CHECK_LINUXDOC 114321c2f794Smrg 114421c2f794Smrg# XORG_CHECK_DOCBOOK 114521c2f794Smrg# ------------------- 114621c2f794Smrg# Minimum version: 1.0.0 114721c2f794Smrg# 114821c2f794Smrg# Checks for the ability to build output formats from SGML DocBook source. 114921c2f794Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" 115021c2f794Smrg# indicates whether the necessary tools and files are found and, if set, 115121c2f794Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx. 115221c2f794SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[ 115321c2f794SmrgXORG_SGML_PATH=$prefix/share/sgml 115421c2f794SmrgHAVE_DEFS_ENT= 115521c2f794SmrgBUILDTXTDOC=no 115621c2f794SmrgBUILDPDFDOC=no 115721c2f794SmrgBUILDPSDOC=no 115821c2f794SmrgBUILDHTMLDOC=no 115921c2f794Smrg 116021c2f794SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes]) 116121c2f794Smrg 116221c2f794SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps) 116321c2f794SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf) 116421c2f794SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html) 116521c2f794SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt) 116621c2f794Smrg 116721c2f794SmrgAC_MSG_CHECKING([Whether to build text documentation]) 116821c2f794Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x && 116921c2f794Smrg test x$BUILD_TXTDOC != xno; then 117021c2f794Smrg BUILDTXTDOC=yes 117121c2f794Smrgfi 117221c2f794SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) 117321c2f794SmrgAC_MSG_RESULT([$BUILDTXTDOC]) 117421c2f794Smrg 117521c2f794SmrgAC_MSG_CHECKING([Whether to build PDF documentation]) 117621c2f794Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x && 117721c2f794Smrg test x$BUILD_PDFDOC != xno; then 117821c2f794Smrg BUILDPDFDOC=yes 117921c2f794Smrgfi 118021c2f794SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 118121c2f794SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 118221c2f794Smrg 118321c2f794SmrgAC_MSG_CHECKING([Whether to build PostScript documentation]) 118421c2f794Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x && 118521c2f794Smrg test x$BUILD_PSDOC != xno; then 118621c2f794Smrg BUILDPSDOC=yes 118721c2f794Smrgfi 118821c2f794SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) 118921c2f794SmrgAC_MSG_RESULT([$BUILDPSDOC]) 119021c2f794Smrg 119121c2f794SmrgAC_MSG_CHECKING([Whether to build HTML documentation]) 119221c2f794Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x && 119321c2f794Smrg test x$BUILD_HTMLDOC != xno; then 119421c2f794Smrg BUILDHTMLDOC=yes 119521c2f794Smrgfi 119621c2f794SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) 119721c2f794SmrgAC_MSG_RESULT([$BUILDHTMLDOC]) 119821c2f794Smrg 119921c2f794SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" 120021c2f794SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" 120121c2f794SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" 120221c2f794SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" 120321c2f794Smrg 120421c2f794SmrgAC_SUBST(MAKE_TEXT) 120521c2f794SmrgAC_SUBST(MAKE_PS) 120621c2f794SmrgAC_SUBST(MAKE_PDF) 120721c2f794SmrgAC_SUBST(MAKE_HTML) 120821c2f794Smrg]) # XORG_CHECK_DOCBOOK 120921c2f794Smrg 121021c2f794Smrg# XORG_CHECK_MALLOC_ZERO 121121c2f794Smrg# ---------------------- 121221c2f794Smrg# Minimum version: 1.0.0 121321c2f794Smrg# 121421c2f794Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 121521c2f794Smrg# malloc(0) returns NULL. Packages should add one of these cflags to 121621c2f794Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 121721c2f794SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 121821c2f794SmrgAC_ARG_ENABLE(malloc0returnsnull, 121921c2f794Smrg AC_HELP_STRING([--enable-malloc0returnsnull], 122021c2f794Smrg [malloc(0) returns NULL (default: auto)]), 122121c2f794Smrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 122221c2f794Smrg [MALLOC_ZERO_RETURNS_NULL=auto]) 122321c2f794Smrg 122421c2f794SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 122521c2f794Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 122621c2f794Smrg AC_RUN_IFELSE([ 122721c2f794Smrgchar *malloc(); 122821c2f794Smrgchar *realloc(); 122921c2f794Smrgchar *calloc(); 123021c2f794Smrgmain() { 123121c2f794Smrg char *m0, *r0, *c0, *p; 123221c2f794Smrg m0 = malloc(0); 123321c2f794Smrg p = malloc(10); 123421c2f794Smrg r0 = realloc(p,0); 123521c2f794Smrg c0 = calloc(0); 123621c2f794Smrg exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); 123721c2f794Smrg}], 123821c2f794Smrg [MALLOC_ZERO_RETURNS_NULL=yes], 123921c2f794Smrg [MALLOC_ZERO_RETURNS_NULL=no]) 124021c2f794Smrgfi 124121c2f794SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 124221c2f794Smrg 124321c2f794Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 124421c2f794Smrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 124521c2f794Smrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 124621c2f794Smrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 124721c2f794Smrgelse 124821c2f794Smrg MALLOC_ZERO_CFLAGS="" 124921c2f794Smrg XMALLOC_ZERO_CFLAGS="" 125021c2f794Smrg XTMALLOC_ZERO_CFLAGS="" 125121c2f794Smrgfi 125221c2f794Smrg 125321c2f794SmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 125421c2f794SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 125521c2f794SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 125621c2f794Smrg]) # XORG_CHECK_MALLOC_ZERO 125721c2f794Smrg 125821c2f794Smrg# XORG_WITH_LINT() 125921c2f794Smrg# ---------------- 126021c2f794Smrg# Minimum version: 1.1.0 126121c2f794Smrg# 126221c2f794Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint 126321c2f794Smrg# is specified. (Use --with-lint=sparse for sparse.) 126421c2f794Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint) 126521c2f794Smrg# Sets $LINT_FLAGS to flags to pass to source checker 126621c2f794Smrg# Sets LINT automake conditional if enabled (default: disabled) 126721c2f794Smrg# 126821c2f794SmrgAC_DEFUN([XORG_WITH_LINT],[ 126921c2f794Smrg 127021c2f794Smrg# Allow checking code with lint, sparse, etc. 127121c2f794SmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint], 127221c2f794Smrg [Use a lint-style source code checker (default: disabled)])], 127321c2f794Smrg [use_lint=$withval], [use_lint=no]) 127421c2f794Smrgif test "x$use_lint" = "xyes" ; then 127521c2f794Smrg LINT="lint" 127621c2f794Smrgelse 127721c2f794Smrg LINT="$use_lint" 127821c2f794Smrgfi 127921c2f794Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then 128021c2f794Smrg case $LINT in 128121c2f794Smrg lint|*/lint) 128221c2f794Smrg case $host_os in 128321c2f794Smrg solaris*) 128421c2f794Smrg LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" 128521c2f794Smrg ;; 128621c2f794Smrg esac 128721c2f794Smrg ;; 128821c2f794Smrg esac 128921c2f794Smrgfi 129021c2f794Smrg 129121c2f794SmrgAC_SUBST(LINT) 129221c2f794SmrgAC_SUBST(LINT_FLAGS) 129321c2f794SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno]) 129421c2f794Smrg 129521c2f794Smrg]) # XORG_WITH_LINT 129621c2f794Smrg 129721c2f794Smrg# XORG_LINT_LIBRARY(LIBNAME) 129821c2f794Smrg# -------------------------- 129921c2f794Smrg# Minimum version: 1.1.0 130021c2f794Smrg# 130121c2f794Smrg# Sets up flags for building lint libraries for checking programs that call 130221c2f794Smrg# functions in the library. 130321c2f794Smrg# Disabled by default, enable with --enable-lint-library 130421c2f794Smrg# Sets: 130521c2f794Smrg# @LINTLIB@ - name of lint library file to make 130621c2f794Smrg# MAKE_LINT_LIB - automake conditional 130721c2f794Smrg# 130821c2f794Smrg 130921c2f794SmrgAC_DEFUN([XORG_LINT_LIBRARY],[ 131021c2f794SmrgAC_REQUIRE([XORG_WITH_LINT]) 131121c2f794Smrg# Build lint "library" for more indepth checks of programs calling this library 131221c2f794SmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library], 131321c2f794Smrg [Create lint library (default: disabled)])], 131421c2f794Smrg [make_lint_lib=$enableval], [make_lint_lib=no]) 131521c2f794Smrgif test "x$make_lint_lib" != "xno" ; then 131621c2f794Smrg if test "x$LINT" = "xno" ; then 131721c2f794Smrg AC_MSG_ERROR([Cannot make lint library without --with-lint]) 131821c2f794Smrg fi 131921c2f794Smrg if test "x$make_lint_lib" = "xyes" ; then 132021c2f794Smrg LINTLIB=llib-l$1.ln 132121c2f794Smrg else 132221c2f794Smrg LINTLIB=$make_lint_lib 132321c2f794Smrg fi 132421c2f794Smrgfi 132521c2f794SmrgAC_SUBST(LINTLIB) 132621c2f794SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) 132721c2f794Smrg 132821c2f794Smrg]) # XORG_LINT_LIBRARY 132921c2f794Smrg 133021c2f794Smrgdnl Copyright 2005 Red Hat, Inc 133121c2f794Smrgdnl 133221c2f794Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 133321c2f794Smrgdnl documentation for any purpose is hereby granted without fee, provided that 133421c2f794Smrgdnl the above copyright notice appear in all copies and that both that 133521c2f794Smrgdnl copyright notice and this permission notice appear in supporting 133621c2f794Smrgdnl documentation. 133721c2f794Smrgdnl 133821c2f794Smrgdnl The above copyright notice and this permission notice shall be included 133921c2f794Smrgdnl in all copies or substantial portions of the Software. 134021c2f794Smrgdnl 134121c2f794Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 134221c2f794Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 134321c2f794Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 134421c2f794Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 134521c2f794Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 134621c2f794Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 134721c2f794Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 134821c2f794Smrgdnl 134921c2f794Smrgdnl Except as contained in this notice, the name of the copyright holders shall 135021c2f794Smrgdnl not be used in advertising or otherwise to promote the sale, use or 135121c2f794Smrgdnl other dealings in this Software without prior written authorization 135221c2f794Smrgdnl from the copyright holders. 135321c2f794Smrgdnl 135421c2f794Smrg 135521c2f794Smrg# XORG_RELEASE_VERSION 135621c2f794Smrg# -------------------- 135721c2f794Smrg# Adds --with/without-release-string and changes the PACKAGE and 135821c2f794Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If 135921c2f794Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. Also 136021c2f794Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. 136121c2f794Smrg 136221c2f794SmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 136321c2f794Smrg AC_ARG_WITH(release-version, 136421c2f794Smrg AC_HELP_STRING([--with-release-version=STRING], 136521c2f794Smrg [Use release version string in package name]), 136621c2f794Smrg [RELEASE_VERSION="$withval"], 136721c2f794Smrg [RELEASE_VERSION=""]) 136821c2f794Smrg if test "x$RELEASE_VERSION" != "x"; then 136921c2f794Smrg PACKAGE="$PACKAGE-$RELEASE_VERSION" 137021c2f794Smrg PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" 137121c2f794Smrg AC_MSG_NOTICE([Building with package name set to $PACKAGE]) 137221c2f794Smrg fi 137321c2f794Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], 137421c2f794Smrg [`echo $PACKAGE_VERSION | cut -d . -f 1`], 137521c2f794Smrg [Major version of this package]) 137621c2f794Smrg PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` 137721c2f794Smrg if test "x$PVM" = "x"; then 137821c2f794Smrg PVM="0" 137921c2f794Smrg fi 138021c2f794Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], 138121c2f794Smrg [$PVM], 138221c2f794Smrg [Minor version of this package]) 138321c2f794Smrg PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` 138421c2f794Smrg if test "x$PVP" = "x"; then 138521c2f794Smrg PVP="0" 138621c2f794Smrg fi 138721c2f794Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], 138821c2f794Smrg [$PVP], 138921c2f794Smrg [Patch version of this package]) 139021c2f794Smrg]) 139121c2f794Smrg 139221c2f794Smrg# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 139321c2f794Smrg# 139421c2f794Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 139521c2f794Smrg# 139621c2f794Smrg# This program is free software; you can redistribute it and/or modify 139721c2f794Smrg# it under the terms of the GNU General Public License as published by 139821c2f794Smrg# the Free Software Foundation; either version 2 of the License, or 139921c2f794Smrg# (at your option) any later version. 140021c2f794Smrg# 140121c2f794Smrg# This program is distributed in the hope that it will be useful, but 140221c2f794Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 140321c2f794Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 140421c2f794Smrg# General Public License for more details. 140521c2f794Smrg# 140621c2f794Smrg# You should have received a copy of the GNU General Public License 140721c2f794Smrg# along with this program; if not, write to the Free Software 140821c2f794Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 140921c2f794Smrg# 141021c2f794Smrg# As a special exception to the GNU General Public License, if you 141121c2f794Smrg# distribute this file as part of a program that contains a 141221c2f794Smrg# configuration script generated by Autoconf, you may include it under 141321c2f794Smrg# the same distribution terms that you use for the rest of that program. 141421c2f794Smrg 141521c2f794Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION]) 141621c2f794Smrg# ---------------------------------- 141721c2f794SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG], 141821c2f794Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 141921c2f794Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 142021c2f794SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl 142121c2f794Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 142221c2f794Smrg AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 142321c2f794Smrgfi 142421c2f794Smrgif test -n "$PKG_CONFIG"; then 142521c2f794Smrg _pkg_min_version=m4_ifval([$1], [$1], [0.9.0]) 142621c2f794Smrg AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 142721c2f794Smrg if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 142821c2f794Smrg AC_MSG_RESULT([yes]) 142921c2f794Smrg else 143021c2f794Smrg AC_MSG_RESULT([no]) 143121c2f794Smrg PKG_CONFIG="" 143221c2f794Smrg fi 143321c2f794Smrg 143421c2f794Smrgfi[]dnl 143521c2f794Smrg])# PKG_PROG_PKG_CONFIG 143621c2f794Smrg 143721c2f794Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 143821c2f794Smrg# 143921c2f794Smrg# Check to see whether a particular set of modules exists. Similar 144021c2f794Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors. 144121c2f794Smrg# 144221c2f794Smrg# 144321c2f794Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of 144421c2f794Smrg# this or PKG_CHECK_MODULES is called, or make sure to call 144521c2f794Smrg# PKG_CHECK_EXISTS manually 144621c2f794Smrg# -------------------------------------------------------------- 144721c2f794SmrgAC_DEFUN([PKG_CHECK_EXISTS], 144821c2f794Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 144921c2f794Smrgif test -n "$PKG_CONFIG" && \ 145021c2f794Smrg AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 145121c2f794Smrg m4_ifval([$2], [$2], [:]) 145221c2f794Smrgm4_ifvaln([$3], [else 145321c2f794Smrg $3])dnl 145421c2f794Smrgfi]) 145521c2f794Smrg 145621c2f794Smrg 145721c2f794Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 145821c2f794Smrg# --------------------------------------------- 145921c2f794Smrgm4_define([_PKG_CONFIG], 146021c2f794Smrg[if test -n "$PKG_CONFIG"; then 146121c2f794Smrg PKG_CHECK_EXISTS([$3], 146221c2f794Smrg [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], 146321c2f794Smrg [pkg_failed=yes]) 146421c2f794Smrgelse 146521c2f794Smrg pkg_failed=untried 146621c2f794Smrgfi[]dnl 146721c2f794Smrg])# _PKG_CONFIG 146821c2f794Smrg 146921c2f794Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 147021c2f794Smrg# [ACTION-IF-NOT-FOUND]) 147121c2f794Smrg# 147221c2f794Smrg# 147321c2f794Smrg# Note that if there is a possibility the first call to 147421c2f794Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an 147521c2f794Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 147621c2f794Smrg# 147721c2f794Smrg# 147821c2f794Smrg# -------------------------------------------------------------- 147921c2f794SmrgAC_DEFUN([PKG_CHECK_MODULES], 148021c2f794Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 148121c2f794SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 148221c2f794SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 148321c2f794Smrg 148421c2f794Smrgpkg_failed=no 148521c2f794SmrgAC_MSG_CHECKING([for $1]) 148621c2f794Smrg 148721c2f794Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 148821c2f794Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 148921c2f794Smrg 149021c2f794Smrgif test $pkg_failed = yes; then 149121c2f794Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` 149221c2f794Smrg # Put the nasty error message in config.log where it belongs 149321c2f794Smrg echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD 149421c2f794Smrg 149521c2f794Smrg ifelse([$4], , [AC_MSG_ERROR(dnl 149621c2f794Smrg[Package requirements ($2) were not met. 149721c2f794SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you 149821c2f794Smrginstalled software in a non-standard prefix. 149921c2f794Smrg 150021c2f794SmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables 150121c2f794Smrgto avoid the need to call pkg-config. See the pkg-config man page for 150221c2f794Smrgmore details.])], 150321c2f794Smrg [$4]) 150421c2f794Smrgelif test $pkg_failed = untried; then 150521c2f794Smrg ifelse([$4], , [AC_MSG_FAILURE(dnl 150621c2f794Smrg[The pkg-config script could not be found or is too old. Make sure it 150721c2f794Smrgis in your PATH or set the PKG_CONFIG environment variable to the full 150821c2f794Smrgpath to pkg-config. 150921c2f794Smrg 151021c2f794SmrgAlternatively you may set the $1_CFLAGS and $1_LIBS environment variables 151121c2f794Smrgto avoid the need to call pkg-config. See the pkg-config man page for 151221c2f794Smrgmore details. 151321c2f794Smrg 151421c2f794SmrgTo get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])], 151521c2f794Smrg [$4]) 151621c2f794Smrgelse 151721c2f794Smrg $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 151821c2f794Smrg $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 151921c2f794Smrg AC_MSG_RESULT([yes]) 152021c2f794Smrg ifelse([$3], , :, [$3]) 152121c2f794Smrgfi[]dnl 152221c2f794Smrg])# PKG_CHECK_MODULES 152321c2f794Smrg 1524