aclocal.m4 revision 585aa3f7
11.66Schristos# generated automatically by aclocal 1.15 -*- Autoconf -*- 21.1Serh 31.1Serh# Copyright (C) 1996-2014 Free Software Foundation, Inc. 41.1Serh 51.1Serh# This file is free software; the Free Software Foundation 61.1Serh# gives unlimited permission to copy and/or distribute it, 71.65Smatt# with or without modifications, as long as this notice is preserved. 81.1Serh 91.1Serh# This program is distributed in the hope that it will be useful, 101.63Schristos# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 111.63Schristos# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 121.5Schristos# PARTICULAR PURPOSE. 131.3Sfvdl 141.3Sfvdlm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) 151.3Sfvdlm4_ifndef([AC_AUTOCONF_VERSION], 161.3Sfvdl [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 171.12Stronm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, 181.12Stron[m4_warning([this file was generated for autoconf 2.69. 191.12StronYou have another version of autoconf. It may work, but is not guaranteed to. 201.12StronIf you have problems, you may need to regenerate the build system entirely. 211.40SlukemTo do so, use the procedure documented by the package, typically 'autoreconf'.])]) 221.40Slukem 231.40Slukem# Copyright (C) 2002-2014 Free Software Foundation, Inc. 241.12Stron# 251.12Stron# This file is free software; the Free Software Foundation 261.12Stron# gives unlimited permission to copy and/or distribute it, 271.12Stron# with or without modifications, as long as this notice is preserved. 281.12Stron 291.1Serh# AM_AUTOMAKE_VERSION(VERSION) 301.1Serh# ---------------------------- 311.5Schristos# Automake X.Y traces this macro to ensure aclocal.m4 has been 321.1Serh# generated from the m4 files accompanying Automake X.Y. 331.1Serh# (This private macro should not be called outside this file.) 341.1SerhAC_DEFUN([AM_AUTOMAKE_VERSION], 351.1Serh[am__api_version='1.15' 361.1Serhdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 371.1Serhdnl require some minimum version. Point them to the right macro. 381.1Serhm4_if([$1], [1.15], [], 391.1Serh [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 401.1Serh]) 411.1Serh 421.1Serh# _AM_AUTOCONF_VERSION(VERSION) 431.5Schristos# ----------------------------- 441.1Serh# aclocal traces this macro to find the Autoconf version. 451.1Serh# This is a private macro too. Using m4_define simplifies 461.1Serh# the logic in aclocal, which can simply ignore this definition. 471.32Sfvdlm4_define([_AM_AUTOCONF_VERSION], []) 481.32Sfvdl 491.32Sfvdl# AM_SET_CURRENT_AUTOMAKE_VERSION 501.32Sfvdl# ------------------------------- 511.32Sfvdl# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 521.1Serh# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 531.5SchristosAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 541.1Serh[AM_AUTOMAKE_VERSION([1.15])dnl 551.1Serhm4_ifndef([AC_AUTOCONF_VERSION], 561.1Serh [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 571.5Schristos_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 581.1Serh 591.1Serh# AM_AUX_DIR_EXPAND -*- Autoconf -*- 601.1Serh 611.1Serh# Copyright (C) 2001-2014 Free Software Foundation, Inc. 621.1Serh# 631.5Schristos# This file is free software; the Free Software Foundation 641.1Serh# gives unlimited permission to copy and/or distribute it, 651.1Serh# with or without modifications, as long as this notice is preserved. 661.1Serh 671.1Serh# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 681.1Serh# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to 691.1Serh# '$srcdir', '$srcdir/..', or '$srcdir/../..'. 701.1Serh# 711.5Schristos# Of course, Automake must honor this variable whenever it calls a 721.1Serh# tool from the auxiliary directory. The problem is that $srcdir (and 731.1Serh# therefore $ac_aux_dir as well) can be either absolute or relative, 741.1Serh# depending on how configure is run. This is pretty annoying, since 751.1Serh# it makes $ac_aux_dir quite unusable in subdirectories: in the top 761.1Serh# source directory, any form will work fine, but in subdirectories a 771.5Schristos# relative path needs to be adjusted first. 781.1Serh# 791.1Serh# $ac_aux_dir/missing 801.1Serh# fails when called from a subdirectory if $ac_aux_dir is relative 811.30Sfvdl# $top_srcdir/$ac_aux_dir/missing 821.5Schristos# fails if $ac_aux_dir is absolute, 831.1Serh# fails when called from a subdirectory in a VPATH build with 841.1Serh# a relative $ac_aux_dir 851.1Serh# 861.1Serh# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 871.1Serh# are both prefixed by $srcdir. In an in-source build this is usually 881.1Serh# harmless because $srcdir is '.', but things will broke when you 891.1Serh# start a VPATH build or use an absolute $srcdir. 901.1Serh# 911.11Stron# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 921.11Stron# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 931.11Stron# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 941.11Stron# and then we would define $MISSING as 951.15Stron# MISSING="\${SHELL} $am_aux_dir/missing" 961.15Stron# This will work as long as MISSING is not called from configure, because 971.15Stron# unfortunately $(top_srcdir) has no meaning in configure. 981.15Stron# However there are other variables, like CC, which are often used in 991.15Stron# configure, and could therefore not use this "fixed" $ac_aux_dir. 1001.15Stron# 1011.15Stron# Another solution, used here, is to always expand $ac_aux_dir to an 1021.1Serh# absolute PATH. The drawback is that using absolute paths prevent a 1031.1Serh# configured tree to be moved without reconfiguration. 1041.1Serh 1051.1SerhAC_DEFUN([AM_AUX_DIR_EXPAND], 1061.1Serh[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl 1071.5Schristos# Expand $ac_aux_dir to an absolute path. 1081.1Serham_aux_dir=`cd "$ac_aux_dir" && pwd` 1091.1Serh]) 1101.1Serh 1111.1Serh# AM_CONDITIONAL -*- Autoconf -*- 1121.5Schristos 1131.1Serh# Copyright (C) 1997-2014 Free Software Foundation, Inc. 1141.1Serh# 1151.1Serh# This file is free software; the Free Software Foundation 1161.1Serh# gives unlimited permission to copy and/or distribute it, 1171.1Serh# with or without modifications, as long as this notice is preserved. 1181.1Serh 1191.1Serh# AM_CONDITIONAL(NAME, SHELL-CONDITION) 1201.1Serh# ------------------------------------- 1211.1Serh# Define a conditional. 1221.1SerhAC_DEFUN([AM_CONDITIONAL], 1231.1Serh[AC_PREREQ([2.52])dnl 1241.1Serh m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 1251.1Serh [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 1261.5SchristosAC_SUBST([$1_TRUE])dnl 1271.5SchristosAC_SUBST([$1_FALSE])dnl 1281.1Serh_AM_SUBST_NOTMAKE([$1_TRUE])dnl 1291.1Serh_AM_SUBST_NOTMAKE([$1_FALSE])dnl 1301.1Serhm4_define([_AM_COND_VALUE_$1], [$2])dnl 1311.5Schristosif $2; then 1321.1Serh $1_TRUE= 1331.1Serh $1_FALSE='#' 1341.1Serhelse 1351.1Serh $1_TRUE='#' 1361.5Schristos $1_FALSE= 1371.1Serhfi 1381.1SerhAC_CONFIG_COMMANDS_PRE( 1391.1Serh[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 1401.1Serh AC_MSG_ERROR([[conditional "$1" was never defined. 1411.1SerhUsually this means the macro was only invoked conditionally.]]) 1421.1Serhfi])]) 1431.1Serh 1441.1Serh# Copyright (C) 1999-2014 Free Software Foundation, Inc. 1451.1Serh# 1461.1Serh# This file is free software; the Free Software Foundation 1471.1Serh# gives unlimited permission to copy and/or distribute it, 1481.1Serh# with or without modifications, as long as this notice is preserved. 1491.1Serh 1501.1Serh 1511.1Serh# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be 1521.13Stron# written in clear, in which case automake, when reading aclocal.m4, 1531.1Serh# will think it sees a *use*, and therefore will trigger all it's 1541.1Serh# C support machinery. Also note that it means that autoscan, seeing 1551.1Serh# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 1561.1Serh 1571.1Serh 1581.1Serh# _AM_DEPENDENCIES(NAME) 1591.66Schristos# ---------------------- 1601.1Serh# See how the compiler implements dependency checking. 1611.1Serh# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". 1621.1Serh# We try a few techniques and use that to set a single cache variable. 1631.1Serh# 1641.1Serh# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 1651.1Serh# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 1661.1Serh# dependency, and given that the user is not expected to run this macro, 1671.1Serh# just rely on AC_PROG_CC. 1681.1SerhAC_DEFUN([_AM_DEPENDENCIES], 1691.1Serh[AC_REQUIRE([AM_SET_DEPDIR])dnl 1701.1SerhAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 1711.1SerhAC_REQUIRE([AM_MAKE_INCLUDE])dnl 1721.1SerhAC_REQUIRE([AM_DEP_TRACK])dnl 1731.1Serh 1741.1Serhm4_if([$1], [CC], [depcc="$CC" am_compiler_list=], 1751.1Serh [$1], [CXX], [depcc="$CXX" am_compiler_list=], 1761.1Serh [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 1771.1Serh [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], 1781.1Serh [$1], [UPC], [depcc="$UPC" am_compiler_list=], 1791.1Serh [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 1801.1Serh [depcc="$$1" am_compiler_list=]) 1811.1Serh 1821.30SfvdlAC_CACHE_CHECK([dependency style of $depcc], 1831.1Serh [am_cv_$1_dependencies_compiler_type], 1841.1Serh[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 1851.1Serh # We make a subdir and do the tests there. Otherwise we can end up 1861.1Serh # making bogus files that we don't know about and never remove. For 1871.30Sfvdl # instance it was reported that on HP-UX the gcc test will end up 1881.1Serh # making a dummy file named 'D' -- because '-MD' means "put the output 1891.1Serh # in D". 1901.1Serh rm -rf conftest.dir 1911.1Serh mkdir conftest.dir 1921.1Serh # Copy depcomp to subdir because otherwise we won't find it if we're 1931.66Schristos # using a relative directory. 1941.1Serh cp "$am_depcomp" conftest.dir 1951.1Serh cd conftest.dir 1961.1Serh # We will build objects and dependencies in a subdirectory because 1971.1Serh # it helps to detect inapplicable dependency modes. For instance 1981.1Serh # both Tru64's cc and ICC support -MD to output dependencies as a 1991.1Serh # side effect of compilation, but ICC will put the dependencies in 2001.1Serh # the current directory while Tru64 will put them in the object 2011.1Serh # directory. 2021.41Schristos mkdir sub 2031.41Schristos 2041.41Schristos am_cv_$1_dependencies_compiler_type=none 2051.41Schristos if test "$am_compiler_list" = ""; then 2061.41Schristos am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 2071.41Schristos fi 2081.41Schristos am__universal=false 2091.41Schristos m4_case([$1], [CC], 2101.41Schristos [case " $depcc " in #( 2111.41Schristos *\ -arch\ *\ -arch\ *) am__universal=true ;; 2121.37Smanu esac], 2131.37Smanu [CXX], 2141.37Smanu [case " $depcc " in #( 2151.37Smanu *\ -arch\ *\ -arch\ *) am__universal=true ;; 2161.37Smanu esac]) 2171.37Smanu 2181.37Smanu for depmode in $am_compiler_list; do 2191.37Smanu # Setup a source with many dependencies, because some compilers 2201.37Smanu # like to wrap large dependency lists on column 80 (with \), and 2211.37Smanu # we should not choose a depcomp mode which is confused by this. 2221.31Sfvdl # 2231.31Sfvdl # We need to recreate these files for each test, as the compiler may 2241.31Sfvdl # overwrite some of them when testing with obscure command lines. 2251.31Sfvdl # This happens at least with the AIX C compiler. 2261.31Sfvdl : > sub/conftest.c 2271.31Sfvdl for i in 1 2 3 4 5 6; do 2281.31Sfvdl echo '#include "conftst'$i'.h"' >> sub/conftest.c 2291.31Sfvdl # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with 2301.31Sfvdl # Solaris 10 /bin/sh. 2311.31Sfvdl echo '/* dummy */' > sub/conftst$i.h 2321.1Serh done 2331.1Serh echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 2341.1Serh 2351.1Serh # We check with '-c' and '-o' for the sake of the "dashmstdout" 2361.1Serh # mode. It turns out that the SunPro C++ compiler does not properly 2371.5Schristos # handle '-M -o', and we need to detect this. Also, some Intel 2381.5Schristos # versions had trouble with output in subdirs. 2391.1Serh am__obj=sub/conftest.${OBJEXT-o} 2401.1Serh am__minus_obj="-o $am__obj" 2411.1Serh case $depmode in 2421.5Schristos gcc) 2431.1Serh # This depmode causes a compiler race in universal mode. 2441.1Serh test "$am__universal" = false || continue 2451.1Serh ;; 2461.58Sjoerg nosideeffect) 2471.1Serh # After this tag, mechanisms are not by side-effect, so they'll 2481.1Serh # only be used when explicitly requested. 2491.5Schristos if test "x$enable_dependency_tracking" = xyes; then 2501.1Serh continue 2511.58Sjoerg else 2521.58Sjoerg break 2531.1Serh fi 2541.22Sjdolecek ;; 2551.22Sjdolecek msvc7 | msvc7msys | msvisualcpp | msvcmsys) 2561.22Sjdolecek # This compiler won't grok '-c -o', but also, the minuso test has 2571.22Sjdolecek # not run yet. These depmodes are late enough in the game, and 2581.17Serh # so weak that their functioning should not be impacted. 2591.17Serh am__obj=conftest.${OBJEXT-o} 2601.17Serh am__minus_obj= 2611.17Serh ;; 2621.17Serh none) break ;; 2631.17Serh esac 2641.17Serh if depmode=$depmode \ 2651.1Serh source=sub/conftest.c object=$am__obj \ 2661.1Serh depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 2671.66Schristos $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 2681.1Serh >/dev/null 2>conftest.err && 2691.1Serh grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 2701.1Serh grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 2711.1Serh grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 2721.1Serh ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 2731.1Serh # icc doesn't choke on unknown options, it will just issue warnings 2741.1Serh # or remarks (even with -Werror). So we grep stderr for any message 2751.1Serh # that says an option was ignored or not supported. 2761.5Schristos # When given -MP, icc 7.0 and 7.1 complain thusly: 2771.1Serh # icc: Command line warning: ignoring option '-M'; no argument required 2781.1Serh # The diagnosis changed in icc 8.0: 2791.1Serh # icc: Command line remark: option '-MP' not supported 2801.30Sfvdl if (grep 'ignoring option' conftest.err || 2811.1Serh grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 2821.1Serh am_cv_$1_dependencies_compiler_type=$depmode 2831.1Serh break 2841.1Serh fi 2851.1Serh fi 2861.63Schristos done 2871.63Schristos 2881.63Schristos cd .. 2891.63Schristos rm -rf conftest.dir 2901.63Schristoselse 2911.1Serh am_cv_$1_dependencies_compiler_type=none 2921.5Schristosfi 2931.1Serh]) 2941.1SerhAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 2951.1SerhAM_CONDITIONAL([am__fastdep$1], [ 2961.1Serh test "x$enable_dependency_tracking" != xno \ 2971.1Serh && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 2981.1Serh]) 2991.1Serh 3001.1Serh 3011.1Serh# AM_SET_DEPDIR 3021.1Serh# ------------- 3031.1Serh# Choose a directory name for dependency files. 3041.1Serh# This macro is AC_REQUIREd in _AM_DEPENDENCIES. 3051.1SerhAC_DEFUN([AM_SET_DEPDIR], 3061.1Serh[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 3071.1SerhAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 3081.1Serh]) 3091.1Serh 3101.1Serh 3111.1Serh# AM_DEP_TRACK 3121.1Serh# ------------ 3131.5SchristosAC_DEFUN([AM_DEP_TRACK], 3141.1Serh[AC_ARG_ENABLE([dependency-tracking], [dnl 3151.1SerhAS_HELP_STRING( 3161.1Serh [--enable-dependency-tracking], 3171.1Serh [do not reject slow dependency extractors]) 3181.5SchristosAS_HELP_STRING( 3191.1Serh [--disable-dependency-tracking], 3201.1Serh [speeds up one-time build])]) 3211.1Serhif test "x$enable_dependency_tracking" != xno; then 3221.1Serh am_depcomp="$ac_aux_dir/depcomp" 3231.1Serh AMDEPBACKSLASH='\' 3241.1Serh am__nodep='_no' 3251.1Serhfi 3261.1SerhAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 3271.1SerhAC_SUBST([AMDEPBACKSLASH])dnl 3281.1Serh_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 3291.1SerhAC_SUBST([am__nodep])dnl 3301.1Serh_AM_SUBST_NOTMAKE([am__nodep])dnl 3311.1Serh]) 3321.1Serh 3331.1Serh# Generate code to set up dependency tracking. -*- Autoconf -*- 3341.1Serh 3351.1Serh# Copyright (C) 1999-2014 Free Software Foundation, Inc. 3361.1Serh# 3371.1Serh# This file is free software; the Free Software Foundation 3381.1Serh# gives unlimited permission to copy and/or distribute it, 3391.1Serh# with or without modifications, as long as this notice is preserved. 3401.1Serh 3411.1Serh 3421.23Sjdolecek# _AM_OUTPUT_DEPENDENCY_COMMANDS 3431.23Sjdolecek# ------------------------------ 3441.23SjdolecekAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 3451.23Sjdolecek[{ 3461.29Saugustss # Older Autoconf quotes --file arguments for eval, but not when files 3471.29Saugustss # are listed without --file. Let's play safe and only enable the eval 3481.29Saugustss # if we detect the quoting. 3491.29Saugustss case $CONFIG_FILES in 3501.1Serh *\'*) eval set x "$CONFIG_FILES" ;; 3511.1Serh *) set x $CONFIG_FILES ;; 3521.1Serh esac 3531.1Serh shift 3541.1Serh for mf 3551.66Schristos do 3561.1Serh # Strip MF so we end up with the name of the file. 3571.1Serh mf=`echo "$mf" | sed -e 's/:.*$//'` 3581.1Serh # Check whether this is an Automake generated Makefile or not. 3591.1Serh # We used to match only the files named 'Makefile.in', but 3601.1Serh # some people rename them; so instead we look at the file content. 3611.1Serh # Grep'ing the first line is not enough: some people post-process 3621.9Sthorpej # each Makefile.in and add a new line on top of each file to say so. 3631.9Sthorpej # Grep'ing the whole file is not good either: AIX grep has a line 3641.9Sthorpej # limit of 2048, but all sed's we know have understand at least 4000. 3651.9Sthorpej if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 3661.9Sthorpej dirpart=`AS_DIRNAME("$mf")` 3671.22Sjdolecek else 3681.22Sjdolecek continue 3691.22Sjdolecek fi 3701.22Sjdolecek # Extract the definition of DEPDIR, am__include, and am__quote 3711.22Sjdolecek # from the Makefile without running 'make'. 3721.1Serh DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 3731.1Serh test -z "$DEPDIR" && continue 3741.1Serh am__include=`sed -n 's/^am__include = //p' < "$mf"` 3751.1Serh test -z "$am__include" && continue 3761.1Serh am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 3771.1Serh # Find all dependency output files, they are included files with 3781.1Serh # $(DEPDIR) in their names. We invoke sed twice because it is the 3791.1Serh # simplest approach to changing $(DEPDIR) to its actual value in the 3801.1Serh # expansion. 3811.1Serh for file in `sed -n " 3821.43Schristos s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 3831.43Schristos sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do 3841.43Schristos # Make sure the directory exists. 3851.43Schristos test -f "$dirpart/$file" && continue 3861.43Schristos fdir=`AS_DIRNAME(["$file"])` 3871.43Schristos AS_MKDIR_P([$dirpart/$fdir]) 3881.1Serh # echo "creating $dirpart/$file" 3891.1Serh echo '# dummy' > "$dirpart/$file" 3901.1Serh done 3911.1Serh done 3921.1Serh} 3931.1Serh])# _AM_OUTPUT_DEPENDENCY_COMMANDS 3941.1Serh 3951.1Serh 3961.1Serh# AM_OUTPUT_DEPENDENCY_COMMANDS 3971.1Serh# ----------------------------- 3981.1Serh# This macro should only be invoked once -- use via AC_REQUIRE. 3991.1Serh# 4001.1Serh# This code is only required when automatic dependency tracking 4011.1Serh# is enabled. FIXME. This creates each '.P' file that we will 4021.1Serh# need in order to bootstrap the dependency handling code. 4031.1SerhAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 4041.1Serh[AC_CONFIG_COMMANDS([depfiles], 4051.1Serh [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 4061.66Schristos [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 4071.1Serh]) 4081.1Serh 4091.1Serh# Do all the work for Automake. -*- Autoconf -*- 4101.1Serh 4111.1Serh# Copyright (C) 1996-2014 Free Software Foundation, Inc. 4121.1Serh# 4131.1Serh# This file is free software; the Free Software Foundation 4141.1Serh# gives unlimited permission to copy and/or distribute it, 4151.1Serh# with or without modifications, as long as this notice is preserved. 4161.1Serh 4171.1Serh# This macro actually does too much. Some checks are only needed if 4181.1Serh# your package does certain things. But this isn't really a big deal. 4191.1Serh 4201.1Serhdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. 4211.1Serhm4_define([AC_PROG_CC], 4221.1Serhm4_defn([AC_PROG_CC]) 4231.1Serh[_AM_PROG_CC_C_O 4241.1Serh]) 4251.66Schristos 4261.1Serh# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 4271.1Serh# AM_INIT_AUTOMAKE([OPTIONS]) 4281.1Serh# ----------------------------------------------- 4291.1Serh# The call with PACKAGE and VERSION arguments is the old style 4301.1Serh# call (pre autoconf-2.50), which is being phased out. PACKAGE 4311.1Serh# and VERSION should now be passed to AC_INIT and removed from 4321.1Serh# the call to AM_INIT_AUTOMAKE. 4331.1Serh# We support both call styles for the transition. After 4341.1Serh# the next Automake release, Autoconf can make the AC_INIT 4351.1Serh# arguments mandatory, and then we can depend on a new Autoconf 4361.1Serh# release and drop the old call support. 4371.1SerhAC_DEFUN([AM_INIT_AUTOMAKE], 4381.12Stron[AC_PREREQ([2.65])dnl 4391.12Strondnl Autoconf wants to disallow AM_ names. We explicitly allow 4401.12Strondnl the ones we care about. 4411.12Stronm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 4421.12StronAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 4431.12StronAC_REQUIRE([AC_PROG_INSTALL])dnl 4441.12Stronif test "`cd $srcdir && pwd`" != "`pwd`"; then 4451.12Stron # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 4461.12Stron # is not polluted with repeated "-I." 4471.12Stron AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 4481.12Stron # test to see if srcdir already configured 4491.12Stron if test -f $srcdir/config.status; then 4501.12Stron AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 4511.12Stron fi 4521.12Stronfi 4531.12Stron 4541.12Stron# test whether we have cygpath 4551.12Stronif test -z "$CYGPATH_W"; then 4561.12Stron if (cygpath --version) >/dev/null 2>/dev/null; then 4571.12Stron CYGPATH_W='cygpath -w' 4581.12Stron else 4591.12Stron CYGPATH_W=echo 4601.12Stron fi 4611.12Stronfi 4621.12StronAC_SUBST([CYGPATH_W]) 4631.12Stron 4641.12Stron# Define the identity of the package. 4651.12Strondnl Distinguish between old-style and new-style calls. 4661.1Serhm4_ifval([$2], 4671.1Serh[AC_DIAGNOSE([obsolete], 4681.1Serh [$0: two- and three-arguments forms are deprecated.]) 4691.1Serhm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 4701.1Serh AC_SUBST([PACKAGE], [$1])dnl 4711.1Serh AC_SUBST([VERSION], [$2])], 4721.1Serh[_AM_SET_OPTIONS([$1])dnl 4731.31Sfvdldnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 4741.10Sthorpejm4_if( 4751.10Sthorpej m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), 4761.10Sthorpej [ok:ok],, 4771.10Sthorpej [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 4781.10Sthorpej AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 4791.31Sfvdl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 4801.10Sthorpej 4811.10Sthorpej_AM_IF_OPTION([no-define],, 4821.10Sthorpej[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) 4831.10Sthorpej AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl 4841.10Sthorpej 4851.1Serh# Some tools Automake needs. 4861.48SchristosAC_REQUIRE([AM_SANITY_CHECK])dnl 4871.1SerhAC_REQUIRE([AC_ARG_PROGRAM])dnl 4881.1SerhAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) 4891.1SerhAM_MISSING_PROG([AUTOCONF], [autoconf]) 4901.1SerhAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) 4911.1SerhAM_MISSING_PROG([AUTOHEADER], [autoheader]) 4921.1SerhAM_MISSING_PROG([MAKEINFO], [makeinfo]) 4931.1SerhAC_REQUIRE([AM_PROG_INSTALL_SH])dnl 4941.1SerhAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 4951.1SerhAC_REQUIRE([AC_PROG_MKDIR_P])dnl 4961.1Serh# For better backward compatibility. To be removed once Automake 1.9.x 4971.1Serh# dies out for good. For more background, see: 4981.1Serh# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> 4991.1Serh# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> 5001.1SerhAC_SUBST([mkdir_p], ['$(MKDIR_P)']) 5011.1Serh# We need awk for the "check" target (and possibly the TAP driver). The 5021.1Serh# system "awk" is bad on some platforms. 5031.1SerhAC_REQUIRE([AC_PROG_AWK])dnl 5041.1SerhAC_REQUIRE([AC_PROG_MAKE_SET])dnl 5051.1SerhAC_REQUIRE([AM_SET_LEADING_DOT])dnl 5061.1Serh_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 5071.1Serh [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 5081.1Serh [_AM_PROG_TAR([v7])])]) 5091.1Serh_AM_IF_OPTION([no-dependencies],, 5101.1Serh[AC_PROVIDE_IFELSE([AC_PROG_CC], 5111.1Serh [_AM_DEPENDENCIES([CC])], 5121.1Serh [m4_define([AC_PROG_CC], 5131.1Serh m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl 5141.1SerhAC_PROVIDE_IFELSE([AC_PROG_CXX], 5151.1Serh [_AM_DEPENDENCIES([CXX])], 5161.1Serh [m4_define([AC_PROG_CXX], 5171.1Serh m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl 5181.1SerhAC_PROVIDE_IFELSE([AC_PROG_OBJC], 5191.14Stron [_AM_DEPENDENCIES([OBJC])], 5201.14Stron [m4_define([AC_PROG_OBJC], 5211.14Stron m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl 5221.14StronAC_PROVIDE_IFELSE([AC_PROG_OBJCXX], 5231.14Stron [_AM_DEPENDENCIES([OBJCXX])], 5241.14Stron [m4_define([AC_PROG_OBJCXX], 5251.14Stron m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl 5261.14Stron]) 5271.14StronAC_REQUIRE([AM_SILENT_RULES])dnl 5281.14Strondnl The testsuite driver may need to know about EXEEXT, so add the 5291.14Strondnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This 5301.14Strondnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. 5311.14StronAC_CONFIG_COMMANDS_PRE(dnl 5321.14Stron[m4_provide_if([_AM_COMPILER_EXEEXT], 5331.30Sfvdl [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 5341.5Schristos 5351.1Serh# POSIX will say in a future version that running "rm -f" with no argument 5361.1Serh# is OK; and we want to be able to make that assumption in our Makefile 5371.1Serh# recipes. So use an aggressive probe to check that the usage we want is 5381.1Serh# actually supported "in the wild" to an acceptable degree. 5391.20Schristos# See automake bug#10828. 5401.20Schristos# To make any issue more visible, cause the running configure to be aborted 5411.20Schristos# by default if the 'rm' program in use doesn't match our expectations; the 5421.20Schristos# user can still override this though. 5431.20Schristosif rm -f && rm -fr && rm -rf; then : OK; else 5441.41Schristos cat >&2 <<'END' 5451.41SchristosOops! 5461.41Schristos 5471.41SchristosYour 'rm' program seems unable to run without file operands specified 5481.41Schristoson the command line, even when the '-f' option is present. This is contrary 5491.28Sjdolecekto the behaviour of most rm programs out there, and not conforming with 5501.28Sjdolecekthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> 5511.28Sjdolecek 5521.28SjdolecekPlease tell bug-automake@gnu.org about your system, including the value 5531.28Sjdolecekof your $PATH and any error possibly output before this message. This 5541.49Sjdolecekcan help us improve future automake versions. 5551.49Sjdolecek 5561.49SjdolecekEND 5571.49Sjdolecek if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then 5581.49Sjdolecek echo 'Configuration will proceed anyway, since you have set the' >&2 5591.27Sjdolecek echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 5601.27Sjdolecek echo >&2 5611.27Sjdolecek else 5621.27Sjdolecek cat >&2 <<'END' 5631.27SjdolecekAborting the configuration process, to ensure you take notice of the issue. 5641.27Sjdolecek 5651.27SjdolecekYou can download and install GNU coreutils to get an 'rm' implementation 5661.27Sjdolecekthat behaves properly: <http://www.gnu.org/software/coreutils/>. 5671.27Sjdolecek 5681.27SjdolecekIf you want to complete the configuration process using your problematic 5691.27Sjdolecek'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM 5701.27Sjdolecekto "yes", and re-run configure. 5711.27Sjdolecek 5721.27SjdolecekEND 5731.27Sjdolecek AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) 5741.31Sfvdl fi 5751.31Sfvdlfi 5761.31Sfvdldnl The trailing newline in this macro's definition is deliberate, for 5771.31Sfvdldnl backward compatibility and to allow trailing 'dnl'-style comments 5781.31Sfvdldnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. 5791.31Sfvdl]) 5801.31Sfvdl 5811.31Sfvdldnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 5821.31Sfvdldnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 5831.31Sfvdldnl mangled by Autoconf and run in a shell conditional statement. 5841.31Sfvdlm4_define([_AC_COMPILER_EXEEXT], 5851.31Sfvdlm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 5861.31Sfvdl 5871.31Sfvdl# When config.status generates a header, we must update the stamp-h file. 5881.31Sfvdl# This file resides in the same directory as the config header 5891.31Sfvdl# that is generated. The stamp files are numbered to have different names. 5901.31Sfvdl 5911.31Sfvdl# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 5921.31Sfvdl# loop where config.status creates the headers, so we can generate 5931.31Sfvdl# our stamp files there. 5941.31SfvdlAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 5951.31Sfvdl[# Compute $1's index in $config_headers. 5961.31Sfvdl_am_arg=$1 5971.31Sfvdl_am_stamp_count=1 5981.31Sfvdlfor _am_header in $config_headers :; do 5991.31Sfvdl case $_am_header in 6001.31Sfvdl $_am_arg | $_am_arg:* ) 6011.31Sfvdl break ;; 6021.31Sfvdl * ) 6031.31Sfvdl _am_stamp_count=`expr $_am_stamp_count + 1` ;; 6041.31Sfvdl esac 6051.31Sfvdldone 6061.31Sfvdlecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 6071.31Sfvdl 6081.31Sfvdl# Copyright (C) 2001-2014 Free Software Foundation, Inc. 6091.31Sfvdl# 6101.31Sfvdl# This file is free software; the Free Software Foundation 6111.31Sfvdl# gives unlimited permission to copy and/or distribute it, 6121.31Sfvdl# with or without modifications, as long as this notice is preserved. 6131.31Sfvdl 6141.44Schristos# AM_PROG_INSTALL_SH 6151.44Schristos# ------------------ 6161.44Schristos# Define $install_sh. 6171.44SchristosAC_DEFUN([AM_PROG_INSTALL_SH], 6181.44Schristos[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 6191.44Schristosif test x"${install_sh+set}" != xset; then 6201.43Schristos case $am_aux_dir in 6211.43Schristos *\ * | *\ *) 6221.43Schristos install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 6231.43Schristos *) 6241.43Schristos install_sh="\${SHELL} $am_aux_dir/install-sh" 6251.43Schristos esac 6261.56Sfvdlfi 6271.56SfvdlAC_SUBST([install_sh])]) 6281.56Sfvdl 6291.56Sfvdl# Copyright (C) 2003-2014 Free Software Foundation, Inc. 6301.56Sfvdl# 6311.56Sfvdl# This file is free software; the Free Software Foundation 6321.56Sfvdl# gives unlimited permission to copy and/or distribute it, 6331.56Sfvdl# with or without modifications, as long as this notice is preserved. 6341.56Sfvdl 6351.56Sfvdl# Check whether the underlying file-system supports filenames 6361.56Sfvdl# with a leading dot. For instance MS-DOS doesn't. 6371.56SfvdlAC_DEFUN([AM_SET_LEADING_DOT], 6381.56Sfvdl[rm -rf .tst 2>/dev/null 6391.56Sfvdlmkdir .tst 2>/dev/null 6401.56Sfvdlif test -d .tst; then 6411.56Sfvdl am__leading_dot=. 6421.56Sfvdlelse 6431.56Sfvdl am__leading_dot=_ 6441.56Sfvdlfi 6451.56Sfvdlrmdir .tst 2>/dev/null 6461.56SfvdlAC_SUBST([am__leading_dot])]) 6471.56Sfvdl 6481.56Sfvdl# Check to see how 'make' treats includes. -*- Autoconf -*- 6491.56Sfvdl 6501.56Sfvdl# Copyright (C) 2001-2014 Free Software Foundation, Inc. 6511.56Sfvdl# 6521.56Sfvdl# This file is free software; the Free Software Foundation 6531.56Sfvdl# gives unlimited permission to copy and/or distribute it, 6541.56Sfvdl# with or without modifications, as long as this notice is preserved. 6551.56Sfvdl 6561.56Sfvdl# AM_MAKE_INCLUDE() 6571.56Sfvdl# ----------------- 6581.56Sfvdl# Check to see how make treats includes. 6591.56SfvdlAC_DEFUN([AM_MAKE_INCLUDE], 6601.56Sfvdl[am_make=${MAKE-make} 6611.56Sfvdlcat > confinc << 'END' 6621.56Sfvdlam__doit: 6631.56Sfvdl @echo this is the am__doit target 6641.56Sfvdl.PHONY: am__doit 6651.56SfvdlEND 6661.56Sfvdl# If we don't find an include directive, just comment out the code. 6671.56SfvdlAC_MSG_CHECKING([for style of include used by $am_make]) 6681.56Sfvdlam__include="#" 6691.56Sfvdlam__quote= 6701.56Sfvdl_am_result=none 6711.56Sfvdl# First try GNU make style include. 6721.56Sfvdlecho "include confinc" > confmf 6731.56Sfvdl# Ignore all kinds of additional output from 'make'. 6741.56Sfvdlcase `$am_make -s -f confmf 2> /dev/null` in #( 6751.56Sfvdl*the\ am__doit\ target*) 6761.56Sfvdl am__include=include 6771.56Sfvdl am__quote= 6781.56Sfvdl _am_result=GNU 6791.56Sfvdl ;; 6801.56Sfvdlesac 6811.56Sfvdl# Now try BSD make style include. 6821.56Sfvdlif test "$am__include" = "#"; then 6831.56Sfvdl echo '.include "confinc"' > confmf 6841.56Sfvdl case `$am_make -s -f confmf 2> /dev/null` in #( 6851.56Sfvdl *the\ am__doit\ target*) 6861.56Sfvdl am__include=.include 6871.56Sfvdl am__quote="\"" 6881.56Sfvdl _am_result=BSD 6891.56Sfvdl ;; 6901.56Sfvdl esac 6911.56Sfvdlfi 6921.56SfvdlAC_SUBST([am__include]) 6931.56SfvdlAC_SUBST([am__quote]) 6941.56SfvdlAC_MSG_RESULT([$_am_result]) 6951.56Sfvdlrm -f confinc confmf 6961.56Sfvdl]) 6971.56Sfvdl 6981.56Sfvdl# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 6991.56Sfvdl 7001.56Sfvdl# Copyright (C) 1997-2014 Free Software Foundation, Inc. 7011.56Sfvdl# 7021.56Sfvdl# This file is free software; the Free Software Foundation 7031.56Sfvdl# gives unlimited permission to copy and/or distribute it, 7041.53Sjdolecek# with or without modifications, as long as this notice is preserved. 7051.53Sjdolecek 7061.53Sjdolecek# AM_MISSING_PROG(NAME, PROGRAM) 7071.53Sjdolecek# ------------------------------ 7081.57SfvdlAC_DEFUN([AM_MISSING_PROG], 7091.57Sfvdl[AC_REQUIRE([AM_MISSING_HAS_RUN]) 7101.57Sfvdl$1=${$1-"${am_missing_run}$2"} 7111.57SfvdlAC_SUBST($1)]) 7121.57Sfvdl 7131.57Sfvdl# AM_MISSING_HAS_RUN 7141.57Sfvdl# ------------------ 7151.57Sfvdl# Define MISSING if not defined so far and test if it is modern enough. 7161.57Sfvdl# If it is, set am_missing_run to use it, otherwise, to nothing. 7171.57SfvdlAC_DEFUN([AM_MISSING_HAS_RUN], 7181.57Sfvdl[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 7191.57SfvdlAC_REQUIRE_AUX_FILE([missing])dnl 7201.57Sfvdlif test x"${MISSING+set}" != xset; then 7211.57Sfvdl case $am_aux_dir in 7221.57Sfvdl *\ * | *\ *) 7231.57Sfvdl MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; 7241.57Sfvdl *) 7251.57Sfvdl MISSING="\${SHELL} $am_aux_dir/missing" ;; 7261.57Sfvdl esac 7271.57Sfvdlfi 7281.57Sfvdl# Use eval to expand $SHELL 7291.57Sfvdlif eval "$MISSING --is-lightweight"; then 7301.54Sjdolecek am_missing_run="$MISSING " 7311.54Sjdolecekelse 7321.54Sjdolecek am_missing_run= 7331.54Sjdolecek AC_MSG_WARN(['missing' script is too old or missing]) 7341.54Sjdolecekfi 7351.54Sjdolecek]) 7361.54Sjdolecek 7371.54Sjdolecek# Helper functions for option handling. -*- Autoconf -*- 7381.54Sjdolecek 7391.54Sjdolecek# Copyright (C) 2001-2014 Free Software Foundation, Inc. 7401.54Sjdolecek# 7411.54Sjdolecek# This file is free software; the Free Software Foundation 7421.1Serh# gives unlimited permission to copy and/or distribute it, 7431.1Serh# with or without modifications, as long as this notice is preserved. 7441.1Serh 7451.1Serh# _AM_MANGLE_OPTION(NAME) 7461.45Sthorpej# ----------------------- 7471.50SjdolecekAC_DEFUN([_AM_MANGLE_OPTION], 7481.45Sthorpej[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 7491.50Sjdolecek 7501.45Sthorpej# _AM_SET_OPTION(NAME) 7511.50Sjdolecek# -------------------- 7521.45Sthorpej# Set option NAME. Presently that only means defining a flag for this option. 7531.50SjdolecekAC_DEFUN([_AM_SET_OPTION], 7541.45Sthorpej[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) 7551.50Sjdolecek 7561.45Sthorpej# _AM_SET_OPTIONS(OPTIONS) 7571.50Sjdolecek# ------------------------ 7581.45Sthorpej# OPTIONS is a space-separated list of Automake options. 7591.50SjdolecekAC_DEFUN([_AM_SET_OPTIONS], 7601.45Sthorpej[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 7611.50Sjdolecek 7621.45Sthorpej# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 7631.50Sjdolecek# ------------------------------------------- 7641.45Sthorpej# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 7651.50SjdolecekAC_DEFUN([_AM_IF_OPTION], 7661.45Sthorpej[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 7671.50Sjdolecek 7681.45Sthorpej# Copyright (C) 1999-2014 Free Software Foundation, Inc. 7691.50Sjdolecek# 7701.45Sthorpej# This file is free software; the Free Software Foundation 7711.50Sjdolecek# gives unlimited permission to copy and/or distribute it, 7721.45Sthorpej# with or without modifications, as long as this notice is preserved. 7731.50Sjdolecek 7741.45Sthorpej# _AM_PROG_CC_C_O 7751.50Sjdolecek# --------------- 7761.45Sthorpej# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC 7771.50Sjdolecek# to automatically call this. 7781.45SthorpejAC_DEFUN([_AM_PROG_CC_C_O], 7791.50Sjdolecek[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 7801.45SthorpejAC_REQUIRE_AUX_FILE([compile])dnl 7811.50SjdolecekAC_LANG_PUSH([C])dnl 7821.45SthorpejAC_CACHE_CHECK( 7831.50Sjdolecek [whether $CC understands -c and -o together], 7841.45Sthorpej [am_cv_prog_cc_c_o], 7851.50Sjdolecek [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) 7861.45Sthorpej # Make sure it works both with $CC and with simple cc. 7871.50Sjdolecek # Following AC_PROG_CC_C_O, we do the test twice because some 7881.45Sthorpej # compilers refuse to overwrite an existing .o file with -o, 7891.50Sjdolecek # though they will create one. 7901.45Sthorpej am_cv_prog_cc_c_o=yes 7911.50Sjdolecek for am_i in 1 2; do 7921.45Sthorpej if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ 7931.50Sjdolecek && test -f conftest2.$ac_objext; then 7941.45Sthorpej : OK 7951.50Sjdolecek else 7961.45Sthorpej am_cv_prog_cc_c_o=no 7971.50Sjdolecek break 7981.45Sthorpej fi 7991.50Sjdolecek done 8001.45Sthorpej rm -f core conftest* 8011.50Sjdolecek unset am_i]) 8021.45Sthorpejif test "$am_cv_prog_cc_c_o" != yes; then 8031.50Sjdolecek # Losing compiler, so override with the script. 8041.45Sthorpej # FIXME: It is wrong to rewrite CC. 8051.50Sjdolecek # But if we don't then we get into trouble of one sort or another. 8061.45Sthorpej # A longer-term fix would be to have automake use am__CC in this case, 8071.50Sjdolecek # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" 8081.45Sthorpej CC="$am_aux_dir/compile $CC" 8091.50Sjdolecekfi 8101.45SthorpejAC_LANG_POP([C])]) 8111.50Sjdolecek 8121.45Sthorpej# For backward compatibility. 8131.50SjdolecekAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) 8141.45Sthorpej 8151.50Sjdolecek# Copyright (C) 2001-2014 Free Software Foundation, Inc. 8161.45Sthorpej# 8171.50Sjdolecek# This file is free software; the Free Software Foundation 8181.45Sthorpej# gives unlimited permission to copy and/or distribute it, 8191.50Sjdolecek# with or without modifications, as long as this notice is preserved. 8201.45Sthorpej 8211.50Sjdolecek# AM_RUN_LOG(COMMAND) 8221.45Sthorpej# ------------------- 8231.50Sjdolecek# Run COMMAND, save the exit status in ac_status, and log it. 8241.45Sthorpej# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) 8251.50SjdolecekAC_DEFUN([AM_RUN_LOG], 8261.45Sthorpej[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD 8271.50Sjdolecek ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD 8281.45Sthorpej ac_status=$? 8291.50Sjdolecek echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 8301.45Sthorpej (exit $ac_status); }]) 8311.50Sjdolecek 8321.45Sthorpej# Check to make sure that the build environment is sane. -*- Autoconf -*- 8331.50Sjdolecek 8341.45Sthorpej# Copyright (C) 1996-2014 Free Software Foundation, Inc. 8351.50Sjdolecek# 8361.45Sthorpej# This file is free software; the Free Software Foundation 8371.50Sjdolecek# gives unlimited permission to copy and/or distribute it, 8381.45Sthorpej# with or without modifications, as long as this notice is preserved. 8391.50Sjdolecek 8401.45Sthorpej# AM_SANITY_CHECK 8411.50Sjdolecek# --------------- 8421.45SthorpejAC_DEFUN([AM_SANITY_CHECK], 8431.50Sjdolecek[AC_MSG_CHECKING([whether build environment is sane]) 8441.45Sthorpej# Reject unsafe characters in $srcdir or the absolute working directory 8451.50Sjdolecek# name. Accept space and tab only in the latter. 8461.45Sthorpejam_lf=' 8471.50Sjdolecek' 8481.45Sthorpejcase `pwd` in 8491.50Sjdolecek *[[\\\"\#\$\&\'\`$am_lf]]*) 8501.45Sthorpej AC_MSG_ERROR([unsafe absolute working directory name]);; 8511.50Sjdolecekesac 8521.45Sthorpejcase $srcdir in 8531.50Sjdolecek *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 8541.45Sthorpej AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; 8551.50Sjdolecekesac 8561.45Sthorpej 8571.50Sjdolecek# Do 'set' in a subshell so we don't clobber the current shell's 8581.45Sthorpej# arguments. Must try -L first in case configure is actually a 8591.50Sjdolecek# symlink; some systems play weird games with the mod time of symlinks 8601.45Sthorpej# (eg FreeBSD returns the mod time of the symlink's containing 8611.50Sjdolecek# directory). 8621.45Sthorpejif ( 8631.50Sjdolecek am_has_slept=no 8641.45Sthorpej for am_try in 1 2; do 8651.50Sjdolecek echo "timestamp, slept: $am_has_slept" > conftest.file 8661.45Sthorpej set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 8671.50Sjdolecek if test "$[*]" = "X"; then 8681.45Sthorpej # -L didn't work. 8691.50Sjdolecek set X `ls -t "$srcdir/configure" conftest.file` 8701.45Sthorpej fi 8711.50Sjdolecek if test "$[*]" != "X $srcdir/configure conftest.file" \ 8721.45Sthorpej && test "$[*]" != "X conftest.file $srcdir/configure"; then 8731.50Sjdolecek 8741.45Sthorpej # If neither matched, then we have a broken ls. This can happen 8751.50Sjdolecek # if, for instance, CONFIG_SHELL is bash and it inherits a 8761.45Sthorpej # broken ls alias from the environment. This has actually 8771.50Sjdolecek # happened. Such a system could not be considered "sane". 8781.45Sthorpej AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 8791.50Sjdolecek alias in your environment]) 8801.45Sthorpej fi 8811.50Sjdolecek if test "$[2]" = conftest.file || test $am_try -eq 2; then 8821.45Sthorpej break 8831.50Sjdolecek fi 8841.45Sthorpej # Just in case. 8851.50Sjdolecek sleep 1 8861.45Sthorpej am_has_slept=yes 8871.50Sjdolecek done 8881.45Sthorpej test "$[2]" = conftest.file 8891.50Sjdolecek ) 8901.45Sthorpejthen 8911.50Sjdolecek # Ok. 8921.58Sjoerg : 8931.45Sthorpejelse 8941.50Sjdolecek AC_MSG_ERROR([newly created file is older than distributed files! 8951.58SjoergCheck your system clock]) 8961.58Sjoergfi 8971.45SthorpejAC_MSG_RESULT([yes]) 8981.50Sjdolecek# If we didn't sleep, we still need to ensure time stamps of config.status and 8991.45Sthorpej# generated files are strictly newer. 9001.50Sjdolecekam_sleep_pid= 9011.45Sthorpejif grep 'slept: no' conftest.file >/dev/null 2>&1; then 9021.50Sjdolecek ( sleep 1 ) & 9031.45Sthorpej am_sleep_pid=$! 9041.50Sjdolecekfi 9051.45SthorpejAC_CONFIG_COMMANDS_PRE( 9061.50Sjdolecek [AC_MSG_CHECKING([that generated files are newer than configure]) 9071.45Sthorpej if test -n "$am_sleep_pid"; then 9081.50Sjdolecek # Hide warnings about reused PIDs. 9091.45Sthorpej wait $am_sleep_pid 2>/dev/null 9101.50Sjdolecek fi 9111.45Sthorpej AC_MSG_RESULT([done])]) 9121.50Sjdolecekrm -f conftest.file 9131.45Sthorpej]) 9141.50Sjdolecek 9151.63Schristos# Copyright (C) 2009-2014 Free Software Foundation, Inc. 9161.50Sjdolecek# 9171.45Sthorpej# This file is free software; the Free Software Foundation 9181.50Sjdolecek# gives unlimited permission to copy and/or distribute it, 9191.45Sthorpej# with or without modifications, as long as this notice is preserved. 9201.50Sjdolecek 9211.45Sthorpej# AM_SILENT_RULES([DEFAULT]) 9221.50Sjdolecek# -------------------------- 9231.45Sthorpej# Enable less verbose build rules; with the default set to DEFAULT 9241.50Sjdolecek# ("yes" being less verbose, "no" or empty being verbose). 9251.45SthorpejAC_DEFUN([AM_SILENT_RULES], 9261.50Sjdolecek[AC_ARG_ENABLE([silent-rules], [dnl 9271.45SthorpejAS_HELP_STRING( 9281.50Sjdolecek [--enable-silent-rules], 9291.45Sthorpej [less verbose build output (undo: "make V=1")]) 9301.50SjdolecekAS_HELP_STRING( 9311.45Sthorpej [--disable-silent-rules], 9321.50Sjdolecek [verbose build output (undo: "make V=0")])dnl 9331.45Sthorpej]) 9341.50Sjdolecekcase $enable_silent_rules in @%:@ ((( 9351.45Sthorpej yes) AM_DEFAULT_VERBOSITY=0;; 9361.50Sjdolecek no) AM_DEFAULT_VERBOSITY=1;; 9371.45Sthorpej *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; 9381.50Sjdolecekesac 9391.45Sthorpejdnl 9401.50Sjdolecekdnl A few 'make' implementations (e.g., NonStop OS and NextStep) 9411.45Sthorpejdnl do not support nested variable expansions. 9421.50Sjdolecekdnl See automake bug#9928 and bug#10237. 9431.45Sthorpejam_make=${MAKE-make} 9441.50SjdolecekAC_CACHE_CHECK([whether $am_make supports nested variables], 9451.45Sthorpej [am_cv_make_support_nested_variables], 9461.50Sjdolecek [if AS_ECHO([['TRUE=$(BAR$(V)) 9471.45SthorpejBAR0=false 9481.50SjdolecekBAR1=true 9491.45SthorpejV=1 9501.50Sjdolecekam__doit: 9511.45Sthorpej @$(TRUE) 9521.50Sjdolecek.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then 9531.45Sthorpej am_cv_make_support_nested_variables=yes 9541.50Sjdolecekelse 9551.45Sthorpej am_cv_make_support_nested_variables=no 9561.50Sjdolecekfi]) 9571.45Sthorpejif test $am_cv_make_support_nested_variables = yes; then 9581.50Sjdolecek dnl Using '$V' instead of '$(V)' breaks IRIX make. 9591.45Sthorpej AM_V='$(V)' 9601.50Sjdolecek AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' 9611.45Sthorpejelse 9621.50Sjdolecek AM_V=$AM_DEFAULT_VERBOSITY 9631.45Sthorpej AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY 9641.50Sjdolecekfi 9651.45SthorpejAC_SUBST([AM_V])dnl 9661.50SjdolecekAM_SUBST_NOTMAKE([AM_V])dnl 9671.45SthorpejAC_SUBST([AM_DEFAULT_V])dnl 9681.50SjdolecekAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl 9691.45SthorpejAC_SUBST([AM_DEFAULT_VERBOSITY])dnl 9701.50SjdolecekAM_BACKSLASH='\' 9711.45SthorpejAC_SUBST([AM_BACKSLASH])dnl 9721.50Sjdolecek_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl 9731.45Sthorpej]) 9741.50Sjdolecek 9751.45Sthorpej# Copyright (C) 2001-2014 Free Software Foundation, Inc. 9761.50Sjdolecek# 9771.45Sthorpej# This file is free software; the Free Software Foundation 9781.50Sjdolecek# gives unlimited permission to copy and/or distribute it, 9791.45Sthorpej# with or without modifications, as long as this notice is preserved. 9801.50Sjdolecek 9811.45Sthorpej# AM_PROG_INSTALL_STRIP 9821.50Sjdolecek# --------------------- 9831.45Sthorpej# One issue with vendor 'install' (even GNU) is that you can't 9841.50Sjdolecek# specify the program used to strip binaries. This is especially 9851.45Sthorpej# annoying in cross-compiling environments, where the build's strip 9861.50Sjdolecek# is unlikely to handle the host's binaries. 9871.45Sthorpej# Fortunately install-sh will honor a STRIPPROG variable, so we 9881.50Sjdolecek# always use install-sh in "make install-strip", and initialize 9891.45Sthorpej# STRIPPROG with the value of the STRIP variable (set by the user). 9901.50SjdolecekAC_DEFUN([AM_PROG_INSTALL_STRIP], 9911.45Sthorpej[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 9921.50Sjdolecek# Installed binaries are usually stripped using 'strip' when the user 9931.45Sthorpej# run "make install-strip". However 'strip' might not be the right 9941.50Sjdolecek# tool to use in cross-compilation environments, therefore Automake 9951.45Sthorpej# will honor the 'STRIP' environment variable to overrule this program. 9961.50Sjdolecekdnl Don't test for $cross_compiling = yes, because it might be 'maybe'. 9971.45Sthorpejif test "$cross_compiling" != no; then 9981.50Sjdolecek AC_CHECK_TOOL([STRIP], [strip], :) 9991.45Sthorpejfi 10001.50SjdolecekINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 10011.45SthorpejAC_SUBST([INSTALL_STRIP_PROGRAM])]) 10021.50Sjdolecek 10031.45Sthorpej# Copyright (C) 2006-2014 Free Software Foundation, Inc. 10041.50Sjdolecek# 10051.45Sthorpej# This file is free software; the Free Software Foundation 10061.50Sjdolecek# gives unlimited permission to copy and/or distribute it, 10071.45Sthorpej# with or without modifications, as long as this notice is preserved. 10081.50Sjdolecek 10091.45Sthorpej# _AM_SUBST_NOTMAKE(VARIABLE) 10101.50Sjdolecek# --------------------------- 10111.45Sthorpej# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 10121.50Sjdolecek# This macro is traced by Automake. 10131.45SthorpejAC_DEFUN([_AM_SUBST_NOTMAKE]) 10141.50Sjdolecek 10151.45Sthorpej# AM_SUBST_NOTMAKE(VARIABLE) 10161.50Sjdolecek# -------------------------- 10171.45Sthorpej# Public sister of _AM_SUBST_NOTMAKE. 10181.50SjdolecekAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 10191.45Sthorpej 10201.50Sjdolecek# Check how to create a tarball. -*- Autoconf -*- 10211.45Sthorpej 10221.50Sjdolecek# Copyright (C) 2004-2014 Free Software Foundation, Inc. 10231.45Sthorpej# 10241.50Sjdolecek# This file is free software; the Free Software Foundation 10251.45Sthorpej# gives unlimited permission to copy and/or distribute it, 10261.50Sjdolecek# with or without modifications, as long as this notice is preserved. 10271.45Sthorpej 10281.50Sjdolecek# _AM_PROG_TAR(FORMAT) 10291.45Sthorpej# -------------------- 10301.50Sjdolecek# Check how to create a tarball in format FORMAT. 10311.45Sthorpej# FORMAT should be one of 'v7', 'ustar', or 'pax'. 10321.50Sjdolecek# 10331.45Sthorpej# Substitute a variable $(am__tar) that is a command 10341.50Sjdolecek# writing to stdout a FORMAT-tarball containing the directory 10351.45Sthorpej# $tardir. 10361.50Sjdolecek# tardir=directory && $(am__tar) > result.tar 10371.45Sthorpej# 10381.50Sjdolecek# Substitute a variable $(am__untar) that extract such 10391.45Sthorpej# a tarball read from stdin. 10401.50Sjdolecek# $(am__untar) < result.tar 10411.45Sthorpej# 10421.50SjdolecekAC_DEFUN([_AM_PROG_TAR], 10431.45Sthorpej[# Always define AMTAR for backward compatibility. Yes, it's still used 10441.50Sjdolecek# in the wild :-( We should find a proper way to deprecate it ... 10451.45SthorpejAC_SUBST([AMTAR], ['$${TAR-tar}']) 10461.50Sjdolecek 10471.45Sthorpej# We'll loop over all known methods to create a tar archive until one works. 10481.50Sjdolecek_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 10491.45Sthorpej 10501.50Sjdolecekm4_if([$1], [v7], 10511.45Sthorpej [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], 10521.50Sjdolecek 10531.45Sthorpej [m4_case([$1], 10541.50Sjdolecek [ustar], 10551.45Sthorpej [# The POSIX 1988 'ustar' format is defined with fixed-size fields. 10561.50Sjdolecek # There is notably a 21 bits limit for the UID and the GID. In fact, 10571.45Sthorpej # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 10581.50Sjdolecek # and bug#13588). 10591.47Schristos am_max_uid=2097151 # 2^21 - 1 10601.50Sjdolecek am_max_gid=$am_max_uid 10611.45Sthorpej # The $UID and $GID variables are not portable, so we need to resort 10621.50Sjdolecek # to the POSIX-mandated id(1) utility. Errors in the 'id' calls 10631.49Sjdolecek # below are definitely unexpected, so allow the users to see them 10641.50Sjdolecek # (that is, avoid stderr redirection). 10651.45Sthorpej am_uid=`id -u || echo unknown` 10661.50Sjdolecek am_gid=`id -g || echo unknown` 10671.45Sthorpej AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) 10681.50Sjdolecek if test $am_uid -le $am_max_uid; then 10691.45Sthorpej AC_MSG_RESULT([yes]) 10701.50Sjdolecek else 10711.45Sthorpej AC_MSG_RESULT([no]) 10721.50Sjdolecek _am_tools=none 10731.45Sthorpej fi 10741.50Sjdolecek AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) 10751.45Sthorpej if test $am_gid -le $am_max_gid; then 10761.50Sjdolecek AC_MSG_RESULT([yes]) 10771.45Sthorpej else 10781.50Sjdolecek AC_MSG_RESULT([no]) 10791.45Sthorpej _am_tools=none 10801.50Sjdolecek fi], 10811.45Sthorpej 10821.50Sjdolecek [pax], 10831.45Sthorpej [], 10841.50Sjdolecek 10851.45Sthorpej [m4_fatal([Unknown tar format])]) 10861.50Sjdolecek 10871.45Sthorpej AC_MSG_CHECKING([how to create a $1 tar archive]) 10881.50Sjdolecek 10891.50Sjdolecek # Go ahead even if we have the value already cached. We do so because we 10901.50Sjdolecek # need to set the values for the 'am__tar' and 'am__untar' variables. 10911.50Sjdolecek _am_tools=${am_cv_prog_tar_$1-$_am_tools} 10921.50Sjdolecek 10931.45Sthorpej for _am_tool in $_am_tools; do 10941.50Sjdolecek case $_am_tool in 10951.45Sthorpej gnutar) 10961.50Sjdolecek for _am_tar in tar gnutar gtar; do 10971.56Sfvdl AM_RUN_LOG([$_am_tar --version]) && break 10981.56Sfvdl done 10991.56Sfvdl am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 11001.56Sfvdl am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 11011.56Sfvdl am__untar="$_am_tar -xf -" 11021.56Sfvdl ;; 11031.56Sfvdl plaintar) 11041.56Sfvdl # Must skip GNU tar: if it does not support --format= it doesn't create 11051.56Sfvdl # ustar tarball either. 11061.56Sfvdl (tar --version) >/dev/null 2>&1 && continue 11071.56Sfvdl am__tar='tar chf - "$$tardir"' 11081.56Sfvdl am__tar_='tar chf - "$tardir"' 11091.56Sfvdl am__untar='tar xf -' 11101.56Sfvdl ;; 11111.56Sfvdl pax) 11121.56Sfvdl am__tar='pax -L -x $1 -w "$$tardir"' 11131.56Sfvdl am__tar_='pax -L -x $1 -w "$tardir"' 11141.56Sfvdl am__untar='pax -r' 11151.56Sfvdl ;; 11161.56Sfvdl cpio) 11171.56Sfvdl am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 11181.56Sfvdl am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 11191.56Sfvdl am__untar='cpio -i -H $1 -d' 11201.56Sfvdl ;; 11211.53Sjdolecek none) 11221.53Sjdolecek am__tar=false 11231.57Sfvdl am__tar_=false 11241.57Sfvdl am__untar=false 11251.57Sfvdl ;; 11261.57Sfvdl esac 11271.57Sfvdl 11281.57Sfvdl # If the value was cached, stop now. We just wanted to have am__tar 11291.57Sfvdl # and am__untar set. 11301.57Sfvdl test -n "${am_cv_prog_tar_$1}" && break 11311.54Sjdolecek 11321.54Sjdolecek # tar/untar a dummy directory, and stop if the command works. 11331.54Sjdolecek rm -rf conftest.dir 11341.54Sjdolecek mkdir conftest.dir 11351.63Schristos echo GrepMe > conftest.dir/file 1136 AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 1137 rm -rf conftest.dir 1138 if test -s conftest.tar; then 1139 AM_RUN_LOG([$am__untar <conftest.tar]) 1140 AM_RUN_LOG([cat conftest.dir/file]) 1141 grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 1142 fi 1143 done 1144 rm -rf conftest.dir 1145 1146 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 1147 AC_MSG_RESULT([$am_cv_prog_tar_$1])]) 1148 1149AC_SUBST([am__tar]) 1150AC_SUBST([am__untar]) 1151]) # _AM_PROG_TAR 1152 1153# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 1154# 1155# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 1156# 1157# This program is free software; you can redistribute it and/or modify 1158# it under the terms of the GNU General Public License as published by 1159# the Free Software Foundation; either version 2 of the License, or 1160# (at your option) any later version. 1161# 1162# This program is distributed in the hope that it will be useful, but 1163# WITHOUT ANY WARRANTY; without even the implied warranty of 1164# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1165# General Public License for more details. 1166# 1167# You should have received a copy of the GNU General Public License 1168# along with this program; if not, write to the Free Software 1169# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 1170# 1171# As a special exception to the GNU General Public License, if you 1172# distribute this file as part of a program that contains a 1173# configuration script generated by Autoconf, you may include it under 1174# the same distribution terms that you use for the rest of that program. 1175 1176# PKG_PROG_PKG_CONFIG([MIN-VERSION]) 1177# ---------------------------------- 1178AC_DEFUN([PKG_PROG_PKG_CONFIG], 1179[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 1180m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 1181AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl 1182if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 1183 AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 1184fi 1185if test -n "$PKG_CONFIG"; then 1186 _pkg_min_version=m4_default([$1], [0.9.0]) 1187 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 1188 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 1189 AC_MSG_RESULT([yes]) 1190 else 1191 AC_MSG_RESULT([no]) 1192 PKG_CONFIG="" 1193 fi 1194 1195fi[]dnl 1196])# PKG_PROG_PKG_CONFIG 1197 1198# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 1199# 1200# Check to see whether a particular set of modules exists. Similar 1201# to PKG_CHECK_MODULES(), but does not set variables or print errors. 1202# 1203# 1204# Similar to PKG_CHECK_MODULES, make sure that the first instance of 1205# this or PKG_CHECK_MODULES is called, or make sure to call 1206# PKG_CHECK_EXISTS manually 1207# -------------------------------------------------------------- 1208AC_DEFUN([PKG_CHECK_EXISTS], 1209[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 1210if test -n "$PKG_CONFIG" && \ 1211 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 1212 m4_ifval([$2], [$2], [:]) 1213m4_ifvaln([$3], [else 1214 $3])dnl 1215fi]) 1216 1217 1218# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 1219# --------------------------------------------- 1220m4_define([_PKG_CONFIG], 1221[if test -n "$$1"; then 1222 pkg_cv_[]$1="$$1" 1223 elif test -n "$PKG_CONFIG"; then 1224 PKG_CHECK_EXISTS([$3], 1225 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], 1226 [pkg_failed=yes]) 1227 else 1228 pkg_failed=untried 1229fi[]dnl 1230])# _PKG_CONFIG 1231 1232# _PKG_SHORT_ERRORS_SUPPORTED 1233# ----------------------------- 1234AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 1235[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 1236if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 1237 _pkg_short_errors_supported=yes 1238else 1239 _pkg_short_errors_supported=no 1240fi[]dnl 1241])# _PKG_SHORT_ERRORS_SUPPORTED 1242 1243 1244# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 1245# [ACTION-IF-NOT-FOUND]) 1246# 1247# 1248# Note that if there is a possibility the first call to 1249# PKG_CHECK_MODULES might not happen, you should be sure to include an 1250# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 1251# 1252# 1253# -------------------------------------------------------------- 1254AC_DEFUN([PKG_CHECK_MODULES], 1255[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 1256AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 1257AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 1258 1259pkg_failed=no 1260AC_MSG_CHECKING([for $1]) 1261 1262_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 1263_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 1264 1265m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 1266and $1[]_LIBS to avoid the need to call pkg-config. 1267See the pkg-config man page for more details.]) 1268 1269if test $pkg_failed = yes; then 1270 _PKG_SHORT_ERRORS_SUPPORTED 1271 if test $_pkg_short_errors_supported = yes; then 1272 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` 1273 else 1274 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` 1275 fi 1276 # Put the nasty error message in config.log where it belongs 1277 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 1278 1279 ifelse([$4], , [AC_MSG_ERROR(dnl 1280[Package requirements ($2) were not met: 1281 1282$$1_PKG_ERRORS 1283 1284Consider adjusting the PKG_CONFIG_PATH environment variable if you 1285installed software in a non-standard prefix. 1286 1287_PKG_TEXT 1288])], 1289 [AC_MSG_RESULT([no]) 1290 $4]) 1291elif test $pkg_failed = untried; then 1292 ifelse([$4], , [AC_MSG_FAILURE(dnl 1293[The pkg-config script could not be found or is too old. Make sure it 1294is in your PATH or set the PKG_CONFIG environment variable to the full 1295path to pkg-config. 1296 1297_PKG_TEXT 1298 1299To get pkg-config, see <http://pkg-config.freedesktop.org/>.])], 1300 [$4]) 1301else 1302 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 1303 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 1304 AC_MSG_RESULT([yes]) 1305 ifelse([$3], , :, [$3]) 1306fi[]dnl 1307])# PKG_CHECK_MODULES 1308 1309dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. 1310dnl 1311dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 1312dnl 1313dnl Permission is hereby granted, free of charge, to any person obtaining a 1314dnl copy of this software and associated documentation files (the "Software"), 1315dnl to deal in the Software without restriction, including without limitation 1316dnl the rights to use, copy, modify, merge, publish, distribute, sublicense, 1317dnl and/or sell copies of the Software, and to permit persons to whom the 1318dnl Software is furnished to do so, subject to the following conditions: 1319dnl 1320dnl The above copyright notice and this permission notice (including the next 1321dnl paragraph) shall be included in all copies or substantial portions of the 1322dnl Software. 1323dnl 1324dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1325dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1326dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 1327dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1328dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 1329dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 1330dnl DEALINGS IN THE SOFTWARE. 1331 1332# XORG_MACROS_VERSION(required-version) 1333# ------------------------------------- 1334# Minimum version: 1.1.0 1335# 1336# If you're using a macro added in Version 1.1 or newer, include this in 1337# your configure.ac with the minimum required version, such as: 1338# XORG_MACROS_VERSION(1.1) 1339# 1340# To ensure that this macro is defined, also add: 1341# m4_ifndef([XORG_MACROS_VERSION], 1342# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) 1343# 1344# 1345# See the "minimum version" comment for each macro you use to see what 1346# version you require. 1347m4_defun([XORG_MACROS_VERSION],[ 1348m4_define([vers_have], [1.19.0]) 1349m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) 1350m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) 1351m4_if(m4_cmp(maj_have, maj_needed), 0,, 1352 [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])]) 1353m4_if(m4_version_compare(vers_have, [$1]), -1, 1354 [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])]) 1355m4_undefine([vers_have]) 1356m4_undefine([maj_have]) 1357m4_undefine([maj_needed]) 1358]) # XORG_MACROS_VERSION 1359 1360# XORG_PROG_RAWCPP() 1361# ------------------ 1362# Minimum version: 1.0.0 1363# 1364# Find cpp program and necessary flags for use in pre-processing text files 1365# such as man pages and config files 1366AC_DEFUN([XORG_PROG_RAWCPP],[ 1367AC_REQUIRE([AC_PROG_CPP]) 1368AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 1369 [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 1370 1371# Check for flag to avoid builtin definitions - assumes unix is predefined, 1372# which is not the best choice for supporting other OS'es, but covers most 1373# of the ones we need for now. 1374AC_MSG_CHECKING([if $RAWCPP requires -undef]) 1375AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])]) 1376if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1377 AC_MSG_RESULT([no]) 1378else 1379 if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1380 RAWCPPFLAGS=-undef 1381 AC_MSG_RESULT([yes]) 1382 # under Cygwin unix is still defined even with -undef 1383 elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 1384 RAWCPPFLAGS="-undef -ansi" 1385 AC_MSG_RESULT([yes, with -ansi]) 1386 else 1387 AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 1388 fi 1389fi 1390rm -f conftest.$ac_ext 1391 1392AC_MSG_CHECKING([if $RAWCPP requires -traditional]) 1393AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])]) 1394if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 1395 AC_MSG_RESULT([no]) 1396else 1397 if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 1398 TRADITIONALCPPFLAGS="-traditional" 1399 RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 1400 AC_MSG_RESULT([yes]) 1401 else 1402 AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 1403 fi 1404fi 1405rm -f conftest.$ac_ext 1406AC_SUBST(RAWCPPFLAGS) 1407AC_SUBST(TRADITIONALCPPFLAGS) 1408]) # XORG_PROG_RAWCPP 1409 1410# XORG_MANPAGE_SECTIONS() 1411# ----------------------- 1412# Minimum version: 1.0.0 1413# 1414# Determine which sections man pages go in for the different man page types 1415# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 1416# Not sure if there's any better way than just hardcoding by OS name. 1417# Override default settings by setting environment variables 1418# Added MAN_SUBSTS in version 1.8 1419# Added AC_PROG_SED in version 1.8 1420 1421AC_DEFUN([XORG_MANPAGE_SECTIONS],[ 1422AC_REQUIRE([AC_CANONICAL_HOST]) 1423AC_REQUIRE([AC_PROG_SED]) 1424 1425if test x$APP_MAN_SUFFIX = x ; then 1426 APP_MAN_SUFFIX=1 1427fi 1428if test x$APP_MAN_DIR = x ; then 1429 APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' 1430fi 1431 1432if test x$LIB_MAN_SUFFIX = x ; then 1433 LIB_MAN_SUFFIX=3 1434fi 1435if test x$LIB_MAN_DIR = x ; then 1436 LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' 1437fi 1438 1439if test x$FILE_MAN_SUFFIX = x ; then 1440 case $host_os in 1441 solaris*) FILE_MAN_SUFFIX=4 ;; 1442 *) FILE_MAN_SUFFIX=5 ;; 1443 esac 1444fi 1445if test x$FILE_MAN_DIR = x ; then 1446 FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' 1447fi 1448 1449if test x$MISC_MAN_SUFFIX = x ; then 1450 case $host_os in 1451 solaris*) MISC_MAN_SUFFIX=5 ;; 1452 *) MISC_MAN_SUFFIX=7 ;; 1453 esac 1454fi 1455if test x$MISC_MAN_DIR = x ; then 1456 MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' 1457fi 1458 1459if test x$DRIVER_MAN_SUFFIX = x ; then 1460 case $host_os in 1461 solaris*) DRIVER_MAN_SUFFIX=7 ;; 1462 *) DRIVER_MAN_SUFFIX=4 ;; 1463 esac 1464fi 1465if test x$DRIVER_MAN_DIR = x ; then 1466 DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' 1467fi 1468 1469if test x$ADMIN_MAN_SUFFIX = x ; then 1470 case $host_os in 1471 solaris*) ADMIN_MAN_SUFFIX=1m ;; 1472 *) ADMIN_MAN_SUFFIX=8 ;; 1473 esac 1474fi 1475if test x$ADMIN_MAN_DIR = x ; then 1476 ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 1477fi 1478 1479 1480AC_SUBST([APP_MAN_SUFFIX]) 1481AC_SUBST([LIB_MAN_SUFFIX]) 1482AC_SUBST([FILE_MAN_SUFFIX]) 1483AC_SUBST([MISC_MAN_SUFFIX]) 1484AC_SUBST([DRIVER_MAN_SUFFIX]) 1485AC_SUBST([ADMIN_MAN_SUFFIX]) 1486AC_SUBST([APP_MAN_DIR]) 1487AC_SUBST([LIB_MAN_DIR]) 1488AC_SUBST([FILE_MAN_DIR]) 1489AC_SUBST([MISC_MAN_DIR]) 1490AC_SUBST([DRIVER_MAN_DIR]) 1491AC_SUBST([ADMIN_MAN_DIR]) 1492 1493XORG_MAN_PAGE="X Version 11" 1494AC_SUBST([XORG_MAN_PAGE]) 1495MAN_SUBSTS="\ 1496 -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 1497 -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 1498 -e 's|__xservername__|Xorg|g' \ 1499 -e 's|__xconfigfile__|xorg.conf|g' \ 1500 -e 's|__projectroot__|\$(prefix)|g' \ 1501 -e 's|__apploaddir__|\$(appdefaultdir)|g' \ 1502 -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ 1503 -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ 1504 -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ 1505 -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ 1506 -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ 1507 -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" 1508AC_SUBST([MAN_SUBSTS]) 1509 1510]) # XORG_MANPAGE_SECTIONS 1511 1512# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION]) 1513# ------------------------ 1514# Minimum version: 1.7.0 1515# 1516# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent 1517# provided by xorg-sgml-doctools, if installed. 1518AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[ 1519AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])]) 1520XORG_SGML_PATH= 1521PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])], 1522 [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`], 1523 [m4_ifval([$1],[:], 1524 [if test x"$cross_compiling" != x"yes" ; then 1525 AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent], 1526 [XORG_SGML_PATH=$prefix/share/sgml]) 1527 fi]) 1528 ]) 1529 1530# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing 1531# the path and the name of the doc stylesheet 1532if test "x$XORG_SGML_PATH" != "x" ; then 1533 AC_MSG_RESULT([$XORG_SGML_PATH]) 1534 STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 1535 XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl 1536else 1537 AC_MSG_RESULT([no]) 1538fi 1539 1540AC_SUBST(XORG_SGML_PATH) 1541AC_SUBST(STYLESHEET_SRCDIR) 1542AC_SUBST(XSL_STYLESHEET) 1543AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"]) 1544]) # XORG_CHECK_SGML_DOCTOOLS 1545 1546# XORG_CHECK_LINUXDOC 1547# ------------------- 1548# Minimum version: 1.0.0 1549# 1550# Defines the variable MAKE_TEXT if the necessary tools and 1551# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 1552# Whether or not the necessary tools and files are found can be checked 1553# with the AM_CONDITIONAL "BUILD_LINUXDOC" 1554AC_DEFUN([XORG_CHECK_LINUXDOC],[ 1555AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 1556AC_REQUIRE([XORG_WITH_PS2PDF]) 1557 1558AC_PATH_PROG(LINUXDOC, linuxdoc) 1559 1560AC_MSG_CHECKING([whether to build documentation]) 1561 1562if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then 1563 BUILDDOC=yes 1564else 1565 BUILDDOC=no 1566fi 1567 1568AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 1569 1570AC_MSG_RESULT([$BUILDDOC]) 1571 1572AC_MSG_CHECKING([whether to build pdf documentation]) 1573 1574if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then 1575 BUILDPDFDOC=yes 1576else 1577 BUILDPDFDOC=no 1578fi 1579 1580AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 1581 1582AC_MSG_RESULT([$BUILDPDFDOC]) 1583 1584MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f" 1585MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 1586MAKE_PDF="$PS2PDF" 1587MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" 1588 1589AC_SUBST(MAKE_TEXT) 1590AC_SUBST(MAKE_PS) 1591AC_SUBST(MAKE_PDF) 1592AC_SUBST(MAKE_HTML) 1593]) # XORG_CHECK_LINUXDOC 1594 1595# XORG_CHECK_DOCBOOK 1596# ------------------- 1597# Minimum version: 1.0.0 1598# 1599# Checks for the ability to build output formats from SGML DocBook source. 1600# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" 1601# indicates whether the necessary tools and files are found and, if set, 1602# $(MAKE_XXX) blah.sgml will produce blah.xxx. 1603AC_DEFUN([XORG_CHECK_DOCBOOK],[ 1604AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 1605 1606BUILDTXTDOC=no 1607BUILDPDFDOC=no 1608BUILDPSDOC=no 1609BUILDHTMLDOC=no 1610 1611AC_PATH_PROG(DOCBOOKPS, docbook2ps) 1612AC_PATH_PROG(DOCBOOKPDF, docbook2pdf) 1613AC_PATH_PROG(DOCBOOKHTML, docbook2html) 1614AC_PATH_PROG(DOCBOOKTXT, docbook2txt) 1615 1616AC_MSG_CHECKING([whether to build text documentation]) 1617if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x && 1618 test x$BUILD_TXTDOC != xno; then 1619 BUILDTXTDOC=yes 1620fi 1621AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) 1622AC_MSG_RESULT([$BUILDTXTDOC]) 1623 1624AC_MSG_CHECKING([whether to build PDF documentation]) 1625if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x && 1626 test x$BUILD_PDFDOC != xno; then 1627 BUILDPDFDOC=yes 1628fi 1629AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 1630AC_MSG_RESULT([$BUILDPDFDOC]) 1631 1632AC_MSG_CHECKING([whether to build PostScript documentation]) 1633if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x && 1634 test x$BUILD_PSDOC != xno; then 1635 BUILDPSDOC=yes 1636fi 1637AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) 1638AC_MSG_RESULT([$BUILDPSDOC]) 1639 1640AC_MSG_CHECKING([whether to build HTML documentation]) 1641if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x && 1642 test x$BUILD_HTMLDOC != xno; then 1643 BUILDHTMLDOC=yes 1644fi 1645AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) 1646AC_MSG_RESULT([$BUILDHTMLDOC]) 1647 1648MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" 1649MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" 1650MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" 1651MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" 1652 1653AC_SUBST(MAKE_TEXT) 1654AC_SUBST(MAKE_PS) 1655AC_SUBST(MAKE_PDF) 1656AC_SUBST(MAKE_HTML) 1657]) # XORG_CHECK_DOCBOOK 1658 1659# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT]) 1660# ---------------- 1661# Minimum version: 1.5.0 1662# Minimum version for optional DEFAULT argument: 1.11.0 1663# 1664# Documentation tools are not always available on all platforms and sometimes 1665# not at the appropriate level. This macro enables a module to test for the 1666# presence of the tool and obtain it's path in separate variables. Coupled with 1667# the --with-xmlto option, it allows maximum flexibilty in making decisions 1668# as whether or not to use the xmlto package. When DEFAULT is not specified, 1669# --with-xmlto assumes 'auto'. 1670# 1671# Interface to module: 1672# HAVE_XMLTO: used in makefiles to conditionally generate documentation 1673# XMLTO: returns the path of the xmlto program found 1674# returns the path set by the user in the environment 1675# --with-xmlto: 'yes' user instructs the module to use xmlto 1676# 'no' user instructs the module not to use xmlto 1677# 1678# Added in version 1.10.0 1679# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation 1680# xmlto for text output requires either lynx, links, or w3m browsers 1681# 1682# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. 1683# 1684AC_DEFUN([XORG_WITH_XMLTO],[ 1685AC_ARG_VAR([XMLTO], [Path to xmlto command]) 1686m4_define([_defopt], m4_default([$2], [auto])) 1687AC_ARG_WITH(xmlto, 1688 AS_HELP_STRING([--with-xmlto], 1689 [Use xmlto to regenerate documentation (default: ]_defopt[)]), 1690 [use_xmlto=$withval], [use_xmlto=]_defopt) 1691m4_undefine([_defopt]) 1692 1693if test "x$use_xmlto" = x"auto"; then 1694 AC_PATH_PROG([XMLTO], [xmlto]) 1695 if test "x$XMLTO" = "x"; then 1696 AC_MSG_WARN([xmlto not found - documentation targets will be skipped]) 1697 have_xmlto=no 1698 else 1699 have_xmlto=yes 1700 fi 1701elif test "x$use_xmlto" = x"yes" ; then 1702 AC_PATH_PROG([XMLTO], [xmlto]) 1703 if test "x$XMLTO" = "x"; then 1704 AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH]) 1705 fi 1706 have_xmlto=yes 1707elif test "x$use_xmlto" = x"no" ; then 1708 if test "x$XMLTO" != "x"; then 1709 AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified]) 1710 fi 1711 have_xmlto=no 1712else 1713 AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no']) 1714fi 1715 1716# Test for a minimum version of xmlto, if provided. 1717m4_ifval([$1], 1718[if test "$have_xmlto" = yes; then 1719 # scrape the xmlto version 1720 AC_MSG_CHECKING([the xmlto version]) 1721 xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` 1722 AC_MSG_RESULT([$xmlto_version]) 1723 AS_VERSION_COMPARE([$xmlto_version], [$1], 1724 [if test "x$use_xmlto" = xauto; then 1725 AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed]) 1726 have_xmlto=no 1727 else 1728 AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed]) 1729 fi]) 1730fi]) 1731 1732# Test for the ability of xmlto to generate a text target 1733have_xmlto_text=no 1734cat > conftest.xml << "EOF" 1735EOF 1736AS_IF([test "$have_xmlto" = yes], 1737 [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], 1738 [have_xmlto_text=yes], 1739 [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])]) 1740rm -f conftest.xml 1741AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) 1742AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) 1743]) # XORG_WITH_XMLTO 1744 1745# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT]) 1746# -------------------------------------------- 1747# Minimum version: 1.12.0 1748# Minimum version for optional DEFAULT argument: 1.12.0 1749# 1750# XSLT (Extensible Stylesheet Language Transformations) is a declarative, 1751# XML-based language used for the transformation of XML documents. 1752# The xsltproc command line tool is for applying XSLT stylesheets to XML documents. 1753# It is used under the cover by xmlto to generate html files from DocBook/XML. 1754# The XSLT processor is often used as a standalone tool for transformations. 1755# It should not be assumed that this tool is used only to work with documnetation. 1756# When DEFAULT is not specified, --with-xsltproc assumes 'auto'. 1757# 1758# Interface to module: 1759# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation 1760# XSLTPROC: returns the path of the xsltproc program found 1761# returns the path set by the user in the environment 1762# --with-xsltproc: 'yes' user instructs the module to use xsltproc 1763# 'no' user instructs the module not to use xsltproc 1764# have_xsltproc: returns yes if xsltproc found in PATH or no 1765# 1766# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path. 1767# 1768AC_DEFUN([XORG_WITH_XSLTPROC],[ 1769AC_ARG_VAR([XSLTPROC], [Path to xsltproc command]) 1770# Preserves the interface, should it be implemented later 1771m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])]) 1772m4_define([_defopt], m4_default([$2], [auto])) 1773AC_ARG_WITH(xsltproc, 1774 AS_HELP_STRING([--with-xsltproc], 1775 [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]), 1776 [use_xsltproc=$withval], [use_xsltproc=]_defopt) 1777m4_undefine([_defopt]) 1778 1779if test "x$use_xsltproc" = x"auto"; then 1780 AC_PATH_PROG([XSLTPROC], [xsltproc]) 1781 if test "x$XSLTPROC" = "x"; then 1782 AC_MSG_WARN([xsltproc not found - cannot transform XML documents]) 1783 have_xsltproc=no 1784 else 1785 have_xsltproc=yes 1786 fi 1787elif test "x$use_xsltproc" = x"yes" ; then 1788 AC_PATH_PROG([XSLTPROC], [xsltproc]) 1789 if test "x$XSLTPROC" = "x"; then 1790 AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH]) 1791 fi 1792 have_xsltproc=yes 1793elif test "x$use_xsltproc" = x"no" ; then 1794 if test "x$XSLTPROC" != "x"; then 1795 AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified]) 1796 fi 1797 have_xsltproc=no 1798else 1799 AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no']) 1800fi 1801 1802AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes]) 1803]) # XORG_WITH_XSLTPROC 1804 1805# XORG_WITH_PERL([MIN-VERSION], [DEFAULT]) 1806# ---------------------------------------- 1807# Minimum version: 1.15.0 1808# 1809# PERL (Practical Extraction and Report Language) is a language optimized for 1810# scanning arbitrary text files, extracting information from those text files, 1811# and printing reports based on that information. 1812# 1813# When DEFAULT is not specified, --with-perl assumes 'auto'. 1814# 1815# Interface to module: 1816# HAVE_PERL: used in makefiles to conditionally scan text files 1817# PERL: returns the path of the perl program found 1818# returns the path set by the user in the environment 1819# --with-perl: 'yes' user instructs the module to use perl 1820# 'no' user instructs the module not to use perl 1821# have_perl: returns yes if perl found in PATH or no 1822# 1823# If the user sets the value of PERL, AC_PATH_PROG skips testing the path. 1824# 1825AC_DEFUN([XORG_WITH_PERL],[ 1826AC_ARG_VAR([PERL], [Path to perl command]) 1827# Preserves the interface, should it be implemented later 1828m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])]) 1829m4_define([_defopt], m4_default([$2], [auto])) 1830AC_ARG_WITH(perl, 1831 AS_HELP_STRING([--with-perl], 1832 [Use perl for extracting information from files (default: ]_defopt[)]), 1833 [use_perl=$withval], [use_perl=]_defopt) 1834m4_undefine([_defopt]) 1835 1836if test "x$use_perl" = x"auto"; then 1837 AC_PATH_PROG([PERL], [perl]) 1838 if test "x$PERL" = "x"; then 1839 AC_MSG_WARN([perl not found - cannot extract information and report]) 1840 have_perl=no 1841 else 1842 have_perl=yes 1843 fi 1844elif test "x$use_perl" = x"yes" ; then 1845 AC_PATH_PROG([PERL], [perl]) 1846 if test "x$PERL" = "x"; then 1847 AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH]) 1848 fi 1849 have_perl=yes 1850elif test "x$use_perl" = x"no" ; then 1851 if test "x$PERL" != "x"; then 1852 AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified]) 1853 fi 1854 have_perl=no 1855else 1856 AC_MSG_ERROR([--with-perl expects 'yes' or 'no']) 1857fi 1858 1859AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes]) 1860]) # XORG_WITH_PERL 1861 1862# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT]) 1863# ---------------- 1864# Minimum version: 1.5.0 1865# Minimum version for optional DEFAULT argument: 1.11.0 1866# 1867# Documentation tools are not always available on all platforms and sometimes 1868# not at the appropriate level. This macro enables a module to test for the 1869# presence of the tool and obtain it's path in separate variables. Coupled with 1870# the --with-asciidoc option, it allows maximum flexibilty in making decisions 1871# as whether or not to use the asciidoc package. When DEFAULT is not specified, 1872# --with-asciidoc assumes 'auto'. 1873# 1874# Interface to module: 1875# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation 1876# ASCIIDOC: returns the path of the asciidoc program found 1877# returns the path set by the user in the environment 1878# --with-asciidoc: 'yes' user instructs the module to use asciidoc 1879# 'no' user instructs the module not to use asciidoc 1880# 1881# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. 1882# 1883AC_DEFUN([XORG_WITH_ASCIIDOC],[ 1884AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command]) 1885m4_define([_defopt], m4_default([$2], [auto])) 1886AC_ARG_WITH(asciidoc, 1887 AS_HELP_STRING([--with-asciidoc], 1888 [Use asciidoc to regenerate documentation (default: ]_defopt[)]), 1889 [use_asciidoc=$withval], [use_asciidoc=]_defopt) 1890m4_undefine([_defopt]) 1891 1892if test "x$use_asciidoc" = x"auto"; then 1893 AC_PATH_PROG([ASCIIDOC], [asciidoc]) 1894 if test "x$ASCIIDOC" = "x"; then 1895 AC_MSG_WARN([asciidoc not found - documentation targets will be skipped]) 1896 have_asciidoc=no 1897 else 1898 have_asciidoc=yes 1899 fi 1900elif test "x$use_asciidoc" = x"yes" ; then 1901 AC_PATH_PROG([ASCIIDOC], [asciidoc]) 1902 if test "x$ASCIIDOC" = "x"; then 1903 AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH]) 1904 fi 1905 have_asciidoc=yes 1906elif test "x$use_asciidoc" = x"no" ; then 1907 if test "x$ASCIIDOC" != "x"; then 1908 AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified]) 1909 fi 1910 have_asciidoc=no 1911else 1912 AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no']) 1913fi 1914m4_ifval([$1], 1915[if test "$have_asciidoc" = yes; then 1916 # scrape the asciidoc version 1917 AC_MSG_CHECKING([the asciidoc version]) 1918 asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2` 1919 AC_MSG_RESULT([$asciidoc_version]) 1920 AS_VERSION_COMPARE([$asciidoc_version], [$1], 1921 [if test "x$use_asciidoc" = xauto; then 1922 AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed]) 1923 have_asciidoc=no 1924 else 1925 AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed]) 1926 fi]) 1927fi]) 1928AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) 1929]) # XORG_WITH_ASCIIDOC 1930 1931# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT]) 1932# ------------------------------------------- 1933# Minimum version: 1.5.0 1934# Minimum version for optional DEFAULT argument: 1.11.0 1935# Minimum version for optional DOT checking: 1.18.0 1936# 1937# Documentation tools are not always available on all platforms and sometimes 1938# not at the appropriate level. This macro enables a module to test for the 1939# presence of the tool and obtain it's path in separate variables. Coupled with 1940# the --with-doxygen option, it allows maximum flexibilty in making decisions 1941# as whether or not to use the doxygen package. When DEFAULT is not specified, 1942# --with-doxygen assumes 'auto'. 1943# 1944# Interface to module: 1945# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation 1946# DOXYGEN: returns the path of the doxygen program found 1947# returns the path set by the user in the environment 1948# --with-doxygen: 'yes' user instructs the module to use doxygen 1949# 'no' user instructs the module not to use doxygen 1950# 1951# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. 1952# 1953AC_DEFUN([XORG_WITH_DOXYGEN],[ 1954AC_ARG_VAR([DOXYGEN], [Path to doxygen command]) 1955AC_ARG_VAR([DOT], [Path to the dot graphics utility]) 1956m4_define([_defopt], m4_default([$2], [auto])) 1957AC_ARG_WITH(doxygen, 1958 AS_HELP_STRING([--with-doxygen], 1959 [Use doxygen to regenerate documentation (default: ]_defopt[)]), 1960 [use_doxygen=$withval], [use_doxygen=]_defopt) 1961m4_undefine([_defopt]) 1962 1963if test "x$use_doxygen" = x"auto"; then 1964 AC_PATH_PROG([DOXYGEN], [doxygen]) 1965 if test "x$DOXYGEN" = "x"; then 1966 AC_MSG_WARN([doxygen not found - documentation targets will be skipped]) 1967 have_doxygen=no 1968 else 1969 have_doxygen=yes 1970 fi 1971elif test "x$use_doxygen" = x"yes" ; then 1972 AC_PATH_PROG([DOXYGEN], [doxygen]) 1973 if test "x$DOXYGEN" = "x"; then 1974 AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH]) 1975 fi 1976 have_doxygen=yes 1977elif test "x$use_doxygen" = x"no" ; then 1978 if test "x$DOXYGEN" != "x"; then 1979 AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified]) 1980 fi 1981 have_doxygen=no 1982else 1983 AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no']) 1984fi 1985m4_ifval([$1], 1986[if test "$have_doxygen" = yes; then 1987 # scrape the doxygen version 1988 AC_MSG_CHECKING([the doxygen version]) 1989 doxygen_version=`$DOXYGEN --version 2>/dev/null` 1990 AC_MSG_RESULT([$doxygen_version]) 1991 AS_VERSION_COMPARE([$doxygen_version], [$1], 1992 [if test "x$use_doxygen" = xauto; then 1993 AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed]) 1994 have_doxygen=no 1995 else 1996 AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) 1997 fi]) 1998fi]) 1999 2000dnl Check for DOT if we have doxygen. The caller decides if it is mandatory 2001dnl HAVE_DOT is a variable that can be used in your doxygen.in config file: 2002dnl HAVE_DOT = @HAVE_DOT@ 2003HAVE_DOT=no 2004if test "x$have_doxygen" = "xyes"; then 2005 AC_PATH_PROG([DOT], [dot]) 2006 if test "x$DOT" != "x"; then 2007 HAVE_DOT=yes 2008 fi 2009fi 2010 2011AC_SUBST([HAVE_DOT]) 2012AM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"]) 2013AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) 2014]) # XORG_WITH_DOXYGEN 2015 2016# XORG_WITH_GROFF([DEFAULT]) 2017# ---------------- 2018# Minimum version: 1.6.0 2019# Minimum version for optional DEFAULT argument: 1.11.0 2020# 2021# Documentation tools are not always available on all platforms and sometimes 2022# not at the appropriate level. This macro enables a module to test for the 2023# presence of the tool and obtain it's path in separate variables. Coupled with 2024# the --with-groff option, it allows maximum flexibilty in making decisions 2025# as whether or not to use the groff package. When DEFAULT is not specified, 2026# --with-groff assumes 'auto'. 2027# 2028# Interface to module: 2029# HAVE_GROFF: used in makefiles to conditionally generate documentation 2030# HAVE_GROFF_MM: the memorandum macros (-mm) package 2031# HAVE_GROFF_MS: the -ms macros package 2032# GROFF: returns the path of the groff program found 2033# returns the path set by the user in the environment 2034# --with-groff: 'yes' user instructs the module to use groff 2035# 'no' user instructs the module not to use groff 2036# 2037# Added in version 1.9.0: 2038# HAVE_GROFF_HTML: groff has dependencies to output HTML format: 2039# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package. 2040# psselect from the psutils package. 2041# the ghostcript package. Refer to the grohtml man pages 2042# 2043# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path. 2044# 2045# OS and distros often splits groff in a basic and full package, the former 2046# having the groff program and the later having devices, fonts and macros 2047# Checking for the groff executable is not enough. 2048# 2049# If macros are missing, we cannot assume that groff is useless, so we don't 2050# unset HAVE_GROFF or GROFF env variables. 2051# HAVE_GROFF_?? can never be true while HAVE_GROFF is false. 2052# 2053AC_DEFUN([XORG_WITH_GROFF],[ 2054AC_ARG_VAR([GROFF], [Path to groff command]) 2055m4_define([_defopt], m4_default([$1], [auto])) 2056AC_ARG_WITH(groff, 2057 AS_HELP_STRING([--with-groff], 2058 [Use groff to regenerate documentation (default: ]_defopt[)]), 2059 [use_groff=$withval], [use_groff=]_defopt) 2060m4_undefine([_defopt]) 2061 2062if test "x$use_groff" = x"auto"; then 2063 AC_PATH_PROG([GROFF], [groff]) 2064 if test "x$GROFF" = "x"; then 2065 AC_MSG_WARN([groff not found - documentation targets will be skipped]) 2066 have_groff=no 2067 else 2068 have_groff=yes 2069 fi 2070elif test "x$use_groff" = x"yes" ; then 2071 AC_PATH_PROG([GROFF], [groff]) 2072 if test "x$GROFF" = "x"; then 2073 AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH]) 2074 fi 2075 have_groff=yes 2076elif test "x$use_groff" = x"no" ; then 2077 if test "x$GROFF" != "x"; then 2078 AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified]) 2079 fi 2080 have_groff=no 2081else 2082 AC_MSG_ERROR([--with-groff expects 'yes' or 'no']) 2083fi 2084 2085# We have groff, test for the presence of the macro packages 2086if test "x$have_groff" = x"yes"; then 2087 AC_MSG_CHECKING([for ${GROFF} -ms macros]) 2088 if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then 2089 groff_ms_works=yes 2090 else 2091 groff_ms_works=no 2092 fi 2093 AC_MSG_RESULT([$groff_ms_works]) 2094 AC_MSG_CHECKING([for ${GROFF} -mm macros]) 2095 if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then 2096 groff_mm_works=yes 2097 else 2098 groff_mm_works=no 2099 fi 2100 AC_MSG_RESULT([$groff_mm_works]) 2101fi 2102 2103# We have groff, test for HTML dependencies, one command per package 2104if test "x$have_groff" = x"yes"; then 2105 AC_PATH_PROGS(GS_PATH, [gs gswin32c]) 2106 AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng]) 2107 AC_PATH_PROG(PSSELECT_PATH, [psselect]) 2108 if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then 2109 have_groff_html=yes 2110 else 2111 have_groff_html=no 2112 AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages]) 2113 fi 2114fi 2115 2116# Set Automake conditionals for Makefiles 2117AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes]) 2118AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes]) 2119AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes]) 2120AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes]) 2121]) # XORG_WITH_GROFF 2122 2123# XORG_WITH_FOP([MIN-VERSION], [DEFAULT]) 2124# --------------------------------------- 2125# Minimum version: 1.6.0 2126# Minimum version for optional DEFAULT argument: 1.11.0 2127# Minimum version for optional MIN-VERSION argument: 1.15.0 2128# 2129# Documentation tools are not always available on all platforms and sometimes 2130# not at the appropriate level. This macro enables a module to test for the 2131# presence of the tool and obtain it's path in separate variables. Coupled with 2132# the --with-fop option, it allows maximum flexibilty in making decisions 2133# as whether or not to use the fop package. When DEFAULT is not specified, 2134# --with-fop assumes 'auto'. 2135# 2136# Interface to module: 2137# HAVE_FOP: used in makefiles to conditionally generate documentation 2138# FOP: returns the path of the fop program found 2139# returns the path set by the user in the environment 2140# --with-fop: 'yes' user instructs the module to use fop 2141# 'no' user instructs the module not to use fop 2142# 2143# If the user sets the value of FOP, AC_PATH_PROG skips testing the path. 2144# 2145AC_DEFUN([XORG_WITH_FOP],[ 2146AC_ARG_VAR([FOP], [Path to fop command]) 2147m4_define([_defopt], m4_default([$2], [auto])) 2148AC_ARG_WITH(fop, 2149 AS_HELP_STRING([--with-fop], 2150 [Use fop to regenerate documentation (default: ]_defopt[)]), 2151 [use_fop=$withval], [use_fop=]_defopt) 2152m4_undefine([_defopt]) 2153 2154if test "x$use_fop" = x"auto"; then 2155 AC_PATH_PROG([FOP], [fop]) 2156 if test "x$FOP" = "x"; then 2157 AC_MSG_WARN([fop not found - documentation targets will be skipped]) 2158 have_fop=no 2159 else 2160 have_fop=yes 2161 fi 2162elif test "x$use_fop" = x"yes" ; then 2163 AC_PATH_PROG([FOP], [fop]) 2164 if test "x$FOP" = "x"; then 2165 AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH]) 2166 fi 2167 have_fop=yes 2168elif test "x$use_fop" = x"no" ; then 2169 if test "x$FOP" != "x"; then 2170 AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified]) 2171 fi 2172 have_fop=no 2173else 2174 AC_MSG_ERROR([--with-fop expects 'yes' or 'no']) 2175fi 2176 2177# Test for a minimum version of fop, if provided. 2178m4_ifval([$1], 2179[if test "$have_fop" = yes; then 2180 # scrape the fop version 2181 AC_MSG_CHECKING([for fop minimum version]) 2182 fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3` 2183 AC_MSG_RESULT([$fop_version]) 2184 AS_VERSION_COMPARE([$fop_version], [$1], 2185 [if test "x$use_fop" = xauto; then 2186 AC_MSG_WARN([fop version $fop_version found, but $1 needed]) 2187 have_fop=no 2188 else 2189 AC_MSG_ERROR([fop version $fop_version found, but $1 needed]) 2190 fi]) 2191fi]) 2192AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) 2193]) # XORG_WITH_FOP 2194 2195# XORG_WITH_M4([MIN-VERSION]) 2196# --------------------------- 2197# Minimum version: 1.19.0 2198# 2199# This macro attempts to locate an m4 macro processor which supports 2200# -I option and is only useful for modules relying on M4 in order to 2201# expand macros in source code files. 2202# 2203# Interface to module: 2204# M4: returns the path of the m4 program found 2205# returns the path set by the user in the environment 2206# 2207AC_DEFUN([XORG_WITH_M4], [ 2208AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4], 2209 [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4], 2210 [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \ 2211 ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]], 2212 [AC_MSG_ERROR([could not find m4 that supports -I option])], 2213 [$PATH:/usr/gnu/bin])]) 2214 2215AC_SUBST([M4], [$ac_cv_path_M4]) 2216]) # XORG_WITH_M4 2217 2218# XORG_WITH_PS2PDF([DEFAULT]) 2219# ---------------- 2220# Minimum version: 1.6.0 2221# Minimum version for optional DEFAULT argument: 1.11.0 2222# 2223# Documentation tools are not always available on all platforms and sometimes 2224# not at the appropriate level. This macro enables a module to test for the 2225# presence of the tool and obtain it's path in separate variables. Coupled with 2226# the --with-ps2pdf option, it allows maximum flexibilty in making decisions 2227# as whether or not to use the ps2pdf package. When DEFAULT is not specified, 2228# --with-ps2pdf assumes 'auto'. 2229# 2230# Interface to module: 2231# HAVE_PS2PDF: used in makefiles to conditionally generate documentation 2232# PS2PDF: returns the path of the ps2pdf program found 2233# returns the path set by the user in the environment 2234# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf 2235# 'no' user instructs the module not to use ps2pdf 2236# 2237# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path. 2238# 2239AC_DEFUN([XORG_WITH_PS2PDF],[ 2240AC_ARG_VAR([PS2PDF], [Path to ps2pdf command]) 2241m4_define([_defopt], m4_default([$1], [auto])) 2242AC_ARG_WITH(ps2pdf, 2243 AS_HELP_STRING([--with-ps2pdf], 2244 [Use ps2pdf to regenerate documentation (default: ]_defopt[)]), 2245 [use_ps2pdf=$withval], [use_ps2pdf=]_defopt) 2246m4_undefine([_defopt]) 2247 2248if test "x$use_ps2pdf" = x"auto"; then 2249 AC_PATH_PROG([PS2PDF], [ps2pdf]) 2250 if test "x$PS2PDF" = "x"; then 2251 AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped]) 2252 have_ps2pdf=no 2253 else 2254 have_ps2pdf=yes 2255 fi 2256elif test "x$use_ps2pdf" = x"yes" ; then 2257 AC_PATH_PROG([PS2PDF], [ps2pdf]) 2258 if test "x$PS2PDF" = "x"; then 2259 AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH]) 2260 fi 2261 have_ps2pdf=yes 2262elif test "x$use_ps2pdf" = x"no" ; then 2263 if test "x$PS2PDF" != "x"; then 2264 AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified]) 2265 fi 2266 have_ps2pdf=no 2267else 2268 AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no']) 2269fi 2270AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes]) 2271]) # XORG_WITH_PS2PDF 2272 2273# XORG_ENABLE_DOCS (enable_docs=yes) 2274# ---------------- 2275# Minimum version: 1.6.0 2276# 2277# Documentation tools are not always available on all platforms and sometimes 2278# not at the appropriate level. This macro enables a builder to skip all 2279# documentation targets except traditional man pages. 2280# Combined with the specific tool checking macros XORG_WITH_*, it provides 2281# maximum flexibilty in controlling documentation building. 2282# Refer to: 2283# XORG_WITH_XMLTO --with-xmlto 2284# XORG_WITH_ASCIIDOC --with-asciidoc 2285# XORG_WITH_DOXYGEN --with-doxygen 2286# XORG_WITH_FOP --with-fop 2287# XORG_WITH_GROFF --with-groff 2288# XORG_WITH_PS2PDF --with-ps2pdf 2289# 2290# Interface to module: 2291# ENABLE_DOCS: used in makefiles to conditionally generate documentation 2292# --enable-docs: 'yes' user instructs the module to generate docs 2293# 'no' user instructs the module not to generate docs 2294# parm1: specify the default value, yes or no. 2295# 2296AC_DEFUN([XORG_ENABLE_DOCS],[ 2297m4_define([docs_default], m4_default([$1], [yes])) 2298AC_ARG_ENABLE(docs, 2299 AS_HELP_STRING([--enable-docs], 2300 [Enable building the documentation (default: ]docs_default[)]), 2301 [build_docs=$enableval], [build_docs=]docs_default) 2302m4_undefine([docs_default]) 2303AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes]) 2304AC_MSG_CHECKING([whether to build documentation]) 2305AC_MSG_RESULT([$build_docs]) 2306]) # XORG_ENABLE_DOCS 2307 2308# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes) 2309# ---------------- 2310# Minimum version: 1.6.0 2311# 2312# This macro enables a builder to skip all developer documentation. 2313# Combined with the specific tool checking macros XORG_WITH_*, it provides 2314# maximum flexibilty in controlling documentation building. 2315# Refer to: 2316# XORG_WITH_XMLTO --with-xmlto 2317# XORG_WITH_ASCIIDOC --with-asciidoc 2318# XORG_WITH_DOXYGEN --with-doxygen 2319# XORG_WITH_FOP --with-fop 2320# XORG_WITH_GROFF --with-groff 2321# XORG_WITH_PS2PDF --with-ps2pdf 2322# 2323# Interface to module: 2324# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs 2325# --enable-devel-docs: 'yes' user instructs the module to generate developer docs 2326# 'no' user instructs the module not to generate developer docs 2327# parm1: specify the default value, yes or no. 2328# 2329AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[ 2330m4_define([devel_default], m4_default([$1], [yes])) 2331AC_ARG_ENABLE(devel-docs, 2332 AS_HELP_STRING([--enable-devel-docs], 2333 [Enable building the developer documentation (default: ]devel_default[)]), 2334 [build_devel_docs=$enableval], [build_devel_docs=]devel_default) 2335m4_undefine([devel_default]) 2336AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes]) 2337AC_MSG_CHECKING([whether to build developer documentation]) 2338AC_MSG_RESULT([$build_devel_docs]) 2339]) # XORG_ENABLE_DEVEL_DOCS 2340 2341# XORG_ENABLE_SPECS (enable_specs=yes) 2342# ---------------- 2343# Minimum version: 1.6.0 2344# 2345# This macro enables a builder to skip all functional specification targets. 2346# Combined with the specific tool checking macros XORG_WITH_*, it provides 2347# maximum flexibilty in controlling documentation building. 2348# Refer to: 2349# XORG_WITH_XMLTO --with-xmlto 2350# XORG_WITH_ASCIIDOC --with-asciidoc 2351# XORG_WITH_DOXYGEN --with-doxygen 2352# XORG_WITH_FOP --with-fop 2353# XORG_WITH_GROFF --with-groff 2354# XORG_WITH_PS2PDF --with-ps2pdf 2355# 2356# Interface to module: 2357# ENABLE_SPECS: used in makefiles to conditionally generate specs 2358# --enable-specs: 'yes' user instructs the module to generate specs 2359# 'no' user instructs the module not to generate specs 2360# parm1: specify the default value, yes or no. 2361# 2362AC_DEFUN([XORG_ENABLE_SPECS],[ 2363m4_define([spec_default], m4_default([$1], [yes])) 2364AC_ARG_ENABLE(specs, 2365 AS_HELP_STRING([--enable-specs], 2366 [Enable building the specs (default: ]spec_default[)]), 2367 [build_specs=$enableval], [build_specs=]spec_default) 2368m4_undefine([spec_default]) 2369AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes]) 2370AC_MSG_CHECKING([whether to build functional specifications]) 2371AC_MSG_RESULT([$build_specs]) 2372]) # XORG_ENABLE_SPECS 2373 2374# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto) 2375# ---------------------------------------------- 2376# Minimum version: 1.13.0 2377# 2378# This macro enables a builder to enable/disable unit testing 2379# It makes no assumption about the test cases implementation 2380# Test cases may or may not use Automake "Support for test suites" 2381# They may or may not use the software utility library GLib 2382# 2383# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL 2384# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib. 2385# The variable enable_unit_tests is used by other macros in this file. 2386# 2387# Interface to module: 2388# ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests 2389# enable_unit_tests: used in configure.ac for additional configuration 2390# --enable-unit-tests: 'yes' user instructs the module to build tests 2391# 'no' user instructs the module not to build tests 2392# parm1: specify the default value, yes or no. 2393# 2394AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[ 2395AC_BEFORE([$0], [XORG_WITH_GLIB]) 2396AC_BEFORE([$0], [XORG_LD_WRAP]) 2397AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS]) 2398m4_define([_defopt], m4_default([$1], [auto])) 2399AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests], 2400 [Enable building unit test cases (default: ]_defopt[)]), 2401 [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt) 2402m4_undefine([_defopt]) 2403AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno]) 2404AC_MSG_CHECKING([whether to build unit test cases]) 2405AC_MSG_RESULT([$enable_unit_tests]) 2406]) # XORG_ENABLE_UNIT_TESTS 2407 2408# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto) 2409# ------------------------------------------------------ 2410# Minimum version: 1.17.0 2411# 2412# This macro enables a builder to enable/disable integration testing 2413# It makes no assumption about the test cases' implementation 2414# Test cases may or may not use Automake "Support for test suites" 2415# 2416# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support 2417# usually requires less dependencies and may be built and run under less 2418# stringent environments than integration tests. 2419# 2420# Interface to module: 2421# ENABLE_INTEGRATION_TESTS: used in makefiles to conditionally build tests 2422# enable_integration_tests: used in configure.ac for additional configuration 2423# --enable-integration-tests: 'yes' user instructs the module to build tests 2424# 'no' user instructs the module not to build tests 2425# parm1: specify the default value, yes or no. 2426# 2427AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[ 2428AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS]) 2429m4_define([_defopt], m4_default([$1], [auto])) 2430AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests], 2431 [Enable building integration test cases (default: ]_defopt[)]), 2432 [enable_integration_tests=$enableval], 2433 [enable_integration_tests=]_defopt) 2434m4_undefine([_defopt]) 2435AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS], 2436 [test "x$enable_integration_tests" != xno]) 2437AC_MSG_CHECKING([whether to build unit test cases]) 2438AC_MSG_RESULT([$enable_integration_tests]) 2439]) # XORG_ENABLE_INTEGRATION_TESTS 2440 2441# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT]) 2442# ---------------------------------------- 2443# Minimum version: 1.13.0 2444# 2445# GLib is a library which provides advanced data structures and functions. 2446# This macro enables a module to test for the presence of Glib. 2447# 2448# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing. 2449# Otherwise the value of $enable_unit_tests is blank. 2450# 2451# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit 2452# test support usually requires less dependencies and may be built and run under 2453# less stringent environments than integration tests. 2454# 2455# Interface to module: 2456# HAVE_GLIB: used in makefiles to conditionally build targets 2457# with_glib: used in configure.ac to know if GLib has been found 2458# --with-glib: 'yes' user instructs the module to use glib 2459# 'no' user instructs the module not to use glib 2460# 2461AC_DEFUN([XORG_WITH_GLIB],[ 2462AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 2463m4_define([_defopt], m4_default([$2], [auto])) 2464AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib], 2465 [Use GLib library for unit testing (default: ]_defopt[)]), 2466 [with_glib=$withval], [with_glib=]_defopt) 2467m4_undefine([_defopt]) 2468 2469have_glib=no 2470# Do not probe GLib if user explicitly disabled unit testing 2471if test "x$enable_unit_tests" != x"no"; then 2472 # Do not probe GLib if user explicitly disabled it 2473 if test "x$with_glib" != x"no"; then 2474 m4_ifval( 2475 [$1], 2476 [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])], 2477 [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])] 2478 ) 2479 fi 2480fi 2481 2482# Not having GLib when unit testing has been explicitly requested is an error 2483if test "x$enable_unit_tests" = x"yes"; then 2484 if test "x$have_glib" = x"no"; then 2485 AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) 2486 fi 2487fi 2488 2489# Having unit testing disabled when GLib has been explicitly requested is an error 2490if test "x$enable_unit_tests" = x"no"; then 2491 if test "x$with_glib" = x"yes"; then 2492 AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found]) 2493 fi 2494fi 2495 2496# Not having GLib when it has been explicitly requested is an error 2497if test "x$with_glib" = x"yes"; then 2498 if test "x$have_glib" = x"no"; then 2499 AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found]) 2500 fi 2501fi 2502 2503AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes]) 2504]) # XORG_WITH_GLIB 2505 2506# XORG_LD_WRAP([required|optional]) 2507# --------------------------------- 2508# Minimum version: 1.13.0 2509# 2510# Check if linker supports -wrap, passed via compiler flags 2511# 2512# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing. 2513# Otherwise the value of $enable_unit_tests is blank. 2514# 2515# Argument added in 1.16.0 - default is "required", to match existing behavior 2516# of returning an error if enable_unit_tests is yes, and ld -wrap is not 2517# available, an argument of "optional" allows use when some unit tests require 2518# ld -wrap and others do not. 2519# 2520AC_DEFUN([XORG_LD_WRAP],[ 2521XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no], 2522 [AC_LANG_PROGRAM([#include <stdlib.h> 2523 void __wrap_exit(int status) { return; }], 2524 [exit(0);])]) 2525# Not having ld wrap when unit testing has been explicitly requested is an error 2526if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then 2527 if test "x$have_ld_wrap" = x"no"; then 2528 AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available]) 2529 fi 2530fi 2531AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes]) 2532# 2533]) # XORG_LD_WRAP 2534 2535# XORG_CHECK_LINKER_FLAGS 2536# ----------------------- 2537# SYNOPSIS 2538# 2539# XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE]) 2540# 2541# DESCRIPTION 2542# 2543# Check whether the given linker FLAGS work with the current language's 2544# linker, or whether they give an error. 2545# 2546# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on 2547# success/failure. 2548# 2549# PROGRAM-SOURCE is the program source to link with, if needed 2550# 2551# NOTE: Based on AX_CHECK_COMPILER_FLAGS. 2552# 2553# LICENSE 2554# 2555# Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org> 2556# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu> 2557# Copyright (c) 2009 Matteo Frigo 2558# 2559# This program is free software: you can redistribute it and/or modify it 2560# under the terms of the GNU General Public License as published by the 2561# Free Software Foundation, either version 3 of the License, or (at your 2562# option) any later version. 2563# 2564# This program is distributed in the hope that it will be useful, but 2565# WITHOUT ANY WARRANTY; without even the implied warranty of 2566# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 2567# Public License for more details. 2568# 2569# You should have received a copy of the GNU General Public License along 2570# with this program. If not, see <http://www.gnu.org/licenses/>. 2571# 2572# As a special exception, the respective Autoconf Macro's copyright owner 2573# gives unlimited permission to copy, distribute and modify the configure 2574# scripts that are the output of Autoconf when processing the Macro. You 2575# need not follow the terms of the GNU General Public License when using 2576# or distributing such scripts, even though portions of the text of the 2577# Macro appear in them. The GNU General Public License (GPL) does govern 2578# all other use of the material that constitutes the Autoconf Macro. 2579# 2580# This special exception to the GPL applies to versions of the Autoconf 2581# Macro released by the Autoconf Archive. When you make and distribute a 2582# modified version of the Autoconf Macro, you may extend this special 2583# exception to the GPL to apply to your modified version as well.# 2584AC_DEFUN([XORG_CHECK_LINKER_FLAGS], 2585[AC_MSG_CHECKING([whether the linker accepts $1]) 2586dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname: 2587AS_LITERAL_IF([$1], 2588 [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [ 2589 ax_save_FLAGS=$LDFLAGS 2590 LDFLAGS="$1" 2591 AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])], 2592 AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, 2593 AS_TR_SH(xorg_cv_linker_flags_[$1])=no) 2594 LDFLAGS=$ax_save_FLAGS])], 2595 [ax_save_FLAGS=$LDFLAGS 2596 LDFLAGS="$1" 2597 AC_LINK_IFELSE([AC_LANG_PROGRAM()], 2598 eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes, 2599 eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no) 2600 LDFLAGS=$ax_save_FLAGS]) 2601eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1]) 2602AC_MSG_RESULT($xorg_check_linker_flags) 2603if test "x$xorg_check_linker_flags" = xyes; then 2604 m4_default([$2], :) 2605else 2606 m4_default([$3], :) 2607fi 2608]) # XORG_CHECK_LINKER_FLAGS 2609 2610# XORG_MEMORY_CHECK_FLAGS 2611# ----------------------- 2612# Minimum version: 1.16.0 2613# 2614# This macro attempts to find appropriate memory checking functionality 2615# for various platforms which unit testing code may use to catch various 2616# forms of memory allocation and access errors in testing. 2617# 2618# Interface to module: 2619# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging 2620# Usually added to TESTS_ENVIRONMENT in Makefile.am 2621# 2622# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim. 2623# 2624AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[ 2625 2626AC_REQUIRE([AC_CANONICAL_HOST]) 2627AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV], 2628 [Environment variables to enable memory checking in tests]) 2629 2630# Check for different types of support on different platforms 2631case $host_os in 2632 solaris*) 2633 AC_CHECK_LIB([umem], [umem_alloc], 2634 [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default']) 2635 ;; 2636 *-gnu*) # GNU libc - Value is used as a single byte bit pattern, 2637 # both directly and inverted, so should not be 0 or 255. 2638 malloc_debug_env='MALLOC_PERTURB_=15' 2639 ;; 2640 darwin*) 2641 malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib' 2642 ;; 2643 *bsd*) 2644 malloc_debug_env='MallocPreScribble=1 MallocScribble=1' 2645 ;; 2646esac 2647 2648# User supplied flags override default flags 2649if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then 2650 malloc_debug_env="$XORG_MALLOC_DEBUG_ENV" 2651fi 2652 2653AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env]) 2654]) # XORG_WITH_LINT 2655 2656# XORG_CHECK_MALLOC_ZERO 2657# ---------------------- 2658# Minimum version: 1.0.0 2659# 2660# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 2661# malloc(0) returns NULL. Packages should add one of these cflags to 2662# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 2663AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 2664AC_ARG_ENABLE(malloc0returnsnull, 2665 AS_HELP_STRING([--enable-malloc0returnsnull], 2666 [malloc(0) returns NULL (default: auto)]), 2667 [MALLOC_ZERO_RETURNS_NULL=$enableval], 2668 [MALLOC_ZERO_RETURNS_NULL=auto]) 2669 2670AC_MSG_CHECKING([whether malloc(0) returns NULL]) 2671if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 2672AC_CACHE_VAL([xorg_cv_malloc0_returns_null], 2673 [AC_RUN_IFELSE([AC_LANG_PROGRAM([ 2674#include <stdlib.h> 2675],[ 2676 char *m0, *r0, *c0, *p; 2677 m0 = malloc(0); 2678 p = malloc(10); 2679 r0 = realloc(p,0); 2680 c0 = calloc(0,10); 2681 exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1); 2682])], 2683 [xorg_cv_malloc0_returns_null=yes], 2684 [xorg_cv_malloc0_returns_null=no])]) 2685MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null 2686fi 2687AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 2688 2689if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 2690 MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 2691 XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 2692 XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 2693else 2694 MALLOC_ZERO_CFLAGS="" 2695 XMALLOC_ZERO_CFLAGS="" 2696 XTMALLOC_ZERO_CFLAGS="" 2697fi 2698 2699AC_SUBST([MALLOC_ZERO_CFLAGS]) 2700AC_SUBST([XMALLOC_ZERO_CFLAGS]) 2701AC_SUBST([XTMALLOC_ZERO_CFLAGS]) 2702]) # XORG_CHECK_MALLOC_ZERO 2703 2704# XORG_WITH_LINT() 2705# ---------------- 2706# Minimum version: 1.1.0 2707# 2708# This macro enables the use of a tool that flags some suspicious and 2709# non-portable constructs (likely to be bugs) in C language source code. 2710# It will attempt to locate the tool and use appropriate options. 2711# There are various lint type tools on different platforms. 2712# 2713# Interface to module: 2714# LINT: returns the path to the tool found on the platform 2715# or the value set to LINT on the configure cmd line 2716# also an Automake conditional 2717# LINT_FLAGS: an Automake variable with appropriate flags 2718# 2719# --with-lint: 'yes' user instructs the module to use lint 2720# 'no' user instructs the module not to use lint (default) 2721# 2722# If the user sets the value of LINT, AC_PATH_PROG skips testing the path. 2723# If the user sets the value of LINT_FLAGS, they are used verbatim. 2724# 2725AC_DEFUN([XORG_WITH_LINT],[ 2726 2727AC_ARG_VAR([LINT], [Path to a lint-style command]) 2728AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command]) 2729AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint], 2730 [Use a lint-style source code checker (default: disabled)])], 2731 [use_lint=$withval], [use_lint=no]) 2732 2733# Obtain platform specific info like program name and options 2734# The lint program on FreeBSD and NetBSD is different from the one on Solaris 2735case $host_os in 2736 *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*) 2737 lint_name=splint 2738 lint_options="-badflag" 2739 ;; 2740 *freebsd* | *netbsd*) 2741 lint_name=lint 2742 lint_options="-u -b" 2743 ;; 2744 *solaris*) 2745 lint_name=lint 2746 lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" 2747 ;; 2748esac 2749 2750# Test for the presence of the program (either guessed by the code or spelled out by the user) 2751if test "x$use_lint" = x"yes" ; then 2752 AC_PATH_PROG([LINT], [$lint_name]) 2753 if test "x$LINT" = "x"; then 2754 AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH]) 2755 fi 2756elif test "x$use_lint" = x"no" ; then 2757 if test "x$LINT" != "x"; then 2758 AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified]) 2759 fi 2760else 2761 AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.]) 2762fi 2763 2764# User supplied flags override default flags 2765if test "x$LINT_FLAGS" != "x"; then 2766 lint_options=$LINT_FLAGS 2767fi 2768 2769AC_SUBST([LINT_FLAGS],[$lint_options]) 2770AM_CONDITIONAL(LINT, [test "x$LINT" != x]) 2771 2772]) # XORG_WITH_LINT 2773 2774# XORG_LINT_LIBRARY(LIBNAME) 2775# -------------------------- 2776# Minimum version: 1.1.0 2777# 2778# Sets up flags for building lint libraries for checking programs that call 2779# functions in the library. 2780# 2781# Interface to module: 2782# LINTLIB - Automake variable with the name of lint library file to make 2783# MAKE_LINT_LIB - Automake conditional 2784# 2785# --enable-lint-library: - 'yes' user instructs the module to created a lint library 2786# - 'no' user instructs the module not to create a lint library (default) 2787 2788AC_DEFUN([XORG_LINT_LIBRARY],[ 2789AC_REQUIRE([XORG_WITH_LINT]) 2790AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library], 2791 [Create lint library (default: disabled)])], 2792 [make_lint_lib=$enableval], [make_lint_lib=no]) 2793 2794if test "x$make_lint_lib" = x"yes" ; then 2795 LINTLIB=llib-l$1.ln 2796 if test "x$LINT" = "x"; then 2797 AC_MSG_ERROR([Cannot make lint library without --with-lint]) 2798 fi 2799elif test "x$make_lint_lib" != x"no" ; then 2800 AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.]) 2801fi 2802 2803AC_SUBST(LINTLIB) 2804AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) 2805 2806]) # XORG_LINT_LIBRARY 2807 2808# XORG_COMPILER_BRAND 2809# ------------------- 2810# Minimum version: 1.14.0 2811# 2812# Checks for various brands of compilers and sets flags as appropriate: 2813# GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes" 2814# GNU g++ - relies on AC_PROG_CXX to set GXX to "yes" 2815# clang compiler - sets CLANGCC to "yes" 2816# Intel compiler - sets INTELCC to "yes" 2817# Sun/Oracle Solaris Studio cc - sets SUNCC to "yes" 2818# 2819AC_DEFUN([XORG_COMPILER_BRAND], [ 2820AC_LANG_CASE( 2821 [C], [ 2822 AC_REQUIRE([AC_PROG_CC_C99]) 2823 ], 2824 [C++], [ 2825 AC_REQUIRE([AC_PROG_CXX]) 2826 ] 2827) 2828AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"]) 2829AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"]) 2830AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 2831]) # XORG_COMPILER_BRAND 2832 2833# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...]) 2834# --------------- 2835# Minimum version: 1.16.0 2836# 2837# Test if the compiler works when passed the given flag as a command line argument. 2838# If it succeeds, the flag is appeneded to the given variable. If not, it tries the 2839# next flag in the list until there are no more options. 2840# 2841# Note that this does not guarantee that the compiler supports the flag as some 2842# compilers will simply ignore arguments that they do not understand, but we do 2843# attempt to weed out false positives by using -Werror=unknown-warning-option and 2844# -Werror=unused-command-line-argument 2845# 2846AC_DEFUN([XORG_TESTSET_CFLAG], [ 2847m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])]) 2848m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])]) 2849 2850AC_LANG_COMPILER_REQUIRE 2851 2852AC_LANG_CASE( 2853 [C], [ 2854 AC_REQUIRE([AC_PROG_CC_C99]) 2855 define([PREFIX], [C]) 2856 define([CACHE_PREFIX], [cc]) 2857 define([COMPILER], [$CC]) 2858 ], 2859 [C++], [ 2860 define([PREFIX], [CXX]) 2861 define([CACHE_PREFIX], [cxx]) 2862 define([COMPILER], [$CXX]) 2863 ] 2864) 2865 2866[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]" 2867 2868if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then 2869 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" 2870 AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option], 2871 [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option], 2872 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], 2873 [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes], 2874 [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no])) 2875 [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option] 2876 PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" 2877fi 2878 2879if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then 2880 if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then 2881 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" 2882 fi 2883 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument" 2884 AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument], 2885 [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument], 2886 AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], 2887 [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes], 2888 [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no])) 2889 [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument] 2890 PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" 2891fi 2892 2893found="no" 2894m4_foreach([flag], m4_cdr($@), [ 2895 if test $found = "no" ; then 2896 if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then 2897 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" 2898 fi 2899 2900 if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then 2901 PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument" 2902 fi 2903 2904 PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag[" 2905 2906dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname 2907 AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[]) 2908 cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[]) 2909 AC_CACHE_VAL($cacheid, 2910 [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])], 2911 [eval $cacheid=yes], 2912 [eval $cacheid=no])]) 2913 2914 PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]" 2915 2916 eval supported=\$$cacheid 2917 AC_MSG_RESULT([$supported]) 2918 if test "$supported" = "yes" ; then 2919 $1="$$1 ]flag[" 2920 found="yes" 2921 fi 2922 fi 2923]) 2924]) # XORG_TESTSET_CFLAG 2925 2926# XORG_COMPILER_FLAGS 2927# --------------- 2928# Minimum version: 1.16.0 2929# 2930# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line 2931# arguments supported by the selected compiler which do NOT alter the generated 2932# code. These arguments will cause the compiler to print various warnings 2933# during compilation AND turn a conservative set of warnings into errors. 2934# 2935# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in 2936# future versions of util-macros as options are added to new compilers. 2937# 2938AC_DEFUN([XORG_COMPILER_FLAGS], [ 2939AC_REQUIRE([XORG_COMPILER_BRAND]) 2940 2941AC_ARG_ENABLE(selective-werror, 2942 AS_HELP_STRING([--disable-selective-werror], 2943 [Turn off selective compiler errors. (default: enabled)]), 2944 [SELECTIVE_WERROR=$enableval], 2945 [SELECTIVE_WERROR=yes]) 2946 2947AC_LANG_CASE( 2948 [C], [ 2949 define([PREFIX], [C]) 2950 ], 2951 [C++], [ 2952 define([PREFIX], [CXX]) 2953 ] 2954) 2955# -v is too short to test reliably with XORG_TESTSET_CFLAG 2956if test "x$SUNCC" = "xyes"; then 2957 [BASE_]PREFIX[FLAGS]="-v" 2958else 2959 [BASE_]PREFIX[FLAGS]="" 2960fi 2961 2962# This chunk of warnings were those that existed in the legacy CWARNFLAGS 2963XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall]) 2964XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith]) 2965XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations]) 2966XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat]) 2967 2968AC_LANG_CASE( 2969 [C], [ 2970 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes]) 2971 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes]) 2972 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs]) 2973 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast]) 2974 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd]) 2975 XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement]) 2976 ] 2977) 2978 2979# This chunk adds additional warnings that could catch undesired effects. 2980XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused]) 2981XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized]) 2982XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow]) 2983XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn]) 2984XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute]) 2985XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls]) 2986XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op]) 2987 2988# These are currently disabled because they are noisy. They will be enabled 2989# in the future once the codebase is sufficiently modernized to silence 2990# them. For now, I don't want them to drown out the other warnings. 2991# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses]) 2992# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) 2993# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual]) 2994 2995# Turn some warnings into errors, so we don't accidently get successful builds 2996# when there are problems that should be fixed. 2997 2998if test "x$SELECTIVE_WERROR" = "xyes" ; then 2999XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED]) 3000XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull]) 3001XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self]) 3002XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main]) 3003XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces]) 3004XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point]) 3005XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT]) 3006XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs]) 3007XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds]) 3008XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings]) 3009XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address]) 3010XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION]) 3011XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION 3012else 3013AC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT]) 3014XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit]) 3015XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull]) 3016XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self]) 3017XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain]) 3018XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces]) 3019XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point]) 3020XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type]) 3021XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs]) 3022XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds]) 3023XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings]) 3024XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress]) 3025XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast]) 3026XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast]) 3027fi 3028 3029AC_SUBST([BASE_]PREFIX[FLAGS]) 3030]) # XORG_COMPILER_FLAGS 3031 3032# XORG_CWARNFLAGS 3033# --------------- 3034# Minimum version: 1.2.0 3035# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead) 3036# 3037# Defines CWARNFLAGS to enable C compiler warnings. 3038# 3039# This function is deprecated because it defines -fno-strict-aliasing 3040# which alters the code generated by the compiler. If -fno-strict-aliasing 3041# is needed, then it should be added explicitly in the module when 3042# it is updated to use BASE_CFLAGS. 3043# 3044AC_DEFUN([XORG_CWARNFLAGS], [ 3045AC_REQUIRE([XORG_COMPILER_FLAGS]) 3046AC_REQUIRE([XORG_COMPILER_BRAND]) 3047AC_LANG_CASE( 3048 [C], [ 3049 CWARNFLAGS="$BASE_CFLAGS" 3050 if test "x$GCC" = xyes ; then 3051 CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing" 3052 fi 3053 AC_SUBST(CWARNFLAGS) 3054 ] 3055) 3056]) # XORG_CWARNFLAGS 3057 3058# XORG_STRICT_OPTION 3059# ----------------------- 3060# Minimum version: 1.3.0 3061# 3062# Add configure option to enable strict compilation flags, such as treating 3063# warnings as fatal errors. 3064# If --enable-strict-compilation is passed to configure, adds strict flags to 3065# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS. 3066# 3067# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or 3068# when strict compilation is unconditionally desired. 3069AC_DEFUN([XORG_STRICT_OPTION], [ 3070AC_REQUIRE([XORG_CWARNFLAGS]) 3071AC_REQUIRE([XORG_COMPILER_FLAGS]) 3072 3073AC_ARG_ENABLE(strict-compilation, 3074 AS_HELP_STRING([--enable-strict-compilation], 3075 [Enable all warnings from compiler and make them errors (default: disabled)]), 3076 [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no]) 3077 3078AC_LANG_CASE( 3079 [C], [ 3080 define([PREFIX], [C]) 3081 ], 3082 [C++], [ 3083 define([PREFIX], [CXX]) 3084 ] 3085) 3086 3087[STRICT_]PREFIX[FLAGS]="" 3088XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic]) 3089XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn]) 3090 3091# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not 3092# activate it with -Werror, so we add it here explicitly. 3093XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes]) 3094 3095if test "x$STRICT_COMPILE" = "xyes"; then 3096 [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]" 3097 AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"]) 3098fi 3099AC_SUBST([STRICT_]PREFIX[FLAGS]) 3100AC_SUBST([BASE_]PREFIX[FLAGS]) 3101AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS])) 3102]) # XORG_STRICT_OPTION 3103 3104# XORG_DEFAULT_OPTIONS 3105# -------------------- 3106# Minimum version: 1.3.0 3107# 3108# Defines default options for X.Org modules. 3109# 3110AC_DEFUN([XORG_DEFAULT_OPTIONS], [ 3111AC_REQUIRE([AC_PROG_INSTALL]) 3112XORG_COMPILER_FLAGS 3113XORG_CWARNFLAGS 3114XORG_STRICT_OPTION 3115XORG_RELEASE_VERSION 3116XORG_CHANGELOG 3117XORG_INSTALL 3118XORG_MANPAGE_SECTIONS 3119m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], 3120 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) 3121]) # XORG_DEFAULT_OPTIONS 3122 3123# XORG_INSTALL() 3124# ---------------- 3125# Minimum version: 1.4.0 3126# 3127# Defines the variable INSTALL_CMD as the command to copy 3128# INSTALL from $prefix/share/util-macros. 3129# 3130AC_DEFUN([XORG_INSTALL], [ 3131AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 3132macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` 3133INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ 3134mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ 3135|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ 3136echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" 3137AC_SUBST([INSTALL_CMD]) 3138]) # XORG_INSTALL 3139dnl Copyright 2005 Red Hat, Inc 3140dnl 3141dnl Permission to use, copy, modify, distribute, and sell this software and its 3142dnl documentation for any purpose is hereby granted without fee, provided that 3143dnl the above copyright notice appear in all copies and that both that 3144dnl copyright notice and this permission notice appear in supporting 3145dnl documentation. 3146dnl 3147dnl The above copyright notice and this permission notice shall be included 3148dnl in all copies or substantial portions of the Software. 3149dnl 3150dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 3151dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 3152dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 3153dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 3154dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 3155dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 3156dnl OTHER DEALINGS IN THE SOFTWARE. 3157dnl 3158dnl Except as contained in this notice, the name of the copyright holders shall 3159dnl not be used in advertising or otherwise to promote the sale, use or 3160dnl other dealings in this Software without prior written authorization 3161dnl from the copyright holders. 3162dnl 3163 3164# XORG_RELEASE_VERSION 3165# -------------------- 3166# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. 3167 3168AC_DEFUN([XORG_RELEASE_VERSION],[ 3169 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], 3170 [`echo $PACKAGE_VERSION | cut -d . -f 1`], 3171 [Major version of this package]) 3172 PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` 3173 if test "x$PVM" = "x"; then 3174 PVM="0" 3175 fi 3176 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], 3177 [$PVM], 3178 [Minor version of this package]) 3179 PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` 3180 if test "x$PVP" = "x"; then 3181 PVP="0" 3182 fi 3183 AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], 3184 [$PVP], 3185 [Patch version of this package]) 3186]) 3187 3188# XORG_CHANGELOG() 3189# ---------------- 3190# Minimum version: 1.2.0 3191# 3192# Defines the variable CHANGELOG_CMD as the command to generate 3193# ChangeLog from git. 3194# 3195# 3196AC_DEFUN([XORG_CHANGELOG], [ 3197CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ 3198mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ 3199|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ 3200echo 'git directory not found: installing possibly empty changelog.' >&2)" 3201AC_SUBST([CHANGELOG_CMD]) 3202]) # XORG_CHANGELOG 3203 3204