aclocal.m4 revision 5bd32fd1
15bd32fd1Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*- 28b22bf3fSmrg 38b22bf3fSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 496a81b41Smrg# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 58b22bf3fSmrg# This file is free software; the Free Software Foundation 68b22bf3fSmrg# gives unlimited permission to copy and/or distribute it, 78b22bf3fSmrg# with or without modifications, as long as this notice is preserved. 88b22bf3fSmrg 98b22bf3fSmrg# This program is distributed in the hope that it will be useful, 108b22bf3fSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 118b22bf3fSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 128b22bf3fSmrg# PARTICULAR PURPOSE. 138b22bf3fSmrg 1496a81b41Smrgm4_ifndef([AC_AUTOCONF_VERSION], 1596a81b41Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 165bd32fd1Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, 175bd32fd1Smrg[m4_warning([this file was generated for autoconf 2.68. 1896a81b41SmrgYou have another version of autoconf. It may work, but is not guaranteed to. 1996a81b41SmrgIf you have problems, you may need to regenerate the build system entirely. 2096a81b41SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])]) 218b22bf3fSmrg 2296a81b41Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 238b22bf3fSmrg# 248b22bf3fSmrg# This file is free software; the Free Software Foundation 258b22bf3fSmrg# gives unlimited permission to copy and/or distribute it, 268b22bf3fSmrg# with or without modifications, as long as this notice is preserved. 278b22bf3fSmrg 288b22bf3fSmrg# AM_AUTOMAKE_VERSION(VERSION) 298b22bf3fSmrg# ---------------------------- 308b22bf3fSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been 318b22bf3fSmrg# generated from the m4 files accompanying Automake X.Y. 328b22bf3fSmrg# (This private macro should not be called outside this file.) 338b22bf3fSmrgAC_DEFUN([AM_AUTOMAKE_VERSION], 3496a81b41Smrg[am__api_version='1.11' 358b22bf3fSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 368b22bf3fSmrgdnl require some minimum version. Point them to the right macro. 375bd32fd1Smrgm4_if([$1], [1.11.1], [], 388b22bf3fSmrg [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 398b22bf3fSmrg]) 408b22bf3fSmrg 418b22bf3fSmrg# _AM_AUTOCONF_VERSION(VERSION) 428b22bf3fSmrg# ----------------------------- 438b22bf3fSmrg# aclocal traces this macro to find the Autoconf version. 448b22bf3fSmrg# This is a private macro too. Using m4_define simplifies 458b22bf3fSmrg# the logic in aclocal, which can simply ignore this definition. 468b22bf3fSmrgm4_define([_AM_AUTOCONF_VERSION], []) 478b22bf3fSmrg 488b22bf3fSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION 498b22bf3fSmrg# ------------------------------- 508b22bf3fSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 5196a81b41Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 528b22bf3fSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 535bd32fd1Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl 5496a81b41Smrgm4_ifndef([AC_AUTOCONF_VERSION], 5596a81b41Smrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 5696a81b41Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 578b22bf3fSmrg 588b22bf3fSmrg# AM_AUX_DIR_EXPAND -*- Autoconf -*- 598b22bf3fSmrg 608b22bf3fSmrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 618b22bf3fSmrg# 628b22bf3fSmrg# This file is free software; the Free Software Foundation 638b22bf3fSmrg# gives unlimited permission to copy and/or distribute it, 648b22bf3fSmrg# with or without modifications, as long as this notice is preserved. 658b22bf3fSmrg 668b22bf3fSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 678b22bf3fSmrg# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 688b22bf3fSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'. 698b22bf3fSmrg# 708b22bf3fSmrg# Of course, Automake must honor this variable whenever it calls a 718b22bf3fSmrg# tool from the auxiliary directory. The problem is that $srcdir (and 728b22bf3fSmrg# therefore $ac_aux_dir as well) can be either absolute or relative, 738b22bf3fSmrg# depending on how configure is run. This is pretty annoying, since 748b22bf3fSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top 758b22bf3fSmrg# source directory, any form will work fine, but in subdirectories a 768b22bf3fSmrg# relative path needs to be adjusted first. 778b22bf3fSmrg# 788b22bf3fSmrg# $ac_aux_dir/missing 798b22bf3fSmrg# fails when called from a subdirectory if $ac_aux_dir is relative 808b22bf3fSmrg# $top_srcdir/$ac_aux_dir/missing 818b22bf3fSmrg# fails if $ac_aux_dir is absolute, 828b22bf3fSmrg# fails when called from a subdirectory in a VPATH build with 838b22bf3fSmrg# a relative $ac_aux_dir 848b22bf3fSmrg# 858b22bf3fSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 868b22bf3fSmrg# are both prefixed by $srcdir. In an in-source build this is usually 878b22bf3fSmrg# harmless because $srcdir is `.', but things will broke when you 888b22bf3fSmrg# start a VPATH build or use an absolute $srcdir. 898b22bf3fSmrg# 908b22bf3fSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 918b22bf3fSmrg# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 928b22bf3fSmrg# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 938b22bf3fSmrg# and then we would define $MISSING as 948b22bf3fSmrg# MISSING="\${SHELL} $am_aux_dir/missing" 958b22bf3fSmrg# This will work as long as MISSING is not called from configure, because 968b22bf3fSmrg# unfortunately $(top_srcdir) has no meaning in configure. 978b22bf3fSmrg# However there are other variables, like CC, which are often used in 988b22bf3fSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir. 998b22bf3fSmrg# 1008b22bf3fSmrg# Another solution, used here, is to always expand $ac_aux_dir to an 1018b22bf3fSmrg# absolute PATH. The drawback is that using absolute paths prevent a 1028b22bf3fSmrg# configured tree to be moved without reconfiguration. 1038b22bf3fSmrg 1048b22bf3fSmrgAC_DEFUN([AM_AUX_DIR_EXPAND], 1058b22bf3fSmrg[dnl Rely on autoconf to set up CDPATH properly. 1068b22bf3fSmrgAC_PREREQ([2.50])dnl 1078b22bf3fSmrg# expand $ac_aux_dir to an absolute path 1088b22bf3fSmrgam_aux_dir=`cd $ac_aux_dir && pwd` 1098b22bf3fSmrg]) 1108b22bf3fSmrg 1118b22bf3fSmrg# AM_CONDITIONAL -*- Autoconf -*- 1128b22bf3fSmrg 11396a81b41Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 1148b22bf3fSmrg# Free Software Foundation, Inc. 1158b22bf3fSmrg# 1168b22bf3fSmrg# This file is free software; the Free Software Foundation 1178b22bf3fSmrg# gives unlimited permission to copy and/or distribute it, 1188b22bf3fSmrg# with or without modifications, as long as this notice is preserved. 1198b22bf3fSmrg 12096a81b41Smrg# serial 9 1218b22bf3fSmrg 1228b22bf3fSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION) 1238b22bf3fSmrg# ------------------------------------- 1248b22bf3fSmrg# Define a conditional. 1258b22bf3fSmrgAC_DEFUN([AM_CONDITIONAL], 1268b22bf3fSmrg[AC_PREREQ(2.52)dnl 1278b22bf3fSmrg ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 1288b22bf3fSmrg [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 1298b22bf3fSmrgAC_SUBST([$1_TRUE])dnl 1308b22bf3fSmrgAC_SUBST([$1_FALSE])dnl 1318b22bf3fSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl 1328b22bf3fSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl 13396a81b41Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl 1348b22bf3fSmrgif $2; then 1358b22bf3fSmrg $1_TRUE= 1368b22bf3fSmrg $1_FALSE='#' 1378b22bf3fSmrgelse 1388b22bf3fSmrg $1_TRUE='#' 1398b22bf3fSmrg $1_FALSE= 1408b22bf3fSmrgfi 1418b22bf3fSmrgAC_CONFIG_COMMANDS_PRE( 1428b22bf3fSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 1438b22bf3fSmrg AC_MSG_ERROR([[conditional "$1" was never defined. 1448b22bf3fSmrgUsually this means the macro was only invoked conditionally.]]) 1458b22bf3fSmrgfi])]) 1468b22bf3fSmrg 14796a81b41Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 1488b22bf3fSmrg# Free Software Foundation, Inc. 1498b22bf3fSmrg# 1508b22bf3fSmrg# This file is free software; the Free Software Foundation 1518b22bf3fSmrg# gives unlimited permission to copy and/or distribute it, 1528b22bf3fSmrg# with or without modifications, as long as this notice is preserved. 1538b22bf3fSmrg 15496a81b41Smrg# serial 10 1558b22bf3fSmrg 1568b22bf3fSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 1578b22bf3fSmrg# written in clear, in which case automake, when reading aclocal.m4, 1588b22bf3fSmrg# will think it sees a *use*, and therefore will trigger all it's 1598b22bf3fSmrg# C support machinery. Also note that it means that autoscan, seeing 1608b22bf3fSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 1618b22bf3fSmrg 1628b22bf3fSmrg 1638b22bf3fSmrg# _AM_DEPENDENCIES(NAME) 1648b22bf3fSmrg# ---------------------- 1658b22bf3fSmrg# See how the compiler implements dependency checking. 1668b22bf3fSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC". 1678b22bf3fSmrg# We try a few techniques and use that to set a single cache variable. 1688b22bf3fSmrg# 1698b22bf3fSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 1708b22bf3fSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 1718b22bf3fSmrg# dependency, and given that the user is not expected to run this macro, 1728b22bf3fSmrg# just rely on AC_PROG_CC. 1738b22bf3fSmrgAC_DEFUN([_AM_DEPENDENCIES], 1748b22bf3fSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl 1758b22bf3fSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 1768b22bf3fSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl 1778b22bf3fSmrgAC_REQUIRE([AM_DEP_TRACK])dnl 1788b22bf3fSmrg 1798b22bf3fSmrgifelse([$1], CC, [depcc="$CC" am_compiler_list=], 1808b22bf3fSmrg [$1], CXX, [depcc="$CXX" am_compiler_list=], 1818b22bf3fSmrg [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 1828b22bf3fSmrg [$1], UPC, [depcc="$UPC" am_compiler_list=], 1838b22bf3fSmrg [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 1848b22bf3fSmrg [depcc="$$1" am_compiler_list=]) 1858b22bf3fSmrg 1868b22bf3fSmrgAC_CACHE_CHECK([dependency style of $depcc], 1878b22bf3fSmrg [am_cv_$1_dependencies_compiler_type], 1888b22bf3fSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 1898b22bf3fSmrg # We make a subdir and do the tests there. Otherwise we can end up 1908b22bf3fSmrg # making bogus files that we don't know about and never remove. For 1918b22bf3fSmrg # instance it was reported that on HP-UX the gcc test will end up 1928b22bf3fSmrg # making a dummy file named `D' -- because `-MD' means `put the output 1938b22bf3fSmrg # in D'. 1948b22bf3fSmrg mkdir conftest.dir 1958b22bf3fSmrg # Copy depcomp to subdir because otherwise we won't find it if we're 1968b22bf3fSmrg # using a relative directory. 1978b22bf3fSmrg cp "$am_depcomp" conftest.dir 1988b22bf3fSmrg cd conftest.dir 1998b22bf3fSmrg # We will build objects and dependencies in a subdirectory because 2008b22bf3fSmrg # it helps to detect inapplicable dependency modes. For instance 2018b22bf3fSmrg # both Tru64's cc and ICC support -MD to output dependencies as a 2028b22bf3fSmrg # side effect of compilation, but ICC will put the dependencies in 2038b22bf3fSmrg # the current directory while Tru64 will put them in the object 2048b22bf3fSmrg # directory. 2058b22bf3fSmrg mkdir sub 2068b22bf3fSmrg 2078b22bf3fSmrg am_cv_$1_dependencies_compiler_type=none 2088b22bf3fSmrg if test "$am_compiler_list" = ""; then 2098b22bf3fSmrg am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 2108b22bf3fSmrg fi 21196a81b41Smrg am__universal=false 21296a81b41Smrg m4_case([$1], [CC], 21396a81b41Smrg [case " $depcc " in #( 21496a81b41Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 21596a81b41Smrg esac], 21696a81b41Smrg [CXX], 21796a81b41Smrg [case " $depcc " in #( 21896a81b41Smrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 21996a81b41Smrg esac]) 22096a81b41Smrg 2218b22bf3fSmrg for depmode in $am_compiler_list; do 2228b22bf3fSmrg # Setup a source with many dependencies, because some compilers 2238b22bf3fSmrg # like to wrap large dependency lists on column 80 (with \), and 2248b22bf3fSmrg # we should not choose a depcomp mode which is confused by this. 2258b22bf3fSmrg # 2268b22bf3fSmrg # We need to recreate these files for each test, as the compiler may 2278b22bf3fSmrg # overwrite some of them when testing with obscure command lines. 2288b22bf3fSmrg # This happens at least with the AIX C compiler. 2298b22bf3fSmrg : > sub/conftest.c 2308b22bf3fSmrg for i in 1 2 3 4 5 6; do 2318b22bf3fSmrg echo '#include "conftst'$i'.h"' >> sub/conftest.c 2328b22bf3fSmrg # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with 2338b22bf3fSmrg # Solaris 8's {/usr,}/bin/sh. 2348b22bf3fSmrg touch sub/conftst$i.h 2358b22bf3fSmrg done 2368b22bf3fSmrg echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 2378b22bf3fSmrg 23896a81b41Smrg # We check with `-c' and `-o' for the sake of the "dashmstdout" 23996a81b41Smrg # mode. It turns out that the SunPro C++ compiler does not properly 24096a81b41Smrg # handle `-M -o', and we need to detect this. Also, some Intel 24196a81b41Smrg # versions had trouble with output in subdirs 24296a81b41Smrg am__obj=sub/conftest.${OBJEXT-o} 24396a81b41Smrg am__minus_obj="-o $am__obj" 2448b22bf3fSmrg case $depmode in 24596a81b41Smrg gcc) 24696a81b41Smrg # This depmode causes a compiler race in universal mode. 24796a81b41Smrg test "$am__universal" = false || continue 24896a81b41Smrg ;; 2498b22bf3fSmrg nosideeffect) 2508b22bf3fSmrg # after this tag, mechanisms are not by side-effect, so they'll 2518b22bf3fSmrg # only be used when explicitly requested 2528b22bf3fSmrg if test "x$enable_dependency_tracking" = xyes; then 2538b22bf3fSmrg continue 2548b22bf3fSmrg else 2558b22bf3fSmrg break 2568b22bf3fSmrg fi 2578b22bf3fSmrg ;; 25896a81b41Smrg msvisualcpp | msvcmsys) 25996a81b41Smrg # This compiler won't grok `-c -o', but also, the minuso test has 26096a81b41Smrg # not run yet. These depmodes are late enough in the game, and 26196a81b41Smrg # so weak that their functioning should not be impacted. 26296a81b41Smrg am__obj=conftest.${OBJEXT-o} 26396a81b41Smrg am__minus_obj= 26496a81b41Smrg ;; 2658b22bf3fSmrg none) break ;; 2668b22bf3fSmrg esac 2678b22bf3fSmrg if depmode=$depmode \ 26896a81b41Smrg source=sub/conftest.c object=$am__obj \ 2698b22bf3fSmrg depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 27096a81b41Smrg $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 2718b22bf3fSmrg >/dev/null 2>conftest.err && 2728b22bf3fSmrg grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 2738b22bf3fSmrg grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 27496a81b41Smrg grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 2758b22bf3fSmrg ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 2768b22bf3fSmrg # icc doesn't choke on unknown options, it will just issue warnings 2778b22bf3fSmrg # or remarks (even with -Werror). So we grep stderr for any message 2788b22bf3fSmrg # that says an option was ignored or not supported. 2798b22bf3fSmrg # When given -MP, icc 7.0 and 7.1 complain thusly: 2808b22bf3fSmrg # icc: Command line warning: ignoring option '-M'; no argument required 2818b22bf3fSmrg # The diagnosis changed in icc 8.0: 2828b22bf3fSmrg # icc: Command line remark: option '-MP' not supported 2838b22bf3fSmrg if (grep 'ignoring option' conftest.err || 2848b22bf3fSmrg grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 2858b22bf3fSmrg am_cv_$1_dependencies_compiler_type=$depmode 2868b22bf3fSmrg break 2878b22bf3fSmrg fi 2888b22bf3fSmrg fi 2898b22bf3fSmrg done 2908b22bf3fSmrg 2918b22bf3fSmrg cd .. 2928b22bf3fSmrg rm -rf conftest.dir 2938b22bf3fSmrgelse 2948b22bf3fSmrg am_cv_$1_dependencies_compiler_type=none 2958b22bf3fSmrgfi 2968b22bf3fSmrg]) 2978b22bf3fSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 2988b22bf3fSmrgAM_CONDITIONAL([am__fastdep$1], [ 2998b22bf3fSmrg test "x$enable_dependency_tracking" != xno \ 3008b22bf3fSmrg && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 3018b22bf3fSmrg]) 3028b22bf3fSmrg 3038b22bf3fSmrg 3048b22bf3fSmrg# AM_SET_DEPDIR 3058b22bf3fSmrg# ------------- 3068b22bf3fSmrg# Choose a directory name for dependency files. 3078b22bf3fSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES 3088b22bf3fSmrgAC_DEFUN([AM_SET_DEPDIR], 3098b22bf3fSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 3108b22bf3fSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 3118b22bf3fSmrg]) 3128b22bf3fSmrg 3138b22bf3fSmrg 3148b22bf3fSmrg# AM_DEP_TRACK 3158b22bf3fSmrg# ------------ 3168b22bf3fSmrgAC_DEFUN([AM_DEP_TRACK], 3178b22bf3fSmrg[AC_ARG_ENABLE(dependency-tracking, 3188b22bf3fSmrg[ --disable-dependency-tracking speeds up one-time build 3198b22bf3fSmrg --enable-dependency-tracking do not reject slow dependency extractors]) 3208b22bf3fSmrgif test "x$enable_dependency_tracking" != xno; then 3218b22bf3fSmrg am_depcomp="$ac_aux_dir/depcomp" 3228b22bf3fSmrg AMDEPBACKSLASH='\' 3238b22bf3fSmrgfi 3248b22bf3fSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 3258b22bf3fSmrgAC_SUBST([AMDEPBACKSLASH])dnl 3268b22bf3fSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 3278b22bf3fSmrg]) 3288b22bf3fSmrg 3298b22bf3fSmrg# Generate code to set up dependency tracking. -*- Autoconf -*- 3308b22bf3fSmrg 33196a81b41Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 3328b22bf3fSmrg# Free Software Foundation, Inc. 3338b22bf3fSmrg# 3348b22bf3fSmrg# This file is free software; the Free Software Foundation 3358b22bf3fSmrg# gives unlimited permission to copy and/or distribute it, 3368b22bf3fSmrg# with or without modifications, as long as this notice is preserved. 3378b22bf3fSmrg 33896a81b41Smrg#serial 5 3398b22bf3fSmrg 3408b22bf3fSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS 3418b22bf3fSmrg# ------------------------------ 3428b22bf3fSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 34396a81b41Smrg[{ 34496a81b41Smrg # Autoconf 2.62 quotes --file arguments for eval, but not when files 34596a81b41Smrg # are listed without --file. Let's play safe and only enable the eval 34696a81b41Smrg # if we detect the quoting. 34796a81b41Smrg case $CONFIG_FILES in 34896a81b41Smrg *\'*) eval set x "$CONFIG_FILES" ;; 34996a81b41Smrg *) set x $CONFIG_FILES ;; 35096a81b41Smrg esac 35196a81b41Smrg shift 35296a81b41Smrg for mf 35396a81b41Smrg do 35496a81b41Smrg # Strip MF so we end up with the name of the file. 35596a81b41Smrg mf=`echo "$mf" | sed -e 's/:.*$//'` 35696a81b41Smrg # Check whether this is an Automake generated Makefile or not. 35796a81b41Smrg # We used to match only the files named `Makefile.in', but 35896a81b41Smrg # some people rename them; so instead we look at the file content. 35996a81b41Smrg # Grep'ing the first line is not enough: some people post-process 36096a81b41Smrg # each Makefile.in and add a new line on top of each file to say so. 36196a81b41Smrg # Grep'ing the whole file is not good either: AIX grep has a line 36296a81b41Smrg # limit of 2048, but all sed's we know have understand at least 4000. 36396a81b41Smrg if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 36496a81b41Smrg dirpart=`AS_DIRNAME("$mf")` 36596a81b41Smrg else 36696a81b41Smrg continue 36796a81b41Smrg fi 36896a81b41Smrg # Extract the definition of DEPDIR, am__include, and am__quote 36996a81b41Smrg # from the Makefile without running `make'. 37096a81b41Smrg DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 37196a81b41Smrg test -z "$DEPDIR" && continue 37296a81b41Smrg am__include=`sed -n 's/^am__include = //p' < "$mf"` 37396a81b41Smrg test -z "am__include" && continue 37496a81b41Smrg am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 37596a81b41Smrg # When using ansi2knr, U may be empty or an underscore; expand it 37696a81b41Smrg U=`sed -n 's/^U = //p' < "$mf"` 37796a81b41Smrg # Find all dependency output files, they are included files with 37896a81b41Smrg # $(DEPDIR) in their names. We invoke sed twice because it is the 37996a81b41Smrg # simplest approach to changing $(DEPDIR) to its actual value in the 38096a81b41Smrg # expansion. 38196a81b41Smrg for file in `sed -n " 38296a81b41Smrg s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 38396a81b41Smrg sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 38496a81b41Smrg # Make sure the directory exists. 38596a81b41Smrg test -f "$dirpart/$file" && continue 38696a81b41Smrg fdir=`AS_DIRNAME(["$file"])` 38796a81b41Smrg AS_MKDIR_P([$dirpart/$fdir]) 38896a81b41Smrg # echo "creating $dirpart/$file" 38996a81b41Smrg echo '# dummy' > "$dirpart/$file" 39096a81b41Smrg done 3918b22bf3fSmrg done 39296a81b41Smrg} 3938b22bf3fSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS 3948b22bf3fSmrg 3958b22bf3fSmrg 3968b22bf3fSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS 3978b22bf3fSmrg# ----------------------------- 3988b22bf3fSmrg# This macro should only be invoked once -- use via AC_REQUIRE. 3998b22bf3fSmrg# 4008b22bf3fSmrg# This code is only required when automatic dependency tracking 4018b22bf3fSmrg# is enabled. FIXME. This creates each `.P' file that we will 4028b22bf3fSmrg# need in order to bootstrap the dependency handling code. 4038b22bf3fSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 4048b22bf3fSmrg[AC_CONFIG_COMMANDS([depfiles], 4058b22bf3fSmrg [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 4068b22bf3fSmrg [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 4078b22bf3fSmrg]) 4088b22bf3fSmrg 4098b22bf3fSmrg# Do all the work for Automake. -*- Autoconf -*- 4108b22bf3fSmrg 4118b22bf3fSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 41296a81b41Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. 4138b22bf3fSmrg# 4148b22bf3fSmrg# This file is free software; the Free Software Foundation 4158b22bf3fSmrg# gives unlimited permission to copy and/or distribute it, 4168b22bf3fSmrg# with or without modifications, as long as this notice is preserved. 4178b22bf3fSmrg 41896a81b41Smrg# serial 16 4198b22bf3fSmrg 4208b22bf3fSmrg# This macro actually does too much. Some checks are only needed if 4218b22bf3fSmrg# your package does certain things. But this isn't really a big deal. 4228b22bf3fSmrg 4238b22bf3fSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 4248b22bf3fSmrg# AM_INIT_AUTOMAKE([OPTIONS]) 4258b22bf3fSmrg# ----------------------------------------------- 4268b22bf3fSmrg# The call with PACKAGE and VERSION arguments is the old style 4278b22bf3fSmrg# call (pre autoconf-2.50), which is being phased out. PACKAGE 4288b22bf3fSmrg# and VERSION should now be passed to AC_INIT and removed from 4298b22bf3fSmrg# the call to AM_INIT_AUTOMAKE. 4308b22bf3fSmrg# We support both call styles for the transition. After 4318b22bf3fSmrg# the next Automake release, Autoconf can make the AC_INIT 4328b22bf3fSmrg# arguments mandatory, and then we can depend on a new Autoconf 4338b22bf3fSmrg# release and drop the old call support. 4348b22bf3fSmrgAC_DEFUN([AM_INIT_AUTOMAKE], 43596a81b41Smrg[AC_PREREQ([2.62])dnl 4368b22bf3fSmrgdnl Autoconf wants to disallow AM_ names. We explicitly allow 4378b22bf3fSmrgdnl the ones we care about. 4388b22bf3fSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 4398b22bf3fSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 4408b22bf3fSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl 4418b22bf3fSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then 4428b22bf3fSmrg # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 4438b22bf3fSmrg # is not polluted with repeated "-I." 4448b22bf3fSmrg AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 4458b22bf3fSmrg # test to see if srcdir already configured 4468b22bf3fSmrg if test -f $srcdir/config.status; then 4478b22bf3fSmrg AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 4488b22bf3fSmrg fi 4498b22bf3fSmrgfi 4508b22bf3fSmrg 4518b22bf3fSmrg# test whether we have cygpath 4528b22bf3fSmrgif test -z "$CYGPATH_W"; then 4538b22bf3fSmrg if (cygpath --version) >/dev/null 2>/dev/null; then 4548b22bf3fSmrg CYGPATH_W='cygpath -w' 4558b22bf3fSmrg else 4568b22bf3fSmrg CYGPATH_W=echo 4578b22bf3fSmrg fi 4588b22bf3fSmrgfi 4598b22bf3fSmrgAC_SUBST([CYGPATH_W]) 4608b22bf3fSmrg 4618b22bf3fSmrg# Define the identity of the package. 4628b22bf3fSmrgdnl Distinguish between old-style and new-style calls. 4638b22bf3fSmrgm4_ifval([$2], 4648b22bf3fSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 4658b22bf3fSmrg AC_SUBST([PACKAGE], [$1])dnl 4668b22bf3fSmrg AC_SUBST([VERSION], [$2])], 4678b22bf3fSmrg[_AM_SET_OPTIONS([$1])dnl 4688b22bf3fSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 4698b22bf3fSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, 4708b22bf3fSmrg [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 4718b22bf3fSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 4728b22bf3fSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 4738b22bf3fSmrg 4748b22bf3fSmrg_AM_IF_OPTION([no-define],, 4758b22bf3fSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 4768b22bf3fSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 4778b22bf3fSmrg 4788b22bf3fSmrg# Some tools Automake needs. 4798b22bf3fSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl 4808b22bf3fSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl 4818b22bf3fSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 4828b22bf3fSmrgAM_MISSING_PROG(AUTOCONF, autoconf) 4838b22bf3fSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 4848b22bf3fSmrgAM_MISSING_PROG(AUTOHEADER, autoheader) 4858b22bf3fSmrgAM_MISSING_PROG(MAKEINFO, makeinfo) 48696a81b41SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl 48796a81b41SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 4888b22bf3fSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl 4898b22bf3fSmrg# We need awk for the "check" target. The system "awk" is bad on 4908b22bf3fSmrg# some platforms. 4918b22bf3fSmrgAC_REQUIRE([AC_PROG_AWK])dnl 4928b22bf3fSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl 4938b22bf3fSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl 4948b22bf3fSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 49596a81b41Smrg [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 49696a81b41Smrg [_AM_PROG_TAR([v7])])]) 4978b22bf3fSmrg_AM_IF_OPTION([no-dependencies],, 4988b22bf3fSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC], 49996a81b41Smrg [_AM_DEPENDENCIES(CC)], 50096a81b41Smrg [define([AC_PROG_CC], 50196a81b41Smrg defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 5028b22bf3fSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX], 50396a81b41Smrg [_AM_DEPENDENCIES(CXX)], 50496a81b41Smrg [define([AC_PROG_CXX], 50596a81b41Smrg defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 5068b22bf3fSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC], 50796a81b41Smrg [_AM_DEPENDENCIES(OBJC)], 50896a81b41Smrg [define([AC_PROG_OBJC], 50996a81b41Smrg defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl 5108b22bf3fSmrg]) 51196a81b41Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl 51296a81b41Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the 51396a81b41Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro 51496a81b41Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below. 51596a81b41SmrgAC_CONFIG_COMMANDS_PRE(dnl 51696a81b41Smrg[m4_provide_if([_AM_COMPILER_EXEEXT], 51796a81b41Smrg [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 5188b22bf3fSmrg]) 5198b22bf3fSmrg 52096a81b41Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 52196a81b41Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 52296a81b41Smrgdnl mangled by Autoconf and run in a shell conditional statement. 52396a81b41Smrgm4_define([_AC_COMPILER_EXEEXT], 52496a81b41Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 52596a81b41Smrg 5268b22bf3fSmrg 5278b22bf3fSmrg# When config.status generates a header, we must update the stamp-h file. 5288b22bf3fSmrg# This file resides in the same directory as the config header 5298b22bf3fSmrg# that is generated. The stamp files are numbered to have different names. 5308b22bf3fSmrg 5318b22bf3fSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 5328b22bf3fSmrg# loop where config.status creates the headers, so we can generate 5338b22bf3fSmrg# our stamp files there. 5348b22bf3fSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 5358b22bf3fSmrg[# Compute $1's index in $config_headers. 53696a81b41Smrg_am_arg=$1 5378b22bf3fSmrg_am_stamp_count=1 5388b22bf3fSmrgfor _am_header in $config_headers :; do 5398b22bf3fSmrg case $_am_header in 54096a81b41Smrg $_am_arg | $_am_arg:* ) 5418b22bf3fSmrg break ;; 5428b22bf3fSmrg * ) 5438b22bf3fSmrg _am_stamp_count=`expr $_am_stamp_count + 1` ;; 5448b22bf3fSmrg esac 5458b22bf3fSmrgdone 54696a81b41Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 5478b22bf3fSmrg 54896a81b41Smrg# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. 5498b22bf3fSmrg# 5508b22bf3fSmrg# This file is free software; the Free Software Foundation 5518b22bf3fSmrg# gives unlimited permission to copy and/or distribute it, 5528b22bf3fSmrg# with or without modifications, as long as this notice is preserved. 5538b22bf3fSmrg 5548b22bf3fSmrg# AM_PROG_INSTALL_SH 5558b22bf3fSmrg# ------------------ 5568b22bf3fSmrg# Define $install_sh. 5578b22bf3fSmrgAC_DEFUN([AM_PROG_INSTALL_SH], 5588b22bf3fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 55996a81b41Smrgif test x"${install_sh}" != xset; then 56096a81b41Smrg case $am_aux_dir in 56196a81b41Smrg *\ * | *\ *) 56296a81b41Smrg install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 56396a81b41Smrg *) 56496a81b41Smrg install_sh="\${SHELL} $am_aux_dir/install-sh" 56596a81b41Smrg esac 56696a81b41Smrgfi 5678b22bf3fSmrgAC_SUBST(install_sh)]) 5688b22bf3fSmrg 5698b22bf3fSmrg# Copyright (C) 2003, 2005 Free Software Foundation, Inc. 5708b22bf3fSmrg# 5718b22bf3fSmrg# This file is free software; the Free Software Foundation 5728b22bf3fSmrg# gives unlimited permission to copy and/or distribute it, 5738b22bf3fSmrg# with or without modifications, as long as this notice is preserved. 5748b22bf3fSmrg 5758b22bf3fSmrg# serial 2 5768b22bf3fSmrg 5778b22bf3fSmrg# Check whether the underlying file-system supports filenames 5788b22bf3fSmrg# with a leading dot. For instance MS-DOS doesn't. 5798b22bf3fSmrgAC_DEFUN([AM_SET_LEADING_DOT], 5808b22bf3fSmrg[rm -rf .tst 2>/dev/null 5818b22bf3fSmrgmkdir .tst 2>/dev/null 5828b22bf3fSmrgif test -d .tst; then 5838b22bf3fSmrg am__leading_dot=. 5848b22bf3fSmrgelse 5858b22bf3fSmrg am__leading_dot=_ 5868b22bf3fSmrgfi 5878b22bf3fSmrgrmdir .tst 2>/dev/null 5888b22bf3fSmrgAC_SUBST([am__leading_dot])]) 5898b22bf3fSmrg 5908b22bf3fSmrg# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- 5918b22bf3fSmrg# From Jim Meyering 5928b22bf3fSmrg 59396a81b41Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 5948b22bf3fSmrg# Free Software Foundation, Inc. 5958b22bf3fSmrg# 5968b22bf3fSmrg# This file is free software; the Free Software Foundation 5978b22bf3fSmrg# gives unlimited permission to copy and/or distribute it, 5988b22bf3fSmrg# with or without modifications, as long as this notice is preserved. 5998b22bf3fSmrg 60096a81b41Smrg# serial 5 6018b22bf3fSmrg 60296a81b41Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE]) 60396a81b41Smrg# ---------------------------------- 60496a81b41Smrg# Control maintainer-specific portions of Makefiles. 60596a81b41Smrg# Default is to disable them, unless `enable' is passed literally. 60696a81b41Smrg# For symmetry, `disable' may be passed as well. Anyway, the user 60796a81b41Smrg# can override the default with the --enable/--disable switch. 6088b22bf3fSmrgAC_DEFUN([AM_MAINTAINER_MODE], 60996a81b41Smrg[m4_case(m4_default([$1], [disable]), 61096a81b41Smrg [enable], [m4_define([am_maintainer_other], [disable])], 61196a81b41Smrg [disable], [m4_define([am_maintainer_other], [enable])], 61296a81b41Smrg [m4_define([am_maintainer_other], [enable]) 61396a81b41Smrg m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) 61496a81b41SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) 61596a81b41Smrg dnl maintainer-mode's default is 'disable' unless 'enable' is passed 61696a81b41Smrg AC_ARG_ENABLE([maintainer-mode], 61796a81b41Smrg[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful 6188b22bf3fSmrg (and sometimes confusing) to the casual installer], 61996a81b41Smrg [USE_MAINTAINER_MODE=$enableval], 62096a81b41Smrg [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) 6218b22bf3fSmrg AC_MSG_RESULT([$USE_MAINTAINER_MODE]) 62296a81b41Smrg AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) 6238b22bf3fSmrg MAINT=$MAINTAINER_MODE_TRUE 62496a81b41Smrg AC_SUBST([MAINT])dnl 6258b22bf3fSmrg] 6268b22bf3fSmrg) 6278b22bf3fSmrg 6288b22bf3fSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) 6298b22bf3fSmrg 6308b22bf3fSmrg# Check to see how 'make' treats includes. -*- Autoconf -*- 6318b22bf3fSmrg 63296a81b41Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. 6338b22bf3fSmrg# 6348b22bf3fSmrg# This file is free software; the Free Software Foundation 6358b22bf3fSmrg# gives unlimited permission to copy and/or distribute it, 6368b22bf3fSmrg# with or without modifications, as long as this notice is preserved. 6378b22bf3fSmrg 63896a81b41Smrg# serial 4 6398b22bf3fSmrg 6408b22bf3fSmrg# AM_MAKE_INCLUDE() 6418b22bf3fSmrg# ----------------- 6428b22bf3fSmrg# Check to see how make treats includes. 6438b22bf3fSmrgAC_DEFUN([AM_MAKE_INCLUDE], 6448b22bf3fSmrg[am_make=${MAKE-make} 6458b22bf3fSmrgcat > confinc << 'END' 6468b22bf3fSmrgam__doit: 64796a81b41Smrg @echo this is the am__doit target 6488b22bf3fSmrg.PHONY: am__doit 6498b22bf3fSmrgEND 6508b22bf3fSmrg# If we don't find an include directive, just comment out the code. 6518b22bf3fSmrgAC_MSG_CHECKING([for style of include used by $am_make]) 6528b22bf3fSmrgam__include="#" 6538b22bf3fSmrgam__quote= 6548b22bf3fSmrg_am_result=none 6558b22bf3fSmrg# First try GNU make style include. 6568b22bf3fSmrgecho "include confinc" > confmf 65796a81b41Smrg# Ignore all kinds of additional output from `make'. 65896a81b41Smrgcase `$am_make -s -f confmf 2> /dev/null` in #( 65996a81b41Smrg*the\ am__doit\ target*) 66096a81b41Smrg am__include=include 66196a81b41Smrg am__quote= 66296a81b41Smrg _am_result=GNU 66396a81b41Smrg ;; 66496a81b41Smrgesac 6658b22bf3fSmrg# Now try BSD make style include. 6668b22bf3fSmrgif test "$am__include" = "#"; then 6678b22bf3fSmrg echo '.include "confinc"' > confmf 66896a81b41Smrg case `$am_make -s -f confmf 2> /dev/null` in #( 66996a81b41Smrg *the\ am__doit\ target*) 67096a81b41Smrg am__include=.include 67196a81b41Smrg am__quote="\"" 67296a81b41Smrg _am_result=BSD 67396a81b41Smrg ;; 67496a81b41Smrg esac 6758b22bf3fSmrgfi 6768b22bf3fSmrgAC_SUBST([am__include]) 6778b22bf3fSmrgAC_SUBST([am__quote]) 6788b22bf3fSmrgAC_MSG_RESULT([$_am_result]) 6798b22bf3fSmrgrm -f confinc confmf 6808b22bf3fSmrg]) 6818b22bf3fSmrg 6828b22bf3fSmrg# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 6838b22bf3fSmrg 68496a81b41Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 6858b22bf3fSmrg# Free Software Foundation, Inc. 6868b22bf3fSmrg# 6878b22bf3fSmrg# This file is free software; the Free Software Foundation 6888b22bf3fSmrg# gives unlimited permission to copy and/or distribute it, 6898b22bf3fSmrg# with or without modifications, as long as this notice is preserved. 6908b22bf3fSmrg 69196a81b41Smrg# serial 6 6928b22bf3fSmrg 6938b22bf3fSmrg# AM_MISSING_PROG(NAME, PROGRAM) 6948b22bf3fSmrg# ------------------------------ 6958b22bf3fSmrgAC_DEFUN([AM_MISSING_PROG], 6968b22bf3fSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN]) 6978b22bf3fSmrg$1=${$1-"${am_missing_run}$2"} 6988b22bf3fSmrgAC_SUBST($1)]) 6998b22bf3fSmrg 7008b22bf3fSmrg 7018b22bf3fSmrg# AM_MISSING_HAS_RUN 7028b22bf3fSmrg# ------------------ 7038b22bf3fSmrg# Define MISSING if not defined so far and test if it supports --run. 7048b22bf3fSmrg# If it does, set am_missing_run to use it, otherwise, to nothing. 7058b22bf3fSmrgAC_DEFUN([AM_MISSING_HAS_RUN], 7068b22bf3fSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 7078b22bf3fSmrgAC_REQUIRE_AUX_FILE([missing])dnl 70896a81b41Smrgif test x"${MISSING+set}" != xset; then 70996a81b41Smrg case $am_aux_dir in 71096a81b41Smrg *\ * | *\ *) 71196a81b41Smrg MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; 71296a81b41Smrg *) 71396a81b41Smrg MISSING="\${SHELL} $am_aux_dir/missing" ;; 71496a81b41Smrg esac 71596a81b41Smrgfi 7168b22bf3fSmrg# Use eval to expand $SHELL 7178b22bf3fSmrgif eval "$MISSING --run true"; then 7188b22bf3fSmrg am_missing_run="$MISSING --run " 7198b22bf3fSmrgelse 7208b22bf3fSmrg am_missing_run= 7218b22bf3fSmrg AC_MSG_WARN([`missing' script is too old or missing]) 7228b22bf3fSmrgfi 7238b22bf3fSmrg]) 7248b22bf3fSmrg 7258b22bf3fSmrg# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 7268b22bf3fSmrg# 7278b22bf3fSmrg# This file is free software; the Free Software Foundation 7288b22bf3fSmrg# gives unlimited permission to copy and/or distribute it, 7298b22bf3fSmrg# with or without modifications, as long as this notice is preserved. 7308b22bf3fSmrg 7318b22bf3fSmrg# AM_PROG_MKDIR_P 7328b22bf3fSmrg# --------------- 7338b22bf3fSmrg# Check for `mkdir -p'. 7348b22bf3fSmrgAC_DEFUN([AM_PROG_MKDIR_P], 7358b22bf3fSmrg[AC_PREREQ([2.60])dnl 7368b22bf3fSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl 7378b22bf3fSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, 7388b22bf3fSmrgdnl while keeping a definition of mkdir_p for backward compatibility. 7398b22bf3fSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. 7408b22bf3fSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of 7418b22bf3fSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own 7428b22bf3fSmrgdnl adjustment using top_builddir (which is defined more often than 7438b22bf3fSmrgdnl MKDIR_P). 7448b22bf3fSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl 7458b22bf3fSmrgcase $mkdir_p in 7468b22bf3fSmrg [[\\/$]]* | ?:[[\\/]]*) ;; 7478b22bf3fSmrg */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 7488b22bf3fSmrgesac 7498b22bf3fSmrg]) 7508b22bf3fSmrg 7518b22bf3fSmrg# Helper functions for option handling. -*- Autoconf -*- 7528b22bf3fSmrg 75396a81b41Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. 7548b22bf3fSmrg# 7558b22bf3fSmrg# This file is free software; the Free Software Foundation 7568b22bf3fSmrg# gives unlimited permission to copy and/or distribute it, 7578b22bf3fSmrg# with or without modifications, as long as this notice is preserved. 7588b22bf3fSmrg 75996a81b41Smrg# serial 4 7608b22bf3fSmrg 7618b22bf3fSmrg# _AM_MANGLE_OPTION(NAME) 7628b22bf3fSmrg# ----------------------- 7638b22bf3fSmrgAC_DEFUN([_AM_MANGLE_OPTION], 7648b22bf3fSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 7658b22bf3fSmrg 7668b22bf3fSmrg# _AM_SET_OPTION(NAME) 7678b22bf3fSmrg# ------------------------------ 7688b22bf3fSmrg# Set option NAME. Presently that only means defining a flag for this option. 7698b22bf3fSmrgAC_DEFUN([_AM_SET_OPTION], 7708b22bf3fSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 7718b22bf3fSmrg 7728b22bf3fSmrg# _AM_SET_OPTIONS(OPTIONS) 7738b22bf3fSmrg# ---------------------------------- 7748b22bf3fSmrg# OPTIONS is a space-separated list of Automake options. 7758b22bf3fSmrgAC_DEFUN([_AM_SET_OPTIONS], 77696a81b41Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 7778b22bf3fSmrg 7788b22bf3fSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 7798b22bf3fSmrg# ------------------------------------------- 7808b22bf3fSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 7818b22bf3fSmrgAC_DEFUN([_AM_IF_OPTION], 7828b22bf3fSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 7838b22bf3fSmrg 7848b22bf3fSmrg# Check to make sure that the build environment is sane. -*- Autoconf -*- 7858b22bf3fSmrg 78696a81b41Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 7878b22bf3fSmrg# Free Software Foundation, Inc. 7888b22bf3fSmrg# 7898b22bf3fSmrg# This file is free software; the Free Software Foundation 7908b22bf3fSmrg# gives unlimited permission to copy and/or distribute it, 7918b22bf3fSmrg# with or without modifications, as long as this notice is preserved. 7928b22bf3fSmrg 79396a81b41Smrg# serial 5 7948b22bf3fSmrg 7958b22bf3fSmrg# AM_SANITY_CHECK 7968b22bf3fSmrg# --------------- 7978b22bf3fSmrgAC_DEFUN([AM_SANITY_CHECK], 7988b22bf3fSmrg[AC_MSG_CHECKING([whether build environment is sane]) 7998b22bf3fSmrg# Just in case 8008b22bf3fSmrgsleep 1 8018b22bf3fSmrgecho timestamp > conftest.file 80296a81b41Smrg# Reject unsafe characters in $srcdir or the absolute working directory 80396a81b41Smrg# name. Accept space and tab only in the latter. 80496a81b41Smrgam_lf=' 80596a81b41Smrg' 80696a81b41Smrgcase `pwd` in 80796a81b41Smrg *[[\\\"\#\$\&\'\`$am_lf]]*) 80896a81b41Smrg AC_MSG_ERROR([unsafe absolute working directory name]);; 80996a81b41Smrgesac 81096a81b41Smrgcase $srcdir in 81196a81b41Smrg *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 81296a81b41Smrg AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; 81396a81b41Smrgesac 81496a81b41Smrg 8158b22bf3fSmrg# Do `set' in a subshell so we don't clobber the current shell's 8168b22bf3fSmrg# arguments. Must try -L first in case configure is actually a 8178b22bf3fSmrg# symlink; some systems play weird games with the mod time of symlinks 8188b22bf3fSmrg# (eg FreeBSD returns the mod time of the symlink's containing 8198b22bf3fSmrg# directory). 8208b22bf3fSmrgif ( 82196a81b41Smrg set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 8228b22bf3fSmrg if test "$[*]" = "X"; then 8238b22bf3fSmrg # -L didn't work. 82496a81b41Smrg set X `ls -t "$srcdir/configure" conftest.file` 8258b22bf3fSmrg fi 8268b22bf3fSmrg rm -f conftest.file 8278b22bf3fSmrg if test "$[*]" != "X $srcdir/configure conftest.file" \ 8288b22bf3fSmrg && test "$[*]" != "X conftest.file $srcdir/configure"; then 8298b22bf3fSmrg 8308b22bf3fSmrg # If neither matched, then we have a broken ls. This can happen 8318b22bf3fSmrg # if, for instance, CONFIG_SHELL is bash and it inherits a 8328b22bf3fSmrg # broken ls alias from the environment. This has actually 8338b22bf3fSmrg # happened. Such a system could not be considered "sane". 8348b22bf3fSmrg AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 8358b22bf3fSmrgalias in your environment]) 8368b22bf3fSmrg fi 8378b22bf3fSmrg 8388b22bf3fSmrg test "$[2]" = conftest.file 8398b22bf3fSmrg ) 8408b22bf3fSmrgthen 8418b22bf3fSmrg # Ok. 8428b22bf3fSmrg : 8438b22bf3fSmrgelse 8448b22bf3fSmrg AC_MSG_ERROR([newly created file is older than distributed files! 8458b22bf3fSmrgCheck your system clock]) 8468b22bf3fSmrgfi 8478b22bf3fSmrgAC_MSG_RESULT(yes)]) 8488b22bf3fSmrg 84996a81b41Smrg# Copyright (C) 2009 Free Software Foundation, Inc. 85096a81b41Smrg# 85196a81b41Smrg# This file is free software; the Free Software Foundation 85296a81b41Smrg# gives unlimited permission to copy and/or distribute it, 85396a81b41Smrg# with or without modifications, as long as this notice is preserved. 85496a81b41Smrg 85596a81b41Smrg# serial 1 85696a81b41Smrg 85796a81b41Smrg# AM_SILENT_RULES([DEFAULT]) 85896a81b41Smrg# -------------------------- 85996a81b41Smrg# Enable less verbose build rules; with the default set to DEFAULT 86096a81b41Smrg# (`yes' being less verbose, `no' or empty being verbose). 86196a81b41SmrgAC_DEFUN([AM_SILENT_RULES], 86296a81b41Smrg[AC_ARG_ENABLE([silent-rules], 86396a81b41Smrg[ --enable-silent-rules less verbose build output (undo: `make V=1') 86496a81b41Smrg --disable-silent-rules verbose build output (undo: `make V=0')]) 86596a81b41Smrgcase $enable_silent_rules in 86696a81b41Smrgyes) AM_DEFAULT_VERBOSITY=0;; 86796a81b41Smrgno) AM_DEFAULT_VERBOSITY=1;; 86896a81b41Smrg*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; 86996a81b41Smrgesac 87096a81b41SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl 87196a81b41SmrgAM_BACKSLASH='\' 87296a81b41SmrgAC_SUBST([AM_BACKSLASH])dnl 87396a81b41Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl 87496a81b41Smrg]) 87596a81b41Smrg 8768b22bf3fSmrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 8778b22bf3fSmrg# 8788b22bf3fSmrg# This file is free software; the Free Software Foundation 8798b22bf3fSmrg# gives unlimited permission to copy and/or distribute it, 8808b22bf3fSmrg# with or without modifications, as long as this notice is preserved. 8818b22bf3fSmrg 8828b22bf3fSmrg# AM_PROG_INSTALL_STRIP 8838b22bf3fSmrg# --------------------- 8848b22bf3fSmrg# One issue with vendor `install' (even GNU) is that you can't 8858b22bf3fSmrg# specify the program used to strip binaries. This is especially 8868b22bf3fSmrg# annoying in cross-compiling environments, where the build's strip 8878b22bf3fSmrg# is unlikely to handle the host's binaries. 8888b22bf3fSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we 8898b22bf3fSmrg# always use install-sh in `make install-strip', and initialize 8908b22bf3fSmrg# STRIPPROG with the value of the STRIP variable (set by the user). 8918b22bf3fSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP], 8928b22bf3fSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 8938b22bf3fSmrg# Installed binaries are usually stripped using `strip' when the user 8948b22bf3fSmrg# run `make install-strip'. However `strip' might not be the right 8958b22bf3fSmrg# tool to use in cross-compilation environments, therefore Automake 8968b22bf3fSmrg# will honor the `STRIP' environment variable to overrule this program. 8978b22bf3fSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'. 8988b22bf3fSmrgif test "$cross_compiling" != no; then 8998b22bf3fSmrg AC_CHECK_TOOL([STRIP], [strip], :) 9008b22bf3fSmrgfi 9018b22bf3fSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 9028b22bf3fSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])]) 9038b22bf3fSmrg 90496a81b41Smrg# Copyright (C) 2006, 2008 Free Software Foundation, Inc. 9058b22bf3fSmrg# 9068b22bf3fSmrg# This file is free software; the Free Software Foundation 9078b22bf3fSmrg# gives unlimited permission to copy and/or distribute it, 9088b22bf3fSmrg# with or without modifications, as long as this notice is preserved. 9098b22bf3fSmrg 91096a81b41Smrg# serial 2 91196a81b41Smrg 9128b22bf3fSmrg# _AM_SUBST_NOTMAKE(VARIABLE) 9138b22bf3fSmrg# --------------------------- 91496a81b41Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 9158b22bf3fSmrg# This macro is traced by Automake. 9168b22bf3fSmrgAC_DEFUN([_AM_SUBST_NOTMAKE]) 9178b22bf3fSmrg 91896a81b41Smrg# AM_SUBST_NOTMAKE(VARIABLE) 91996a81b41Smrg# --------------------------- 92096a81b41Smrg# Public sister of _AM_SUBST_NOTMAKE. 92196a81b41SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 92296a81b41Smrg 9238b22bf3fSmrg# Check how to create a tarball. -*- Autoconf -*- 9248b22bf3fSmrg 9258b22bf3fSmrg# Copyright (C) 2004, 2005 Free Software Foundation, Inc. 9268b22bf3fSmrg# 9278b22bf3fSmrg# This file is free software; the Free Software Foundation 9288b22bf3fSmrg# gives unlimited permission to copy and/or distribute it, 9298b22bf3fSmrg# with or without modifications, as long as this notice is preserved. 9308b22bf3fSmrg 9318b22bf3fSmrg# serial 2 9328b22bf3fSmrg 9338b22bf3fSmrg# _AM_PROG_TAR(FORMAT) 9348b22bf3fSmrg# -------------------- 9358b22bf3fSmrg# Check how to create a tarball in format FORMAT. 9368b22bf3fSmrg# FORMAT should be one of `v7', `ustar', or `pax'. 9378b22bf3fSmrg# 9388b22bf3fSmrg# Substitute a variable $(am__tar) that is a command 9398b22bf3fSmrg# writing to stdout a FORMAT-tarball containing the directory 9408b22bf3fSmrg# $tardir. 9418b22bf3fSmrg# tardir=directory && $(am__tar) > result.tar 9428b22bf3fSmrg# 9438b22bf3fSmrg# Substitute a variable $(am__untar) that extract such 9448b22bf3fSmrg# a tarball read from stdin. 9458b22bf3fSmrg# $(am__untar) < result.tar 9468b22bf3fSmrgAC_DEFUN([_AM_PROG_TAR], 9478b22bf3fSmrg[# Always define AMTAR for backward compatibility. 9488b22bf3fSmrgAM_MISSING_PROG([AMTAR], [tar]) 9498b22bf3fSmrgm4_if([$1], [v7], 9508b22bf3fSmrg [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], 9518b22bf3fSmrg [m4_case([$1], [ustar],, [pax],, 9528b22bf3fSmrg [m4_fatal([Unknown tar format])]) 9538b22bf3fSmrgAC_MSG_CHECKING([how to create a $1 tar archive]) 9548b22bf3fSmrg# Loop over all known methods to create a tar archive until one works. 9558b22bf3fSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 9568b22bf3fSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools} 9578b22bf3fSmrg# Do not fold the above two line into one, because Tru64 sh and 9588b22bf3fSmrg# Solaris sh will not grok spaces in the rhs of `-'. 9598b22bf3fSmrgfor _am_tool in $_am_tools 9608b22bf3fSmrgdo 9618b22bf3fSmrg case $_am_tool in 9628b22bf3fSmrg gnutar) 9638b22bf3fSmrg for _am_tar in tar gnutar gtar; 9648b22bf3fSmrg do 9658b22bf3fSmrg AM_RUN_LOG([$_am_tar --version]) && break 9668b22bf3fSmrg done 9678b22bf3fSmrg am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 9688b22bf3fSmrg am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 9698b22bf3fSmrg am__untar="$_am_tar -xf -" 9708b22bf3fSmrg ;; 9718b22bf3fSmrg plaintar) 9728b22bf3fSmrg # Must skip GNU tar: if it does not support --format= it doesn't create 9738b22bf3fSmrg # ustar tarball either. 9748b22bf3fSmrg (tar --version) >/dev/null 2>&1 && continue 9758b22bf3fSmrg am__tar='tar chf - "$$tardir"' 9768b22bf3fSmrg am__tar_='tar chf - "$tardir"' 9778b22bf3fSmrg am__untar='tar xf -' 9788b22bf3fSmrg ;; 9798b22bf3fSmrg pax) 9808b22bf3fSmrg am__tar='pax -L -x $1 -w "$$tardir"' 9818b22bf3fSmrg am__tar_='pax -L -x $1 -w "$tardir"' 9828b22bf3fSmrg am__untar='pax -r' 9838b22bf3fSmrg ;; 9848b22bf3fSmrg cpio) 9858b22bf3fSmrg am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 9868b22bf3fSmrg am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 9878b22bf3fSmrg am__untar='cpio -i -H $1 -d' 9888b22bf3fSmrg ;; 9898b22bf3fSmrg none) 9908b22bf3fSmrg am__tar=false 9918b22bf3fSmrg am__tar_=false 9928b22bf3fSmrg am__untar=false 9938b22bf3fSmrg ;; 9948b22bf3fSmrg esac 9958b22bf3fSmrg 9968b22bf3fSmrg # If the value was cached, stop now. We just wanted to have am__tar 9978b22bf3fSmrg # and am__untar set. 9988b22bf3fSmrg test -n "${am_cv_prog_tar_$1}" && break 9998b22bf3fSmrg 10008b22bf3fSmrg # tar/untar a dummy directory, and stop if the command works 10018b22bf3fSmrg rm -rf conftest.dir 10028b22bf3fSmrg mkdir conftest.dir 10038b22bf3fSmrg echo GrepMe > conftest.dir/file 10048b22bf3fSmrg AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 10058b22bf3fSmrg rm -rf conftest.dir 10068b22bf3fSmrg if test -s conftest.tar; then 10078b22bf3fSmrg AM_RUN_LOG([$am__untar <conftest.tar]) 10088b22bf3fSmrg grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 10098b22bf3fSmrg fi 10108b22bf3fSmrgdone 10118b22bf3fSmrgrm -rf conftest.dir 10128b22bf3fSmrg 10138b22bf3fSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 10148b22bf3fSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])]) 10158b22bf3fSmrgAC_SUBST([am__tar]) 10168b22bf3fSmrgAC_SUBST([am__untar]) 10178b22bf3fSmrg]) # _AM_PROG_TAR 10188b22bf3fSmrg 101996a81b41Smrgdnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. 10208b22bf3fSmrgdnl 10215bd32fd1Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 10228b22bf3fSmrgdnl 10238b22bf3fSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a 10245bd32fd1Smrgdnl copy of this software and associated documentation files (the "Software"), 10255bd32fd1Smrgdnl to deal in the Software without restriction, including without limitation 10265bd32fd1Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense, 10275bd32fd1Smrgdnl and/or sell copies of the Software, and to permit persons to whom the 10285bd32fd1Smrgdnl Software is furnished to do so, subject to the following conditions: 10298b22bf3fSmrgdnl 10305bd32fd1Smrgdnl The above copyright notice and this permission notice (including the next 10315bd32fd1Smrgdnl paragraph) shall be included in all copies or substantial portions of the 10325bd32fd1Smrgdnl Software. 10338b22bf3fSmrgdnl 10345bd32fd1Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 10355bd32fd1Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 10365bd32fd1Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 10375bd32fd1Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 10385bd32fd1Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 10395bd32fd1Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 10405bd32fd1Smrgdnl DEALINGS IN THE SOFTWARE. 10418b22bf3fSmrg 10428b22bf3fSmrg# XORG_MACROS_VERSION(required-version) 10438b22bf3fSmrg# ------------------------------------- 10448b22bf3fSmrg# Minimum version: 1.1.0 10458b22bf3fSmrg# 10468b22bf3fSmrg# If you're using a macro added in Version 1.1 or newer, include this in 10478b22bf3fSmrg# your configure.ac with the minimum required version, such as: 10488b22bf3fSmrg# XORG_MACROS_VERSION(1.1) 10498b22bf3fSmrg# 105096a81b41Smrg# To ensure that this macro is defined, also add: 105196a81b41Smrg# m4_ifndef([XORG_MACROS_VERSION], 105296a81b41Smrg# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) 10538b22bf3fSmrg# 10548b22bf3fSmrg# 10558b22bf3fSmrg# See the "minimum version" comment for each macro you use to see what 10568b22bf3fSmrg# version you require. 105796a81b41Smrgm4_defun([XORG_MACROS_VERSION],[ 10585bd32fd1Smrgm4_define([vers_have], [1.11.0]) 105996a81b41Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) 106096a81b41Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) 106196a81b41Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,, 106296a81b41Smrg [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])]) 106396a81b41Smrgm4_if(m4_version_compare(vers_have, [$1]), -1, 106496a81b41Smrg [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])]) 106596a81b41Smrgm4_undefine([vers_have]) 106696a81b41Smrgm4_undefine([maj_have]) 106796a81b41Smrgm4_undefine([maj_needed]) 10688b22bf3fSmrg]) # XORG_MACROS_VERSION 10698b22bf3fSmrg 10708b22bf3fSmrg# XORG_PROG_RAWCPP() 10718b22bf3fSmrg# ------------------ 10728b22bf3fSmrg# Minimum version: 1.0.0 10738b22bf3fSmrg# 10748b22bf3fSmrg# Find cpp program and necessary flags for use in pre-processing text files 10758b22bf3fSmrg# such as man pages and config files 10768b22bf3fSmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 10778b22bf3fSmrgAC_REQUIRE([AC_PROG_CPP]) 10788b22bf3fSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 10798b22bf3fSmrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 10808b22bf3fSmrg 10818b22bf3fSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 10828b22bf3fSmrg# which is not the best choice for supporting other OS'es, but covers most 10838b22bf3fSmrg# of the ones we need for now. 10848b22bf3fSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 10858b22bf3fSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?]) 10868b22bf3fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 10878b22bf3fSmrg AC_MSG_RESULT([no]) 10888b22bf3fSmrgelse 10898b22bf3fSmrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 10908b22bf3fSmrg RAWCPPFLAGS=-undef 10918b22bf3fSmrg AC_MSG_RESULT([yes]) 109296a81b41Smrg # under Cygwin unix is still defined even with -undef 109396a81b41Smrg elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 109496a81b41Smrg RAWCPPFLAGS="-undef -ansi" 109596a81b41Smrg AC_MSG_RESULT([yes, with -ansi]) 10968b22bf3fSmrg else 10978b22bf3fSmrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 10988b22bf3fSmrg fi 10998b22bf3fSmrgfi 11008b22bf3fSmrgrm -f conftest.$ac_ext 11018b22bf3fSmrg 11028b22bf3fSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 11038b22bf3fSmrgAC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) 11048b22bf3fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 11058b22bf3fSmrg AC_MSG_RESULT([no]) 11068b22bf3fSmrgelse 11078b22bf3fSmrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 11088b22bf3fSmrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 11098b22bf3fSmrg AC_MSG_RESULT([yes]) 11108b22bf3fSmrg else 11118b22bf3fSmrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 11128b22bf3fSmrg fi 11138b22bf3fSmrgfi 11148b22bf3fSmrgrm -f conftest.$ac_ext 11158b22bf3fSmrgAC_SUBST(RAWCPPFLAGS) 11168b22bf3fSmrg]) # XORG_PROG_RAWCPP 11178b22bf3fSmrg 11188b22bf3fSmrg# XORG_MANPAGE_SECTIONS() 11198b22bf3fSmrg# ----------------------- 11208b22bf3fSmrg# Minimum version: 1.0.0 11218b22bf3fSmrg# 11228b22bf3fSmrg# Determine which sections man pages go in for the different man page types 11238b22bf3fSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 11248b22bf3fSmrg# Not sure if there's any better way than just hardcoding by OS name. 11258b22bf3fSmrg# Override default settings by setting environment variables 11265bd32fd1Smrg# Added MAN_SUBSTS in version 1.8 11275bd32fd1Smrg# Added AC_PROG_SED in version 1.8 11288b22bf3fSmrg 11298b22bf3fSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 11308b22bf3fSmrgAC_REQUIRE([AC_CANONICAL_HOST]) 11315bd32fd1SmrgAC_REQUIRE([AC_PROG_SED]) 11328b22bf3fSmrg 11338b22bf3fSmrgif test x$APP_MAN_SUFFIX = x ; then 11348b22bf3fSmrg APP_MAN_SUFFIX=1 11358b22bf3fSmrgfi 11368b22bf3fSmrgif test x$APP_MAN_DIR = x ; then 11378b22bf3fSmrg APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' 11388b22bf3fSmrgfi 11398b22bf3fSmrg 11408b22bf3fSmrgif test x$LIB_MAN_SUFFIX = x ; then 11418b22bf3fSmrg LIB_MAN_SUFFIX=3 11428b22bf3fSmrgfi 11438b22bf3fSmrgif test x$LIB_MAN_DIR = x ; then 11448b22bf3fSmrg LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' 11458b22bf3fSmrgfi 11468b22bf3fSmrg 11478b22bf3fSmrgif test x$FILE_MAN_SUFFIX = x ; then 11488b22bf3fSmrg case $host_os in 11498b22bf3fSmrg solaris*) FILE_MAN_SUFFIX=4 ;; 11508b22bf3fSmrg *) FILE_MAN_SUFFIX=5 ;; 11518b22bf3fSmrg esac 11528b22bf3fSmrgfi 11538b22bf3fSmrgif test x$FILE_MAN_DIR = x ; then 11548b22bf3fSmrg FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' 11558b22bf3fSmrgfi 11568b22bf3fSmrg 11578b22bf3fSmrgif test x$MISC_MAN_SUFFIX = x ; then 11588b22bf3fSmrg case $host_os in 11598b22bf3fSmrg solaris*) MISC_MAN_SUFFIX=5 ;; 11608b22bf3fSmrg *) MISC_MAN_SUFFIX=7 ;; 11618b22bf3fSmrg esac 11628b22bf3fSmrgfi 11638b22bf3fSmrgif test x$MISC_MAN_DIR = x ; then 11648b22bf3fSmrg MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' 11658b22bf3fSmrgfi 11668b22bf3fSmrg 11678b22bf3fSmrgif test x$DRIVER_MAN_SUFFIX = x ; then 11688b22bf3fSmrg case $host_os in 11698b22bf3fSmrg solaris*) DRIVER_MAN_SUFFIX=7 ;; 11708b22bf3fSmrg *) DRIVER_MAN_SUFFIX=4 ;; 11718b22bf3fSmrg esac 11728b22bf3fSmrgfi 11738b22bf3fSmrgif test x$DRIVER_MAN_DIR = x ; then 11748b22bf3fSmrg DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' 11758b22bf3fSmrgfi 11768b22bf3fSmrg 11778b22bf3fSmrgif test x$ADMIN_MAN_SUFFIX = x ; then 11788b22bf3fSmrg case $host_os in 11798b22bf3fSmrg solaris*) ADMIN_MAN_SUFFIX=1m ;; 11808b22bf3fSmrg *) ADMIN_MAN_SUFFIX=8 ;; 11818b22bf3fSmrg esac 11828b22bf3fSmrgfi 11838b22bf3fSmrgif test x$ADMIN_MAN_DIR = x ; then 11848b22bf3fSmrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 11858b22bf3fSmrgfi 11868b22bf3fSmrg 11878b22bf3fSmrg 11888b22bf3fSmrgAC_SUBST([APP_MAN_SUFFIX]) 11898b22bf3fSmrgAC_SUBST([LIB_MAN_SUFFIX]) 11908b22bf3fSmrgAC_SUBST([FILE_MAN_SUFFIX]) 11918b22bf3fSmrgAC_SUBST([MISC_MAN_SUFFIX]) 11928b22bf3fSmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 11938b22bf3fSmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 11948b22bf3fSmrgAC_SUBST([APP_MAN_DIR]) 11958b22bf3fSmrgAC_SUBST([LIB_MAN_DIR]) 11968b22bf3fSmrgAC_SUBST([FILE_MAN_DIR]) 11978b22bf3fSmrgAC_SUBST([MISC_MAN_DIR]) 11988b22bf3fSmrgAC_SUBST([DRIVER_MAN_DIR]) 11998b22bf3fSmrgAC_SUBST([ADMIN_MAN_DIR]) 12005bd32fd1Smrg 12015bd32fd1SmrgXORG_MAN_PAGE="X Version 11" 12025bd32fd1SmrgAC_SUBST([XORG_MAN_PAGE]) 12035bd32fd1SmrgMAN_SUBSTS="\ 12045bd32fd1Smrg -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 12055bd32fd1Smrg -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 12065bd32fd1Smrg -e 's|__xservername__|Xorg|g' \ 12075bd32fd1Smrg -e 's|__xconfigfile__|xorg.conf|g' \ 12085bd32fd1Smrg -e 's|__projectroot__|\$(prefix)|g' \ 12095bd32fd1Smrg -e 's|__apploaddir__|\$(appdefaultdir)|g' \ 12105bd32fd1Smrg -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ 12115bd32fd1Smrg -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ 12125bd32fd1Smrg -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ 12135bd32fd1Smrg -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ 12145bd32fd1Smrg -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ 12155bd32fd1Smrg -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" 12165bd32fd1SmrgAC_SUBST([MAN_SUBSTS]) 12175bd32fd1Smrg 12188b22bf3fSmrg]) # XORG_MANPAGE_SECTIONS 12198b22bf3fSmrg 12205bd32fd1Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION]) 12215bd32fd1Smrg# ------------------------ 12225bd32fd1Smrg# Minimum version: 1.7.0 12235bd32fd1Smrg# 12245bd32fd1Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent 12255bd32fd1Smrg# provided by xorg-sgml-doctools, if installed. 12265bd32fd1SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[ 12275bd32fd1SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])]) 12285bd32fd1SmrgXORG_SGML_PATH= 12295bd32fd1SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])], 12305bd32fd1Smrg [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`], 12315bd32fd1Smrg [m4_ifval([$1],[:], 12325bd32fd1Smrg [if test x"$cross_compiling" != x"yes" ; then 12335bd32fd1Smrg AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent], 12345bd32fd1Smrg [XORG_SGML_PATH=$prefix/share/sgml]) 12355bd32fd1Smrg fi]) 12365bd32fd1Smrg ]) 12375bd32fd1Smrg 12385bd32fd1Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing 12395bd32fd1Smrg# the path and the name of the doc stylesheet 12405bd32fd1Smrgif test "x$XORG_SGML_PATH" != "x" ; then 12415bd32fd1Smrg AC_MSG_RESULT([$XORG_SGML_PATH]) 12425bd32fd1Smrg STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 12435bd32fd1Smrg XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl 12445bd32fd1Smrgelse 12455bd32fd1Smrg AC_MSG_RESULT([no]) 12465bd32fd1Smrgfi 12475bd32fd1Smrg 12485bd32fd1SmrgAC_SUBST(XORG_SGML_PATH) 12495bd32fd1SmrgAC_SUBST(STYLESHEET_SRCDIR) 12505bd32fd1SmrgAC_SUBST(XSL_STYLESHEET) 12515bd32fd1SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"]) 12525bd32fd1Smrg]) # XORG_CHECK_SGML_DOCTOOLS 12535bd32fd1Smrg 12548b22bf3fSmrg# XORG_CHECK_LINUXDOC 12558b22bf3fSmrg# ------------------- 12568b22bf3fSmrg# Minimum version: 1.0.0 12578b22bf3fSmrg# 12588b22bf3fSmrg# Defines the variable MAKE_TEXT if the necessary tools and 12598b22bf3fSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 12608b22bf3fSmrg# Whether or not the necessary tools and files are found can be checked 12618b22bf3fSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 12628b22bf3fSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 12635bd32fd1SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 12645bd32fd1SmrgAC_REQUIRE([XORG_WITH_PS2PDF]) 12658b22bf3fSmrg 12668b22bf3fSmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 12678b22bf3fSmrg 12685bd32fd1SmrgAC_MSG_CHECKING([whether to build documentation]) 12698b22bf3fSmrg 12705bd32fd1Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then 12718b22bf3fSmrg BUILDDOC=yes 12728b22bf3fSmrgelse 12738b22bf3fSmrg BUILDDOC=no 12748b22bf3fSmrgfi 12758b22bf3fSmrg 12768b22bf3fSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 12778b22bf3fSmrg 12788b22bf3fSmrgAC_MSG_RESULT([$BUILDDOC]) 12798b22bf3fSmrg 12805bd32fd1SmrgAC_MSG_CHECKING([whether to build pdf documentation]) 12818b22bf3fSmrg 12825bd32fd1Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then 12838b22bf3fSmrg BUILDPDFDOC=yes 12848b22bf3fSmrgelse 12858b22bf3fSmrg BUILDPDFDOC=no 12868b22bf3fSmrgfi 12878b22bf3fSmrg 12888b22bf3fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 12898b22bf3fSmrg 12908b22bf3fSmrgAC_MSG_RESULT([$BUILDPDFDOC]) 12918b22bf3fSmrg 12925bd32fd1SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f" 12938b22bf3fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 12948b22bf3fSmrgMAKE_PDF="$PS2PDF" 12958b22bf3fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" 12968b22bf3fSmrg 12978b22bf3fSmrgAC_SUBST(MAKE_TEXT) 12988b22bf3fSmrgAC_SUBST(MAKE_PS) 12998b22bf3fSmrgAC_SUBST(MAKE_PDF) 13008b22bf3fSmrgAC_SUBST(MAKE_HTML) 13018b22bf3fSmrg]) # XORG_CHECK_LINUXDOC 13028b22bf3fSmrg 13038b22bf3fSmrg# XORG_CHECK_DOCBOOK 13048b22bf3fSmrg# ------------------- 13058b22bf3fSmrg# Minimum version: 1.0.0 13068b22bf3fSmrg# 13078b22bf3fSmrg# Checks for the ability to build output formats from SGML DocBook source. 13088b22bf3fSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" 13098b22bf3fSmrg# indicates whether the necessary tools and files are found and, if set, 13108b22bf3fSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx. 13118b22bf3fSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[ 13125bd32fd1SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 13135bd32fd1Smrg 13148b22bf3fSmrgBUILDTXTDOC=no 13158b22bf3fSmrgBUILDPDFDOC=no 13168b22bf3fSmrgBUILDPSDOC=no 13178b22bf3fSmrgBUILDHTMLDOC=no 13188b22bf3fSmrg 13198b22bf3fSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps) 13208b22bf3fSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf) 13218b22bf3fSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html) 13228b22bf3fSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt) 13238b22bf3fSmrg 13245bd32fd1SmrgAC_MSG_CHECKING([whether to build text documentation]) 13255bd32fd1Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x && 13268b22bf3fSmrg test x$BUILD_TXTDOC != xno; then 13278b22bf3fSmrg BUILDTXTDOC=yes 13288b22bf3fSmrgfi 13298b22bf3fSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) 13308b22bf3fSmrgAC_MSG_RESULT([$BUILDTXTDOC]) 13318b22bf3fSmrg 13325bd32fd1SmrgAC_MSG_CHECKING([whether to build PDF documentation]) 13335bd32fd1Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x && 13348b22bf3fSmrg test x$BUILD_PDFDOC != xno; then 13358b22bf3fSmrg BUILDPDFDOC=yes 13368b22bf3fSmrgfi 13378b22bf3fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 13388b22bf3fSmrgAC_MSG_RESULT([$BUILDPDFDOC]) 13398b22bf3fSmrg 13405bd32fd1SmrgAC_MSG_CHECKING([whether to build PostScript documentation]) 13415bd32fd1Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x && 13428b22bf3fSmrg test x$BUILD_PSDOC != xno; then 13438b22bf3fSmrg BUILDPSDOC=yes 13448b22bf3fSmrgfi 13458b22bf3fSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) 13468b22bf3fSmrgAC_MSG_RESULT([$BUILDPSDOC]) 13478b22bf3fSmrg 13485bd32fd1SmrgAC_MSG_CHECKING([whether to build HTML documentation]) 13495bd32fd1Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x && 13508b22bf3fSmrg test x$BUILD_HTMLDOC != xno; then 13518b22bf3fSmrg BUILDHTMLDOC=yes 13528b22bf3fSmrgfi 13538b22bf3fSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) 13548b22bf3fSmrgAC_MSG_RESULT([$BUILDHTMLDOC]) 13558b22bf3fSmrg 13568b22bf3fSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" 13578b22bf3fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" 13588b22bf3fSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" 13598b22bf3fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" 13608b22bf3fSmrg 13618b22bf3fSmrgAC_SUBST(MAKE_TEXT) 13628b22bf3fSmrgAC_SUBST(MAKE_PS) 13638b22bf3fSmrgAC_SUBST(MAKE_PDF) 13648b22bf3fSmrgAC_SUBST(MAKE_HTML) 13658b22bf3fSmrg]) # XORG_CHECK_DOCBOOK 13668b22bf3fSmrg 13675bd32fd1Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT]) 13685bd32fd1Smrg# ---------------- 13695bd32fd1Smrg# Minimum version: 1.5.0 13705bd32fd1Smrg# Minimum version for optional DEFAULT argument: 1.11.0 13715bd32fd1Smrg# 13725bd32fd1Smrg# Documentation tools are not always available on all platforms and sometimes 13735bd32fd1Smrg# not at the appropriate level. This macro enables a module to test for the 13745bd32fd1Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 13755bd32fd1Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions 13765bd32fd1Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified, 13775bd32fd1Smrg# --with-xmlto assumes 'auto'. 13785bd32fd1Smrg# 13795bd32fd1Smrg# Interface to module: 13805bd32fd1Smrg# HAVE_XMLTO: used in makefiles to conditionally generate documentation 13815bd32fd1Smrg# XMLTO: returns the path of the xmlto program found 13825bd32fd1Smrg# returns the path set by the user in the environment 13835bd32fd1Smrg# --with-xmlto: 'yes' user instructs the module to use xmlto 13845bd32fd1Smrg# 'no' user instructs the module not to use xmlto 13855bd32fd1Smrg# 13865bd32fd1Smrg# Added in version 1.10.0 13875bd32fd1Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation 13885bd32fd1Smrg# xmlto for text output requires either lynx, links, or w3m browsers 13895bd32fd1Smrg# 13905bd32fd1Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. 13915bd32fd1Smrg# 13925bd32fd1SmrgAC_DEFUN([XORG_WITH_XMLTO],[ 13935bd32fd1SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command]) 13945bd32fd1Smrgm4_define([_defopt], m4_default([$2], [auto])) 13955bd32fd1SmrgAC_ARG_WITH(xmlto, 13965bd32fd1Smrg AS_HELP_STRING([--with-xmlto], 13975bd32fd1Smrg [Use xmlto to regenerate documentation (default: ]_defopt[)]), 13985bd32fd1Smrg [use_xmlto=$withval], [use_xmlto=]_defopt) 13995bd32fd1Smrgm4_undefine([_defopt]) 14005bd32fd1Smrg 14015bd32fd1Smrgif test "x$use_xmlto" = x"auto"; then 14025bd32fd1Smrg AC_PATH_PROG([XMLTO], [xmlto]) 14035bd32fd1Smrg if test "x$XMLTO" = "x"; then 14045bd32fd1Smrg AC_MSG_WARN([xmlto not found - documentation targets will be skipped]) 14055bd32fd1Smrg have_xmlto=no 14065bd32fd1Smrg else 14075bd32fd1Smrg have_xmlto=yes 14085bd32fd1Smrg fi 14095bd32fd1Smrgelif test "x$use_xmlto" = x"yes" ; then 14105bd32fd1Smrg AC_PATH_PROG([XMLTO], [xmlto]) 14115bd32fd1Smrg if test "x$XMLTO" = "x"; then 14125bd32fd1Smrg AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH]) 14135bd32fd1Smrg fi 14145bd32fd1Smrg have_xmlto=yes 14155bd32fd1Smrgelif test "x$use_xmlto" = x"no" ; then 14165bd32fd1Smrg if test "x$XMLTO" != "x"; then 14175bd32fd1Smrg AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified]) 14185bd32fd1Smrg fi 14195bd32fd1Smrg have_xmlto=no 14205bd32fd1Smrgelse 14215bd32fd1Smrg AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no']) 14225bd32fd1Smrgfi 14235bd32fd1Smrg 14245bd32fd1Smrg# Test for a minimum version of xmlto, if provided. 14255bd32fd1Smrgm4_ifval([$1], 14265bd32fd1Smrg[if test "$have_xmlto" = yes; then 14275bd32fd1Smrg # scrape the xmlto version 14285bd32fd1Smrg AC_MSG_CHECKING([the xmlto version]) 14295bd32fd1Smrg xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` 14305bd32fd1Smrg AC_MSG_RESULT([$xmlto_version]) 14315bd32fd1Smrg AS_VERSION_COMPARE([$xmlto_version], [$1], 14325bd32fd1Smrg [if test "x$use_xmlto" = xauto; then 14335bd32fd1Smrg AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed]) 14345bd32fd1Smrg have_xmlto=no 14355bd32fd1Smrg else 14365bd32fd1Smrg AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed]) 14375bd32fd1Smrg fi]) 14385bd32fd1Smrgfi]) 14395bd32fd1Smrg 14405bd32fd1Smrg# Test for the ability of xmlto to generate a text target 14415bd32fd1Smrghave_xmlto_text=no 14425bd32fd1Smrgcat > conftest.xml << "EOF" 14435bd32fd1SmrgEOF 14445bd32fd1SmrgAS_IF([test "$have_xmlto" = yes], 14455bd32fd1Smrg [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], 14465bd32fd1Smrg [have_xmlto_text=yes], 14475bd32fd1Smrg [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])]) 14485bd32fd1Smrgrm -f conftest.xml 14495bd32fd1SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) 14505bd32fd1SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) 14515bd32fd1Smrg]) # XORG_WITH_XMLTO 14525bd32fd1Smrg 14535bd32fd1Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT]) 14545bd32fd1Smrg# ---------------- 14555bd32fd1Smrg# Minimum version: 1.5.0 14565bd32fd1Smrg# Minimum version for optional DEFAULT argument: 1.11.0 14575bd32fd1Smrg# 14585bd32fd1Smrg# Documentation tools are not always available on all platforms and sometimes 14595bd32fd1Smrg# not at the appropriate level. This macro enables a module to test for the 14605bd32fd1Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 14615bd32fd1Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions 14625bd32fd1Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified, 14635bd32fd1Smrg# --with-asciidoc assumes 'auto'. 14645bd32fd1Smrg# 14655bd32fd1Smrg# Interface to module: 14665bd32fd1Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation 14675bd32fd1Smrg# ASCIIDOC: returns the path of the asciidoc program found 14685bd32fd1Smrg# returns the path set by the user in the environment 14695bd32fd1Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc 14705bd32fd1Smrg# 'no' user instructs the module not to use asciidoc 14715bd32fd1Smrg# 14725bd32fd1Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. 14735bd32fd1Smrg# 14745bd32fd1SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[ 14755bd32fd1SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command]) 14765bd32fd1Smrgm4_define([_defopt], m4_default([$2], [auto])) 14775bd32fd1SmrgAC_ARG_WITH(asciidoc, 14785bd32fd1Smrg AS_HELP_STRING([--with-asciidoc], 14795bd32fd1Smrg [Use asciidoc to regenerate documentation (default: ]_defopt[)]), 14805bd32fd1Smrg [use_asciidoc=$withval], [use_asciidoc=]_defopt) 14815bd32fd1Smrgm4_undefine([_defopt]) 14825bd32fd1Smrg 14835bd32fd1Smrgif test "x$use_asciidoc" = x"auto"; then 14845bd32fd1Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 14855bd32fd1Smrg if test "x$ASCIIDOC" = "x"; then 14865bd32fd1Smrg AC_MSG_WARN([asciidoc not found - documentation targets will be skipped]) 14875bd32fd1Smrg have_asciidoc=no 14885bd32fd1Smrg else 14895bd32fd1Smrg have_asciidoc=yes 14905bd32fd1Smrg fi 14915bd32fd1Smrgelif test "x$use_asciidoc" = x"yes" ; then 14925bd32fd1Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 14935bd32fd1Smrg if test "x$ASCIIDOC" = "x"; then 14945bd32fd1Smrg AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH]) 14955bd32fd1Smrg fi 14965bd32fd1Smrg have_asciidoc=yes 14975bd32fd1Smrgelif test "x$use_asciidoc" = x"no" ; then 14985bd32fd1Smrg if test "x$ASCIIDOC" != "x"; then 14995bd32fd1Smrg AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified]) 15005bd32fd1Smrg fi 15015bd32fd1Smrg have_asciidoc=no 15025bd32fd1Smrgelse 15035bd32fd1Smrg AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no']) 15045bd32fd1Smrgfi 15055bd32fd1Smrgm4_ifval([$1], 15065bd32fd1Smrg[if test "$have_asciidoc" = yes; then 15075bd32fd1Smrg # scrape the asciidoc version 15085bd32fd1Smrg AC_MSG_CHECKING([the asciidoc version]) 15095bd32fd1Smrg asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2` 15105bd32fd1Smrg AC_MSG_RESULT([$asciidoc_version]) 15115bd32fd1Smrg AS_VERSION_COMPARE([$asciidoc_version], [$1], 15125bd32fd1Smrg [if test "x$use_asciidoc" = xauto; then 15135bd32fd1Smrg AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed]) 15145bd32fd1Smrg have_asciidoc=no 15155bd32fd1Smrg else 15165bd32fd1Smrg AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed]) 15175bd32fd1Smrg fi]) 15185bd32fd1Smrgfi]) 15195bd32fd1SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) 15205bd32fd1Smrg]) # XORG_WITH_ASCIIDOC 15215bd32fd1Smrg 15225bd32fd1Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT]) 15235bd32fd1Smrg# -------------------------------- 15245bd32fd1Smrg# Minimum version: 1.5.0 15255bd32fd1Smrg# Minimum version for optional DEFAULT argument: 1.11.0 15265bd32fd1Smrg# 15275bd32fd1Smrg# Documentation tools are not always available on all platforms and sometimes 15285bd32fd1Smrg# not at the appropriate level. This macro enables a module to test for the 15295bd32fd1Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 15305bd32fd1Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions 15315bd32fd1Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified, 15325bd32fd1Smrg# --with-doxygen assumes 'auto'. 15335bd32fd1Smrg# 15345bd32fd1Smrg# Interface to module: 15355bd32fd1Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation 15365bd32fd1Smrg# DOXYGEN: returns the path of the doxygen program found 15375bd32fd1Smrg# returns the path set by the user in the environment 15385bd32fd1Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen 15395bd32fd1Smrg# 'no' user instructs the module not to use doxygen 15405bd32fd1Smrg# 15415bd32fd1Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. 15425bd32fd1Smrg# 15435bd32fd1SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[ 15445bd32fd1SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command]) 15455bd32fd1Smrgm4_define([_defopt], m4_default([$2], [auto])) 15465bd32fd1SmrgAC_ARG_WITH(doxygen, 15475bd32fd1Smrg AS_HELP_STRING([--with-doxygen], 15485bd32fd1Smrg [Use doxygen to regenerate documentation (default: ]_defopt[)]), 15495bd32fd1Smrg [use_doxygen=$withval], [use_doxygen=]_defopt) 15505bd32fd1Smrgm4_undefine([_defopt]) 15515bd32fd1Smrg 15525bd32fd1Smrgif test "x$use_doxygen" = x"auto"; then 15535bd32fd1Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 15545bd32fd1Smrg if test "x$DOXYGEN" = "x"; then 15555bd32fd1Smrg AC_MSG_WARN([doxygen not found - documentation targets will be skipped]) 15565bd32fd1Smrg have_doxygen=no 15575bd32fd1Smrg else 15585bd32fd1Smrg have_doxygen=yes 15595bd32fd1Smrg fi 15605bd32fd1Smrgelif test "x$use_doxygen" = x"yes" ; then 15615bd32fd1Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 15625bd32fd1Smrg if test "x$DOXYGEN" = "x"; then 15635bd32fd1Smrg AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH]) 15645bd32fd1Smrg fi 15655bd32fd1Smrg have_doxygen=yes 15665bd32fd1Smrgelif test "x$use_doxygen" = x"no" ; then 15675bd32fd1Smrg if test "x$DOXYGEN" != "x"; then 15685bd32fd1Smrg AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified]) 15695bd32fd1Smrg fi 15705bd32fd1Smrg have_doxygen=no 15715bd32fd1Smrgelse 15725bd32fd1Smrg AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no']) 15735bd32fd1Smrgfi 15745bd32fd1Smrgm4_ifval([$1], 15755bd32fd1Smrg[if test "$have_doxygen" = yes; then 15765bd32fd1Smrg # scrape the doxygen version 15775bd32fd1Smrg AC_MSG_CHECKING([the doxygen version]) 15785bd32fd1Smrg doxygen_version=`$DOXYGEN --version 2>/dev/null` 15795bd32fd1Smrg AC_MSG_RESULT([$doxygen_version]) 15805bd32fd1Smrg AS_VERSION_COMPARE([$doxygen_version], [$1], 15815bd32fd1Smrg [if test "x$use_doxygen" = xauto; then 15825bd32fd1Smrg AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed]) 15835bd32fd1Smrg have_doxygen=no 15845bd32fd1Smrg else 15855bd32fd1Smrg AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) 15865bd32fd1Smrg fi]) 15875bd32fd1Smrgfi]) 15885bd32fd1SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) 15895bd32fd1Smrg]) # XORG_WITH_DOXYGEN 15905bd32fd1Smrg 15915bd32fd1Smrg# XORG_WITH_GROFF([DEFAULT]) 15925bd32fd1Smrg# ---------------- 15935bd32fd1Smrg# Minimum version: 1.6.0 15945bd32fd1Smrg# Minimum version for optional DEFAULT argument: 1.11.0 15955bd32fd1Smrg# 15965bd32fd1Smrg# Documentation tools are not always available on all platforms and sometimes 15975bd32fd1Smrg# not at the appropriate level. This macro enables a module to test for the 15985bd32fd1Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 15995bd32fd1Smrg# the --with-groff option, it allows maximum flexibilty in making decisions 16005bd32fd1Smrg# as whether or not to use the groff package. When DEFAULT is not specified, 16015bd32fd1Smrg# --with-groff assumes 'auto'. 16025bd32fd1Smrg# 16035bd32fd1Smrg# Interface to module: 16045bd32fd1Smrg# HAVE_GROFF: used in makefiles to conditionally generate documentation 16055bd32fd1Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package 16065bd32fd1Smrg# HAVE_GROFF_MS: the -ms macros package 16075bd32fd1Smrg# GROFF: returns the path of the groff program found 16085bd32fd1Smrg# returns the path set by the user in the environment 16095bd32fd1Smrg# --with-groff: 'yes' user instructs the module to use groff 16105bd32fd1Smrg# 'no' user instructs the module not to use groff 16115bd32fd1Smrg# 16125bd32fd1Smrg# Added in version 1.9.0: 16135bd32fd1Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format: 16145bd32fd1Smrg# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package. 16155bd32fd1Smrg# psselect from the psutils package. 16165bd32fd1Smrg# the ghostcript package. Refer to the grohtml man pages 16175bd32fd1Smrg# 16185bd32fd1Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path. 16195bd32fd1Smrg# 16205bd32fd1Smrg# OS and distros often splits groff in a basic and full package, the former 16215bd32fd1Smrg# having the groff program and the later having devices, fonts and macros 16225bd32fd1Smrg# Checking for the groff executable is not enough. 16235bd32fd1Smrg# 16245bd32fd1Smrg# If macros are missing, we cannot assume that groff is useless, so we don't 16255bd32fd1Smrg# unset HAVE_GROFF or GROFF env variables. 16265bd32fd1Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false. 16275bd32fd1Smrg# 16285bd32fd1SmrgAC_DEFUN([XORG_WITH_GROFF],[ 16295bd32fd1SmrgAC_ARG_VAR([GROFF], [Path to groff command]) 16305bd32fd1Smrgm4_define([_defopt], m4_default([$1], [auto])) 16315bd32fd1SmrgAC_ARG_WITH(groff, 16325bd32fd1Smrg AS_HELP_STRING([--with-groff], 16335bd32fd1Smrg [Use groff to regenerate documentation (default: ]_defopt[)]), 16345bd32fd1Smrg [use_groff=$withval], [use_groff=]_defopt) 16355bd32fd1Smrgm4_undefine([_defopt]) 16365bd32fd1Smrg 16375bd32fd1Smrgif test "x$use_groff" = x"auto"; then 16385bd32fd1Smrg AC_PATH_PROG([GROFF], [groff]) 16395bd32fd1Smrg if test "x$GROFF" = "x"; then 16405bd32fd1Smrg AC_MSG_WARN([groff not found - documentation targets will be skipped]) 16415bd32fd1Smrg have_groff=no 16425bd32fd1Smrg else 16435bd32fd1Smrg have_groff=yes 16445bd32fd1Smrg fi 16455bd32fd1Smrgelif test "x$use_groff" = x"yes" ; then 16465bd32fd1Smrg AC_PATH_PROG([GROFF], [groff]) 16475bd32fd1Smrg if test "x$GROFF" = "x"; then 16485bd32fd1Smrg AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH]) 16495bd32fd1Smrg fi 16505bd32fd1Smrg have_groff=yes 16515bd32fd1Smrgelif test "x$use_groff" = x"no" ; then 16525bd32fd1Smrg if test "x$GROFF" != "x"; then 16535bd32fd1Smrg AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified]) 16545bd32fd1Smrg fi 16555bd32fd1Smrg have_groff=no 16565bd32fd1Smrgelse 16575bd32fd1Smrg AC_MSG_ERROR([--with-groff expects 'yes' or 'no']) 16585bd32fd1Smrgfi 16595bd32fd1Smrg 16605bd32fd1Smrg# We have groff, test for the presence of the macro packages 16615bd32fd1Smrgif test "x$have_groff" = x"yes"; then 16625bd32fd1Smrg AC_MSG_CHECKING([for ${GROFF} -ms macros]) 16635bd32fd1Smrg if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then 16645bd32fd1Smrg groff_ms_works=yes 16655bd32fd1Smrg else 16665bd32fd1Smrg groff_ms_works=no 16675bd32fd1Smrg fi 16685bd32fd1Smrg AC_MSG_RESULT([$groff_ms_works]) 16695bd32fd1Smrg AC_MSG_CHECKING([for ${GROFF} -mm macros]) 16705bd32fd1Smrg if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then 16715bd32fd1Smrg groff_mm_works=yes 16725bd32fd1Smrg else 16735bd32fd1Smrg groff_mm_works=no 16745bd32fd1Smrg fi 16755bd32fd1Smrg AC_MSG_RESULT([$groff_mm_works]) 16765bd32fd1Smrgfi 16775bd32fd1Smrg 16785bd32fd1Smrg# We have groff, test for HTML dependencies, one command per package 16795bd32fd1Smrgif test "x$have_groff" = x"yes"; then 16805bd32fd1Smrg AC_PATH_PROGS(GS_PATH, [gs gswin32c]) 16815bd32fd1Smrg AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng]) 16825bd32fd1Smrg AC_PATH_PROG(PSSELECT_PATH, [psselect]) 16835bd32fd1Smrg if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then 16845bd32fd1Smrg have_groff_html=yes 16855bd32fd1Smrg else 16865bd32fd1Smrg have_groff_html=no 16875bd32fd1Smrg AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages]) 16885bd32fd1Smrg fi 16895bd32fd1Smrgfi 16905bd32fd1Smrg 16915bd32fd1Smrg# Set Automake conditionals for Makefiles 16925bd32fd1SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes]) 16935bd32fd1SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes]) 16945bd32fd1SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes]) 16955bd32fd1SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes]) 16965bd32fd1Smrg]) # XORG_WITH_GROFF 16975bd32fd1Smrg 16985bd32fd1Smrg# XORG_WITH_FOP([DEFAULT]) 16995bd32fd1Smrg# ---------------- 17005bd32fd1Smrg# Minimum version: 1.6.0 17015bd32fd1Smrg# Minimum version for optional DEFAULT argument: 1.11.0 17025bd32fd1Smrg# 17035bd32fd1Smrg# Documentation tools are not always available on all platforms and sometimes 17045bd32fd1Smrg# not at the appropriate level. This macro enables a module to test for the 17055bd32fd1Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 17065bd32fd1Smrg# the --with-fop option, it allows maximum flexibilty in making decisions 17075bd32fd1Smrg# as whether or not to use the fop package. When DEFAULT is not specified, 17085bd32fd1Smrg# --with-fop assumes 'auto'. 17095bd32fd1Smrg# 17105bd32fd1Smrg# Interface to module: 17115bd32fd1Smrg# HAVE_FOP: used in makefiles to conditionally generate documentation 17125bd32fd1Smrg# FOP: returns the path of the fop program found 17135bd32fd1Smrg# returns the path set by the user in the environment 17145bd32fd1Smrg# --with-fop: 'yes' user instructs the module to use fop 17155bd32fd1Smrg# 'no' user instructs the module not to use fop 17165bd32fd1Smrg# 17175bd32fd1Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path. 17185bd32fd1Smrg# 17195bd32fd1SmrgAC_DEFUN([XORG_WITH_FOP],[ 17205bd32fd1SmrgAC_ARG_VAR([FOP], [Path to fop command]) 17215bd32fd1Smrgm4_define([_defopt], m4_default([$1], [auto])) 17225bd32fd1SmrgAC_ARG_WITH(fop, 17235bd32fd1Smrg AS_HELP_STRING([--with-fop], 17245bd32fd1Smrg [Use fop to regenerate documentation (default: ]_defopt[)]), 17255bd32fd1Smrg [use_fop=$withval], [use_fop=]_defopt) 17265bd32fd1Smrgm4_undefine([_defopt]) 17275bd32fd1Smrg 17285bd32fd1Smrgif test "x$use_fop" = x"auto"; then 17295bd32fd1Smrg AC_PATH_PROG([FOP], [fop]) 17305bd32fd1Smrg if test "x$FOP" = "x"; then 17315bd32fd1Smrg AC_MSG_WARN([fop not found - documentation targets will be skipped]) 17325bd32fd1Smrg have_fop=no 17335bd32fd1Smrg else 17345bd32fd1Smrg have_fop=yes 17355bd32fd1Smrg fi 17365bd32fd1Smrgelif test "x$use_fop" = x"yes" ; then 17375bd32fd1Smrg AC_PATH_PROG([FOP], [fop]) 17385bd32fd1Smrg if test "x$FOP" = "x"; then 17395bd32fd1Smrg AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH]) 17405bd32fd1Smrg fi 17415bd32fd1Smrg have_fop=yes 17425bd32fd1Smrgelif test "x$use_fop" = x"no" ; then 17435bd32fd1Smrg if test "x$FOP" != "x"; then 17445bd32fd1Smrg AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified]) 17455bd32fd1Smrg fi 17465bd32fd1Smrg have_fop=no 17475bd32fd1Smrgelse 17485bd32fd1Smrg AC_MSG_ERROR([--with-fop expects 'yes' or 'no']) 17495bd32fd1Smrgfi 17505bd32fd1SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) 17515bd32fd1Smrg]) # XORG_WITH_FOP 17525bd32fd1Smrg 17535bd32fd1Smrg# XORG_WITH_PS2PDF([DEFAULT]) 17545bd32fd1Smrg# ---------------- 17555bd32fd1Smrg# Minimum version: 1.6.0 17565bd32fd1Smrg# Minimum version for optional DEFAULT argument: 1.11.0 17575bd32fd1Smrg# 17585bd32fd1Smrg# Documentation tools are not always available on all platforms and sometimes 17595bd32fd1Smrg# not at the appropriate level. This macro enables a module to test for the 17605bd32fd1Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 17615bd32fd1Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions 17625bd32fd1Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified, 17635bd32fd1Smrg# --with-ps2pdf assumes 'auto'. 17645bd32fd1Smrg# 17655bd32fd1Smrg# Interface to module: 17665bd32fd1Smrg# HAVE_PS2PDF: used in makefiles to conditionally generate documentation 17675bd32fd1Smrg# PS2PDF: returns the path of the ps2pdf program found 17685bd32fd1Smrg# returns the path set by the user in the environment 17695bd32fd1Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf 17705bd32fd1Smrg# 'no' user instructs the module not to use ps2pdf 17715bd32fd1Smrg# 17725bd32fd1Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path. 17735bd32fd1Smrg# 17745bd32fd1SmrgAC_DEFUN([XORG_WITH_PS2PDF],[ 17755bd32fd1SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command]) 17765bd32fd1Smrgm4_define([_defopt], m4_default([$1], [auto])) 17775bd32fd1SmrgAC_ARG_WITH(ps2pdf, 17785bd32fd1Smrg AS_HELP_STRING([--with-ps2pdf], 17795bd32fd1Smrg [Use ps2pdf to regenerate documentation (default: ]_defopt[)]), 17805bd32fd1Smrg [use_ps2pdf=$withval], [use_ps2pdf=]_defopt) 17815bd32fd1Smrgm4_undefine([_defopt]) 17825bd32fd1Smrg 17835bd32fd1Smrgif test "x$use_ps2pdf" = x"auto"; then 17845bd32fd1Smrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 17855bd32fd1Smrg if test "x$PS2PDF" = "x"; then 17865bd32fd1Smrg AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped]) 17875bd32fd1Smrg have_ps2pdf=no 17885bd32fd1Smrg else 17895bd32fd1Smrg have_ps2pdf=yes 17905bd32fd1Smrg fi 17915bd32fd1Smrgelif test "x$use_ps2pdf" = x"yes" ; then 17925bd32fd1Smrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 17935bd32fd1Smrg if test "x$PS2PDF" = "x"; then 17945bd32fd1Smrg AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH]) 17955bd32fd1Smrg fi 17965bd32fd1Smrg have_ps2pdf=yes 17975bd32fd1Smrgelif test "x$use_ps2pdf" = x"no" ; then 17985bd32fd1Smrg if test "x$PS2PDF" != "x"; then 17995bd32fd1Smrg AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified]) 18005bd32fd1Smrg fi 18015bd32fd1Smrg have_ps2pdf=no 18025bd32fd1Smrgelse 18035bd32fd1Smrg AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no']) 18045bd32fd1Smrgfi 18055bd32fd1SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes]) 18065bd32fd1Smrg]) # XORG_WITH_PS2PDF 18075bd32fd1Smrg 18085bd32fd1Smrg# XORG_ENABLE_DOCS (enable_docs=yes) 18095bd32fd1Smrg# ---------------- 18105bd32fd1Smrg# Minimum version: 1.6.0 18115bd32fd1Smrg# 18125bd32fd1Smrg# Documentation tools are not always available on all platforms and sometimes 18135bd32fd1Smrg# not at the appropriate level. This macro enables a builder to skip all 18145bd32fd1Smrg# documentation targets except traditional man pages. 18155bd32fd1Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 18165bd32fd1Smrg# maximum flexibilty in controlling documentation building. 18175bd32fd1Smrg# Refer to: 18185bd32fd1Smrg# XORG_WITH_XMLTO --with-xmlto 18195bd32fd1Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 18205bd32fd1Smrg# XORG_WITH_DOXYGEN --with-doxygen 18215bd32fd1Smrg# XORG_WITH_FOP --with-fop 18225bd32fd1Smrg# XORG_WITH_GROFF --with-groff 18235bd32fd1Smrg# XORG_WITH_PS2PDF --with-ps2pdf 18245bd32fd1Smrg# 18255bd32fd1Smrg# Interface to module: 18265bd32fd1Smrg# ENABLE_DOCS: used in makefiles to conditionally generate documentation 18275bd32fd1Smrg# --enable-docs: 'yes' user instructs the module to generate docs 18285bd32fd1Smrg# 'no' user instructs the module not to generate docs 18295bd32fd1Smrg# parm1: specify the default value, yes or no. 18305bd32fd1Smrg# 18315bd32fd1SmrgAC_DEFUN([XORG_ENABLE_DOCS],[ 18325bd32fd1Smrgm4_define([default], m4_default([$1], [yes])) 18335bd32fd1SmrgAC_ARG_ENABLE(docs, 18345bd32fd1Smrg AS_HELP_STRING([--enable-docs], 18355bd32fd1Smrg [Enable building the documentation (default: ]default[)]), 18365bd32fd1Smrg [build_docs=$enableval], [build_docs=]default) 18375bd32fd1Smrgm4_undefine([default]) 18385bd32fd1SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes]) 18395bd32fd1SmrgAC_MSG_CHECKING([whether to build documentation]) 18405bd32fd1SmrgAC_MSG_RESULT([$build_docs]) 18415bd32fd1Smrg]) # XORG_ENABLE_DOCS 18425bd32fd1Smrg 18435bd32fd1Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes) 18445bd32fd1Smrg# ---------------- 18455bd32fd1Smrg# Minimum version: 1.6.0 18465bd32fd1Smrg# 18475bd32fd1Smrg# This macro enables a builder to skip all developer documentation. 18485bd32fd1Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 18495bd32fd1Smrg# maximum flexibilty in controlling documentation building. 18505bd32fd1Smrg# Refer to: 18515bd32fd1Smrg# XORG_WITH_XMLTO --with-xmlto 18525bd32fd1Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 18535bd32fd1Smrg# XORG_WITH_DOXYGEN --with-doxygen 18545bd32fd1Smrg# XORG_WITH_FOP --with-fop 18555bd32fd1Smrg# XORG_WITH_GROFF --with-groff 18565bd32fd1Smrg# XORG_WITH_PS2PDF --with-ps2pdf 18575bd32fd1Smrg# 18585bd32fd1Smrg# Interface to module: 18595bd32fd1Smrg# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs 18605bd32fd1Smrg# --enable-devel-docs: 'yes' user instructs the module to generate developer docs 18615bd32fd1Smrg# 'no' user instructs the module not to generate developer docs 18625bd32fd1Smrg# parm1: specify the default value, yes or no. 18635bd32fd1Smrg# 18645bd32fd1SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[ 18655bd32fd1Smrgm4_define([devel_default], m4_default([$1], [yes])) 18665bd32fd1SmrgAC_ARG_ENABLE(devel-docs, 18675bd32fd1Smrg AS_HELP_STRING([--enable-devel-docs], 18685bd32fd1Smrg [Enable building the developer documentation (default: ]devel_default[)]), 18695bd32fd1Smrg [build_devel_docs=$enableval], [build_devel_docs=]devel_default) 18705bd32fd1Smrgm4_undefine([devel_default]) 18715bd32fd1SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes]) 18725bd32fd1SmrgAC_MSG_CHECKING([whether to build developer documentation]) 18735bd32fd1SmrgAC_MSG_RESULT([$build_devel_docs]) 18745bd32fd1Smrg]) # XORG_ENABLE_DEVEL_DOCS 18755bd32fd1Smrg 18765bd32fd1Smrg# XORG_ENABLE_SPECS (enable_specs=yes) 18775bd32fd1Smrg# ---------------- 18785bd32fd1Smrg# Minimum version: 1.6.0 18795bd32fd1Smrg# 18805bd32fd1Smrg# This macro enables a builder to skip all functional specification targets. 18815bd32fd1Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 18825bd32fd1Smrg# maximum flexibilty in controlling documentation building. 18835bd32fd1Smrg# Refer to: 18845bd32fd1Smrg# XORG_WITH_XMLTO --with-xmlto 18855bd32fd1Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 18865bd32fd1Smrg# XORG_WITH_DOXYGEN --with-doxygen 18875bd32fd1Smrg# XORG_WITH_FOP --with-fop 18885bd32fd1Smrg# XORG_WITH_GROFF --with-groff 18895bd32fd1Smrg# XORG_WITH_PS2PDF --with-ps2pdf 18905bd32fd1Smrg# 18915bd32fd1Smrg# Interface to module: 18925bd32fd1Smrg# ENABLE_SPECS: used in makefiles to conditionally generate specs 18935bd32fd1Smrg# --enable-specs: 'yes' user instructs the module to generate specs 18945bd32fd1Smrg# 'no' user instructs the module not to generate specs 18955bd32fd1Smrg# parm1: specify the default value, yes or no. 18965bd32fd1Smrg# 18975bd32fd1SmrgAC_DEFUN([XORG_ENABLE_SPECS],[ 18985bd32fd1Smrgm4_define([spec_default], m4_default([$1], [yes])) 18995bd32fd1SmrgAC_ARG_ENABLE(specs, 19005bd32fd1Smrg AS_HELP_STRING([--enable-specs], 19015bd32fd1Smrg [Enable building the specs (default: ]spec_default[)]), 19025bd32fd1Smrg [build_specs=$enableval], [build_specs=]spec_default) 19035bd32fd1Smrgm4_undefine([spec_default]) 19045bd32fd1SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes]) 19055bd32fd1SmrgAC_MSG_CHECKING([whether to build functional specifications]) 19065bd32fd1SmrgAC_MSG_RESULT([$build_specs]) 19075bd32fd1Smrg]) # XORG_ENABLE_SPECS 19085bd32fd1Smrg 19098b22bf3fSmrg# XORG_CHECK_MALLOC_ZERO 19108b22bf3fSmrg# ---------------------- 19118b22bf3fSmrg# Minimum version: 1.0.0 19128b22bf3fSmrg# 19138b22bf3fSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 19148b22bf3fSmrg# malloc(0) returns NULL. Packages should add one of these cflags to 19158b22bf3fSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 19168b22bf3fSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 19178b22bf3fSmrgAC_ARG_ENABLE(malloc0returnsnull, 191896a81b41Smrg AS_HELP_STRING([--enable-malloc0returnsnull], 19198b22bf3fSmrg [malloc(0) returns NULL (default: auto)]), 19208b22bf3fSmrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 19218b22bf3fSmrg [MALLOC_ZERO_RETURNS_NULL=auto]) 19228b22bf3fSmrg 19238b22bf3fSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 19248b22bf3fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 19258b22bf3fSmrg AC_RUN_IFELSE([ 19268b22bf3fSmrgchar *malloc(); 19278b22bf3fSmrgchar *realloc(); 19288b22bf3fSmrgchar *calloc(); 19298b22bf3fSmrgmain() { 19308b22bf3fSmrg char *m0, *r0, *c0, *p; 19318b22bf3fSmrg m0 = malloc(0); 19328b22bf3fSmrg p = malloc(10); 19338b22bf3fSmrg r0 = realloc(p,0); 19348b22bf3fSmrg c0 = calloc(0); 19358b22bf3fSmrg exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); 19368b22bf3fSmrg}], 19378b22bf3fSmrg [MALLOC_ZERO_RETURNS_NULL=yes], 19385bd32fd1Smrg [MALLOC_ZERO_RETURNS_NULL=no], 19395bd32fd1Smrg [MALLOC_ZERO_RETURNS_NULL=yes]) 19408b22bf3fSmrgfi 19418b22bf3fSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 19428b22bf3fSmrg 19438b22bf3fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 19448b22bf3fSmrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 19458b22bf3fSmrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 19468b22bf3fSmrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 19478b22bf3fSmrgelse 19488b22bf3fSmrg MALLOC_ZERO_CFLAGS="" 19498b22bf3fSmrg XMALLOC_ZERO_CFLAGS="" 19508b22bf3fSmrg XTMALLOC_ZERO_CFLAGS="" 19518b22bf3fSmrgfi 19528b22bf3fSmrg 19538b22bf3fSmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 19548b22bf3fSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 19558b22bf3fSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 19568b22bf3fSmrg]) # XORG_CHECK_MALLOC_ZERO 19578b22bf3fSmrg 19588b22bf3fSmrg# XORG_WITH_LINT() 19598b22bf3fSmrg# ---------------- 19608b22bf3fSmrg# Minimum version: 1.1.0 19618b22bf3fSmrg# 19625bd32fd1Smrg# This macro enables the use of a tool that flags some suspicious and 19635bd32fd1Smrg# non-portable constructs (likely to be bugs) in C language source code. 19645bd32fd1Smrg# It will attempt to locate the tool and use appropriate options. 19655bd32fd1Smrg# There are various lint type tools on different platforms. 19665bd32fd1Smrg# 19675bd32fd1Smrg# Interface to module: 19685bd32fd1Smrg# LINT: returns the path to the tool found on the platform 19695bd32fd1Smrg# or the value set to LINT on the configure cmd line 19705bd32fd1Smrg# also an Automake conditional 19715bd32fd1Smrg# LINT_FLAGS: an Automake variable with appropriate flags 19725bd32fd1Smrg# 19735bd32fd1Smrg# --with-lint: 'yes' user instructs the module to use lint 19745bd32fd1Smrg# 'no' user instructs the module not to use lint (default) 19755bd32fd1Smrg# 19765bd32fd1Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path. 19775bd32fd1Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim. 19788b22bf3fSmrg# 19798b22bf3fSmrgAC_DEFUN([XORG_WITH_LINT],[ 19808b22bf3fSmrg 19815bd32fd1SmrgAC_ARG_VAR([LINT], [Path to a lint-style command]) 19825bd32fd1SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command]) 198396a81b41SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint], 19848b22bf3fSmrg [Use a lint-style source code checker (default: disabled)])], 19858b22bf3fSmrg [use_lint=$withval], [use_lint=no]) 19865bd32fd1Smrg 19875bd32fd1Smrg# Obtain platform specific info like program name and options 19885bd32fd1Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris 19895bd32fd1Smrgcase $host_os in 19905bd32fd1Smrg *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*) 19915bd32fd1Smrg lint_name=splint 19925bd32fd1Smrg lint_options="-badflag" 19935bd32fd1Smrg ;; 19945bd32fd1Smrg *freebsd* | *netbsd*) 19955bd32fd1Smrg lint_name=lint 19965bd32fd1Smrg lint_options="-u -b" 19975bd32fd1Smrg ;; 19985bd32fd1Smrg *solaris*) 19995bd32fd1Smrg lint_name=lint 20005bd32fd1Smrg lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" 20015bd32fd1Smrg ;; 20025bd32fd1Smrgesac 20035bd32fd1Smrg 20045bd32fd1Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user) 20055bd32fd1Smrgif test "x$use_lint" = x"yes" ; then 20065bd32fd1Smrg AC_PATH_PROG([LINT], [$lint_name]) 20075bd32fd1Smrg if test "x$LINT" = "x"; then 20085bd32fd1Smrg AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH]) 20095bd32fd1Smrg fi 20105bd32fd1Smrgelif test "x$use_lint" = x"no" ; then 20115bd32fd1Smrg if test "x$LINT" != "x"; then 20125bd32fd1Smrg AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified]) 20135bd32fd1Smrg fi 20148b22bf3fSmrgelse 20155bd32fd1Smrg AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.]) 20168b22bf3fSmrgfi 20175bd32fd1Smrg 20185bd32fd1Smrg# User supplied flags override default flags 20195bd32fd1Smrgif test "x$LINT_FLAGS" != "x"; then 20205bd32fd1Smrg lint_options=$LINT_FLAGS 20218b22bf3fSmrgfi 20228b22bf3fSmrg 20235bd32fd1SmrgAC_SUBST([LINT_FLAGS],[$lint_options]) 20245bd32fd1SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x]) 20258b22bf3fSmrg 20268b22bf3fSmrg]) # XORG_WITH_LINT 20278b22bf3fSmrg 20288b22bf3fSmrg# XORG_LINT_LIBRARY(LIBNAME) 20298b22bf3fSmrg# -------------------------- 20308b22bf3fSmrg# Minimum version: 1.1.0 20318b22bf3fSmrg# 20328b22bf3fSmrg# Sets up flags for building lint libraries for checking programs that call 20338b22bf3fSmrg# functions in the library. 20348b22bf3fSmrg# 20355bd32fd1Smrg# Interface to module: 20365bd32fd1Smrg# LINTLIB - Automake variable with the name of lint library file to make 20375bd32fd1Smrg# MAKE_LINT_LIB - Automake conditional 20385bd32fd1Smrg# 20395bd32fd1Smrg# --enable-lint-library: - 'yes' user instructs the module to created a lint library 20405bd32fd1Smrg# - 'no' user instructs the module not to create a lint library (default) 20418b22bf3fSmrg 20428b22bf3fSmrgAC_DEFUN([XORG_LINT_LIBRARY],[ 20438b22bf3fSmrgAC_REQUIRE([XORG_WITH_LINT]) 204496a81b41SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library], 20458b22bf3fSmrg [Create lint library (default: disabled)])], 20468b22bf3fSmrg [make_lint_lib=$enableval], [make_lint_lib=no]) 20475bd32fd1Smrg 20485bd32fd1Smrgif test "x$make_lint_lib" = x"yes" ; then 20495bd32fd1Smrg LINTLIB=llib-l$1.ln 20505bd32fd1Smrg if test "x$LINT" = "x"; then 20515bd32fd1Smrg AC_MSG_ERROR([Cannot make lint library without --with-lint]) 20525bd32fd1Smrg fi 20535bd32fd1Smrgelif test "x$make_lint_lib" != x"no" ; then 20545bd32fd1Smrg AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.]) 20558b22bf3fSmrgfi 20565bd32fd1Smrg 20578b22bf3fSmrgAC_SUBST(LINTLIB) 20588b22bf3fSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) 20598b22bf3fSmrg 20608b22bf3fSmrg]) # XORG_LINT_LIBRARY 20618b22bf3fSmrg 206296a81b41Smrg# XORG_CWARNFLAGS 206396a81b41Smrg# --------------- 206496a81b41Smrg# Minimum version: 1.2.0 206596a81b41Smrg# 206696a81b41Smrg# Defines CWARNFLAGS to enable C compiler warnings. 206796a81b41Smrg# 206896a81b41SmrgAC_DEFUN([XORG_CWARNFLAGS], [ 20695bd32fd1SmrgAC_REQUIRE([AC_PROG_CC_C99]) 207096a81b41Smrgif test "x$GCC" = xyes ; then 207196a81b41Smrg CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \ 207296a81b41Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \ 20735bd32fd1Smrg-Wbad-function-cast -Wformat=2" 207496a81b41Smrg case `$CC -dumpversion` in 207596a81b41Smrg 3.4.* | 4.*) 207696a81b41Smrg CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement" 207796a81b41Smrg ;; 207896a81b41Smrg esac 207996a81b41Smrgelse 208096a81b41Smrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 208196a81b41Smrg if test "x$SUNCC" = "xyes"; then 208296a81b41Smrg CWARNFLAGS="-v" 208396a81b41Smrg fi 208496a81b41Smrgfi 208596a81b41SmrgAC_SUBST(CWARNFLAGS) 208696a81b41Smrg]) # XORG_CWARNFLAGS 208796a81b41Smrg 208896a81b41Smrg# XORG_STRICT_OPTION 208996a81b41Smrg# ----------------------- 209096a81b41Smrg# Minimum version: 1.3.0 209196a81b41Smrg# 209296a81b41Smrg# Add configure option to enable strict compilation 209396a81b41SmrgAC_DEFUN([XORG_STRICT_OPTION], [ 20945bd32fd1Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89 209596a81b41SmrgAC_REQUIRE([AC_PROG_CC_C99]) 209696a81b41SmrgAC_REQUIRE([XORG_CWARNFLAGS]) 209796a81b41Smrg 209896a81b41SmrgAC_ARG_ENABLE(strict-compilation, 209996a81b41Smrg AS_HELP_STRING([--enable-strict-compilation], 210096a81b41Smrg [Enable all warnings from compiler and make them errors (default: disabled)]), 210196a81b41Smrg [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no]) 210296a81b41Smrgif test "x$STRICT_COMPILE" = "xyes"; then 210396a81b41Smrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 210496a81b41Smrg AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"]) 210596a81b41Smrg if test "x$GCC" = xyes ; then 210696a81b41Smrg STRICT_CFLAGS="-pedantic -Werror" 210796a81b41Smrg elif test "x$SUNCC" = "xyes"; then 210896a81b41Smrg STRICT_CFLAGS="-errwarn" 210996a81b41Smrg elif test "x$INTELCC" = "xyes"; then 211096a81b41Smrg STRICT_CFLAGS="-Werror" 211196a81b41Smrg fi 211296a81b41Smrgfi 211396a81b41SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS" 211496a81b41SmrgAC_SUBST([CWARNFLAGS]) 211596a81b41Smrg]) # XORG_STRICT_OPTION 211696a81b41Smrg 211796a81b41Smrg# XORG_DEFAULT_OPTIONS 211896a81b41Smrg# -------------------- 211996a81b41Smrg# Minimum version: 1.3.0 212096a81b41Smrg# 212196a81b41Smrg# Defines default options for X.Org modules. 212296a81b41Smrg# 212396a81b41SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [ 21245bd32fd1SmrgAC_REQUIRE([AC_PROG_INSTALL]) 212596a81b41SmrgXORG_CWARNFLAGS 212696a81b41SmrgXORG_STRICT_OPTION 212796a81b41SmrgXORG_RELEASE_VERSION 212896a81b41SmrgXORG_CHANGELOG 21295bd32fd1SmrgXORG_INSTALL 213096a81b41SmrgXORG_MANPAGE_SECTIONS 21315bd32fd1Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], 21325bd32fd1Smrg [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) 213396a81b41Smrg]) # XORG_DEFAULT_OPTIONS 21345bd32fd1Smrg 21355bd32fd1Smrg# XORG_INSTALL() 21365bd32fd1Smrg# ---------------- 21375bd32fd1Smrg# Minimum version: 1.4.0 21385bd32fd1Smrg# 21395bd32fd1Smrg# Defines the variable INSTALL_CMD as the command to copy 21405bd32fd1Smrg# INSTALL from $prefix/share/util-macros. 21415bd32fd1Smrg# 21425bd32fd1SmrgAC_DEFUN([XORG_INSTALL], [ 21435bd32fd1SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG]) 21445bd32fd1Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` 21455bd32fd1SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ 21465bd32fd1Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ 21475bd32fd1Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ 21485bd32fd1Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" 21495bd32fd1SmrgAC_SUBST([INSTALL_CMD]) 21505bd32fd1Smrg]) # XORG_INSTALL 21518b22bf3fSmrgdnl Copyright 2005 Red Hat, Inc 21528b22bf3fSmrgdnl 21538b22bf3fSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its 21548b22bf3fSmrgdnl documentation for any purpose is hereby granted without fee, provided that 21558b22bf3fSmrgdnl the above copyright notice appear in all copies and that both that 21568b22bf3fSmrgdnl copyright notice and this permission notice appear in supporting 21578b22bf3fSmrgdnl documentation. 21588b22bf3fSmrgdnl 21598b22bf3fSmrgdnl The above copyright notice and this permission notice shall be included 21608b22bf3fSmrgdnl in all copies or substantial portions of the Software. 21618b22bf3fSmrgdnl 21628b22bf3fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 21638b22bf3fSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21648b22bf3fSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21658b22bf3fSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 21668b22bf3fSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21678b22bf3fSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 21688b22bf3fSmrgdnl OTHER DEALINGS IN THE SOFTWARE. 21698b22bf3fSmrgdnl 21708b22bf3fSmrgdnl Except as contained in this notice, the name of the copyright holders shall 21718b22bf3fSmrgdnl not be used in advertising or otherwise to promote the sale, use or 21728b22bf3fSmrgdnl other dealings in this Software without prior written authorization 21738b22bf3fSmrgdnl from the copyright holders. 21748b22bf3fSmrgdnl 21758b22bf3fSmrg 21768b22bf3fSmrg# XORG_RELEASE_VERSION 21778b22bf3fSmrg# -------------------- 21785bd32fd1Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. 21798b22bf3fSmrg 21808b22bf3fSmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 21818b22bf3fSmrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], 21828b22bf3fSmrg [`echo $PACKAGE_VERSION | cut -d . -f 1`], 21838b22bf3fSmrg [Major version of this package]) 218496a81b41Smrg PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` 21858b22bf3fSmrg if test "x$PVM" = "x"; then 21868b22bf3fSmrg PVM="0" 21878b22bf3fSmrg fi 21888b22bf3fSmrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], 21898b22bf3fSmrg [$PVM], 21908b22bf3fSmrg [Minor version of this package]) 219196a81b41Smrg PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` 21928b22bf3fSmrg if test "x$PVP" = "x"; then 21938b22bf3fSmrg PVP="0" 21948b22bf3fSmrg fi 21958b22bf3fSmrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], 21968b22bf3fSmrg [$PVP], 21978b22bf3fSmrg [Patch version of this package]) 21988b22bf3fSmrg]) 21998b22bf3fSmrg 220096a81b41Smrg# XORG_CHANGELOG() 220196a81b41Smrg# ---------------- 220296a81b41Smrg# Minimum version: 1.2.0 220396a81b41Smrg# 220496a81b41Smrg# Defines the variable CHANGELOG_CMD as the command to generate 220596a81b41Smrg# ChangeLog from git. 220696a81b41Smrg# 220796a81b41Smrg# 220896a81b41SmrgAC_DEFUN([XORG_CHANGELOG], [ 22095bd32fd1SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ 22105bd32fd1Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ 22115bd32fd1Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ 221296a81b41Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)" 221396a81b41SmrgAC_SUBST([CHANGELOG_CMD]) 221496a81b41Smrg]) # XORG_CHANGELOG 221596a81b41Smrg 22168b22bf3fSmrg# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 22178b22bf3fSmrg# 22188b22bf3fSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 22198b22bf3fSmrg# 22208b22bf3fSmrg# This program is free software; you can redistribute it and/or modify 22218b22bf3fSmrg# it under the terms of the GNU General Public License as published by 22228b22bf3fSmrg# the Free Software Foundation; either version 2 of the License, or 22238b22bf3fSmrg# (at your option) any later version. 22248b22bf3fSmrg# 22258b22bf3fSmrg# This program is distributed in the hope that it will be useful, but 22268b22bf3fSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of 22278b22bf3fSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 22288b22bf3fSmrg# General Public License for more details. 22298b22bf3fSmrg# 22308b22bf3fSmrg# You should have received a copy of the GNU General Public License 22318b22bf3fSmrg# along with this program; if not, write to the Free Software 22328b22bf3fSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22338b22bf3fSmrg# 22348b22bf3fSmrg# As a special exception to the GNU General Public License, if you 22358b22bf3fSmrg# distribute this file as part of a program that contains a 22368b22bf3fSmrg# configuration script generated by Autoconf, you may include it under 22378b22bf3fSmrg# the same distribution terms that you use for the rest of that program. 22388b22bf3fSmrg 22398b22bf3fSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION]) 22408b22bf3fSmrg# ---------------------------------- 22418b22bf3fSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG], 22428b22bf3fSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 22438b22bf3fSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 22448b22bf3fSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl 22458b22bf3fSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 22468b22bf3fSmrg AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 22478b22bf3fSmrgfi 22488b22bf3fSmrgif test -n "$PKG_CONFIG"; then 224996a81b41Smrg _pkg_min_version=m4_default([$1], [0.9.0]) 22508b22bf3fSmrg AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 22518b22bf3fSmrg if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 22528b22bf3fSmrg AC_MSG_RESULT([yes]) 22538b22bf3fSmrg else 22548b22bf3fSmrg AC_MSG_RESULT([no]) 22558b22bf3fSmrg PKG_CONFIG="" 22568b22bf3fSmrg fi 22578b22bf3fSmrg 22588b22bf3fSmrgfi[]dnl 22598b22bf3fSmrg])# PKG_PROG_PKG_CONFIG 22608b22bf3fSmrg 22618b22bf3fSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 22628b22bf3fSmrg# 22638b22bf3fSmrg# Check to see whether a particular set of modules exists. Similar 22648b22bf3fSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors. 22658b22bf3fSmrg# 22668b22bf3fSmrg# 22678b22bf3fSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of 22688b22bf3fSmrg# this or PKG_CHECK_MODULES is called, or make sure to call 22698b22bf3fSmrg# PKG_CHECK_EXISTS manually 22708b22bf3fSmrg# -------------------------------------------------------------- 22718b22bf3fSmrgAC_DEFUN([PKG_CHECK_EXISTS], 22728b22bf3fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 22738b22bf3fSmrgif test -n "$PKG_CONFIG" && \ 22748b22bf3fSmrg AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 22758b22bf3fSmrg m4_ifval([$2], [$2], [:]) 22768b22bf3fSmrgm4_ifvaln([$3], [else 22778b22bf3fSmrg $3])dnl 22788b22bf3fSmrgfi]) 22798b22bf3fSmrg 22808b22bf3fSmrg 22818b22bf3fSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 22828b22bf3fSmrg# --------------------------------------------- 22838b22bf3fSmrgm4_define([_PKG_CONFIG], 228496a81b41Smrg[if test -n "$$1"; then 228596a81b41Smrg pkg_cv_[]$1="$$1" 228696a81b41Smrg elif test -n "$PKG_CONFIG"; then 228796a81b41Smrg PKG_CHECK_EXISTS([$3], 228896a81b41Smrg [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], 228996a81b41Smrg [pkg_failed=yes]) 229096a81b41Smrg else 229196a81b41Smrg pkg_failed=untried 22928b22bf3fSmrgfi[]dnl 22938b22bf3fSmrg])# _PKG_CONFIG 22948b22bf3fSmrg 229596a81b41Smrg# _PKG_SHORT_ERRORS_SUPPORTED 229696a81b41Smrg# ----------------------------- 229796a81b41SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 229896a81b41Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 229996a81b41Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 230096a81b41Smrg _pkg_short_errors_supported=yes 230196a81b41Smrgelse 230296a81b41Smrg _pkg_short_errors_supported=no 230396a81b41Smrgfi[]dnl 230496a81b41Smrg])# _PKG_SHORT_ERRORS_SUPPORTED 230596a81b41Smrg 230696a81b41Smrg 23078b22bf3fSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 23088b22bf3fSmrg# [ACTION-IF-NOT-FOUND]) 23098b22bf3fSmrg# 23108b22bf3fSmrg# 23118b22bf3fSmrg# Note that if there is a possibility the first call to 23128b22bf3fSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an 23138b22bf3fSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 23148b22bf3fSmrg# 23158b22bf3fSmrg# 23168b22bf3fSmrg# -------------------------------------------------------------- 23178b22bf3fSmrgAC_DEFUN([PKG_CHECK_MODULES], 23188b22bf3fSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 23198b22bf3fSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 23208b22bf3fSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 23218b22bf3fSmrg 23228b22bf3fSmrgpkg_failed=no 23238b22bf3fSmrgAC_MSG_CHECKING([for $1]) 23248b22bf3fSmrg 23258b22bf3fSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 23268b22bf3fSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 23278b22bf3fSmrg 232896a81b41Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 232996a81b41Smrgand $1[]_LIBS to avoid the need to call pkg-config. 233096a81b41SmrgSee the pkg-config man page for more details.]) 233196a81b41Smrg 23328b22bf3fSmrgif test $pkg_failed = yes; then 233396a81b41Smrg _PKG_SHORT_ERRORS_SUPPORTED 233496a81b41Smrg if test $_pkg_short_errors_supported = yes; then 233596a81b41Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` 233696a81b41Smrg else 233796a81b41Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` 233896a81b41Smrg fi 23398b22bf3fSmrg # Put the nasty error message in config.log where it belongs 234096a81b41Smrg echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 23418b22bf3fSmrg 23428b22bf3fSmrg ifelse([$4], , [AC_MSG_ERROR(dnl 234396a81b41Smrg[Package requirements ($2) were not met: 234496a81b41Smrg 234596a81b41Smrg$$1_PKG_ERRORS 234696a81b41Smrg 23478b22bf3fSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you 23488b22bf3fSmrginstalled software in a non-standard prefix. 23498b22bf3fSmrg 235096a81b41Smrg_PKG_TEXT 235196a81b41Smrg])], 235296a81b41Smrg [AC_MSG_RESULT([no]) 235396a81b41Smrg $4]) 23548b22bf3fSmrgelif test $pkg_failed = untried; then 23558b22bf3fSmrg ifelse([$4], , [AC_MSG_FAILURE(dnl 23568b22bf3fSmrg[The pkg-config script could not be found or is too old. Make sure it 23578b22bf3fSmrgis in your PATH or set the PKG_CONFIG environment variable to the full 23588b22bf3fSmrgpath to pkg-config. 23598b22bf3fSmrg 236096a81b41Smrg_PKG_TEXT 23618b22bf3fSmrg 236296a81b41SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])], 23638b22bf3fSmrg [$4]) 23648b22bf3fSmrgelse 23658b22bf3fSmrg $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 23668b22bf3fSmrg $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 23678b22bf3fSmrg AC_MSG_RESULT([yes]) 23688b22bf3fSmrg ifelse([$3], , :, [$3]) 23698b22bf3fSmrgfi[]dnl 23708b22bf3fSmrg])# PKG_CHECK_MODULES 23718b22bf3fSmrg 2372