aclocal.m4 revision 12391620
112391620Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*- 221c2f794Smrg 321c2f794Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 412391620Smrg# 2005, 2006, 2007, 2008, 2009 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 1412391620Smrgm4_ifndef([AC_AUTOCONF_VERSION], 1512391620Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 1612391620Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, 1712391620Smrg[m4_warning([this file was generated for autoconf 2.68. 1812391620SmrgYou have another version of autoconf. It may work, but is not guaranteed to. 1912391620SmrgIf you have problems, you may need to regenerate the build system entirely. 2012391620SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])]) 2121c2f794Smrg 2212391620Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 2321c2f794Smrg# 2421c2f794Smrg# This file is free software; the Free Software Foundation 2521c2f794Smrg# gives unlimited permission to copy and/or distribute it, 2621c2f794Smrg# with or without modifications, as long as this notice is preserved. 2721c2f794Smrg 2821c2f794Smrg# AM_AUTOMAKE_VERSION(VERSION) 2921c2f794Smrg# ---------------------------- 3021c2f794Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been 3121c2f794Smrg# generated from the m4 files accompanying Automake X.Y. 3221c2f794Smrg# (This private macro should not be called outside this file.) 3321c2f794SmrgAC_DEFUN([AM_AUTOMAKE_VERSION], 3412391620Smrg[am__api_version='1.11' 3521c2f794Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 3621c2f794Smrgdnl require some minimum version. Point them to the right macro. 3712391620Smrgm4_if([$1], [1.11.1], [], 3821c2f794Smrg [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 3921c2f794Smrg]) 4021c2f794Smrg 4121c2f794Smrg# _AM_AUTOCONF_VERSION(VERSION) 4221c2f794Smrg# ----------------------------- 4321c2f794Smrg# aclocal traces this macro to find the Autoconf version. 4421c2f794Smrg# This is a private macro too. Using m4_define simplifies 4521c2f794Smrg# the logic in aclocal, which can simply ignore this definition. 4621c2f794Smrgm4_define([_AM_AUTOCONF_VERSION], []) 4721c2f794Smrg 4821c2f794Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION 4921c2f794Smrg# ------------------------------- 5021c2f794Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 5112391620Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 5221c2f794SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 5312391620Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl 5412391620Smrgm4_ifndef([AC_AUTOCONF_VERSION], 5512391620Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 5612391620Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 5721c2f794Smrg 5821c2f794Smrg# AM_AUX_DIR_EXPAND -*- Autoconf -*- 5921c2f794Smrg 6021c2f794Smrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 6121c2f794Smrg# 6221c2f794Smrg# This file is free software; the Free Software Foundation 6321c2f794Smrg# gives unlimited permission to copy and/or distribute it, 6421c2f794Smrg# with or without modifications, as long as this notice is preserved. 6521c2f794Smrg 6621c2f794Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 6721c2f794Smrg# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 6821c2f794Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'. 6921c2f794Smrg# 7021c2f794Smrg# Of course, Automake must honor this variable whenever it calls a 7121c2f794Smrg# tool from the auxiliary directory. The problem is that $srcdir (and 7221c2f794Smrg# therefore $ac_aux_dir as well) can be either absolute or relative, 7321c2f794Smrg# depending on how configure is run. This is pretty annoying, since 7421c2f794Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top 7521c2f794Smrg# source directory, any form will work fine, but in subdirectories a 7621c2f794Smrg# relative path needs to be adjusted first. 7721c2f794Smrg# 7821c2f794Smrg# $ac_aux_dir/missing 7921c2f794Smrg# fails when called from a subdirectory if $ac_aux_dir is relative 8021c2f794Smrg# $top_srcdir/$ac_aux_dir/missing 8121c2f794Smrg# fails if $ac_aux_dir is absolute, 8221c2f794Smrg# fails when called from a subdirectory in a VPATH build with 8321c2f794Smrg# a relative $ac_aux_dir 8421c2f794Smrg# 8521c2f794Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 8621c2f794Smrg# are both prefixed by $srcdir. In an in-source build this is usually 8721c2f794Smrg# harmless because $srcdir is `.', but things will broke when you 8821c2f794Smrg# start a VPATH build or use an absolute $srcdir. 8921c2f794Smrg# 9021c2f794Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 9121c2f794Smrg# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 9221c2f794Smrg# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 9321c2f794Smrg# and then we would define $MISSING as 9421c2f794Smrg# MISSING="\${SHELL} $am_aux_dir/missing" 9521c2f794Smrg# This will work as long as MISSING is not called from configure, because 9621c2f794Smrg# unfortunately $(top_srcdir) has no meaning in configure. 9721c2f794Smrg# However there are other variables, like CC, which are often used in 9821c2f794Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir. 9921c2f794Smrg# 10021c2f794Smrg# Another solution, used here, is to always expand $ac_aux_dir to an 10121c2f794Smrg# absolute PATH. The drawback is that using absolute paths prevent a 10221c2f794Smrg# configured tree to be moved without reconfiguration. 10321c2f794Smrg 10421c2f794SmrgAC_DEFUN([AM_AUX_DIR_EXPAND], 10521c2f794Smrg[dnl Rely on autoconf to set up CDPATH properly. 10621c2f794SmrgAC_PREREQ([2.50])dnl 10721c2f794Smrg# expand $ac_aux_dir to an absolute path 10821c2f794Smrgam_aux_dir=`cd $ac_aux_dir && pwd` 10921c2f794Smrg]) 11021c2f794Smrg 11121c2f794Smrg# AM_CONDITIONAL -*- Autoconf -*- 11221c2f794Smrg 11312391620Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 11421c2f794Smrg# Free Software Foundation, Inc. 11521c2f794Smrg# 11621c2f794Smrg# This file is free software; the Free Software Foundation 11721c2f794Smrg# gives unlimited permission to copy and/or distribute it, 11821c2f794Smrg# with or without modifications, as long as this notice is preserved. 11921c2f794Smrg 12012391620Smrg# serial 9 12121c2f794Smrg 12221c2f794Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION) 12321c2f794Smrg# ------------------------------------- 12421c2f794Smrg# Define a conditional. 12521c2f794SmrgAC_DEFUN([AM_CONDITIONAL], 12621c2f794Smrg[AC_PREREQ(2.52)dnl 12721c2f794Smrg ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 12821c2f794Smrg [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 12921c2f794SmrgAC_SUBST([$1_TRUE])dnl 13021c2f794SmrgAC_SUBST([$1_FALSE])dnl 13121c2f794Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl 13221c2f794Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl 13312391620Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl 13421c2f794Smrgif $2; then 13521c2f794Smrg $1_TRUE= 13621c2f794Smrg $1_FALSE='#' 13721c2f794Smrgelse 13821c2f794Smrg $1_TRUE='#' 13921c2f794Smrg $1_FALSE= 14021c2f794Smrgfi 14121c2f794SmrgAC_CONFIG_COMMANDS_PRE( 14221c2f794Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 14321c2f794Smrg AC_MSG_ERROR([[conditional "$1" was never defined. 14421c2f794SmrgUsually this means the macro was only invoked conditionally.]]) 14521c2f794Smrgfi])]) 14621c2f794Smrg 14712391620Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 14821c2f794Smrg# Free Software Foundation, Inc. 14921c2f794Smrg# 15021c2f794Smrg# This file is free software; the Free Software Foundation 15121c2f794Smrg# gives unlimited permission to copy and/or distribute it, 15221c2f794Smrg# with or without modifications, as long as this notice is preserved. 15321c2f794Smrg 15412391620Smrg# serial 10 15521c2f794Smrg 15621c2f794Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 15721c2f794Smrg# written in clear, in which case automake, when reading aclocal.m4, 15821c2f794Smrg# will think it sees a *use*, and therefore will trigger all it's 15921c2f794Smrg# C support machinery. Also note that it means that autoscan, seeing 16021c2f794Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 16121c2f794Smrg 16221c2f794Smrg 16321c2f794Smrg# _AM_DEPENDENCIES(NAME) 16421c2f794Smrg# ---------------------- 16521c2f794Smrg# See how the compiler implements dependency checking. 16621c2f794Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC". 16721c2f794Smrg# We try a few techniques and use that to set a single cache variable. 16821c2f794Smrg# 16921c2f794Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 17021c2f794Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 17121c2f794Smrg# dependency, and given that the user is not expected to run this macro, 17221c2f794Smrg# just rely on AC_PROG_CC. 17321c2f794SmrgAC_DEFUN([_AM_DEPENDENCIES], 17421c2f794Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl 17521c2f794SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 17621c2f794SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl 17721c2f794SmrgAC_REQUIRE([AM_DEP_TRACK])dnl 17821c2f794Smrg 17921c2f794Smrgifelse([$1], CC, [depcc="$CC" am_compiler_list=], 18021c2f794Smrg [$1], CXX, [depcc="$CXX" am_compiler_list=], 18121c2f794Smrg [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 18221c2f794Smrg [$1], UPC, [depcc="$UPC" am_compiler_list=], 18321c2f794Smrg [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 18421c2f794Smrg [depcc="$$1" am_compiler_list=]) 18521c2f794Smrg 18621c2f794SmrgAC_CACHE_CHECK([dependency style of $depcc], 18721c2f794Smrg [am_cv_$1_dependencies_compiler_type], 18821c2f794Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 18921c2f794Smrg # We make a subdir and do the tests there. Otherwise we can end up 19021c2f794Smrg # making bogus files that we don't know about and never remove. For 19121c2f794Smrg # instance it was reported that on HP-UX the gcc test will end up 19221c2f794Smrg # making a dummy file named `D' -- because `-MD' means `put the output 19321c2f794Smrg # in D'. 19421c2f794Smrg mkdir conftest.dir 19521c2f794Smrg # Copy depcomp to subdir because otherwise we won't find it if we're 19621c2f794Smrg # using a relative directory. 19721c2f794Smrg cp "$am_depcomp" conftest.dir 19821c2f794Smrg cd conftest.dir 19921c2f794Smrg # We will build objects and dependencies in a subdirectory because 20021c2f794Smrg # it helps to detect inapplicable dependency modes. For instance 20121c2f794Smrg # both Tru64's cc and ICC support -MD to output dependencies as a 20221c2f794Smrg # side effect of compilation, but ICC will put the dependencies in 20321c2f794Smrg # the current directory while Tru64 will put them in the object 20421c2f794Smrg # directory. 20521c2f794Smrg mkdir sub 20621c2f794Smrg 20721c2f794Smrg am_cv_$1_dependencies_compiler_type=none 20821c2f794Smrg if test "$am_compiler_list" = ""; then 20921c2f794Smrg am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 21021c2f794Smrg fi 21112391620Smrg am__universal=false 21212391620Smrg m4_case([$1], [CC], 21312391620Smrg [case " $depcc " in #( 21412391620Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 21512391620Smrg esac], 21612391620Smrg [CXX], 21712391620Smrg [case " $depcc " in #( 21812391620Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 21912391620Smrg esac]) 22012391620Smrg 22121c2f794Smrg for depmode in $am_compiler_list; do 22221c2f794Smrg # Setup a source with many dependencies, because some compilers 22321c2f794Smrg # like to wrap large dependency lists on column 80 (with \), and 22421c2f794Smrg # we should not choose a depcomp mode which is confused by this. 22521c2f794Smrg # 22621c2f794Smrg # We need to recreate these files for each test, as the compiler may 22721c2f794Smrg # overwrite some of them when testing with obscure command lines. 22821c2f794Smrg # This happens at least with the AIX C compiler. 22921c2f794Smrg : > sub/conftest.c 23021c2f794Smrg for i in 1 2 3 4 5 6; do 23121c2f794Smrg echo '#include "conftst'$i'.h"' >> sub/conftest.c 23221c2f794Smrg # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with 23321c2f794Smrg # Solaris 8's {/usr,}/bin/sh. 23421c2f794Smrg touch sub/conftst$i.h 23521c2f794Smrg done 23621c2f794Smrg echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 23721c2f794Smrg 23812391620Smrg # We check with `-c' and `-o' for the sake of the "dashmstdout" 23912391620Smrg # mode. It turns out that the SunPro C++ compiler does not properly 24012391620Smrg # handle `-M -o', and we need to detect this. Also, some Intel 24112391620Smrg # versions had trouble with output in subdirs 24212391620Smrg am__obj=sub/conftest.${OBJEXT-o} 24312391620Smrg am__minus_obj="-o $am__obj" 24421c2f794Smrg case $depmode in 24512391620Smrg gcc) 24612391620Smrg # This depmode causes a compiler race in universal mode. 24712391620Smrg test "$am__universal" = false || continue 24812391620Smrg ;; 24921c2f794Smrg nosideeffect) 25021c2f794Smrg # after this tag, mechanisms are not by side-effect, so they'll 25121c2f794Smrg # only be used when explicitly requested 25221c2f794Smrg if test "x$enable_dependency_tracking" = xyes; then 25321c2f794Smrg continue 25421c2f794Smrg else 25521c2f794Smrg break 25621c2f794Smrg fi 25721c2f794Smrg ;; 25812391620Smrg msvisualcpp | msvcmsys) 25912391620Smrg # This compiler won't grok `-c -o', but also, the minuso test has 26012391620Smrg # not run yet. These depmodes are late enough in the game, and 26112391620Smrg # so weak that their functioning should not be impacted. 26212391620Smrg am__obj=conftest.${OBJEXT-o} 26312391620Smrg am__minus_obj= 26412391620Smrg ;; 26521c2f794Smrg none) break ;; 26621c2f794Smrg esac 26721c2f794Smrg if depmode=$depmode \ 26812391620Smrg source=sub/conftest.c object=$am__obj \ 26921c2f794Smrg depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 27012391620Smrg $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 27121c2f794Smrg >/dev/null 2>conftest.err && 27221c2f794Smrg grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 27321c2f794Smrg grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 27412391620Smrg grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 27521c2f794Smrg ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 27621c2f794Smrg # icc doesn't choke on unknown options, it will just issue warnings 27721c2f794Smrg # or remarks (even with -Werror). So we grep stderr for any message 27821c2f794Smrg # that says an option was ignored or not supported. 27921c2f794Smrg # When given -MP, icc 7.0 and 7.1 complain thusly: 28021c2f794Smrg # icc: Command line warning: ignoring option '-M'; no argument required 28121c2f794Smrg # The diagnosis changed in icc 8.0: 28221c2f794Smrg # icc: Command line remark: option '-MP' not supported 28321c2f794Smrg if (grep 'ignoring option' conftest.err || 28421c2f794Smrg grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 28521c2f794Smrg am_cv_$1_dependencies_compiler_type=$depmode 28621c2f794Smrg break 28721c2f794Smrg fi 28821c2f794Smrg fi 28921c2f794Smrg done 29021c2f794Smrg 29121c2f794Smrg cd .. 29221c2f794Smrg rm -rf conftest.dir 29321c2f794Smrgelse 29421c2f794Smrg am_cv_$1_dependencies_compiler_type=none 29521c2f794Smrgfi 29621c2f794Smrg]) 29721c2f794SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 29821c2f794SmrgAM_CONDITIONAL([am__fastdep$1], [ 29921c2f794Smrg test "x$enable_dependency_tracking" != xno \ 30021c2f794Smrg && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 30121c2f794Smrg]) 30221c2f794Smrg 30321c2f794Smrg 30421c2f794Smrg# AM_SET_DEPDIR 30521c2f794Smrg# ------------- 30621c2f794Smrg# Choose a directory name for dependency files. 30721c2f794Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES 30821c2f794SmrgAC_DEFUN([AM_SET_DEPDIR], 30921c2f794Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 31021c2f794SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 31121c2f794Smrg]) 31221c2f794Smrg 31321c2f794Smrg 31421c2f794Smrg# AM_DEP_TRACK 31521c2f794Smrg# ------------ 31621c2f794SmrgAC_DEFUN([AM_DEP_TRACK], 31721c2f794Smrg[AC_ARG_ENABLE(dependency-tracking, 31821c2f794Smrg[ --disable-dependency-tracking speeds up one-time build 31921c2f794Smrg --enable-dependency-tracking do not reject slow dependency extractors]) 32021c2f794Smrgif test "x$enable_dependency_tracking" != xno; then 32121c2f794Smrg am_depcomp="$ac_aux_dir/depcomp" 32221c2f794Smrg AMDEPBACKSLASH='\' 32321c2f794Smrgfi 32421c2f794SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 32521c2f794SmrgAC_SUBST([AMDEPBACKSLASH])dnl 32621c2f794Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 32721c2f794Smrg]) 32821c2f794Smrg 32921c2f794Smrg# Generate code to set up dependency tracking. -*- Autoconf -*- 33021c2f794Smrg 33112391620Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 33221c2f794Smrg# Free Software Foundation, Inc. 33321c2f794Smrg# 33421c2f794Smrg# This file is free software; the Free Software Foundation 33521c2f794Smrg# gives unlimited permission to copy and/or distribute it, 33621c2f794Smrg# with or without modifications, as long as this notice is preserved. 33721c2f794Smrg 33812391620Smrg#serial 5 33921c2f794Smrg 34021c2f794Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS 34121c2f794Smrg# ------------------------------ 34221c2f794SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 34312391620Smrg[{ 34412391620Smrg # Autoconf 2.62 quotes --file arguments for eval, but not when files 34512391620Smrg # are listed without --file. Let's play safe and only enable the eval 34612391620Smrg # if we detect the quoting. 34712391620Smrg case $CONFIG_FILES in 34812391620Smrg *\'*) eval set x "$CONFIG_FILES" ;; 34912391620Smrg *) set x $CONFIG_FILES ;; 35012391620Smrg esac 35112391620Smrg shift 35212391620Smrg for mf 35312391620Smrg do 35412391620Smrg # Strip MF so we end up with the name of the file. 35512391620Smrg mf=`echo "$mf" | sed -e 's/:.*$//'` 35612391620Smrg # Check whether this is an Automake generated Makefile or not. 35712391620Smrg # We used to match only the files named `Makefile.in', but 35812391620Smrg # some people rename them; so instead we look at the file content. 35912391620Smrg # Grep'ing the first line is not enough: some people post-process 36012391620Smrg # each Makefile.in and add a new line on top of each file to say so. 36112391620Smrg # Grep'ing the whole file is not good either: AIX grep has a line 36212391620Smrg # limit of 2048, but all sed's we know have understand at least 4000. 36312391620Smrg if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 36412391620Smrg dirpart=`AS_DIRNAME("$mf")` 36512391620Smrg else 36612391620Smrg continue 36712391620Smrg fi 36812391620Smrg # Extract the definition of DEPDIR, am__include, and am__quote 36912391620Smrg # from the Makefile without running `make'. 37012391620Smrg DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 37112391620Smrg test -z "$DEPDIR" && continue 37212391620Smrg am__include=`sed -n 's/^am__include = //p' < "$mf"` 37312391620Smrg test -z "am__include" && continue 37412391620Smrg am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 37512391620Smrg # When using ansi2knr, U may be empty or an underscore; expand it 37612391620Smrg U=`sed -n 's/^U = //p' < "$mf"` 37712391620Smrg # Find all dependency output files, they are included files with 37812391620Smrg # $(DEPDIR) in their names. We invoke sed twice because it is the 37912391620Smrg # simplest approach to changing $(DEPDIR) to its actual value in the 38012391620Smrg # expansion. 38112391620Smrg for file in `sed -n " 38212391620Smrg s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 38312391620Smrg sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 38412391620Smrg # Make sure the directory exists. 38512391620Smrg test -f "$dirpart/$file" && continue 38612391620Smrg fdir=`AS_DIRNAME(["$file"])` 38712391620Smrg AS_MKDIR_P([$dirpart/$fdir]) 38812391620Smrg # echo "creating $dirpart/$file" 38912391620Smrg echo '# dummy' > "$dirpart/$file" 39012391620Smrg done 39121c2f794Smrg done 39212391620Smrg} 39321c2f794Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS 39421c2f794Smrg 39521c2f794Smrg 39621c2f794Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS 39721c2f794Smrg# ----------------------------- 39821c2f794Smrg# This macro should only be invoked once -- use via AC_REQUIRE. 39921c2f794Smrg# 40021c2f794Smrg# This code is only required when automatic dependency tracking 40121c2f794Smrg# is enabled. FIXME. This creates each `.P' file that we will 40221c2f794Smrg# need in order to bootstrap the dependency handling code. 40321c2f794SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 40421c2f794Smrg[AC_CONFIG_COMMANDS([depfiles], 40521c2f794Smrg [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 40621c2f794Smrg [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 40721c2f794Smrg]) 40821c2f794Smrg 40921c2f794Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 41021c2f794Smrg# Free Software Foundation, Inc. 41121c2f794Smrg# 41221c2f794Smrg# This file is free software; the Free Software Foundation 41321c2f794Smrg# gives unlimited permission to copy and/or distribute it, 41421c2f794Smrg# with or without modifications, as long as this notice is preserved. 41521c2f794Smrg 41621c2f794Smrg# serial 8 41721c2f794Smrg 41821c2f794Smrg# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. 41921c2f794SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) 42021c2f794Smrg 42121c2f794Smrg# Do all the work for Automake. -*- Autoconf -*- 42221c2f794Smrg 42321c2f794Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 42412391620Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. 42521c2f794Smrg# 42621c2f794Smrg# This file is free software; the Free Software Foundation 42721c2f794Smrg# gives unlimited permission to copy and/or distribute it, 42821c2f794Smrg# with or without modifications, as long as this notice is preserved. 42921c2f794Smrg 43012391620Smrg# serial 16 43121c2f794Smrg 43221c2f794Smrg# This macro actually does too much. Some checks are only needed if 43321c2f794Smrg# your package does certain things. But this isn't really a big deal. 43421c2f794Smrg 43521c2f794Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 43621c2f794Smrg# AM_INIT_AUTOMAKE([OPTIONS]) 43721c2f794Smrg# ----------------------------------------------- 43821c2f794Smrg# The call with PACKAGE and VERSION arguments is the old style 43921c2f794Smrg# call (pre autoconf-2.50), which is being phased out. PACKAGE 44021c2f794Smrg# and VERSION should now be passed to AC_INIT and removed from 44121c2f794Smrg# the call to AM_INIT_AUTOMAKE. 44221c2f794Smrg# We support both call styles for the transition. After 44321c2f794Smrg# the next Automake release, Autoconf can make the AC_INIT 44421c2f794Smrg# arguments mandatory, and then we can depend on a new Autoconf 44521c2f794Smrg# release and drop the old call support. 44621c2f794SmrgAC_DEFUN([AM_INIT_AUTOMAKE], 44712391620Smrg[AC_PREREQ([2.62])dnl 44821c2f794Smrgdnl Autoconf wants to disallow AM_ names. We explicitly allow 44921c2f794Smrgdnl the ones we care about. 45021c2f794Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 45121c2f794SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 45221c2f794SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl 45321c2f794Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then 45421c2f794Smrg # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 45521c2f794Smrg # is not polluted with repeated "-I." 45621c2f794Smrg AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 45721c2f794Smrg # test to see if srcdir already configured 45821c2f794Smrg if test -f $srcdir/config.status; then 45921c2f794Smrg AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 46021c2f794Smrg fi 46121c2f794Smrgfi 46221c2f794Smrg 46321c2f794Smrg# test whether we have cygpath 46421c2f794Smrgif test -z "$CYGPATH_W"; then 46521c2f794Smrg if (cygpath --version) >/dev/null 2>/dev/null; then 46621c2f794Smrg CYGPATH_W='cygpath -w' 46721c2f794Smrg else 46821c2f794Smrg CYGPATH_W=echo 46921c2f794Smrg fi 47021c2f794Smrgfi 47121c2f794SmrgAC_SUBST([CYGPATH_W]) 47221c2f794Smrg 47321c2f794Smrg# Define the identity of the package. 47421c2f794Smrgdnl Distinguish between old-style and new-style calls. 47521c2f794Smrgm4_ifval([$2], 47621c2f794Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 47721c2f794Smrg AC_SUBST([PACKAGE], [$1])dnl 47821c2f794Smrg AC_SUBST([VERSION], [$2])], 47921c2f794Smrg[_AM_SET_OPTIONS([$1])dnl 48021c2f794Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 48121c2f794Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, 48221c2f794Smrg [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 48321c2f794Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 48421c2f794Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 48521c2f794Smrg 48621c2f794Smrg_AM_IF_OPTION([no-define],, 48721c2f794Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 48821c2f794Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 48921c2f794Smrg 49021c2f794Smrg# Some tools Automake needs. 49121c2f794SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl 49221c2f794SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl 49321c2f794SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 49421c2f794SmrgAM_MISSING_PROG(AUTOCONF, autoconf) 49521c2f794SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 49621c2f794SmrgAM_MISSING_PROG(AUTOHEADER, autoheader) 49721c2f794SmrgAM_MISSING_PROG(MAKEINFO, makeinfo) 49812391620SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl 49912391620SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 50021c2f794SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl 50121c2f794Smrg# We need awk for the "check" target. The system "awk" is bad on 50221c2f794Smrg# some platforms. 50321c2f794SmrgAC_REQUIRE([AC_PROG_AWK])dnl 50421c2f794SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl 50521c2f794SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl 50621c2f794Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 50712391620Smrg [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 50812391620Smrg [_AM_PROG_TAR([v7])])]) 50921c2f794Smrg_AM_IF_OPTION([no-dependencies],, 51021c2f794Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC], 51112391620Smrg [_AM_DEPENDENCIES(CC)], 51212391620Smrg [define([AC_PROG_CC], 51312391620Smrg defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 51421c2f794SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX], 51512391620Smrg [_AM_DEPENDENCIES(CXX)], 51612391620Smrg [define([AC_PROG_CXX], 51712391620Smrg defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 51821c2f794SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC], 51912391620Smrg [_AM_DEPENDENCIES(OBJC)], 52012391620Smrg [define([AC_PROG_OBJC], 52112391620Smrg defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl 52221c2f794Smrg]) 52312391620Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl 52412391620Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the 52512391620Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro 52612391620Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below. 52712391620SmrgAC_CONFIG_COMMANDS_PRE(dnl 52812391620Smrg[m4_provide_if([_AM_COMPILER_EXEEXT], 52912391620Smrg [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 53021c2f794Smrg]) 53121c2f794Smrg 53212391620Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 53312391620Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 53412391620Smrgdnl mangled by Autoconf and run in a shell conditional statement. 53512391620Smrgm4_define([_AC_COMPILER_EXEEXT], 53612391620Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 53712391620Smrg 53821c2f794Smrg 53921c2f794Smrg# When config.status generates a header, we must update the stamp-h file. 54021c2f794Smrg# This file resides in the same directory as the config header 54121c2f794Smrg# that is generated. The stamp files are numbered to have different names. 54221c2f794Smrg 54321c2f794Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 54421c2f794Smrg# loop where config.status creates the headers, so we can generate 54521c2f794Smrg# our stamp files there. 54621c2f794SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 54721c2f794Smrg[# Compute $1's index in $config_headers. 54812391620Smrg_am_arg=$1 54921c2f794Smrg_am_stamp_count=1 55021c2f794Smrgfor _am_header in $config_headers :; do 55121c2f794Smrg case $_am_header in 55212391620Smrg $_am_arg | $_am_arg:* ) 55321c2f794Smrg break ;; 55421c2f794Smrg * ) 55521c2f794Smrg _am_stamp_count=`expr $_am_stamp_count + 1` ;; 55621c2f794Smrg esac 55721c2f794Smrgdone 55812391620Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 55921c2f794Smrg 56012391620Smrg# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. 56121c2f794Smrg# 56221c2f794Smrg# This file is free software; the Free Software Foundation 56321c2f794Smrg# gives unlimited permission to copy and/or distribute it, 56421c2f794Smrg# with or without modifications, as long as this notice is preserved. 56521c2f794Smrg 56621c2f794Smrg# AM_PROG_INSTALL_SH 56721c2f794Smrg# ------------------ 56821c2f794Smrg# Define $install_sh. 56921c2f794SmrgAC_DEFUN([AM_PROG_INSTALL_SH], 57021c2f794Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 57112391620Smrgif test x"${install_sh}" != xset; then 57212391620Smrg case $am_aux_dir in 57312391620Smrg *\ * | *\ *) 57412391620Smrg install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 57512391620Smrg *) 57612391620Smrg install_sh="\${SHELL} $am_aux_dir/install-sh" 57712391620Smrg esac 57812391620Smrgfi 57921c2f794SmrgAC_SUBST(install_sh)]) 58021c2f794Smrg 58121c2f794Smrg# Copyright (C) 2003, 2005 Free Software Foundation, Inc. 58221c2f794Smrg# 58321c2f794Smrg# This file is free software; the Free Software Foundation 58421c2f794Smrg# gives unlimited permission to copy and/or distribute it, 58521c2f794Smrg# with or without modifications, as long as this notice is preserved. 58621c2f794Smrg 58721c2f794Smrg# serial 2 58821c2f794Smrg 58921c2f794Smrg# Check whether the underlying file-system supports filenames 59021c2f794Smrg# with a leading dot. For instance MS-DOS doesn't. 59121c2f794SmrgAC_DEFUN([AM_SET_LEADING_DOT], 59221c2f794Smrg[rm -rf .tst 2>/dev/null 59321c2f794Smrgmkdir .tst 2>/dev/null 59421c2f794Smrgif test -d .tst; then 59521c2f794Smrg am__leading_dot=. 59621c2f794Smrgelse 59721c2f794Smrg am__leading_dot=_ 59821c2f794Smrgfi 59921c2f794Smrgrmdir .tst 2>/dev/null 60021c2f794SmrgAC_SUBST([am__leading_dot])]) 60121c2f794Smrg 60221c2f794Smrg# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- 60321c2f794Smrg# From Jim Meyering 60421c2f794Smrg 60512391620Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 60621c2f794Smrg# Free Software Foundation, Inc. 60721c2f794Smrg# 60821c2f794Smrg# This file is free software; the Free Software Foundation 60921c2f794Smrg# gives unlimited permission to copy and/or distribute it, 61021c2f794Smrg# with or without modifications, as long as this notice is preserved. 61121c2f794Smrg 61212391620Smrg# serial 5 61321c2f794Smrg 61412391620Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE]) 61512391620Smrg# ---------------------------------- 61612391620Smrg# Control maintainer-specific portions of Makefiles. 61712391620Smrg# Default is to disable them, unless `enable' is passed literally. 61812391620Smrg# For symmetry, `disable' may be passed as well. Anyway, the user 61912391620Smrg# can override the default with the --enable/--disable switch. 62021c2f794SmrgAC_DEFUN([AM_MAINTAINER_MODE], 62112391620Smrg[m4_case(m4_default([$1], [disable]), 62212391620Smrg [enable], [m4_define([am_maintainer_other], [disable])], 62312391620Smrg [disable], [m4_define([am_maintainer_other], [enable])], 62412391620Smrg [m4_define([am_maintainer_other], [enable]) 62512391620Smrg m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) 62612391620SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) 62712391620Smrg dnl maintainer-mode's default is 'disable' unless 'enable' is passed 62812391620Smrg AC_ARG_ENABLE([maintainer-mode], 62912391620Smrg[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful 63021c2f794Smrg (and sometimes confusing) to the casual installer], 63112391620Smrg [USE_MAINTAINER_MODE=$enableval], 63212391620Smrg [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) 63321c2f794Smrg AC_MSG_RESULT([$USE_MAINTAINER_MODE]) 63412391620Smrg AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) 63521c2f794Smrg MAINT=$MAINTAINER_MODE_TRUE 63612391620Smrg AC_SUBST([MAINT])dnl 63721c2f794Smrg] 63821c2f794Smrg) 63921c2f794Smrg 64021c2f794SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) 64121c2f794Smrg 64221c2f794Smrg# Check to see how 'make' treats includes. -*- Autoconf -*- 64321c2f794Smrg 64412391620Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. 64521c2f794Smrg# 64621c2f794Smrg# This file is free software; the Free Software Foundation 64721c2f794Smrg# gives unlimited permission to copy and/or distribute it, 64821c2f794Smrg# with or without modifications, as long as this notice is preserved. 64921c2f794Smrg 65012391620Smrg# serial 4 65121c2f794Smrg 65221c2f794Smrg# AM_MAKE_INCLUDE() 65321c2f794Smrg# ----------------- 65421c2f794Smrg# Check to see how make treats includes. 65521c2f794SmrgAC_DEFUN([AM_MAKE_INCLUDE], 65621c2f794Smrg[am_make=${MAKE-make} 65721c2f794Smrgcat > confinc << 'END' 65821c2f794Smrgam__doit: 65912391620Smrg @echo this is the am__doit target 66021c2f794Smrg.PHONY: am__doit 66121c2f794SmrgEND 66221c2f794Smrg# If we don't find an include directive, just comment out the code. 66321c2f794SmrgAC_MSG_CHECKING([for style of include used by $am_make]) 66421c2f794Smrgam__include="#" 66521c2f794Smrgam__quote= 66621c2f794Smrg_am_result=none 66721c2f794Smrg# First try GNU make style include. 66821c2f794Smrgecho "include confinc" > confmf 66912391620Smrg# Ignore all kinds of additional output from `make'. 67012391620Smrgcase `$am_make -s -f confmf 2> /dev/null` in #( 67112391620Smrg*the\ am__doit\ target*) 67212391620Smrg am__include=include 67312391620Smrg am__quote= 67412391620Smrg _am_result=GNU 67512391620Smrg ;; 67612391620Smrgesac 67721c2f794Smrg# Now try BSD make style include. 67821c2f794Smrgif test "$am__include" = "#"; then 67921c2f794Smrg echo '.include "confinc"' > confmf 68012391620Smrg case `$am_make -s -f confmf 2> /dev/null` in #( 68112391620Smrg *the\ am__doit\ target*) 68212391620Smrg am__include=.include 68312391620Smrg am__quote="\"" 68412391620Smrg _am_result=BSD 68512391620Smrg ;; 68612391620Smrg esac 68721c2f794Smrgfi 68821c2f794SmrgAC_SUBST([am__include]) 68921c2f794SmrgAC_SUBST([am__quote]) 69021c2f794SmrgAC_MSG_RESULT([$_am_result]) 69121c2f794Smrgrm -f confinc confmf 69221c2f794Smrg]) 69321c2f794Smrg 69421c2f794Smrg# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 69521c2f794Smrg 69612391620Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 69721c2f794Smrg# Free Software Foundation, Inc. 69821c2f794Smrg# 69921c2f794Smrg# This file is free software; the Free Software Foundation 70021c2f794Smrg# gives unlimited permission to copy and/or distribute it, 70121c2f794Smrg# with or without modifications, as long as this notice is preserved. 70221c2f794Smrg 70312391620Smrg# serial 6 70421c2f794Smrg 70521c2f794Smrg# AM_MISSING_PROG(NAME, PROGRAM) 70621c2f794Smrg# ------------------------------ 70721c2f794SmrgAC_DEFUN([AM_MISSING_PROG], 70821c2f794Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN]) 70921c2f794Smrg$1=${$1-"${am_missing_run}$2"} 71021c2f794SmrgAC_SUBST($1)]) 71121c2f794Smrg 71221c2f794Smrg 71321c2f794Smrg# AM_MISSING_HAS_RUN 71421c2f794Smrg# ------------------ 71521c2f794Smrg# Define MISSING if not defined so far and test if it supports --run. 71621c2f794Smrg# If it does, set am_missing_run to use it, otherwise, to nothing. 71721c2f794SmrgAC_DEFUN([AM_MISSING_HAS_RUN], 71821c2f794Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 71921c2f794SmrgAC_REQUIRE_AUX_FILE([missing])dnl 72012391620Smrgif test x"${MISSING+set}" != xset; then 72112391620Smrg case $am_aux_dir in 72212391620Smrg *\ * | *\ *) 72312391620Smrg MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; 72412391620Smrg *) 72512391620Smrg MISSING="\${SHELL} $am_aux_dir/missing" ;; 72612391620Smrg esac 72712391620Smrgfi 72821c2f794Smrg# Use eval to expand $SHELL 72921c2f794Smrgif eval "$MISSING --run true"; then 73021c2f794Smrg am_missing_run="$MISSING --run " 73121c2f794Smrgelse 73221c2f794Smrg am_missing_run= 73321c2f794Smrg AC_MSG_WARN([`missing' script is too old or missing]) 73421c2f794Smrgfi 73521c2f794Smrg]) 73621c2f794Smrg 73721c2f794Smrg# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 73821c2f794Smrg# 73921c2f794Smrg# This file is free software; the Free Software Foundation 74021c2f794Smrg# gives unlimited permission to copy and/or distribute it, 74121c2f794Smrg# with or without modifications, as long as this notice is preserved. 74221c2f794Smrg 74321c2f794Smrg# AM_PROG_MKDIR_P 74421c2f794Smrg# --------------- 74521c2f794Smrg# Check for `mkdir -p'. 74621c2f794SmrgAC_DEFUN([AM_PROG_MKDIR_P], 74721c2f794Smrg[AC_PREREQ([2.60])dnl 74821c2f794SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl 74921c2f794Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, 75021c2f794Smrgdnl while keeping a definition of mkdir_p for backward compatibility. 75121c2f794Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. 75221c2f794Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of 75321c2f794Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own 75421c2f794Smrgdnl adjustment using top_builddir (which is defined more often than 75521c2f794Smrgdnl MKDIR_P). 75621c2f794SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl 75721c2f794Smrgcase $mkdir_p in 75821c2f794Smrg [[\\/$]]* | ?:[[\\/]]*) ;; 75921c2f794Smrg */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 76021c2f794Smrgesac 76121c2f794Smrg]) 76221c2f794Smrg 76321c2f794Smrg# Helper functions for option handling. -*- Autoconf -*- 76421c2f794Smrg 76512391620Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. 76621c2f794Smrg# 76721c2f794Smrg# This file is free software; the Free Software Foundation 76821c2f794Smrg# gives unlimited permission to copy and/or distribute it, 76921c2f794Smrg# with or without modifications, as long as this notice is preserved. 77021c2f794Smrg 77112391620Smrg# serial 4 77221c2f794Smrg 77321c2f794Smrg# _AM_MANGLE_OPTION(NAME) 77421c2f794Smrg# ----------------------- 77521c2f794SmrgAC_DEFUN([_AM_MANGLE_OPTION], 77621c2f794Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 77721c2f794Smrg 77821c2f794Smrg# _AM_SET_OPTION(NAME) 77921c2f794Smrg# ------------------------------ 78021c2f794Smrg# Set option NAME. Presently that only means defining a flag for this option. 78121c2f794SmrgAC_DEFUN([_AM_SET_OPTION], 78221c2f794Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 78321c2f794Smrg 78421c2f794Smrg# _AM_SET_OPTIONS(OPTIONS) 78521c2f794Smrg# ---------------------------------- 78621c2f794Smrg# OPTIONS is a space-separated list of Automake options. 78721c2f794SmrgAC_DEFUN([_AM_SET_OPTIONS], 78812391620Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 78921c2f794Smrg 79021c2f794Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 79121c2f794Smrg# ------------------------------------------- 79221c2f794Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 79321c2f794SmrgAC_DEFUN([_AM_IF_OPTION], 79421c2f794Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 79521c2f794Smrg 79621c2f794Smrg# Check to make sure that the build environment is sane. -*- Autoconf -*- 79721c2f794Smrg 79812391620Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 79921c2f794Smrg# Free Software Foundation, Inc. 80021c2f794Smrg# 80121c2f794Smrg# This file is free software; the Free Software Foundation 80221c2f794Smrg# gives unlimited permission to copy and/or distribute it, 80321c2f794Smrg# with or without modifications, as long as this notice is preserved. 80421c2f794Smrg 80512391620Smrg# serial 5 80621c2f794Smrg 80721c2f794Smrg# AM_SANITY_CHECK 80821c2f794Smrg# --------------- 80921c2f794SmrgAC_DEFUN([AM_SANITY_CHECK], 81021c2f794Smrg[AC_MSG_CHECKING([whether build environment is sane]) 81121c2f794Smrg# Just in case 81221c2f794Smrgsleep 1 81321c2f794Smrgecho timestamp > conftest.file 81412391620Smrg# Reject unsafe characters in $srcdir or the absolute working directory 81512391620Smrg# name. Accept space and tab only in the latter. 81612391620Smrgam_lf=' 81712391620Smrg' 81812391620Smrgcase `pwd` in 81912391620Smrg *[[\\\"\#\$\&\'\`$am_lf]]*) 82012391620Smrg AC_MSG_ERROR([unsafe absolute working directory name]);; 82112391620Smrgesac 82212391620Smrgcase $srcdir in 82312391620Smrg *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 82412391620Smrg AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; 82512391620Smrgesac 82612391620Smrg 82721c2f794Smrg# Do `set' in a subshell so we don't clobber the current shell's 82821c2f794Smrg# arguments. Must try -L first in case configure is actually a 82921c2f794Smrg# symlink; some systems play weird games with the mod time of symlinks 83021c2f794Smrg# (eg FreeBSD returns the mod time of the symlink's containing 83121c2f794Smrg# directory). 83221c2f794Smrgif ( 83312391620Smrg set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 83421c2f794Smrg if test "$[*]" = "X"; then 83521c2f794Smrg # -L didn't work. 83612391620Smrg set X `ls -t "$srcdir/configure" conftest.file` 83721c2f794Smrg fi 83821c2f794Smrg rm -f conftest.file 83921c2f794Smrg if test "$[*]" != "X $srcdir/configure conftest.file" \ 84021c2f794Smrg && test "$[*]" != "X conftest.file $srcdir/configure"; then 84121c2f794Smrg 84221c2f794Smrg # If neither matched, then we have a broken ls. This can happen 84321c2f794Smrg # if, for instance, CONFIG_SHELL is bash and it inherits a 84421c2f794Smrg # broken ls alias from the environment. This has actually 84521c2f794Smrg # happened. Such a system could not be considered "sane". 84621c2f794Smrg AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 84721c2f794Smrgalias in your environment]) 84821c2f794Smrg fi 84921c2f794Smrg 85021c2f794Smrg test "$[2]" = conftest.file 85121c2f794Smrg ) 85221c2f794Smrgthen 85321c2f794Smrg # Ok. 85421c2f794Smrg : 85521c2f794Smrgelse 85621c2f794Smrg AC_MSG_ERROR([newly created file is older than distributed files! 85721c2f794SmrgCheck your system clock]) 85821c2f794Smrgfi 85921c2f794SmrgAC_MSG_RESULT(yes)]) 86021c2f794Smrg 86112391620Smrg# Copyright (C) 2009 Free Software Foundation, Inc. 86212391620Smrg# 86312391620Smrg# This file is free software; the Free Software Foundation 86412391620Smrg# gives unlimited permission to copy and/or distribute it, 86512391620Smrg# with or without modifications, as long as this notice is preserved. 86612391620Smrg 86712391620Smrg# serial 1 86812391620Smrg 86912391620Smrg# AM_SILENT_RULES([DEFAULT]) 87012391620Smrg# -------------------------- 87112391620Smrg# Enable less verbose build rules; with the default set to DEFAULT 87212391620Smrg# (`yes' being less verbose, `no' or empty being verbose). 87312391620SmrgAC_DEFUN([AM_SILENT_RULES], 87412391620Smrg[AC_ARG_ENABLE([silent-rules], 87512391620Smrg[ --enable-silent-rules less verbose build output (undo: `make V=1') 87612391620Smrg --disable-silent-rules verbose build output (undo: `make V=0')]) 87712391620Smrgcase $enable_silent_rules in 87812391620Smrgyes) AM_DEFAULT_VERBOSITY=0;; 87912391620Smrgno) AM_DEFAULT_VERBOSITY=1;; 88012391620Smrg*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; 88112391620Smrgesac 88212391620SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl 88312391620SmrgAM_BACKSLASH='\' 88412391620SmrgAC_SUBST([AM_BACKSLASH])dnl 88512391620Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl 88612391620Smrg]) 88712391620Smrg 88821c2f794Smrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 88921c2f794Smrg# 89021c2f794Smrg# This file is free software; the Free Software Foundation 89121c2f794Smrg# gives unlimited permission to copy and/or distribute it, 89221c2f794Smrg# with or without modifications, as long as this notice is preserved. 89321c2f794Smrg 89421c2f794Smrg# AM_PROG_INSTALL_STRIP 89521c2f794Smrg# --------------------- 89621c2f794Smrg# One issue with vendor `install' (even GNU) is that you can't 89721c2f794Smrg# specify the program used to strip binaries. This is especially 89821c2f794Smrg# annoying in cross-compiling environments, where the build's strip 89921c2f794Smrg# is unlikely to handle the host's binaries. 90021c2f794Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we 90121c2f794Smrg# always use install-sh in `make install-strip', and initialize 90221c2f794Smrg# STRIPPROG with the value of the STRIP variable (set by the user). 90321c2f794SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP], 90421c2f794Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 90521c2f794Smrg# Installed binaries are usually stripped using `strip' when the user 90621c2f794Smrg# run `make install-strip'. However `strip' might not be the right 90721c2f794Smrg# tool to use in cross-compilation environments, therefore Automake 90821c2f794Smrg# will honor the `STRIP' environment variable to overrule this program. 90921c2f794Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'. 91021c2f794Smrgif test "$cross_compiling" != no; then 91121c2f794Smrg AC_CHECK_TOOL([STRIP], [strip], :) 91221c2f794Smrgfi 91321c2f794SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 91421c2f794SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])]) 91521c2f794Smrg 91612391620Smrg# Copyright (C) 2006, 2008 Free Software Foundation, Inc. 91721c2f794Smrg# 91821c2f794Smrg# This file is free software; the Free Software Foundation 91921c2f794Smrg# gives unlimited permission to copy and/or distribute it, 92021c2f794Smrg# with or without modifications, as long as this notice is preserved. 92121c2f794Smrg 92212391620Smrg# serial 2 92312391620Smrg 92421c2f794Smrg# _AM_SUBST_NOTMAKE(VARIABLE) 92521c2f794Smrg# --------------------------- 92612391620Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 92721c2f794Smrg# This macro is traced by Automake. 92821c2f794SmrgAC_DEFUN([_AM_SUBST_NOTMAKE]) 92921c2f794Smrg 93012391620Smrg# AM_SUBST_NOTMAKE(VARIABLE) 93112391620Smrg# --------------------------- 93212391620Smrg# Public sister of _AM_SUBST_NOTMAKE. 93312391620SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 93412391620Smrg 93521c2f794Smrg# Check how to create a tarball. -*- Autoconf -*- 93621c2f794Smrg 93721c2f794Smrg# Copyright (C) 2004, 2005 Free Software Foundation, Inc. 93821c2f794Smrg# 93921c2f794Smrg# This file is free software; the Free Software Foundation 94021c2f794Smrg# gives unlimited permission to copy and/or distribute it, 94121c2f794Smrg# with or without modifications, as long as this notice is preserved. 94221c2f794Smrg 94321c2f794Smrg# serial 2 94421c2f794Smrg 94521c2f794Smrg# _AM_PROG_TAR(FORMAT) 94621c2f794Smrg# -------------------- 94721c2f794Smrg# Check how to create a tarball in format FORMAT. 94821c2f794Smrg# FORMAT should be one of `v7', `ustar', or `pax'. 94921c2f794Smrg# 95021c2f794Smrg# Substitute a variable $(am__tar) that is a command 95121c2f794Smrg# writing to stdout a FORMAT-tarball containing the directory 95221c2f794Smrg# $tardir. 95321c2f794Smrg# tardir=directory && $(am__tar) > result.tar 95421c2f794Smrg# 95521c2f794Smrg# Substitute a variable $(am__untar) that extract such 95621c2f794Smrg# a tarball read from stdin. 95721c2f794Smrg# $(am__untar) < result.tar 95821c2f794SmrgAC_DEFUN([_AM_PROG_TAR], 95921c2f794Smrg[# Always define AMTAR for backward compatibility. 96021c2f794SmrgAM_MISSING_PROG([AMTAR], [tar]) 96121c2f794Smrgm4_if([$1], [v7], 96221c2f794Smrg [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], 96321c2f794Smrg [m4_case([$1], [ustar],, [pax],, 96421c2f794Smrg [m4_fatal([Unknown tar format])]) 96521c2f794SmrgAC_MSG_CHECKING([how to create a $1 tar archive]) 96621c2f794Smrg# Loop over all known methods to create a tar archive until one works. 96721c2f794Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 96821c2f794Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools} 96921c2f794Smrg# Do not fold the above two line into one, because Tru64 sh and 97021c2f794Smrg# Solaris sh will not grok spaces in the rhs of `-'. 97121c2f794Smrgfor _am_tool in $_am_tools 97221c2f794Smrgdo 97321c2f794Smrg case $_am_tool in 97421c2f794Smrg gnutar) 97521c2f794Smrg for _am_tar in tar gnutar gtar; 97621c2f794Smrg do 97721c2f794Smrg AM_RUN_LOG([$_am_tar --version]) && break 97821c2f794Smrg done 97921c2f794Smrg am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 98021c2f794Smrg am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 98121c2f794Smrg am__untar="$_am_tar -xf -" 98221c2f794Smrg ;; 98321c2f794Smrg plaintar) 98421c2f794Smrg # Must skip GNU tar: if it does not support --format= it doesn't create 98521c2f794Smrg # ustar tarball either. 98621c2f794Smrg (tar --version) >/dev/null 2>&1 && continue 98721c2f794Smrg am__tar='tar chf - "$$tardir"' 98821c2f794Smrg am__tar_='tar chf - "$tardir"' 98921c2f794Smrg am__untar='tar xf -' 99021c2f794Smrg ;; 99121c2f794Smrg pax) 99221c2f794Smrg am__tar='pax -L -x $1 -w "$$tardir"' 99321c2f794Smrg am__tar_='pax -L -x $1 -w "$tardir"' 99421c2f794Smrg am__untar='pax -r' 99521c2f794Smrg ;; 99621c2f794Smrg cpio) 99721c2f794Smrg am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 99821c2f794Smrg am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 99921c2f794Smrg am__untar='cpio -i -H $1 -d' 100021c2f794Smrg ;; 100121c2f794Smrg none) 100221c2f794Smrg am__tar=false 100321c2f794Smrg am__tar_=false 100421c2f794Smrg am__untar=false 100521c2f794Smrg ;; 100621c2f794Smrg esac 100721c2f794Smrg 100821c2f794Smrg # If the value was cached, stop now. We just wanted to have am__tar 100921c2f794Smrg # and am__untar set. 101021c2f794Smrg test -n "${am_cv_prog_tar_$1}" && break 101121c2f794Smrg 101221c2f794Smrg # tar/untar a dummy directory, and stop if the command works 101321c2f794Smrg rm -rf conftest.dir 101421c2f794Smrg mkdir conftest.dir 101521c2f794Smrg echo GrepMe > conftest.dir/file 101621c2f794Smrg AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 101721c2f794Smrg rm -rf conftest.dir 101821c2f794Smrg if test -s conftest.tar; then 101921c2f794Smrg AM_RUN_LOG([$am__untar <conftest.tar]) 102021c2f794Smrg grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 102121c2f794Smrg fi 102221c2f794Smrgdone 102321c2f794Smrgrm -rf conftest.dir 102421c2f794Smrg 102521c2f794SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 102621c2f794SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])]) 102721c2f794SmrgAC_SUBST([am__tar]) 102821c2f794SmrgAC_SUBST([am__untar]) 102921c2f794Smrg]) # _AM_PROG_TAR 103021c2f794Smrg 103112391620Smrgdnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. 103221c2f794Smrgdnl 103312391620Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 103421c2f794Smrgdnl 103521c2f794Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a 103612391620Smrgdnl copy of this software and associated documentation files (the "Software"), 103712391620Smrgdnl to deal in the Software without restriction, including without limitation 103812391620Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense, 103912391620Smrgdnl and/or sell copies of the Software, and to permit persons to whom the 104012391620Smrgdnl Software is furnished to do so, subject to the following conditions: 104121c2f794Smrgdnl 104212391620Smrgdnl The above copyright notice and this permission notice (including the next 104312391620Smrgdnl paragraph) shall be included in all copies or substantial portions of the 104412391620Smrgdnl Software. 104521c2f794Smrgdnl 104612391620Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 104712391620Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 104812391620Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 104912391620Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 105012391620Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 105112391620Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 105212391620Smrgdnl DEALINGS IN THE SOFTWARE. 105321c2f794Smrg 105421c2f794Smrg# XORG_MACROS_VERSION(required-version) 105521c2f794Smrg# ------------------------------------- 105621c2f794Smrg# Minimum version: 1.1.0 105721c2f794Smrg# 105821c2f794Smrg# If you're using a macro added in Version 1.1 or newer, include this in 105921c2f794Smrg# your configure.ac with the minimum required version, such as: 106021c2f794Smrg# XORG_MACROS_VERSION(1.1) 106121c2f794Smrg# 106212391620Smrg# To ensure that this macro is defined, also add: 106312391620Smrg# m4_ifndef([XORG_MACROS_VERSION], 106412391620Smrg# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) 106521c2f794Smrg# 106621c2f794Smrg# 106721c2f794Smrg# See the "minimum version" comment for each macro you use to see what 106821c2f794Smrg# version you require. 106912391620Smrgm4_defun([XORG_MACROS_VERSION],[ 107012391620Smrgm4_define([vers_have], [1.11.0]) 107112391620Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) 107212391620Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) 107312391620Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,, 107412391620Smrg [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])]) 107512391620Smrgm4_if(m4_version_compare(vers_have, [$1]), -1, 107612391620Smrg [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])]) 107712391620Smrgm4_undefine([vers_have]) 107812391620Smrgm4_undefine([maj_have]) 107912391620Smrgm4_undefine([maj_needed]) 108021c2f794Smrg]) # XORG_MACROS_VERSION 108121c2f794Smrg 108221c2f794Smrg# XORG_PROG_RAWCPP() 108321c2f794Smrg# ------------------ 108421c2f794Smrg# Minimum version: 1.0.0 108521c2f794Smrg# 108621c2f794Smrg# Find cpp program and necessary flags for use in pre-processing text files 108721c2f794Smrg# such as man pages and config files 108821c2f794SmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 108921c2f794SmrgAC_REQUIRE([AC_PROG_CPP]) 109021c2f794SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 109121c2f794Smrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 109221c2f794Smrg 109321c2f794Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 109421c2f794Smrg# which is not the best choice for supporting other OS'es, but covers most 109521c2f794Smrg# of the ones we need for now. 109621c2f794SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 109721c2f794SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?]) 109821c2f794Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 109921c2f794Smrg AC_MSG_RESULT([no]) 110021c2f794Smrgelse 110121c2f794Smrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 110221c2f794Smrg RAWCPPFLAGS=-undef 110321c2f794Smrg AC_MSG_RESULT([yes]) 110412391620Smrg # under Cygwin unix is still defined even with -undef 110512391620Smrg elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 110612391620Smrg RAWCPPFLAGS="-undef -ansi" 110712391620Smrg AC_MSG_RESULT([yes, with -ansi]) 110821c2f794Smrg else 110921c2f794Smrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 111021c2f794Smrg fi 111121c2f794Smrgfi 111221c2f794Smrgrm -f conftest.$ac_ext 111321c2f794Smrg 111421c2f794SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 111521c2f794SmrgAC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) 111621c2f794Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 111721c2f794Smrg AC_MSG_RESULT([no]) 111821c2f794Smrgelse 111921c2f794Smrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 112021c2f794Smrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 112121c2f794Smrg AC_MSG_RESULT([yes]) 112221c2f794Smrg else 112321c2f794Smrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 112421c2f794Smrg fi 112521c2f794Smrgfi 112621c2f794Smrgrm -f conftest.$ac_ext 112721c2f794SmrgAC_SUBST(RAWCPPFLAGS) 112821c2f794Smrg]) # XORG_PROG_RAWCPP 112921c2f794Smrg 113021c2f794Smrg# XORG_MANPAGE_SECTIONS() 113121c2f794Smrg# ----------------------- 113221c2f794Smrg# Minimum version: 1.0.0 113321c2f794Smrg# 113421c2f794Smrg# Determine which sections man pages go in for the different man page types 113521c2f794Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 113621c2f794Smrg# Not sure if there's any better way than just hardcoding by OS name. 113721c2f794Smrg# Override default settings by setting environment variables 113812391620Smrg# Added MAN_SUBSTS in version 1.8 113912391620Smrg# Added AC_PROG_SED in version 1.8 114021c2f794Smrg 114121c2f794SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 114221c2f794SmrgAC_REQUIRE([AC_CANONICAL_HOST]) 114312391620SmrgAC_REQUIRE([AC_PROG_SED]) 114421c2f794Smrg 114521c2f794Smrgif test x$APP_MAN_SUFFIX = x ; then 114621c2f794Smrg APP_MAN_SUFFIX=1 114721c2f794Smrgfi 114821c2f794Smrgif test x$APP_MAN_DIR = x ; then 114921c2f794Smrg APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' 115021c2f794Smrgfi 115121c2f794Smrg 115221c2f794Smrgif test x$LIB_MAN_SUFFIX = x ; then 115321c2f794Smrg LIB_MAN_SUFFIX=3 115421c2f794Smrgfi 115521c2f794Smrgif test x$LIB_MAN_DIR = x ; then 115621c2f794Smrg LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' 115721c2f794Smrgfi 115821c2f794Smrg 115921c2f794Smrgif test x$FILE_MAN_SUFFIX = x ; then 116021c2f794Smrg case $host_os in 116121c2f794Smrg solaris*) FILE_MAN_SUFFIX=4 ;; 116221c2f794Smrg *) FILE_MAN_SUFFIX=5 ;; 116321c2f794Smrg esac 116421c2f794Smrgfi 116521c2f794Smrgif test x$FILE_MAN_DIR = x ; then 116621c2f794Smrg FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' 116721c2f794Smrgfi 116821c2f794Smrg 116921c2f794Smrgif test x$MISC_MAN_SUFFIX = x ; then 117021c2f794Smrg case $host_os in 117121c2f794Smrg solaris*) MISC_MAN_SUFFIX=5 ;; 117221c2f794Smrg *) MISC_MAN_SUFFIX=7 ;; 117321c2f794Smrg esac 117421c2f794Smrgfi 117521c2f794Smrgif test x$MISC_MAN_DIR = x ; then 117621c2f794Smrg MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' 117721c2f794Smrgfi 117821c2f794Smrg 117921c2f794Smrgif test x$DRIVER_MAN_SUFFIX = x ; then 118021c2f794Smrg case $host_os in 118121c2f794Smrg solaris*) DRIVER_MAN_SUFFIX=7 ;; 118221c2f794Smrg *) DRIVER_MAN_SUFFIX=4 ;; 118321c2f794Smrg esac 118421c2f794Smrgfi 118521c2f794Smrgif test x$DRIVER_MAN_DIR = x ; then 118621c2f794Smrg DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' 118721c2f794Smrgfi 118821c2f794Smrg 118921c2f794Smrgif test x$ADMIN_MAN_SUFFIX = x ; then 119021c2f794Smrg case $host_os in 119121c2f794Smrg solaris*) ADMIN_MAN_SUFFIX=1m ;; 119221c2f794Smrg *) ADMIN_MAN_SUFFIX=8 ;; 119321c2f794Smrg esac 119421c2f794Smrgfi 119521c2f794Smrgif test x$ADMIN_MAN_DIR = x ; then 119621c2f794Smrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 119721c2f794Smrgfi 119821c2f794Smrg 119921c2f794Smrg 120021c2f794SmrgAC_SUBST([APP_MAN_SUFFIX]) 120121c2f794SmrgAC_SUBST([LIB_MAN_SUFFIX]) 120221c2f794SmrgAC_SUBST([FILE_MAN_SUFFIX]) 120321c2f794SmrgAC_SUBST([MISC_MAN_SUFFIX]) 120421c2f794SmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 120521c2f794SmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 120621c2f794SmrgAC_SUBST([APP_MAN_DIR]) 120721c2f794SmrgAC_SUBST([LIB_MAN_DIR]) 120821c2f794SmrgAC_SUBST([FILE_MAN_DIR]) 120921c2f794SmrgAC_SUBST([MISC_MAN_DIR]) 121021c2f794SmrgAC_SUBST([DRIVER_MAN_DIR]) 121121c2f794SmrgAC_SUBST([ADMIN_MAN_DIR]) 121212391620Smrg 121312391620SmrgXORG_MAN_PAGE="X Version 11" 121412391620SmrgAC_SUBST([XORG_MAN_PAGE]) 121512391620SmrgMAN_SUBSTS="\ 121612391620Smrg -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 121712391620Smrg -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 121812391620Smrg -e 's|__xservername__|Xorg|g' \ 121912391620Smrg -e 's|__xconfigfile__|xorg.conf|g' \ 122012391620Smrg -e 's|__projectroot__|\$(prefix)|g' \ 122112391620Smrg -e 's|__apploaddir__|\$(appdefaultdir)|g' \ 122212391620Smrg -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ 122312391620Smrg -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ 122412391620Smrg -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ 122512391620Smrg -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ 122612391620Smrg -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ 122712391620Smrg -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" 122812391620SmrgAC_SUBST([MAN_SUBSTS]) 122912391620Smrg 123021c2f794Smrg]) # XORG_MANPAGE_SECTIONS 123121c2f794Smrg 123212391620Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION]) 123312391620Smrg# ------------------------ 123412391620Smrg# Minimum version: 1.7.0 123512391620Smrg# 123612391620Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent 123712391620Smrg# provided by xorg-sgml-doctools, if installed. 123812391620SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[ 123912391620SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])]) 124012391620SmrgXORG_SGML_PATH= 124112391620SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])], 124212391620Smrg [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`], 124312391620Smrg [m4_ifval([$1],[:], 124412391620Smrg [if test x"$cross_compiling" != x"yes" ; then 124512391620Smrg AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent], 124612391620Smrg [XORG_SGML_PATH=$prefix/share/sgml]) 124712391620Smrg fi]) 124812391620Smrg ]) 124912391620Smrg 125012391620Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing 125112391620Smrg# the path and the name of the doc stylesheet 125212391620Smrgif test "x$XORG_SGML_PATH" != "x" ; then 125312391620Smrg AC_MSG_RESULT([$XORG_SGML_PATH]) 125412391620Smrg STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 125512391620Smrg XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl 125612391620Smrgelse 125712391620Smrg AC_MSG_RESULT([no]) 125812391620Smrgfi 125912391620Smrg 126012391620SmrgAC_SUBST(XORG_SGML_PATH) 126112391620SmrgAC_SUBST(STYLESHEET_SRCDIR) 126212391620SmrgAC_SUBST(XSL_STYLESHEET) 126312391620SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"]) 126412391620Smrg]) # XORG_CHECK_SGML_DOCTOOLS 126512391620Smrg 126621c2f794Smrg# XORG_CHECK_LINUXDOC 126721c2f794Smrg# ------------------- 126821c2f794Smrg# Minimum version: 1.0.0 126921c2f794Smrg# 127021c2f794Smrg# Defines the variable MAKE_TEXT if the necessary tools and 127121c2f794Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 127221c2f794Smrg# Whether or not the necessary tools and files are found can be checked 127321c2f794Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 127421c2f794SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 127512391620SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 127612391620SmrgAC_REQUIRE([XORG_WITH_PS2PDF]) 127721c2f794Smrg 127821c2f794SmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 127921c2f794Smrg 128012391620SmrgAC_MSG_CHECKING([whether to build documentation]) 128121c2f794Smrg 128212391620Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then 128321c2f794Smrg BUILDDOC=yes 128421c2f794Smrgelse 128521c2f794Smrg BUILDDOC=no 128621c2f794Smrgfi 128721c2f794Smrg 128821c2f794SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 128921c2f794Smrg 129021c2f794SmrgAC_MSG_RESULT([$BUILDDOC]) 129121c2f794Smrg 129212391620SmrgAC_MSG_CHECKING([whether to build pdf documentation]) 129321c2f794Smrg 129412391620Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then 129521c2f794Smrg BUILDPDFDOC=yes 129621c2f794Smrgelse 129721c2f794Smrg BUILDPDFDOC=no 129821c2f794Smrgfi 129921c2f794Smrg 130021c2f794SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 130121c2f794Smrg 130221c2f794SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 130321c2f794Smrg 130412391620SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f" 130521c2f794SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 130621c2f794SmrgMAKE_PDF="$PS2PDF" 130721c2f794SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" 130821c2f794Smrg 130921c2f794SmrgAC_SUBST(MAKE_TEXT) 131021c2f794SmrgAC_SUBST(MAKE_PS) 131121c2f794SmrgAC_SUBST(MAKE_PDF) 131221c2f794SmrgAC_SUBST(MAKE_HTML) 131321c2f794Smrg]) # XORG_CHECK_LINUXDOC 131421c2f794Smrg 131521c2f794Smrg# XORG_CHECK_DOCBOOK 131621c2f794Smrg# ------------------- 131721c2f794Smrg# Minimum version: 1.0.0 131821c2f794Smrg# 131921c2f794Smrg# Checks for the ability to build output formats from SGML DocBook source. 132021c2f794Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" 132121c2f794Smrg# indicates whether the necessary tools and files are found and, if set, 132221c2f794Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx. 132321c2f794SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[ 132412391620SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 132512391620Smrg 132621c2f794SmrgBUILDTXTDOC=no 132721c2f794SmrgBUILDPDFDOC=no 132821c2f794SmrgBUILDPSDOC=no 132921c2f794SmrgBUILDHTMLDOC=no 133021c2f794Smrg 133121c2f794SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps) 133221c2f794SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf) 133321c2f794SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html) 133421c2f794SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt) 133521c2f794Smrg 133612391620SmrgAC_MSG_CHECKING([whether to build text documentation]) 133712391620Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x && 133821c2f794Smrg test x$BUILD_TXTDOC != xno; then 133921c2f794Smrg BUILDTXTDOC=yes 134021c2f794Smrgfi 134121c2f794SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) 134221c2f794SmrgAC_MSG_RESULT([$BUILDTXTDOC]) 134321c2f794Smrg 134412391620SmrgAC_MSG_CHECKING([whether to build PDF documentation]) 134512391620Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x && 134621c2f794Smrg test x$BUILD_PDFDOC != xno; then 134721c2f794Smrg BUILDPDFDOC=yes 134821c2f794Smrgfi 134921c2f794SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 135021c2f794SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 135121c2f794Smrg 135212391620SmrgAC_MSG_CHECKING([whether to build PostScript documentation]) 135312391620Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x && 135421c2f794Smrg test x$BUILD_PSDOC != xno; then 135521c2f794Smrg BUILDPSDOC=yes 135621c2f794Smrgfi 135721c2f794SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) 135821c2f794SmrgAC_MSG_RESULT([$BUILDPSDOC]) 135921c2f794Smrg 136012391620SmrgAC_MSG_CHECKING([whether to build HTML documentation]) 136112391620Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x && 136221c2f794Smrg test x$BUILD_HTMLDOC != xno; then 136321c2f794Smrg BUILDHTMLDOC=yes 136421c2f794Smrgfi 136521c2f794SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) 136621c2f794SmrgAC_MSG_RESULT([$BUILDHTMLDOC]) 136721c2f794Smrg 136821c2f794SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" 136921c2f794SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" 137021c2f794SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" 137121c2f794SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" 137221c2f794Smrg 137321c2f794SmrgAC_SUBST(MAKE_TEXT) 137421c2f794SmrgAC_SUBST(MAKE_PS) 137521c2f794SmrgAC_SUBST(MAKE_PDF) 137621c2f794SmrgAC_SUBST(MAKE_HTML) 137721c2f794Smrg]) # XORG_CHECK_DOCBOOK 137821c2f794Smrg 137912391620Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT]) 138012391620Smrg# ---------------- 138112391620Smrg# Minimum version: 1.5.0 138212391620Smrg# Minimum version for optional DEFAULT argument: 1.11.0 138312391620Smrg# 138412391620Smrg# Documentation tools are not always available on all platforms and sometimes 138512391620Smrg# not at the appropriate level. This macro enables a module to test for the 138612391620Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 138712391620Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions 138812391620Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified, 138912391620Smrg# --with-xmlto assumes 'auto'. 139012391620Smrg# 139112391620Smrg# Interface to module: 139212391620Smrg# HAVE_XMLTO: used in makefiles to conditionally generate documentation 139312391620Smrg# XMLTO: returns the path of the xmlto program found 139412391620Smrg# returns the path set by the user in the environment 139512391620Smrg# --with-xmlto: 'yes' user instructs the module to use xmlto 139612391620Smrg# 'no' user instructs the module not to use xmlto 139712391620Smrg# 139812391620Smrg# Added in version 1.10.0 139912391620Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation 140012391620Smrg# xmlto for text output requires either lynx, links, or w3m browsers 140112391620Smrg# 140212391620Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. 140312391620Smrg# 140412391620SmrgAC_DEFUN([XORG_WITH_XMLTO],[ 140512391620SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command]) 140612391620Smrgm4_define([_defopt], m4_default([$2], [auto])) 140712391620SmrgAC_ARG_WITH(xmlto, 140812391620Smrg AS_HELP_STRING([--with-xmlto], 140912391620Smrg [Use xmlto to regenerate documentation (default: ]_defopt[)]), 141012391620Smrg [use_xmlto=$withval], [use_xmlto=]_defopt) 141112391620Smrgm4_undefine([_defopt]) 141212391620Smrg 141312391620Smrgif test "x$use_xmlto" = x"auto"; then 141412391620Smrg AC_PATH_PROG([XMLTO], [xmlto]) 141512391620Smrg if test "x$XMLTO" = "x"; then 141612391620Smrg AC_MSG_WARN([xmlto not found - documentation targets will be skipped]) 141712391620Smrg have_xmlto=no 141812391620Smrg else 141912391620Smrg have_xmlto=yes 142012391620Smrg fi 142112391620Smrgelif test "x$use_xmlto" = x"yes" ; then 142212391620Smrg AC_PATH_PROG([XMLTO], [xmlto]) 142312391620Smrg if test "x$XMLTO" = "x"; then 142412391620Smrg AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH]) 142512391620Smrg fi 142612391620Smrg have_xmlto=yes 142712391620Smrgelif test "x$use_xmlto" = x"no" ; then 142812391620Smrg if test "x$XMLTO" != "x"; then 142912391620Smrg AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified]) 143012391620Smrg fi 143112391620Smrg have_xmlto=no 143212391620Smrgelse 143312391620Smrg AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no']) 143412391620Smrgfi 143512391620Smrg 143612391620Smrg# Test for a minimum version of xmlto, if provided. 143712391620Smrgm4_ifval([$1], 143812391620Smrg[if test "$have_xmlto" = yes; then 143912391620Smrg # scrape the xmlto version 144012391620Smrg AC_MSG_CHECKING([the xmlto version]) 144112391620Smrg xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` 144212391620Smrg AC_MSG_RESULT([$xmlto_version]) 144312391620Smrg AS_VERSION_COMPARE([$xmlto_version], [$1], 144412391620Smrg [if test "x$use_xmlto" = xauto; then 144512391620Smrg AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed]) 144612391620Smrg have_xmlto=no 144712391620Smrg else 144812391620Smrg AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed]) 144912391620Smrg fi]) 145012391620Smrgfi]) 145112391620Smrg 145212391620Smrg# Test for the ability of xmlto to generate a text target 145312391620Smrghave_xmlto_text=no 145412391620Smrgcat > conftest.xml << "EOF" 145512391620SmrgEOF 145612391620SmrgAS_IF([test "$have_xmlto" = yes], 145712391620Smrg [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], 145812391620Smrg [have_xmlto_text=yes], 145912391620Smrg [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])]) 146012391620Smrgrm -f conftest.xml 146112391620SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) 146212391620SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) 146312391620Smrg]) # XORG_WITH_XMLTO 146412391620Smrg 146512391620Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT]) 146612391620Smrg# ---------------- 146712391620Smrg# Minimum version: 1.5.0 146812391620Smrg# Minimum version for optional DEFAULT argument: 1.11.0 146912391620Smrg# 147012391620Smrg# Documentation tools are not always available on all platforms and sometimes 147112391620Smrg# not at the appropriate level. This macro enables a module to test for the 147212391620Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 147312391620Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions 147412391620Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified, 147512391620Smrg# --with-asciidoc assumes 'auto'. 147612391620Smrg# 147712391620Smrg# Interface to module: 147812391620Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation 147912391620Smrg# ASCIIDOC: returns the path of the asciidoc program found 148012391620Smrg# returns the path set by the user in the environment 148112391620Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc 148212391620Smrg# 'no' user instructs the module not to use asciidoc 148312391620Smrg# 148412391620Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. 148512391620Smrg# 148612391620SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[ 148712391620SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command]) 148812391620Smrgm4_define([_defopt], m4_default([$2], [auto])) 148912391620SmrgAC_ARG_WITH(asciidoc, 149012391620Smrg AS_HELP_STRING([--with-asciidoc], 149112391620Smrg [Use asciidoc to regenerate documentation (default: ]_defopt[)]), 149212391620Smrg [use_asciidoc=$withval], [use_asciidoc=]_defopt) 149312391620Smrgm4_undefine([_defopt]) 149412391620Smrg 149512391620Smrgif test "x$use_asciidoc" = x"auto"; then 149612391620Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 149712391620Smrg if test "x$ASCIIDOC" = "x"; then 149812391620Smrg AC_MSG_WARN([asciidoc not found - documentation targets will be skipped]) 149912391620Smrg have_asciidoc=no 150012391620Smrg else 150112391620Smrg have_asciidoc=yes 150212391620Smrg fi 150312391620Smrgelif test "x$use_asciidoc" = x"yes" ; then 150412391620Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 150512391620Smrg if test "x$ASCIIDOC" = "x"; then 150612391620Smrg AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH]) 150712391620Smrg fi 150812391620Smrg have_asciidoc=yes 150912391620Smrgelif test "x$use_asciidoc" = x"no" ; then 151012391620Smrg if test "x$ASCIIDOC" != "x"; then 151112391620Smrg AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified]) 151212391620Smrg fi 151312391620Smrg have_asciidoc=no 151412391620Smrgelse 151512391620Smrg AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no']) 151612391620Smrgfi 151712391620Smrgm4_ifval([$1], 151812391620Smrg[if test "$have_asciidoc" = yes; then 151912391620Smrg # scrape the asciidoc version 152012391620Smrg AC_MSG_CHECKING([the asciidoc version]) 152112391620Smrg asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2` 152212391620Smrg AC_MSG_RESULT([$asciidoc_version]) 152312391620Smrg AS_VERSION_COMPARE([$asciidoc_version], [$1], 152412391620Smrg [if test "x$use_asciidoc" = xauto; then 152512391620Smrg AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed]) 152612391620Smrg have_asciidoc=no 152712391620Smrg else 152812391620Smrg AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed]) 152912391620Smrg fi]) 153012391620Smrgfi]) 153112391620SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) 153212391620Smrg]) # XORG_WITH_ASCIIDOC 153312391620Smrg 153412391620Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT]) 153512391620Smrg# -------------------------------- 153612391620Smrg# Minimum version: 1.5.0 153712391620Smrg# Minimum version for optional DEFAULT argument: 1.11.0 153812391620Smrg# 153912391620Smrg# Documentation tools are not always available on all platforms and sometimes 154012391620Smrg# not at the appropriate level. This macro enables a module to test for the 154112391620Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 154212391620Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions 154312391620Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified, 154412391620Smrg# --with-doxygen assumes 'auto'. 154512391620Smrg# 154612391620Smrg# Interface to module: 154712391620Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation 154812391620Smrg# DOXYGEN: returns the path of the doxygen program found 154912391620Smrg# returns the path set by the user in the environment 155012391620Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen 155112391620Smrg# 'no' user instructs the module not to use doxygen 155212391620Smrg# 155312391620Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. 155412391620Smrg# 155512391620SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[ 155612391620SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command]) 155712391620Smrgm4_define([_defopt], m4_default([$2], [auto])) 155812391620SmrgAC_ARG_WITH(doxygen, 155912391620Smrg AS_HELP_STRING([--with-doxygen], 156012391620Smrg [Use doxygen to regenerate documentation (default: ]_defopt[)]), 156112391620Smrg [use_doxygen=$withval], [use_doxygen=]_defopt) 156212391620Smrgm4_undefine([_defopt]) 156312391620Smrg 156412391620Smrgif test "x$use_doxygen" = x"auto"; then 156512391620Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 156612391620Smrg if test "x$DOXYGEN" = "x"; then 156712391620Smrg AC_MSG_WARN([doxygen not found - documentation targets will be skipped]) 156812391620Smrg have_doxygen=no 156912391620Smrg else 157012391620Smrg have_doxygen=yes 157112391620Smrg fi 157212391620Smrgelif test "x$use_doxygen" = x"yes" ; then 157312391620Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 157412391620Smrg if test "x$DOXYGEN" = "x"; then 157512391620Smrg AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH]) 157612391620Smrg fi 157712391620Smrg have_doxygen=yes 157812391620Smrgelif test "x$use_doxygen" = x"no" ; then 157912391620Smrg if test "x$DOXYGEN" != "x"; then 158012391620Smrg AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified]) 158112391620Smrg fi 158212391620Smrg have_doxygen=no 158312391620Smrgelse 158412391620Smrg AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no']) 158512391620Smrgfi 158612391620Smrgm4_ifval([$1], 158712391620Smrg[if test "$have_doxygen" = yes; then 158812391620Smrg # scrape the doxygen version 158912391620Smrg AC_MSG_CHECKING([the doxygen version]) 159012391620Smrg doxygen_version=`$DOXYGEN --version 2>/dev/null` 159112391620Smrg AC_MSG_RESULT([$doxygen_version]) 159212391620Smrg AS_VERSION_COMPARE([$doxygen_version], [$1], 159312391620Smrg [if test "x$use_doxygen" = xauto; then 159412391620Smrg AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed]) 159512391620Smrg have_doxygen=no 159612391620Smrg else 159712391620Smrg AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) 159812391620Smrg fi]) 159912391620Smrgfi]) 160012391620SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) 160112391620Smrg]) # XORG_WITH_DOXYGEN 160212391620Smrg 160312391620Smrg# XORG_WITH_GROFF([DEFAULT]) 160412391620Smrg# ---------------- 160512391620Smrg# Minimum version: 1.6.0 160612391620Smrg# Minimum version for optional DEFAULT argument: 1.11.0 160712391620Smrg# 160812391620Smrg# Documentation tools are not always available on all platforms and sometimes 160912391620Smrg# not at the appropriate level. This macro enables a module to test for the 161012391620Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 161112391620Smrg# the --with-groff option, it allows maximum flexibilty in making decisions 161212391620Smrg# as whether or not to use the groff package. When DEFAULT is not specified, 161312391620Smrg# --with-groff assumes 'auto'. 161412391620Smrg# 161512391620Smrg# Interface to module: 161612391620Smrg# HAVE_GROFF: used in makefiles to conditionally generate documentation 161712391620Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package 161812391620Smrg# HAVE_GROFF_MS: the -ms macros package 161912391620Smrg# GROFF: returns the path of the groff program found 162012391620Smrg# returns the path set by the user in the environment 162112391620Smrg# --with-groff: 'yes' user instructs the module to use groff 162212391620Smrg# 'no' user instructs the module not to use groff 162312391620Smrg# 162412391620Smrg# Added in version 1.9.0: 162512391620Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format: 162612391620Smrg# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package. 162712391620Smrg# psselect from the psutils package. 162812391620Smrg# the ghostcript package. Refer to the grohtml man pages 162912391620Smrg# 163012391620Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path. 163112391620Smrg# 163212391620Smrg# OS and distros often splits groff in a basic and full package, the former 163312391620Smrg# having the groff program and the later having devices, fonts and macros 163412391620Smrg# Checking for the groff executable is not enough. 163512391620Smrg# 163612391620Smrg# If macros are missing, we cannot assume that groff is useless, so we don't 163712391620Smrg# unset HAVE_GROFF or GROFF env variables. 163812391620Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false. 163912391620Smrg# 164012391620SmrgAC_DEFUN([XORG_WITH_GROFF],[ 164112391620SmrgAC_ARG_VAR([GROFF], [Path to groff command]) 164212391620Smrgm4_define([_defopt], m4_default([$1], [auto])) 164312391620SmrgAC_ARG_WITH(groff, 164412391620Smrg AS_HELP_STRING([--with-groff], 164512391620Smrg [Use groff to regenerate documentation (default: ]_defopt[)]), 164612391620Smrg [use_groff=$withval], [use_groff=]_defopt) 164712391620Smrgm4_undefine([_defopt]) 164812391620Smrg 164912391620Smrgif test "x$use_groff" = x"auto"; then 165012391620Smrg AC_PATH_PROG([GROFF], [groff]) 165112391620Smrg if test "x$GROFF" = "x"; then 165212391620Smrg AC_MSG_WARN([groff not found - documentation targets will be skipped]) 165312391620Smrg have_groff=no 165412391620Smrg else 165512391620Smrg have_groff=yes 165612391620Smrg fi 165712391620Smrgelif test "x$use_groff" = x"yes" ; then 165812391620Smrg AC_PATH_PROG([GROFF], [groff]) 165912391620Smrg if test "x$GROFF" = "x"; then 166012391620Smrg AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH]) 166112391620Smrg fi 166212391620Smrg have_groff=yes 166312391620Smrgelif test "x$use_groff" = x"no" ; then 166412391620Smrg if test "x$GROFF" != "x"; then 166512391620Smrg AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified]) 166612391620Smrg fi 166712391620Smrg have_groff=no 166812391620Smrgelse 166912391620Smrg AC_MSG_ERROR([--with-groff expects 'yes' or 'no']) 167012391620Smrgfi 167112391620Smrg 167212391620Smrg# We have groff, test for the presence of the macro packages 167312391620Smrgif test "x$have_groff" = x"yes"; then 167412391620Smrg AC_MSG_CHECKING([for ${GROFF} -ms macros]) 167512391620Smrg if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then 167612391620Smrg groff_ms_works=yes 167712391620Smrg else 167812391620Smrg groff_ms_works=no 167912391620Smrg fi 168012391620Smrg AC_MSG_RESULT([$groff_ms_works]) 168112391620Smrg AC_MSG_CHECKING([for ${GROFF} -mm macros]) 168212391620Smrg if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then 168312391620Smrg groff_mm_works=yes 168412391620Smrg else 168512391620Smrg groff_mm_works=no 168612391620Smrg fi 168712391620Smrg AC_MSG_RESULT([$groff_mm_works]) 168812391620Smrgfi 168912391620Smrg 169012391620Smrg# We have groff, test for HTML dependencies, one command per package 169112391620Smrgif test "x$have_groff" = x"yes"; then 169212391620Smrg AC_PATH_PROGS(GS_PATH, [gs gswin32c]) 169312391620Smrg AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng]) 169412391620Smrg AC_PATH_PROG(PSSELECT_PATH, [psselect]) 169512391620Smrg if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then 169612391620Smrg have_groff_html=yes 169712391620Smrg else 169812391620Smrg have_groff_html=no 169912391620Smrg AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages]) 170012391620Smrg fi 170112391620Smrgfi 170212391620Smrg 170312391620Smrg# Set Automake conditionals for Makefiles 170412391620SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes]) 170512391620SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes]) 170612391620SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes]) 170712391620SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes]) 170812391620Smrg]) # XORG_WITH_GROFF 170912391620Smrg 171012391620Smrg# XORG_WITH_FOP([DEFAULT]) 171112391620Smrg# ---------------- 171212391620Smrg# Minimum version: 1.6.0 171312391620Smrg# Minimum version for optional DEFAULT argument: 1.11.0 171412391620Smrg# 171512391620Smrg# Documentation tools are not always available on all platforms and sometimes 171612391620Smrg# not at the appropriate level. This macro enables a module to test for the 171712391620Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 171812391620Smrg# the --with-fop option, it allows maximum flexibilty in making decisions 171912391620Smrg# as whether or not to use the fop package. When DEFAULT is not specified, 172012391620Smrg# --with-fop assumes 'auto'. 172112391620Smrg# 172212391620Smrg# Interface to module: 172312391620Smrg# HAVE_FOP: used in makefiles to conditionally generate documentation 172412391620Smrg# FOP: returns the path of the fop program found 172512391620Smrg# returns the path set by the user in the environment 172612391620Smrg# --with-fop: 'yes' user instructs the module to use fop 172712391620Smrg# 'no' user instructs the module not to use fop 172812391620Smrg# 172912391620Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path. 173012391620Smrg# 173112391620SmrgAC_DEFUN([XORG_WITH_FOP],[ 173212391620SmrgAC_ARG_VAR([FOP], [Path to fop command]) 173312391620Smrgm4_define([_defopt], m4_default([$1], [auto])) 173412391620SmrgAC_ARG_WITH(fop, 173512391620Smrg AS_HELP_STRING([--with-fop], 173612391620Smrg [Use fop to regenerate documentation (default: ]_defopt[)]), 173712391620Smrg [use_fop=$withval], [use_fop=]_defopt) 173812391620Smrgm4_undefine([_defopt]) 173912391620Smrg 174012391620Smrgif test "x$use_fop" = x"auto"; then 174112391620Smrg AC_PATH_PROG([FOP], [fop]) 174212391620Smrg if test "x$FOP" = "x"; then 174312391620Smrg AC_MSG_WARN([fop not found - documentation targets will be skipped]) 174412391620Smrg have_fop=no 174512391620Smrg else 174612391620Smrg have_fop=yes 174712391620Smrg fi 174812391620Smrgelif test "x$use_fop" = x"yes" ; then 174912391620Smrg AC_PATH_PROG([FOP], [fop]) 175012391620Smrg if test "x$FOP" = "x"; then 175112391620Smrg AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH]) 175212391620Smrg fi 175312391620Smrg have_fop=yes 175412391620Smrgelif test "x$use_fop" = x"no" ; then 175512391620Smrg if test "x$FOP" != "x"; then 175612391620Smrg AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified]) 175712391620Smrg fi 175812391620Smrg have_fop=no 175912391620Smrgelse 176012391620Smrg AC_MSG_ERROR([--with-fop expects 'yes' or 'no']) 176112391620Smrgfi 176212391620SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) 176312391620Smrg]) # XORG_WITH_FOP 176412391620Smrg 176512391620Smrg# XORG_WITH_PS2PDF([DEFAULT]) 176612391620Smrg# ---------------- 176712391620Smrg# Minimum version: 1.6.0 176812391620Smrg# Minimum version for optional DEFAULT argument: 1.11.0 176912391620Smrg# 177012391620Smrg# Documentation tools are not always available on all platforms and sometimes 177112391620Smrg# not at the appropriate level. This macro enables a module to test for the 177212391620Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 177312391620Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions 177412391620Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified, 177512391620Smrg# --with-ps2pdf assumes 'auto'. 177612391620Smrg# 177712391620Smrg# Interface to module: 177812391620Smrg# HAVE_PS2PDF: used in makefiles to conditionally generate documentation 177912391620Smrg# PS2PDF: returns the path of the ps2pdf program found 178012391620Smrg# returns the path set by the user in the environment 178112391620Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf 178212391620Smrg# 'no' user instructs the module not to use ps2pdf 178312391620Smrg# 178412391620Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path. 178512391620Smrg# 178612391620SmrgAC_DEFUN([XORG_WITH_PS2PDF],[ 178712391620SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command]) 178812391620Smrgm4_define([_defopt], m4_default([$1], [auto])) 178912391620SmrgAC_ARG_WITH(ps2pdf, 179012391620Smrg AS_HELP_STRING([--with-ps2pdf], 179112391620Smrg [Use ps2pdf to regenerate documentation (default: ]_defopt[)]), 179212391620Smrg [use_ps2pdf=$withval], [use_ps2pdf=]_defopt) 179312391620Smrgm4_undefine([_defopt]) 179412391620Smrg 179512391620Smrgif test "x$use_ps2pdf" = x"auto"; then 179612391620Smrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 179712391620Smrg if test "x$PS2PDF" = "x"; then 179812391620Smrg AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped]) 179912391620Smrg have_ps2pdf=no 180012391620Smrg else 180112391620Smrg have_ps2pdf=yes 180212391620Smrg fi 180312391620Smrgelif test "x$use_ps2pdf" = x"yes" ; then 180412391620Smrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 180512391620Smrg if test "x$PS2PDF" = "x"; then 180612391620Smrg AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH]) 180712391620Smrg fi 180812391620Smrg have_ps2pdf=yes 180912391620Smrgelif test "x$use_ps2pdf" = x"no" ; then 181012391620Smrg if test "x$PS2PDF" != "x"; then 181112391620Smrg AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified]) 181212391620Smrg fi 181312391620Smrg have_ps2pdf=no 181412391620Smrgelse 181512391620Smrg AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no']) 181612391620Smrgfi 181712391620SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes]) 181812391620Smrg]) # XORG_WITH_PS2PDF 181912391620Smrg 182012391620Smrg# XORG_ENABLE_DOCS (enable_docs=yes) 182112391620Smrg# ---------------- 182212391620Smrg# Minimum version: 1.6.0 182312391620Smrg# 182412391620Smrg# Documentation tools are not always available on all platforms and sometimes 182512391620Smrg# not at the appropriate level. This macro enables a builder to skip all 182612391620Smrg# documentation targets except traditional man pages. 182712391620Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 182812391620Smrg# maximum flexibilty in controlling documentation building. 182912391620Smrg# Refer to: 183012391620Smrg# XORG_WITH_XMLTO --with-xmlto 183112391620Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 183212391620Smrg# XORG_WITH_DOXYGEN --with-doxygen 183312391620Smrg# XORG_WITH_FOP --with-fop 183412391620Smrg# XORG_WITH_GROFF --with-groff 183512391620Smrg# XORG_WITH_PS2PDF --with-ps2pdf 183612391620Smrg# 183712391620Smrg# Interface to module: 183812391620Smrg# ENABLE_DOCS: used in makefiles to conditionally generate documentation 183912391620Smrg# --enable-docs: 'yes' user instructs the module to generate docs 184012391620Smrg# 'no' user instructs the module not to generate docs 184112391620Smrg# parm1: specify the default value, yes or no. 184212391620Smrg# 184312391620SmrgAC_DEFUN([XORG_ENABLE_DOCS],[ 184412391620Smrgm4_define([default], m4_default([$1], [yes])) 184512391620SmrgAC_ARG_ENABLE(docs, 184612391620Smrg AS_HELP_STRING([--enable-docs], 184712391620Smrg [Enable building the documentation (default: ]default[)]), 184812391620Smrg [build_docs=$enableval], [build_docs=]default) 184912391620Smrgm4_undefine([default]) 185012391620SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes]) 185112391620SmrgAC_MSG_CHECKING([whether to build documentation]) 185212391620SmrgAC_MSG_RESULT([$build_docs]) 185312391620Smrg]) # XORG_ENABLE_DOCS 185412391620Smrg 185512391620Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes) 185612391620Smrg# ---------------- 185712391620Smrg# Minimum version: 1.6.0 185812391620Smrg# 185912391620Smrg# This macro enables a builder to skip all developer documentation. 186012391620Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 186112391620Smrg# maximum flexibilty in controlling documentation building. 186212391620Smrg# Refer to: 186312391620Smrg# XORG_WITH_XMLTO --with-xmlto 186412391620Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 186512391620Smrg# XORG_WITH_DOXYGEN --with-doxygen 186612391620Smrg# XORG_WITH_FOP --with-fop 186712391620Smrg# XORG_WITH_GROFF --with-groff 186812391620Smrg# XORG_WITH_PS2PDF --with-ps2pdf 186912391620Smrg# 187012391620Smrg# Interface to module: 187112391620Smrg# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs 187212391620Smrg# --enable-devel-docs: 'yes' user instructs the module to generate developer docs 187312391620Smrg# 'no' user instructs the module not to generate developer docs 187412391620Smrg# parm1: specify the default value, yes or no. 187512391620Smrg# 187612391620SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[ 187712391620Smrgm4_define([devel_default], m4_default([$1], [yes])) 187812391620SmrgAC_ARG_ENABLE(devel-docs, 187912391620Smrg AS_HELP_STRING([--enable-devel-docs], 188012391620Smrg [Enable building the developer documentation (default: ]devel_default[)]), 188112391620Smrg [build_devel_docs=$enableval], [build_devel_docs=]devel_default) 188212391620Smrgm4_undefine([devel_default]) 188312391620SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes]) 188412391620SmrgAC_MSG_CHECKING([whether to build developer documentation]) 188512391620SmrgAC_MSG_RESULT([$build_devel_docs]) 188612391620Smrg]) # XORG_ENABLE_DEVEL_DOCS 188712391620Smrg 188812391620Smrg# XORG_ENABLE_SPECS (enable_specs=yes) 188912391620Smrg# ---------------- 189012391620Smrg# Minimum version: 1.6.0 189112391620Smrg# 189212391620Smrg# This macro enables a builder to skip all functional specification targets. 189312391620Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 189412391620Smrg# maximum flexibilty in controlling documentation building. 189512391620Smrg# Refer to: 189612391620Smrg# XORG_WITH_XMLTO --with-xmlto 189712391620Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 189812391620Smrg# XORG_WITH_DOXYGEN --with-doxygen 189912391620Smrg# XORG_WITH_FOP --with-fop 190012391620Smrg# XORG_WITH_GROFF --with-groff 190112391620Smrg# XORG_WITH_PS2PDF --with-ps2pdf 190212391620Smrg# 190312391620Smrg# Interface to module: 190412391620Smrg# ENABLE_SPECS: used in makefiles to conditionally generate specs 190512391620Smrg# --enable-specs: 'yes' user instructs the module to generate specs 190612391620Smrg# 'no' user instructs the module not to generate specs 190712391620Smrg# parm1: specify the default value, yes or no. 190812391620Smrg# 190912391620SmrgAC_DEFUN([XORG_ENABLE_SPECS],[ 191012391620Smrgm4_define([spec_default], m4_default([$1], [yes])) 191112391620SmrgAC_ARG_ENABLE(specs, 191212391620Smrg AS_HELP_STRING([--enable-specs], 191312391620Smrg [Enable building the specs (default: ]spec_default[)]), 191412391620Smrg [build_specs=$enableval], [build_specs=]spec_default) 191512391620Smrgm4_undefine([spec_default]) 191612391620SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes]) 191712391620SmrgAC_MSG_CHECKING([whether to build functional specifications]) 191812391620SmrgAC_MSG_RESULT([$build_specs]) 191912391620Smrg]) # XORG_ENABLE_SPECS 192012391620Smrg 192121c2f794Smrg# XORG_CHECK_MALLOC_ZERO 192221c2f794Smrg# ---------------------- 192321c2f794Smrg# Minimum version: 1.0.0 192421c2f794Smrg# 192521c2f794Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 192621c2f794Smrg# malloc(0) returns NULL. Packages should add one of these cflags to 192721c2f794Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 192821c2f794SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 192921c2f794SmrgAC_ARG_ENABLE(malloc0returnsnull, 193012391620Smrg AS_HELP_STRING([--enable-malloc0returnsnull], 193121c2f794Smrg [malloc(0) returns NULL (default: auto)]), 193221c2f794Smrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 193321c2f794Smrg [MALLOC_ZERO_RETURNS_NULL=auto]) 193421c2f794Smrg 193521c2f794SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 193621c2f794Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 193721c2f794Smrg AC_RUN_IFELSE([ 193821c2f794Smrgchar *malloc(); 193921c2f794Smrgchar *realloc(); 194021c2f794Smrgchar *calloc(); 194121c2f794Smrgmain() { 194221c2f794Smrg char *m0, *r0, *c0, *p; 194321c2f794Smrg m0 = malloc(0); 194421c2f794Smrg p = malloc(10); 194521c2f794Smrg r0 = realloc(p,0); 194621c2f794Smrg c0 = calloc(0); 194721c2f794Smrg exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); 194821c2f794Smrg}], 194921c2f794Smrg [MALLOC_ZERO_RETURNS_NULL=yes], 195012391620Smrg [MALLOC_ZERO_RETURNS_NULL=no], 195112391620Smrg [MALLOC_ZERO_RETURNS_NULL=yes]) 195221c2f794Smrgfi 195321c2f794SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 195421c2f794Smrg 195521c2f794Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 195621c2f794Smrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 195721c2f794Smrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 195821c2f794Smrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 195921c2f794Smrgelse 196021c2f794Smrg MALLOC_ZERO_CFLAGS="" 196121c2f794Smrg XMALLOC_ZERO_CFLAGS="" 196221c2f794Smrg XTMALLOC_ZERO_CFLAGS="" 196321c2f794Smrgfi 196421c2f794Smrg 196521c2f794SmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 196621c2f794SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 196721c2f794SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 196821c2f794Smrg]) # XORG_CHECK_MALLOC_ZERO 196921c2f794Smrg 197021c2f794Smrg# XORG_WITH_LINT() 197121c2f794Smrg# ---------------- 197221c2f794Smrg# Minimum version: 1.1.0 197321c2f794Smrg# 197412391620Smrg# This macro enables the use of a tool that flags some suspicious and 197512391620Smrg# non-portable constructs (likely to be bugs) in C language source code. 197612391620Smrg# It will attempt to locate the tool and use appropriate options. 197712391620Smrg# There are various lint type tools on different platforms. 197812391620Smrg# 197912391620Smrg# Interface to module: 198012391620Smrg# LINT: returns the path to the tool found on the platform 198112391620Smrg# or the value set to LINT on the configure cmd line 198212391620Smrg# also an Automake conditional 198312391620Smrg# LINT_FLAGS: an Automake variable with appropriate flags 198412391620Smrg# 198512391620Smrg# --with-lint: 'yes' user instructs the module to use lint 198612391620Smrg# 'no' user instructs the module not to use lint (default) 198712391620Smrg# 198812391620Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path. 198912391620Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim. 199021c2f794Smrg# 199121c2f794SmrgAC_DEFUN([XORG_WITH_LINT],[ 199221c2f794Smrg 199312391620SmrgAC_ARG_VAR([LINT], [Path to a lint-style command]) 199412391620SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command]) 199512391620SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint], 199621c2f794Smrg [Use a lint-style source code checker (default: disabled)])], 199721c2f794Smrg [use_lint=$withval], [use_lint=no]) 199812391620Smrg 199912391620Smrg# Obtain platform specific info like program name and options 200012391620Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris 200112391620Smrgcase $host_os in 200212391620Smrg *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*) 200312391620Smrg lint_name=splint 200412391620Smrg lint_options="-badflag" 200512391620Smrg ;; 200612391620Smrg *freebsd* | *netbsd*) 200712391620Smrg lint_name=lint 200812391620Smrg lint_options="-u -b" 200912391620Smrg ;; 201012391620Smrg *solaris*) 201112391620Smrg lint_name=lint 201212391620Smrg lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" 201312391620Smrg ;; 201412391620Smrgesac 201512391620Smrg 201612391620Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user) 201712391620Smrgif test "x$use_lint" = x"yes" ; then 201812391620Smrg AC_PATH_PROG([LINT], [$lint_name]) 201912391620Smrg if test "x$LINT" = "x"; then 202012391620Smrg AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH]) 202112391620Smrg fi 202212391620Smrgelif test "x$use_lint" = x"no" ; then 202312391620Smrg if test "x$LINT" != "x"; then 202412391620Smrg AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified]) 202512391620Smrg fi 202621c2f794Smrgelse 202712391620Smrg AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.]) 202821c2f794Smrgfi 202912391620Smrg 203012391620Smrg# User supplied flags override default flags 203112391620Smrgif test "x$LINT_FLAGS" != "x"; then 203212391620Smrg lint_options=$LINT_FLAGS 203321c2f794Smrgfi 203421c2f794Smrg 203512391620SmrgAC_SUBST([LINT_FLAGS],[$lint_options]) 203612391620SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x]) 203721c2f794Smrg 203821c2f794Smrg]) # XORG_WITH_LINT 203921c2f794Smrg 204021c2f794Smrg# XORG_LINT_LIBRARY(LIBNAME) 204121c2f794Smrg# -------------------------- 204221c2f794Smrg# Minimum version: 1.1.0 204321c2f794Smrg# 204421c2f794Smrg# Sets up flags for building lint libraries for checking programs that call 204521c2f794Smrg# functions in the library. 204621c2f794Smrg# 204712391620Smrg# Interface to module: 204812391620Smrg# LINTLIB - Automake variable with the name of lint library file to make 204912391620Smrg# MAKE_LINT_LIB - Automake conditional 205012391620Smrg# 205112391620Smrg# --enable-lint-library: - 'yes' user instructs the module to created a lint library 205212391620Smrg# - 'no' user instructs the module not to create a lint library (default) 205321c2f794Smrg 205421c2f794SmrgAC_DEFUN([XORG_LINT_LIBRARY],[ 205521c2f794SmrgAC_REQUIRE([XORG_WITH_LINT]) 205612391620SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library], 205721c2f794Smrg [Create lint library (default: disabled)])], 205821c2f794Smrg [make_lint_lib=$enableval], [make_lint_lib=no]) 205912391620Smrg 206012391620Smrgif test "x$make_lint_lib" = x"yes" ; then 206112391620Smrg LINTLIB=llib-l$1.ln 206212391620Smrg if test "x$LINT" = "x"; then 206312391620Smrg AC_MSG_ERROR([Cannot make lint library without --with-lint]) 206412391620Smrg fi 206512391620Smrgelif test "x$make_lint_lib" != x"no" ; then 206612391620Smrg AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.]) 206721c2f794Smrgfi 206812391620Smrg 206921c2f794SmrgAC_SUBST(LINTLIB) 207021c2f794SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) 207121c2f794Smrg 207221c2f794Smrg]) # XORG_LINT_LIBRARY 207321c2f794Smrg 207412391620Smrg# XORG_CWARNFLAGS 207512391620Smrg# --------------- 207612391620Smrg# Minimum version: 1.2.0 207712391620Smrg# 207812391620Smrg# Defines CWARNFLAGS to enable C compiler warnings. 207912391620Smrg# 208012391620SmrgAC_DEFUN([XORG_CWARNFLAGS], [ 208112391620SmrgAC_REQUIRE([AC_PROG_CC_C99]) 208212391620Smrgif test "x$GCC" = xyes ; then 208312391620Smrg CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \ 208412391620Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \ 208512391620Smrg-Wbad-function-cast -Wformat=2" 208612391620Smrg case `$CC -dumpversion` in 208712391620Smrg 3.4.* | 4.*) 208812391620Smrg CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement" 208912391620Smrg ;; 209012391620Smrg esac 209112391620Smrgelse 209212391620Smrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 209312391620Smrg if test "x$SUNCC" = "xyes"; then 209412391620Smrg CWARNFLAGS="-v" 209512391620Smrg fi 209612391620Smrgfi 209712391620SmrgAC_SUBST(CWARNFLAGS) 209812391620Smrg]) # XORG_CWARNFLAGS 209912391620Smrg 210012391620Smrg# XORG_STRICT_OPTION 210112391620Smrg# ----------------------- 210212391620Smrg# Minimum version: 1.3.0 210312391620Smrg# 210412391620Smrg# Add configure option to enable strict compilation 210512391620SmrgAC_DEFUN([XORG_STRICT_OPTION], [ 210612391620Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89 210712391620SmrgAC_REQUIRE([AC_PROG_CC_C99]) 210812391620SmrgAC_REQUIRE([XORG_CWARNFLAGS]) 210912391620Smrg 211012391620SmrgAC_ARG_ENABLE(strict-compilation, 211112391620Smrg AS_HELP_STRING([--enable-strict-compilation], 211212391620Smrg [Enable all warnings from compiler and make them errors (default: disabled)]), 211312391620Smrg [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no]) 211412391620Smrgif test "x$STRICT_COMPILE" = "xyes"; then 211512391620Smrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 211612391620Smrg AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"]) 211712391620Smrg if test "x$GCC" = xyes ; then 211812391620Smrg STRICT_CFLAGS="-pedantic -Werror" 211912391620Smrg elif test "x$SUNCC" = "xyes"; then 212012391620Smrg STRICT_CFLAGS="-errwarn" 212112391620Smrg elif test "x$INTELCC" = "xyes"; then 212212391620Smrg STRICT_CFLAGS="-Werror" 212312391620Smrg fi 212412391620Smrgfi 212512391620SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS" 212612391620SmrgAC_SUBST([CWARNFLAGS]) 212712391620Smrg]) # XORG_STRICT_OPTION 212812391620Smrg 212912391620Smrg# XORG_DEFAULT_OPTIONS 213012391620Smrg# -------------------- 213112391620Smrg# Minimum version: 1.3.0 213212391620Smrg# 213312391620Smrg# Defines default options for X.Org modules. 213412391620Smrg# 213512391620SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [ 213612391620SmrgAC_REQUIRE([AC_PROG_INSTALL]) 213712391620SmrgXORG_CWARNFLAGS 213812391620SmrgXORG_STRICT_OPTION 213912391620SmrgXORG_RELEASE_VERSION 214012391620SmrgXORG_CHANGELOG 214112391620SmrgXORG_INSTALL 214212391620SmrgXORG_MANPAGE_SECTIONS 214312391620Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], 214412391620Smrg [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) 214512391620Smrg]) # XORG_DEFAULT_OPTIONS 214612391620Smrg 214712391620Smrg# XORG_INSTALL() 214812391620Smrg# ---------------- 214912391620Smrg# Minimum version: 1.4.0 215012391620Smrg# 215112391620Smrg# Defines the variable INSTALL_CMD as the command to copy 215212391620Smrg# INSTALL from $prefix/share/util-macros. 215312391620Smrg# 215412391620SmrgAC_DEFUN([XORG_INSTALL], [ 215512391620SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG]) 215612391620Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` 215712391620SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ 215812391620Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ 215912391620Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ 216012391620Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" 216112391620SmrgAC_SUBST([INSTALL_CMD]) 216212391620Smrg]) # XORG_INSTALL 216321c2f794Smrgdnl Copyright 2005 Red Hat, Inc 216421c2f794Smrgdnl 216521c2f794Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 216621c2f794Smrgdnl documentation for any purpose is hereby granted without fee, provided that 216721c2f794Smrgdnl the above copyright notice appear in all copies and that both that 216821c2f794Smrgdnl copyright notice and this permission notice appear in supporting 216921c2f794Smrgdnl documentation. 217021c2f794Smrgdnl 217121c2f794Smrgdnl The above copyright notice and this permission notice shall be included 217221c2f794Smrgdnl in all copies or substantial portions of the Software. 217321c2f794Smrgdnl 217421c2f794Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 217521c2f794Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 217621c2f794Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 217721c2f794Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 217821c2f794Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 217921c2f794Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 218021c2f794Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 218121c2f794Smrgdnl 218221c2f794Smrgdnl Except as contained in this notice, the name of the copyright holders shall 218321c2f794Smrgdnl not be used in advertising or otherwise to promote the sale, use or 218421c2f794Smrgdnl other dealings in this Software without prior written authorization 218521c2f794Smrgdnl from the copyright holders. 218621c2f794Smrgdnl 218721c2f794Smrg 218821c2f794Smrg# XORG_RELEASE_VERSION 218921c2f794Smrg# -------------------- 219012391620Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. 219121c2f794Smrg 219221c2f794SmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 219321c2f794Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], 219421c2f794Smrg [`echo $PACKAGE_VERSION | cut -d . -f 1`], 219521c2f794Smrg [Major version of this package]) 219621c2f794Smrg PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` 219721c2f794Smrg if test "x$PVM" = "x"; then 219821c2f794Smrg PVM="0" 219921c2f794Smrg fi 220021c2f794Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], 220121c2f794Smrg [$PVM], 220221c2f794Smrg [Minor version of this package]) 220321c2f794Smrg PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` 220421c2f794Smrg if test "x$PVP" = "x"; then 220521c2f794Smrg PVP="0" 220621c2f794Smrg fi 220721c2f794Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], 220821c2f794Smrg [$PVP], 220921c2f794Smrg [Patch version of this package]) 221021c2f794Smrg]) 221121c2f794Smrg 221212391620Smrg# XORG_CHANGELOG() 221312391620Smrg# ---------------- 221412391620Smrg# Minimum version: 1.2.0 221512391620Smrg# 221612391620Smrg# Defines the variable CHANGELOG_CMD as the command to generate 221712391620Smrg# ChangeLog from git. 221812391620Smrg# 221912391620Smrg# 222012391620SmrgAC_DEFUN([XORG_CHANGELOG], [ 222112391620SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ 222212391620Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ 222312391620Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ 222412391620Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)" 222512391620SmrgAC_SUBST([CHANGELOG_CMD]) 222612391620Smrg]) # XORG_CHANGELOG 222712391620Smrg 222821c2f794Smrg# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 222921c2f794Smrg# 223021c2f794Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 223121c2f794Smrg# 223221c2f794Smrg# This program is free software; you can redistribute it and/or modify 223321c2f794Smrg# it under the terms of the GNU General Public License as published by 223421c2f794Smrg# the Free Software Foundation; either version 2 of the License, or 223521c2f794Smrg# (at your option) any later version. 223621c2f794Smrg# 223721c2f794Smrg# This program is distributed in the hope that it will be useful, but 223821c2f794Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 223921c2f794Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 224021c2f794Smrg# General Public License for more details. 224121c2f794Smrg# 224221c2f794Smrg# You should have received a copy of the GNU General Public License 224321c2f794Smrg# along with this program; if not, write to the Free Software 224421c2f794Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 224521c2f794Smrg# 224621c2f794Smrg# As a special exception to the GNU General Public License, if you 224721c2f794Smrg# distribute this file as part of a program that contains a 224821c2f794Smrg# configuration script generated by Autoconf, you may include it under 224921c2f794Smrg# the same distribution terms that you use for the rest of that program. 225021c2f794Smrg 225121c2f794Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION]) 225221c2f794Smrg# ---------------------------------- 225321c2f794SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG], 225421c2f794Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 225521c2f794Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 225621c2f794SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl 225721c2f794Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 225821c2f794Smrg AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 225921c2f794Smrgfi 226021c2f794Smrgif test -n "$PKG_CONFIG"; then 226112391620Smrg _pkg_min_version=m4_default([$1], [0.9.0]) 226221c2f794Smrg AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 226321c2f794Smrg if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 226421c2f794Smrg AC_MSG_RESULT([yes]) 226521c2f794Smrg else 226621c2f794Smrg AC_MSG_RESULT([no]) 226721c2f794Smrg PKG_CONFIG="" 226821c2f794Smrg fi 226921c2f794Smrg 227021c2f794Smrgfi[]dnl 227121c2f794Smrg])# PKG_PROG_PKG_CONFIG 227221c2f794Smrg 227321c2f794Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 227421c2f794Smrg# 227521c2f794Smrg# Check to see whether a particular set of modules exists. Similar 227621c2f794Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors. 227721c2f794Smrg# 227821c2f794Smrg# 227921c2f794Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of 228021c2f794Smrg# this or PKG_CHECK_MODULES is called, or make sure to call 228121c2f794Smrg# PKG_CHECK_EXISTS manually 228221c2f794Smrg# -------------------------------------------------------------- 228321c2f794SmrgAC_DEFUN([PKG_CHECK_EXISTS], 228421c2f794Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 228521c2f794Smrgif test -n "$PKG_CONFIG" && \ 228621c2f794Smrg AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 228721c2f794Smrg m4_ifval([$2], [$2], [:]) 228821c2f794Smrgm4_ifvaln([$3], [else 228921c2f794Smrg $3])dnl 229021c2f794Smrgfi]) 229121c2f794Smrg 229221c2f794Smrg 229321c2f794Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 229421c2f794Smrg# --------------------------------------------- 229521c2f794Smrgm4_define([_PKG_CONFIG], 229612391620Smrg[if test -n "$$1"; then 229712391620Smrg pkg_cv_[]$1="$$1" 229812391620Smrg elif test -n "$PKG_CONFIG"; then 229912391620Smrg PKG_CHECK_EXISTS([$3], 230012391620Smrg [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], 230112391620Smrg [pkg_failed=yes]) 230212391620Smrg else 230312391620Smrg pkg_failed=untried 230421c2f794Smrgfi[]dnl 230521c2f794Smrg])# _PKG_CONFIG 230621c2f794Smrg 230712391620Smrg# _PKG_SHORT_ERRORS_SUPPORTED 230812391620Smrg# ----------------------------- 230912391620SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 231012391620Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 231112391620Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 231212391620Smrg _pkg_short_errors_supported=yes 231312391620Smrgelse 231412391620Smrg _pkg_short_errors_supported=no 231512391620Smrgfi[]dnl 231612391620Smrg])# _PKG_SHORT_ERRORS_SUPPORTED 231712391620Smrg 231812391620Smrg 231921c2f794Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 232021c2f794Smrg# [ACTION-IF-NOT-FOUND]) 232121c2f794Smrg# 232221c2f794Smrg# 232321c2f794Smrg# Note that if there is a possibility the first call to 232421c2f794Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an 232521c2f794Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 232621c2f794Smrg# 232721c2f794Smrg# 232821c2f794Smrg# -------------------------------------------------------------- 232921c2f794SmrgAC_DEFUN([PKG_CHECK_MODULES], 233021c2f794Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 233121c2f794SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 233221c2f794SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 233321c2f794Smrg 233421c2f794Smrgpkg_failed=no 233521c2f794SmrgAC_MSG_CHECKING([for $1]) 233621c2f794Smrg 233721c2f794Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 233821c2f794Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 233921c2f794Smrg 234012391620Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 234112391620Smrgand $1[]_LIBS to avoid the need to call pkg-config. 234212391620SmrgSee the pkg-config man page for more details.]) 234312391620Smrg 234421c2f794Smrgif test $pkg_failed = yes; then 234512391620Smrg _PKG_SHORT_ERRORS_SUPPORTED 234612391620Smrg if test $_pkg_short_errors_supported = yes; then 234712391620Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` 234812391620Smrg else 234912391620Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` 235012391620Smrg fi 235121c2f794Smrg # Put the nasty error message in config.log where it belongs 235212391620Smrg echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 235321c2f794Smrg 235421c2f794Smrg ifelse([$4], , [AC_MSG_ERROR(dnl 235512391620Smrg[Package requirements ($2) were not met: 235612391620Smrg 235712391620Smrg$$1_PKG_ERRORS 235812391620Smrg 235921c2f794SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you 236021c2f794Smrginstalled software in a non-standard prefix. 236121c2f794Smrg 236212391620Smrg_PKG_TEXT 236312391620Smrg])], 236412391620Smrg [AC_MSG_RESULT([no]) 236512391620Smrg $4]) 236621c2f794Smrgelif test $pkg_failed = untried; then 236721c2f794Smrg ifelse([$4], , [AC_MSG_FAILURE(dnl 236821c2f794Smrg[The pkg-config script could not be found or is too old. Make sure it 236921c2f794Smrgis in your PATH or set the PKG_CONFIG environment variable to the full 237021c2f794Smrgpath to pkg-config. 237121c2f794Smrg 237212391620Smrg_PKG_TEXT 237321c2f794Smrg 237412391620SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])], 237521c2f794Smrg [$4]) 237621c2f794Smrgelse 237721c2f794Smrg $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 237821c2f794Smrg $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 237921c2f794Smrg AC_MSG_RESULT([yes]) 238021c2f794Smrg ifelse([$3], , :, [$3]) 238121c2f794Smrgfi[]dnl 238221c2f794Smrg])# PKG_CHECK_MODULES 238321c2f794Smrg 2384