aclocal.m4 revision d13010c3
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 1019d13010c3Smrg# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 1020d13010c3Smrg# serial 1 (pkg-config-0.24) 1021d13010c3Smrg# 1022d13010c3Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 1023d13010c3Smrg# 1024d13010c3Smrg# This program is free software; you can redistribute it and/or modify 1025d13010c3Smrg# it under the terms of the GNU General Public License as published by 1026d13010c3Smrg# the Free Software Foundation; either version 2 of the License, or 1027d13010c3Smrg# (at your option) any later version. 1028d13010c3Smrg# 1029d13010c3Smrg# This program is distributed in the hope that it will be useful, but 1030d13010c3Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 1031d13010c3Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1032d13010c3Smrg# General Public License for more details. 1033d13010c3Smrg# 1034d13010c3Smrg# You should have received a copy of the GNU General Public License 1035d13010c3Smrg# along with this program; if not, write to the Free Software 1036d13010c3Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 1037d13010c3Smrg# 1038d13010c3Smrg# As a special exception to the GNU General Public License, if you 1039d13010c3Smrg# distribute this file as part of a program that contains a 1040d13010c3Smrg# configuration script generated by Autoconf, you may include it under 1041d13010c3Smrg# the same distribution terms that you use for the rest of that program. 1042d13010c3Smrg 1043d13010c3Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION]) 1044d13010c3Smrg# ---------------------------------- 1045d13010c3SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG], 1046d13010c3Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 1047d13010c3Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 1048d13010c3SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) 1049d13010c3SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) 1050d13010c3SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) 1051d13010c3Smrg 1052d13010c3Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 1053d13010c3Smrg AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 1054d13010c3Smrgfi 1055d13010c3Smrgif test -n "$PKG_CONFIG"; then 1056d13010c3Smrg _pkg_min_version=m4_default([$1], [0.9.0]) 1057d13010c3Smrg AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 1058d13010c3Smrg if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 1059d13010c3Smrg AC_MSG_RESULT([yes]) 1060d13010c3Smrg else 1061d13010c3Smrg AC_MSG_RESULT([no]) 1062d13010c3Smrg PKG_CONFIG="" 1063d13010c3Smrg fi 1064d13010c3Smrgfi[]dnl 1065d13010c3Smrg])# PKG_PROG_PKG_CONFIG 1066d13010c3Smrg 1067d13010c3Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 1068d13010c3Smrg# 1069d13010c3Smrg# Check to see whether a particular set of modules exists. Similar 1070d13010c3Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors. 1071d13010c3Smrg# 1072d13010c3Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 1073d13010c3Smrg# only at the first occurence in configure.ac, so if the first place 1074d13010c3Smrg# it's called might be skipped (such as if it is within an "if", you 1075d13010c3Smrg# have to call PKG_CHECK_EXISTS manually 1076d13010c3Smrg# -------------------------------------------------------------- 1077d13010c3SmrgAC_DEFUN([PKG_CHECK_EXISTS], 1078d13010c3Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 1079d13010c3Smrgif test -n "$PKG_CONFIG" && \ 1080d13010c3Smrg AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 1081d13010c3Smrg m4_default([$2], [:]) 1082d13010c3Smrgm4_ifvaln([$3], [else 1083d13010c3Smrg $3])dnl 1084d13010c3Smrgfi]) 1085d13010c3Smrg 1086d13010c3Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 1087d13010c3Smrg# --------------------------------------------- 1088d13010c3Smrgm4_define([_PKG_CONFIG], 1089d13010c3Smrg[if test -n "$$1"; then 1090d13010c3Smrg pkg_cv_[]$1="$$1" 1091d13010c3Smrg elif test -n "$PKG_CONFIG"; then 1092d13010c3Smrg PKG_CHECK_EXISTS([$3], 1093d13010c3Smrg [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], 1094d13010c3Smrg [pkg_failed=yes]) 1095d13010c3Smrg else 1096d13010c3Smrg pkg_failed=untried 1097d13010c3Smrgfi[]dnl 1098d13010c3Smrg])# _PKG_CONFIG 1099d13010c3Smrg 1100d13010c3Smrg# _PKG_SHORT_ERRORS_SUPPORTED 1101d13010c3Smrg# ----------------------------- 1102d13010c3SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 1103d13010c3Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 1104d13010c3Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 1105d13010c3Smrg _pkg_short_errors_supported=yes 1106d13010c3Smrgelse 1107d13010c3Smrg _pkg_short_errors_supported=no 1108d13010c3Smrgfi[]dnl 1109d13010c3Smrg])# _PKG_SHORT_ERRORS_SUPPORTED 1110d13010c3Smrg 1111d13010c3Smrg 1112d13010c3Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 1113d13010c3Smrg# [ACTION-IF-NOT-FOUND]) 1114d13010c3Smrg# 1115d13010c3Smrg# 1116d13010c3Smrg# Note that if there is a possibility the first call to 1117d13010c3Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an 1118d13010c3Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 1119d13010c3Smrg# 1120d13010c3Smrg# 1121d13010c3Smrg# -------------------------------------------------------------- 1122d13010c3SmrgAC_DEFUN([PKG_CHECK_MODULES], 1123d13010c3Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 1124d13010c3SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 1125d13010c3SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 1126d13010c3Smrg 1127d13010c3Smrgpkg_failed=no 1128d13010c3SmrgAC_MSG_CHECKING([for $1]) 1129d13010c3Smrg 1130d13010c3Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 1131d13010c3Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 1132d13010c3Smrg 1133d13010c3Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 1134d13010c3Smrgand $1[]_LIBS to avoid the need to call pkg-config. 1135d13010c3SmrgSee the pkg-config man page for more details.]) 1136d13010c3Smrg 1137d13010c3Smrgif test $pkg_failed = yes; then 1138d13010c3Smrg AC_MSG_RESULT([no]) 1139d13010c3Smrg _PKG_SHORT_ERRORS_SUPPORTED 1140d13010c3Smrg if test $_pkg_short_errors_supported = yes; then 1141d13010c3Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` 1142d13010c3Smrg else 1143d13010c3Smrg $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` 1144d13010c3Smrg fi 1145d13010c3Smrg # Put the nasty error message in config.log where it belongs 1146d13010c3Smrg echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 1147d13010c3Smrg 1148d13010c3Smrg m4_default([$4], [AC_MSG_ERROR( 1149d13010c3Smrg[Package requirements ($2) were not met: 1150d13010c3Smrg 1151d13010c3Smrg$$1_PKG_ERRORS 1152d13010c3Smrg 1153d13010c3SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you 1154d13010c3Smrginstalled software in a non-standard prefix. 1155d13010c3Smrg 1156d13010c3Smrg_PKG_TEXT])[]dnl 1157d13010c3Smrg ]) 1158d13010c3Smrgelif test $pkg_failed = untried; then 1159d13010c3Smrg AC_MSG_RESULT([no]) 1160d13010c3Smrg m4_default([$4], [AC_MSG_FAILURE( 1161d13010c3Smrg[The pkg-config script could not be found or is too old. Make sure it 1162d13010c3Smrgis in your PATH or set the PKG_CONFIG environment variable to the full 1163d13010c3Smrgpath to pkg-config. 1164d13010c3Smrg 1165d13010c3Smrg_PKG_TEXT 1166d13010c3Smrg 1167d13010c3SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl 1168d13010c3Smrg ]) 1169d13010c3Smrgelse 1170d13010c3Smrg $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 1171d13010c3Smrg $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 1172d13010c3Smrg AC_MSG_RESULT([yes]) 1173d13010c3Smrg $3 1174d13010c3Smrgfi[]dnl 1175d13010c3Smrg])# PKG_CHECK_MODULES 1176d13010c3Smrg 117796a81b41Smrgdnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. 11788b22bf3fSmrgdnl 11795bd32fd1Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 11808b22bf3fSmrgdnl 11818b22bf3fSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a 11825bd32fd1Smrgdnl copy of this software and associated documentation files (the "Software"), 11835bd32fd1Smrgdnl to deal in the Software without restriction, including without limitation 11845bd32fd1Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense, 11855bd32fd1Smrgdnl and/or sell copies of the Software, and to permit persons to whom the 11865bd32fd1Smrgdnl Software is furnished to do so, subject to the following conditions: 11878b22bf3fSmrgdnl 11885bd32fd1Smrgdnl The above copyright notice and this permission notice (including the next 11895bd32fd1Smrgdnl paragraph) shall be included in all copies or substantial portions of the 11905bd32fd1Smrgdnl Software. 11918b22bf3fSmrgdnl 11925bd32fd1Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 11935bd32fd1Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 11945bd32fd1Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 11955bd32fd1Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 11965bd32fd1Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 11975bd32fd1Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 11985bd32fd1Smrgdnl DEALINGS IN THE SOFTWARE. 11998b22bf3fSmrg 12008b22bf3fSmrg# XORG_MACROS_VERSION(required-version) 12018b22bf3fSmrg# ------------------------------------- 12028b22bf3fSmrg# Minimum version: 1.1.0 12038b22bf3fSmrg# 12048b22bf3fSmrg# If you're using a macro added in Version 1.1 or newer, include this in 12058b22bf3fSmrg# your configure.ac with the minimum required version, such as: 12068b22bf3fSmrg# XORG_MACROS_VERSION(1.1) 12078b22bf3fSmrg# 120896a81b41Smrg# To ensure that this macro is defined, also add: 120996a81b41Smrg# m4_ifndef([XORG_MACROS_VERSION], 121096a81b41Smrg# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) 12118b22bf3fSmrg# 12128b22bf3fSmrg# 12138b22bf3fSmrg# See the "minimum version" comment for each macro you use to see what 12148b22bf3fSmrg# version you require. 121596a81b41Smrgm4_defun([XORG_MACROS_VERSION],[ 12165bd32fd1Smrgm4_define([vers_have], [1.11.0]) 121796a81b41Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) 121896a81b41Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) 121996a81b41Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,, 122096a81b41Smrg [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])]) 122196a81b41Smrgm4_if(m4_version_compare(vers_have, [$1]), -1, 122296a81b41Smrg [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])]) 122396a81b41Smrgm4_undefine([vers_have]) 122496a81b41Smrgm4_undefine([maj_have]) 122596a81b41Smrgm4_undefine([maj_needed]) 12268b22bf3fSmrg]) # XORG_MACROS_VERSION 12278b22bf3fSmrg 12288b22bf3fSmrg# XORG_PROG_RAWCPP() 12298b22bf3fSmrg# ------------------ 12308b22bf3fSmrg# Minimum version: 1.0.0 12318b22bf3fSmrg# 12328b22bf3fSmrg# Find cpp program and necessary flags for use in pre-processing text files 12338b22bf3fSmrg# such as man pages and config files 12348b22bf3fSmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 12358b22bf3fSmrgAC_REQUIRE([AC_PROG_CPP]) 12368b22bf3fSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 12378b22bf3fSmrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 12388b22bf3fSmrg 12398b22bf3fSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 12408b22bf3fSmrg# which is not the best choice for supporting other OS'es, but covers most 12418b22bf3fSmrg# of the ones we need for now. 12428b22bf3fSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 12438b22bf3fSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?]) 12448b22bf3fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 12458b22bf3fSmrg AC_MSG_RESULT([no]) 12468b22bf3fSmrgelse 12478b22bf3fSmrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 12488b22bf3fSmrg RAWCPPFLAGS=-undef 12498b22bf3fSmrg AC_MSG_RESULT([yes]) 125096a81b41Smrg # under Cygwin unix is still defined even with -undef 125196a81b41Smrg elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 125296a81b41Smrg RAWCPPFLAGS="-undef -ansi" 125396a81b41Smrg AC_MSG_RESULT([yes, with -ansi]) 12548b22bf3fSmrg else 12558b22bf3fSmrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 12568b22bf3fSmrg fi 12578b22bf3fSmrgfi 12588b22bf3fSmrgrm -f conftest.$ac_ext 12598b22bf3fSmrg 12608b22bf3fSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 12618b22bf3fSmrgAC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) 12628b22bf3fSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 12638b22bf3fSmrg AC_MSG_RESULT([no]) 12648b22bf3fSmrgelse 12658b22bf3fSmrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 12668b22bf3fSmrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 12678b22bf3fSmrg AC_MSG_RESULT([yes]) 12688b22bf3fSmrg else 12698b22bf3fSmrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 12708b22bf3fSmrg fi 12718b22bf3fSmrgfi 12728b22bf3fSmrgrm -f conftest.$ac_ext 12738b22bf3fSmrgAC_SUBST(RAWCPPFLAGS) 12748b22bf3fSmrg]) # XORG_PROG_RAWCPP 12758b22bf3fSmrg 12768b22bf3fSmrg# XORG_MANPAGE_SECTIONS() 12778b22bf3fSmrg# ----------------------- 12788b22bf3fSmrg# Minimum version: 1.0.0 12798b22bf3fSmrg# 12808b22bf3fSmrg# Determine which sections man pages go in for the different man page types 12818b22bf3fSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 12828b22bf3fSmrg# Not sure if there's any better way than just hardcoding by OS name. 12838b22bf3fSmrg# Override default settings by setting environment variables 12845bd32fd1Smrg# Added MAN_SUBSTS in version 1.8 12855bd32fd1Smrg# Added AC_PROG_SED in version 1.8 12868b22bf3fSmrg 12878b22bf3fSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 12888b22bf3fSmrgAC_REQUIRE([AC_CANONICAL_HOST]) 12895bd32fd1SmrgAC_REQUIRE([AC_PROG_SED]) 12908b22bf3fSmrg 12918b22bf3fSmrgif test x$APP_MAN_SUFFIX = x ; then 12928b22bf3fSmrg APP_MAN_SUFFIX=1 12938b22bf3fSmrgfi 12948b22bf3fSmrgif test x$APP_MAN_DIR = x ; then 12958b22bf3fSmrg APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' 12968b22bf3fSmrgfi 12978b22bf3fSmrg 12988b22bf3fSmrgif test x$LIB_MAN_SUFFIX = x ; then 12998b22bf3fSmrg LIB_MAN_SUFFIX=3 13008b22bf3fSmrgfi 13018b22bf3fSmrgif test x$LIB_MAN_DIR = x ; then 13028b22bf3fSmrg LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' 13038b22bf3fSmrgfi 13048b22bf3fSmrg 13058b22bf3fSmrgif test x$FILE_MAN_SUFFIX = x ; then 13068b22bf3fSmrg case $host_os in 13078b22bf3fSmrg solaris*) FILE_MAN_SUFFIX=4 ;; 13088b22bf3fSmrg *) FILE_MAN_SUFFIX=5 ;; 13098b22bf3fSmrg esac 13108b22bf3fSmrgfi 13118b22bf3fSmrgif test x$FILE_MAN_DIR = x ; then 13128b22bf3fSmrg FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' 13138b22bf3fSmrgfi 13148b22bf3fSmrg 13158b22bf3fSmrgif test x$MISC_MAN_SUFFIX = x ; then 13168b22bf3fSmrg case $host_os in 13178b22bf3fSmrg solaris*) MISC_MAN_SUFFIX=5 ;; 13188b22bf3fSmrg *) MISC_MAN_SUFFIX=7 ;; 13198b22bf3fSmrg esac 13208b22bf3fSmrgfi 13218b22bf3fSmrgif test x$MISC_MAN_DIR = x ; then 13228b22bf3fSmrg MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' 13238b22bf3fSmrgfi 13248b22bf3fSmrg 13258b22bf3fSmrgif test x$DRIVER_MAN_SUFFIX = x ; then 13268b22bf3fSmrg case $host_os in 13278b22bf3fSmrg solaris*) DRIVER_MAN_SUFFIX=7 ;; 13288b22bf3fSmrg *) DRIVER_MAN_SUFFIX=4 ;; 13298b22bf3fSmrg esac 13308b22bf3fSmrgfi 13318b22bf3fSmrgif test x$DRIVER_MAN_DIR = x ; then 13328b22bf3fSmrg DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' 13338b22bf3fSmrgfi 13348b22bf3fSmrg 13358b22bf3fSmrgif test x$ADMIN_MAN_SUFFIX = x ; then 13368b22bf3fSmrg case $host_os in 13378b22bf3fSmrg solaris*) ADMIN_MAN_SUFFIX=1m ;; 13388b22bf3fSmrg *) ADMIN_MAN_SUFFIX=8 ;; 13398b22bf3fSmrg esac 13408b22bf3fSmrgfi 13418b22bf3fSmrgif test x$ADMIN_MAN_DIR = x ; then 13428b22bf3fSmrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 13438b22bf3fSmrgfi 13448b22bf3fSmrg 13458b22bf3fSmrg 13468b22bf3fSmrgAC_SUBST([APP_MAN_SUFFIX]) 13478b22bf3fSmrgAC_SUBST([LIB_MAN_SUFFIX]) 13488b22bf3fSmrgAC_SUBST([FILE_MAN_SUFFIX]) 13498b22bf3fSmrgAC_SUBST([MISC_MAN_SUFFIX]) 13508b22bf3fSmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 13518b22bf3fSmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 13528b22bf3fSmrgAC_SUBST([APP_MAN_DIR]) 13538b22bf3fSmrgAC_SUBST([LIB_MAN_DIR]) 13548b22bf3fSmrgAC_SUBST([FILE_MAN_DIR]) 13558b22bf3fSmrgAC_SUBST([MISC_MAN_DIR]) 13568b22bf3fSmrgAC_SUBST([DRIVER_MAN_DIR]) 13578b22bf3fSmrgAC_SUBST([ADMIN_MAN_DIR]) 13585bd32fd1Smrg 13595bd32fd1SmrgXORG_MAN_PAGE="X Version 11" 13605bd32fd1SmrgAC_SUBST([XORG_MAN_PAGE]) 13615bd32fd1SmrgMAN_SUBSTS="\ 13625bd32fd1Smrg -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 13635bd32fd1Smrg -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \ 13645bd32fd1Smrg -e 's|__xservername__|Xorg|g' \ 13655bd32fd1Smrg -e 's|__xconfigfile__|xorg.conf|g' \ 13665bd32fd1Smrg -e 's|__projectroot__|\$(prefix)|g' \ 13675bd32fd1Smrg -e 's|__apploaddir__|\$(appdefaultdir)|g' \ 13685bd32fd1Smrg -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \ 13695bd32fd1Smrg -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \ 13705bd32fd1Smrg -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \ 13715bd32fd1Smrg -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \ 13725bd32fd1Smrg -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \ 13735bd32fd1Smrg -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'" 13745bd32fd1SmrgAC_SUBST([MAN_SUBSTS]) 13755bd32fd1Smrg 13768b22bf3fSmrg]) # XORG_MANPAGE_SECTIONS 13778b22bf3fSmrg 13785bd32fd1Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION]) 13795bd32fd1Smrg# ------------------------ 13805bd32fd1Smrg# Minimum version: 1.7.0 13815bd32fd1Smrg# 13825bd32fd1Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent 13835bd32fd1Smrg# provided by xorg-sgml-doctools, if installed. 13845bd32fd1SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[ 13855bd32fd1SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])]) 13865bd32fd1SmrgXORG_SGML_PATH= 13875bd32fd1SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])], 13885bd32fd1Smrg [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`], 13895bd32fd1Smrg [m4_ifval([$1],[:], 13905bd32fd1Smrg [if test x"$cross_compiling" != x"yes" ; then 13915bd32fd1Smrg AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent], 13925bd32fd1Smrg [XORG_SGML_PATH=$prefix/share/sgml]) 13935bd32fd1Smrg fi]) 13945bd32fd1Smrg ]) 13955bd32fd1Smrg 13965bd32fd1Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing 13975bd32fd1Smrg# the path and the name of the doc stylesheet 13985bd32fd1Smrgif test "x$XORG_SGML_PATH" != "x" ; then 13995bd32fd1Smrg AC_MSG_RESULT([$XORG_SGML_PATH]) 14005bd32fd1Smrg STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11 14015bd32fd1Smrg XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl 14025bd32fd1Smrgelse 14035bd32fd1Smrg AC_MSG_RESULT([no]) 14045bd32fd1Smrgfi 14055bd32fd1Smrg 14065bd32fd1SmrgAC_SUBST(XORG_SGML_PATH) 14075bd32fd1SmrgAC_SUBST(STYLESHEET_SRCDIR) 14085bd32fd1SmrgAC_SUBST(XSL_STYLESHEET) 14095bd32fd1SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"]) 14105bd32fd1Smrg]) # XORG_CHECK_SGML_DOCTOOLS 14115bd32fd1Smrg 14128b22bf3fSmrg# XORG_CHECK_LINUXDOC 14138b22bf3fSmrg# ------------------- 14148b22bf3fSmrg# Minimum version: 1.0.0 14158b22bf3fSmrg# 14168b22bf3fSmrg# Defines the variable MAKE_TEXT if the necessary tools and 14178b22bf3fSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 14188b22bf3fSmrg# Whether or not the necessary tools and files are found can be checked 14198b22bf3fSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 14208b22bf3fSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 14215bd32fd1SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 14225bd32fd1SmrgAC_REQUIRE([XORG_WITH_PS2PDF]) 14238b22bf3fSmrg 14248b22bf3fSmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 14258b22bf3fSmrg 14265bd32fd1SmrgAC_MSG_CHECKING([whether to build documentation]) 14278b22bf3fSmrg 14285bd32fd1Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then 14298b22bf3fSmrg BUILDDOC=yes 14308b22bf3fSmrgelse 14318b22bf3fSmrg BUILDDOC=no 14328b22bf3fSmrgfi 14338b22bf3fSmrg 14348b22bf3fSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 14358b22bf3fSmrg 14368b22bf3fSmrgAC_MSG_RESULT([$BUILDDOC]) 14378b22bf3fSmrg 14385bd32fd1SmrgAC_MSG_CHECKING([whether to build pdf documentation]) 14398b22bf3fSmrg 14405bd32fd1Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then 14418b22bf3fSmrg BUILDPDFDOC=yes 14428b22bf3fSmrgelse 14438b22bf3fSmrg BUILDPDFDOC=no 14448b22bf3fSmrgfi 14458b22bf3fSmrg 14468b22bf3fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 14478b22bf3fSmrg 14488b22bf3fSmrgAC_MSG_RESULT([$BUILDPDFDOC]) 14498b22bf3fSmrg 14505bd32fd1SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f" 14518b22bf3fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 14528b22bf3fSmrgMAKE_PDF="$PS2PDF" 14538b22bf3fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" 14548b22bf3fSmrg 14558b22bf3fSmrgAC_SUBST(MAKE_TEXT) 14568b22bf3fSmrgAC_SUBST(MAKE_PS) 14578b22bf3fSmrgAC_SUBST(MAKE_PDF) 14588b22bf3fSmrgAC_SUBST(MAKE_HTML) 14598b22bf3fSmrg]) # XORG_CHECK_LINUXDOC 14608b22bf3fSmrg 14618b22bf3fSmrg# XORG_CHECK_DOCBOOK 14628b22bf3fSmrg# ------------------- 14638b22bf3fSmrg# Minimum version: 1.0.0 14648b22bf3fSmrg# 14658b22bf3fSmrg# Checks for the ability to build output formats from SGML DocBook source. 14668b22bf3fSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" 14678b22bf3fSmrg# indicates whether the necessary tools and files are found and, if set, 14688b22bf3fSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx. 14698b22bf3fSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[ 14705bd32fd1SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS]) 14715bd32fd1Smrg 14728b22bf3fSmrgBUILDTXTDOC=no 14738b22bf3fSmrgBUILDPDFDOC=no 14748b22bf3fSmrgBUILDPSDOC=no 14758b22bf3fSmrgBUILDHTMLDOC=no 14768b22bf3fSmrg 14778b22bf3fSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps) 14788b22bf3fSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf) 14798b22bf3fSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html) 14808b22bf3fSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt) 14818b22bf3fSmrg 14825bd32fd1SmrgAC_MSG_CHECKING([whether to build text documentation]) 14835bd32fd1Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x && 14848b22bf3fSmrg test x$BUILD_TXTDOC != xno; then 14858b22bf3fSmrg BUILDTXTDOC=yes 14868b22bf3fSmrgfi 14878b22bf3fSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) 14888b22bf3fSmrgAC_MSG_RESULT([$BUILDTXTDOC]) 14898b22bf3fSmrg 14905bd32fd1SmrgAC_MSG_CHECKING([whether to build PDF documentation]) 14915bd32fd1Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x && 14928b22bf3fSmrg test x$BUILD_PDFDOC != xno; then 14938b22bf3fSmrg BUILDPDFDOC=yes 14948b22bf3fSmrgfi 14958b22bf3fSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 14968b22bf3fSmrgAC_MSG_RESULT([$BUILDPDFDOC]) 14978b22bf3fSmrg 14985bd32fd1SmrgAC_MSG_CHECKING([whether to build PostScript documentation]) 14995bd32fd1Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x && 15008b22bf3fSmrg test x$BUILD_PSDOC != xno; then 15018b22bf3fSmrg BUILDPSDOC=yes 15028b22bf3fSmrgfi 15038b22bf3fSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) 15048b22bf3fSmrgAC_MSG_RESULT([$BUILDPSDOC]) 15058b22bf3fSmrg 15065bd32fd1SmrgAC_MSG_CHECKING([whether to build HTML documentation]) 15075bd32fd1Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x && 15088b22bf3fSmrg test x$BUILD_HTMLDOC != xno; then 15098b22bf3fSmrg BUILDHTMLDOC=yes 15108b22bf3fSmrgfi 15118b22bf3fSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) 15128b22bf3fSmrgAC_MSG_RESULT([$BUILDHTMLDOC]) 15138b22bf3fSmrg 15148b22bf3fSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" 15158b22bf3fSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" 15168b22bf3fSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" 15178b22bf3fSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" 15188b22bf3fSmrg 15198b22bf3fSmrgAC_SUBST(MAKE_TEXT) 15208b22bf3fSmrgAC_SUBST(MAKE_PS) 15218b22bf3fSmrgAC_SUBST(MAKE_PDF) 15228b22bf3fSmrgAC_SUBST(MAKE_HTML) 15238b22bf3fSmrg]) # XORG_CHECK_DOCBOOK 15248b22bf3fSmrg 15255bd32fd1Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT]) 15265bd32fd1Smrg# ---------------- 15275bd32fd1Smrg# Minimum version: 1.5.0 15285bd32fd1Smrg# Minimum version for optional DEFAULT argument: 1.11.0 15295bd32fd1Smrg# 15305bd32fd1Smrg# Documentation tools are not always available on all platforms and sometimes 15315bd32fd1Smrg# not at the appropriate level. This macro enables a module to test for the 15325bd32fd1Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 15335bd32fd1Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions 15345bd32fd1Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified, 15355bd32fd1Smrg# --with-xmlto assumes 'auto'. 15365bd32fd1Smrg# 15375bd32fd1Smrg# Interface to module: 15385bd32fd1Smrg# HAVE_XMLTO: used in makefiles to conditionally generate documentation 15395bd32fd1Smrg# XMLTO: returns the path of the xmlto program found 15405bd32fd1Smrg# returns the path set by the user in the environment 15415bd32fd1Smrg# --with-xmlto: 'yes' user instructs the module to use xmlto 15425bd32fd1Smrg# 'no' user instructs the module not to use xmlto 15435bd32fd1Smrg# 15445bd32fd1Smrg# Added in version 1.10.0 15455bd32fd1Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation 15465bd32fd1Smrg# xmlto for text output requires either lynx, links, or w3m browsers 15475bd32fd1Smrg# 15485bd32fd1Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path. 15495bd32fd1Smrg# 15505bd32fd1SmrgAC_DEFUN([XORG_WITH_XMLTO],[ 15515bd32fd1SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command]) 15525bd32fd1Smrgm4_define([_defopt], m4_default([$2], [auto])) 15535bd32fd1SmrgAC_ARG_WITH(xmlto, 15545bd32fd1Smrg AS_HELP_STRING([--with-xmlto], 15555bd32fd1Smrg [Use xmlto to regenerate documentation (default: ]_defopt[)]), 15565bd32fd1Smrg [use_xmlto=$withval], [use_xmlto=]_defopt) 15575bd32fd1Smrgm4_undefine([_defopt]) 15585bd32fd1Smrg 15595bd32fd1Smrgif test "x$use_xmlto" = x"auto"; then 15605bd32fd1Smrg AC_PATH_PROG([XMLTO], [xmlto]) 15615bd32fd1Smrg if test "x$XMLTO" = "x"; then 15625bd32fd1Smrg AC_MSG_WARN([xmlto not found - documentation targets will be skipped]) 15635bd32fd1Smrg have_xmlto=no 15645bd32fd1Smrg else 15655bd32fd1Smrg have_xmlto=yes 15665bd32fd1Smrg fi 15675bd32fd1Smrgelif test "x$use_xmlto" = x"yes" ; then 15685bd32fd1Smrg AC_PATH_PROG([XMLTO], [xmlto]) 15695bd32fd1Smrg if test "x$XMLTO" = "x"; then 15705bd32fd1Smrg AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH]) 15715bd32fd1Smrg fi 15725bd32fd1Smrg have_xmlto=yes 15735bd32fd1Smrgelif test "x$use_xmlto" = x"no" ; then 15745bd32fd1Smrg if test "x$XMLTO" != "x"; then 15755bd32fd1Smrg AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified]) 15765bd32fd1Smrg fi 15775bd32fd1Smrg have_xmlto=no 15785bd32fd1Smrgelse 15795bd32fd1Smrg AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no']) 15805bd32fd1Smrgfi 15815bd32fd1Smrg 15825bd32fd1Smrg# Test for a minimum version of xmlto, if provided. 15835bd32fd1Smrgm4_ifval([$1], 15845bd32fd1Smrg[if test "$have_xmlto" = yes; then 15855bd32fd1Smrg # scrape the xmlto version 15865bd32fd1Smrg AC_MSG_CHECKING([the xmlto version]) 15875bd32fd1Smrg xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3` 15885bd32fd1Smrg AC_MSG_RESULT([$xmlto_version]) 15895bd32fd1Smrg AS_VERSION_COMPARE([$xmlto_version], [$1], 15905bd32fd1Smrg [if test "x$use_xmlto" = xauto; then 15915bd32fd1Smrg AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed]) 15925bd32fd1Smrg have_xmlto=no 15935bd32fd1Smrg else 15945bd32fd1Smrg AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed]) 15955bd32fd1Smrg fi]) 15965bd32fd1Smrgfi]) 15975bd32fd1Smrg 15985bd32fd1Smrg# Test for the ability of xmlto to generate a text target 15995bd32fd1Smrghave_xmlto_text=no 16005bd32fd1Smrgcat > conftest.xml << "EOF" 16015bd32fd1SmrgEOF 16025bd32fd1SmrgAS_IF([test "$have_xmlto" = yes], 16035bd32fd1Smrg [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], 16045bd32fd1Smrg [have_xmlto_text=yes], 16055bd32fd1Smrg [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])]) 16065bd32fd1Smrgrm -f conftest.xml 16075bd32fd1SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) 16085bd32fd1SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) 16095bd32fd1Smrg]) # XORG_WITH_XMLTO 16105bd32fd1Smrg 16115bd32fd1Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT]) 16125bd32fd1Smrg# ---------------- 16135bd32fd1Smrg# Minimum version: 1.5.0 16145bd32fd1Smrg# Minimum version for optional DEFAULT argument: 1.11.0 16155bd32fd1Smrg# 16165bd32fd1Smrg# Documentation tools are not always available on all platforms and sometimes 16175bd32fd1Smrg# not at the appropriate level. This macro enables a module to test for the 16185bd32fd1Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 16195bd32fd1Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions 16205bd32fd1Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified, 16215bd32fd1Smrg# --with-asciidoc assumes 'auto'. 16225bd32fd1Smrg# 16235bd32fd1Smrg# Interface to module: 16245bd32fd1Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation 16255bd32fd1Smrg# ASCIIDOC: returns the path of the asciidoc program found 16265bd32fd1Smrg# returns the path set by the user in the environment 16275bd32fd1Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc 16285bd32fd1Smrg# 'no' user instructs the module not to use asciidoc 16295bd32fd1Smrg# 16305bd32fd1Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path. 16315bd32fd1Smrg# 16325bd32fd1SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[ 16335bd32fd1SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command]) 16345bd32fd1Smrgm4_define([_defopt], m4_default([$2], [auto])) 16355bd32fd1SmrgAC_ARG_WITH(asciidoc, 16365bd32fd1Smrg AS_HELP_STRING([--with-asciidoc], 16375bd32fd1Smrg [Use asciidoc to regenerate documentation (default: ]_defopt[)]), 16385bd32fd1Smrg [use_asciidoc=$withval], [use_asciidoc=]_defopt) 16395bd32fd1Smrgm4_undefine([_defopt]) 16405bd32fd1Smrg 16415bd32fd1Smrgif test "x$use_asciidoc" = x"auto"; then 16425bd32fd1Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 16435bd32fd1Smrg if test "x$ASCIIDOC" = "x"; then 16445bd32fd1Smrg AC_MSG_WARN([asciidoc not found - documentation targets will be skipped]) 16455bd32fd1Smrg have_asciidoc=no 16465bd32fd1Smrg else 16475bd32fd1Smrg have_asciidoc=yes 16485bd32fd1Smrg fi 16495bd32fd1Smrgelif test "x$use_asciidoc" = x"yes" ; then 16505bd32fd1Smrg AC_PATH_PROG([ASCIIDOC], [asciidoc]) 16515bd32fd1Smrg if test "x$ASCIIDOC" = "x"; then 16525bd32fd1Smrg AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH]) 16535bd32fd1Smrg fi 16545bd32fd1Smrg have_asciidoc=yes 16555bd32fd1Smrgelif test "x$use_asciidoc" = x"no" ; then 16565bd32fd1Smrg if test "x$ASCIIDOC" != "x"; then 16575bd32fd1Smrg AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified]) 16585bd32fd1Smrg fi 16595bd32fd1Smrg have_asciidoc=no 16605bd32fd1Smrgelse 16615bd32fd1Smrg AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no']) 16625bd32fd1Smrgfi 16635bd32fd1Smrgm4_ifval([$1], 16645bd32fd1Smrg[if test "$have_asciidoc" = yes; then 16655bd32fd1Smrg # scrape the asciidoc version 16665bd32fd1Smrg AC_MSG_CHECKING([the asciidoc version]) 16675bd32fd1Smrg asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2` 16685bd32fd1Smrg AC_MSG_RESULT([$asciidoc_version]) 16695bd32fd1Smrg AS_VERSION_COMPARE([$asciidoc_version], [$1], 16705bd32fd1Smrg [if test "x$use_asciidoc" = xauto; then 16715bd32fd1Smrg AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed]) 16725bd32fd1Smrg have_asciidoc=no 16735bd32fd1Smrg else 16745bd32fd1Smrg AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed]) 16755bd32fd1Smrg fi]) 16765bd32fd1Smrgfi]) 16775bd32fd1SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) 16785bd32fd1Smrg]) # XORG_WITH_ASCIIDOC 16795bd32fd1Smrg 16805bd32fd1Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT]) 16815bd32fd1Smrg# -------------------------------- 16825bd32fd1Smrg# Minimum version: 1.5.0 16835bd32fd1Smrg# Minimum version for optional DEFAULT argument: 1.11.0 16845bd32fd1Smrg# 16855bd32fd1Smrg# Documentation tools are not always available on all platforms and sometimes 16865bd32fd1Smrg# not at the appropriate level. This macro enables a module to test for the 16875bd32fd1Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 16885bd32fd1Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions 16895bd32fd1Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified, 16905bd32fd1Smrg# --with-doxygen assumes 'auto'. 16915bd32fd1Smrg# 16925bd32fd1Smrg# Interface to module: 16935bd32fd1Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation 16945bd32fd1Smrg# DOXYGEN: returns the path of the doxygen program found 16955bd32fd1Smrg# returns the path set by the user in the environment 16965bd32fd1Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen 16975bd32fd1Smrg# 'no' user instructs the module not to use doxygen 16985bd32fd1Smrg# 16995bd32fd1Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path. 17005bd32fd1Smrg# 17015bd32fd1SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[ 17025bd32fd1SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command]) 17035bd32fd1Smrgm4_define([_defopt], m4_default([$2], [auto])) 17045bd32fd1SmrgAC_ARG_WITH(doxygen, 17055bd32fd1Smrg AS_HELP_STRING([--with-doxygen], 17065bd32fd1Smrg [Use doxygen to regenerate documentation (default: ]_defopt[)]), 17075bd32fd1Smrg [use_doxygen=$withval], [use_doxygen=]_defopt) 17085bd32fd1Smrgm4_undefine([_defopt]) 17095bd32fd1Smrg 17105bd32fd1Smrgif test "x$use_doxygen" = x"auto"; then 17115bd32fd1Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 17125bd32fd1Smrg if test "x$DOXYGEN" = "x"; then 17135bd32fd1Smrg AC_MSG_WARN([doxygen not found - documentation targets will be skipped]) 17145bd32fd1Smrg have_doxygen=no 17155bd32fd1Smrg else 17165bd32fd1Smrg have_doxygen=yes 17175bd32fd1Smrg fi 17185bd32fd1Smrgelif test "x$use_doxygen" = x"yes" ; then 17195bd32fd1Smrg AC_PATH_PROG([DOXYGEN], [doxygen]) 17205bd32fd1Smrg if test "x$DOXYGEN" = "x"; then 17215bd32fd1Smrg AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH]) 17225bd32fd1Smrg fi 17235bd32fd1Smrg have_doxygen=yes 17245bd32fd1Smrgelif test "x$use_doxygen" = x"no" ; then 17255bd32fd1Smrg if test "x$DOXYGEN" != "x"; then 17265bd32fd1Smrg AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified]) 17275bd32fd1Smrg fi 17285bd32fd1Smrg have_doxygen=no 17295bd32fd1Smrgelse 17305bd32fd1Smrg AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no']) 17315bd32fd1Smrgfi 17325bd32fd1Smrgm4_ifval([$1], 17335bd32fd1Smrg[if test "$have_doxygen" = yes; then 17345bd32fd1Smrg # scrape the doxygen version 17355bd32fd1Smrg AC_MSG_CHECKING([the doxygen version]) 17365bd32fd1Smrg doxygen_version=`$DOXYGEN --version 2>/dev/null` 17375bd32fd1Smrg AC_MSG_RESULT([$doxygen_version]) 17385bd32fd1Smrg AS_VERSION_COMPARE([$doxygen_version], [$1], 17395bd32fd1Smrg [if test "x$use_doxygen" = xauto; then 17405bd32fd1Smrg AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed]) 17415bd32fd1Smrg have_doxygen=no 17425bd32fd1Smrg else 17435bd32fd1Smrg AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) 17445bd32fd1Smrg fi]) 17455bd32fd1Smrgfi]) 17465bd32fd1SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) 17475bd32fd1Smrg]) # XORG_WITH_DOXYGEN 17485bd32fd1Smrg 17495bd32fd1Smrg# XORG_WITH_GROFF([DEFAULT]) 17505bd32fd1Smrg# ---------------- 17515bd32fd1Smrg# Minimum version: 1.6.0 17525bd32fd1Smrg# Minimum version for optional DEFAULT argument: 1.11.0 17535bd32fd1Smrg# 17545bd32fd1Smrg# Documentation tools are not always available on all platforms and sometimes 17555bd32fd1Smrg# not at the appropriate level. This macro enables a module to test for the 17565bd32fd1Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 17575bd32fd1Smrg# the --with-groff option, it allows maximum flexibilty in making decisions 17585bd32fd1Smrg# as whether or not to use the groff package. When DEFAULT is not specified, 17595bd32fd1Smrg# --with-groff assumes 'auto'. 17605bd32fd1Smrg# 17615bd32fd1Smrg# Interface to module: 17625bd32fd1Smrg# HAVE_GROFF: used in makefiles to conditionally generate documentation 17635bd32fd1Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package 17645bd32fd1Smrg# HAVE_GROFF_MS: the -ms macros package 17655bd32fd1Smrg# GROFF: returns the path of the groff program found 17665bd32fd1Smrg# returns the path set by the user in the environment 17675bd32fd1Smrg# --with-groff: 'yes' user instructs the module to use groff 17685bd32fd1Smrg# 'no' user instructs the module not to use groff 17695bd32fd1Smrg# 17705bd32fd1Smrg# Added in version 1.9.0: 17715bd32fd1Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format: 17725bd32fd1Smrg# pnmcut pnmcrop pnmtopng pnmtops from the netpbm package. 17735bd32fd1Smrg# psselect from the psutils package. 17745bd32fd1Smrg# the ghostcript package. Refer to the grohtml man pages 17755bd32fd1Smrg# 17765bd32fd1Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path. 17775bd32fd1Smrg# 17785bd32fd1Smrg# OS and distros often splits groff in a basic and full package, the former 17795bd32fd1Smrg# having the groff program and the later having devices, fonts and macros 17805bd32fd1Smrg# Checking for the groff executable is not enough. 17815bd32fd1Smrg# 17825bd32fd1Smrg# If macros are missing, we cannot assume that groff is useless, so we don't 17835bd32fd1Smrg# unset HAVE_GROFF or GROFF env variables. 17845bd32fd1Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false. 17855bd32fd1Smrg# 17865bd32fd1SmrgAC_DEFUN([XORG_WITH_GROFF],[ 17875bd32fd1SmrgAC_ARG_VAR([GROFF], [Path to groff command]) 17885bd32fd1Smrgm4_define([_defopt], m4_default([$1], [auto])) 17895bd32fd1SmrgAC_ARG_WITH(groff, 17905bd32fd1Smrg AS_HELP_STRING([--with-groff], 17915bd32fd1Smrg [Use groff to regenerate documentation (default: ]_defopt[)]), 17925bd32fd1Smrg [use_groff=$withval], [use_groff=]_defopt) 17935bd32fd1Smrgm4_undefine([_defopt]) 17945bd32fd1Smrg 17955bd32fd1Smrgif test "x$use_groff" = x"auto"; then 17965bd32fd1Smrg AC_PATH_PROG([GROFF], [groff]) 17975bd32fd1Smrg if test "x$GROFF" = "x"; then 17985bd32fd1Smrg AC_MSG_WARN([groff not found - documentation targets will be skipped]) 17995bd32fd1Smrg have_groff=no 18005bd32fd1Smrg else 18015bd32fd1Smrg have_groff=yes 18025bd32fd1Smrg fi 18035bd32fd1Smrgelif test "x$use_groff" = x"yes" ; then 18045bd32fd1Smrg AC_PATH_PROG([GROFF], [groff]) 18055bd32fd1Smrg if test "x$GROFF" = "x"; then 18065bd32fd1Smrg AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH]) 18075bd32fd1Smrg fi 18085bd32fd1Smrg have_groff=yes 18095bd32fd1Smrgelif test "x$use_groff" = x"no" ; then 18105bd32fd1Smrg if test "x$GROFF" != "x"; then 18115bd32fd1Smrg AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified]) 18125bd32fd1Smrg fi 18135bd32fd1Smrg have_groff=no 18145bd32fd1Smrgelse 18155bd32fd1Smrg AC_MSG_ERROR([--with-groff expects 'yes' or 'no']) 18165bd32fd1Smrgfi 18175bd32fd1Smrg 18185bd32fd1Smrg# We have groff, test for the presence of the macro packages 18195bd32fd1Smrgif test "x$have_groff" = x"yes"; then 18205bd32fd1Smrg AC_MSG_CHECKING([for ${GROFF} -ms macros]) 18215bd32fd1Smrg if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then 18225bd32fd1Smrg groff_ms_works=yes 18235bd32fd1Smrg else 18245bd32fd1Smrg groff_ms_works=no 18255bd32fd1Smrg fi 18265bd32fd1Smrg AC_MSG_RESULT([$groff_ms_works]) 18275bd32fd1Smrg AC_MSG_CHECKING([for ${GROFF} -mm macros]) 18285bd32fd1Smrg if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then 18295bd32fd1Smrg groff_mm_works=yes 18305bd32fd1Smrg else 18315bd32fd1Smrg groff_mm_works=no 18325bd32fd1Smrg fi 18335bd32fd1Smrg AC_MSG_RESULT([$groff_mm_works]) 18345bd32fd1Smrgfi 18355bd32fd1Smrg 18365bd32fd1Smrg# We have groff, test for HTML dependencies, one command per package 18375bd32fd1Smrgif test "x$have_groff" = x"yes"; then 18385bd32fd1Smrg AC_PATH_PROGS(GS_PATH, [gs gswin32c]) 18395bd32fd1Smrg AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng]) 18405bd32fd1Smrg AC_PATH_PROG(PSSELECT_PATH, [psselect]) 18415bd32fd1Smrg if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then 18425bd32fd1Smrg have_groff_html=yes 18435bd32fd1Smrg else 18445bd32fd1Smrg have_groff_html=no 18455bd32fd1Smrg AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages]) 18465bd32fd1Smrg fi 18475bd32fd1Smrgfi 18485bd32fd1Smrg 18495bd32fd1Smrg# Set Automake conditionals for Makefiles 18505bd32fd1SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes]) 18515bd32fd1SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes]) 18525bd32fd1SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes]) 18535bd32fd1SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes]) 18545bd32fd1Smrg]) # XORG_WITH_GROFF 18555bd32fd1Smrg 18565bd32fd1Smrg# XORG_WITH_FOP([DEFAULT]) 18575bd32fd1Smrg# ---------------- 18585bd32fd1Smrg# Minimum version: 1.6.0 18595bd32fd1Smrg# Minimum version for optional DEFAULT argument: 1.11.0 18605bd32fd1Smrg# 18615bd32fd1Smrg# Documentation tools are not always available on all platforms and sometimes 18625bd32fd1Smrg# not at the appropriate level. This macro enables a module to test for the 18635bd32fd1Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 18645bd32fd1Smrg# the --with-fop option, it allows maximum flexibilty in making decisions 18655bd32fd1Smrg# as whether or not to use the fop package. When DEFAULT is not specified, 18665bd32fd1Smrg# --with-fop assumes 'auto'. 18675bd32fd1Smrg# 18685bd32fd1Smrg# Interface to module: 18695bd32fd1Smrg# HAVE_FOP: used in makefiles to conditionally generate documentation 18705bd32fd1Smrg# FOP: returns the path of the fop program found 18715bd32fd1Smrg# returns the path set by the user in the environment 18725bd32fd1Smrg# --with-fop: 'yes' user instructs the module to use fop 18735bd32fd1Smrg# 'no' user instructs the module not to use fop 18745bd32fd1Smrg# 18755bd32fd1Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path. 18765bd32fd1Smrg# 18775bd32fd1SmrgAC_DEFUN([XORG_WITH_FOP],[ 18785bd32fd1SmrgAC_ARG_VAR([FOP], [Path to fop command]) 18795bd32fd1Smrgm4_define([_defopt], m4_default([$1], [auto])) 18805bd32fd1SmrgAC_ARG_WITH(fop, 18815bd32fd1Smrg AS_HELP_STRING([--with-fop], 18825bd32fd1Smrg [Use fop to regenerate documentation (default: ]_defopt[)]), 18835bd32fd1Smrg [use_fop=$withval], [use_fop=]_defopt) 18845bd32fd1Smrgm4_undefine([_defopt]) 18855bd32fd1Smrg 18865bd32fd1Smrgif test "x$use_fop" = x"auto"; then 18875bd32fd1Smrg AC_PATH_PROG([FOP], [fop]) 18885bd32fd1Smrg if test "x$FOP" = "x"; then 18895bd32fd1Smrg AC_MSG_WARN([fop not found - documentation targets will be skipped]) 18905bd32fd1Smrg have_fop=no 18915bd32fd1Smrg else 18925bd32fd1Smrg have_fop=yes 18935bd32fd1Smrg fi 18945bd32fd1Smrgelif test "x$use_fop" = x"yes" ; then 18955bd32fd1Smrg AC_PATH_PROG([FOP], [fop]) 18965bd32fd1Smrg if test "x$FOP" = "x"; then 18975bd32fd1Smrg AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH]) 18985bd32fd1Smrg fi 18995bd32fd1Smrg have_fop=yes 19005bd32fd1Smrgelif test "x$use_fop" = x"no" ; then 19015bd32fd1Smrg if test "x$FOP" != "x"; then 19025bd32fd1Smrg AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified]) 19035bd32fd1Smrg fi 19045bd32fd1Smrg have_fop=no 19055bd32fd1Smrgelse 19065bd32fd1Smrg AC_MSG_ERROR([--with-fop expects 'yes' or 'no']) 19075bd32fd1Smrgfi 19085bd32fd1SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) 19095bd32fd1Smrg]) # XORG_WITH_FOP 19105bd32fd1Smrg 19115bd32fd1Smrg# XORG_WITH_PS2PDF([DEFAULT]) 19125bd32fd1Smrg# ---------------- 19135bd32fd1Smrg# Minimum version: 1.6.0 19145bd32fd1Smrg# Minimum version for optional DEFAULT argument: 1.11.0 19155bd32fd1Smrg# 19165bd32fd1Smrg# Documentation tools are not always available on all platforms and sometimes 19175bd32fd1Smrg# not at the appropriate level. This macro enables a module to test for the 19185bd32fd1Smrg# presence of the tool and obtain it's path in separate variables. Coupled with 19195bd32fd1Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions 19205bd32fd1Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified, 19215bd32fd1Smrg# --with-ps2pdf assumes 'auto'. 19225bd32fd1Smrg# 19235bd32fd1Smrg# Interface to module: 19245bd32fd1Smrg# HAVE_PS2PDF: used in makefiles to conditionally generate documentation 19255bd32fd1Smrg# PS2PDF: returns the path of the ps2pdf program found 19265bd32fd1Smrg# returns the path set by the user in the environment 19275bd32fd1Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf 19285bd32fd1Smrg# 'no' user instructs the module not to use ps2pdf 19295bd32fd1Smrg# 19305bd32fd1Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path. 19315bd32fd1Smrg# 19325bd32fd1SmrgAC_DEFUN([XORG_WITH_PS2PDF],[ 19335bd32fd1SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command]) 19345bd32fd1Smrgm4_define([_defopt], m4_default([$1], [auto])) 19355bd32fd1SmrgAC_ARG_WITH(ps2pdf, 19365bd32fd1Smrg AS_HELP_STRING([--with-ps2pdf], 19375bd32fd1Smrg [Use ps2pdf to regenerate documentation (default: ]_defopt[)]), 19385bd32fd1Smrg [use_ps2pdf=$withval], [use_ps2pdf=]_defopt) 19395bd32fd1Smrgm4_undefine([_defopt]) 19405bd32fd1Smrg 19415bd32fd1Smrgif test "x$use_ps2pdf" = x"auto"; then 19425bd32fd1Smrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 19435bd32fd1Smrg if test "x$PS2PDF" = "x"; then 19445bd32fd1Smrg AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped]) 19455bd32fd1Smrg have_ps2pdf=no 19465bd32fd1Smrg else 19475bd32fd1Smrg have_ps2pdf=yes 19485bd32fd1Smrg fi 19495bd32fd1Smrgelif test "x$use_ps2pdf" = x"yes" ; then 19505bd32fd1Smrg AC_PATH_PROG([PS2PDF], [ps2pdf]) 19515bd32fd1Smrg if test "x$PS2PDF" = "x"; then 19525bd32fd1Smrg AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH]) 19535bd32fd1Smrg fi 19545bd32fd1Smrg have_ps2pdf=yes 19555bd32fd1Smrgelif test "x$use_ps2pdf" = x"no" ; then 19565bd32fd1Smrg if test "x$PS2PDF" != "x"; then 19575bd32fd1Smrg AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified]) 19585bd32fd1Smrg fi 19595bd32fd1Smrg have_ps2pdf=no 19605bd32fd1Smrgelse 19615bd32fd1Smrg AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no']) 19625bd32fd1Smrgfi 19635bd32fd1SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes]) 19645bd32fd1Smrg]) # XORG_WITH_PS2PDF 19655bd32fd1Smrg 19665bd32fd1Smrg# XORG_ENABLE_DOCS (enable_docs=yes) 19675bd32fd1Smrg# ---------------- 19685bd32fd1Smrg# Minimum version: 1.6.0 19695bd32fd1Smrg# 19705bd32fd1Smrg# Documentation tools are not always available on all platforms and sometimes 19715bd32fd1Smrg# not at the appropriate level. This macro enables a builder to skip all 19725bd32fd1Smrg# documentation targets except traditional man pages. 19735bd32fd1Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 19745bd32fd1Smrg# maximum flexibilty in controlling documentation building. 19755bd32fd1Smrg# Refer to: 19765bd32fd1Smrg# XORG_WITH_XMLTO --with-xmlto 19775bd32fd1Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 19785bd32fd1Smrg# XORG_WITH_DOXYGEN --with-doxygen 19795bd32fd1Smrg# XORG_WITH_FOP --with-fop 19805bd32fd1Smrg# XORG_WITH_GROFF --with-groff 19815bd32fd1Smrg# XORG_WITH_PS2PDF --with-ps2pdf 19825bd32fd1Smrg# 19835bd32fd1Smrg# Interface to module: 19845bd32fd1Smrg# ENABLE_DOCS: used in makefiles to conditionally generate documentation 19855bd32fd1Smrg# --enable-docs: 'yes' user instructs the module to generate docs 19865bd32fd1Smrg# 'no' user instructs the module not to generate docs 19875bd32fd1Smrg# parm1: specify the default value, yes or no. 19885bd32fd1Smrg# 19895bd32fd1SmrgAC_DEFUN([XORG_ENABLE_DOCS],[ 19905bd32fd1Smrgm4_define([default], m4_default([$1], [yes])) 19915bd32fd1SmrgAC_ARG_ENABLE(docs, 19925bd32fd1Smrg AS_HELP_STRING([--enable-docs], 19935bd32fd1Smrg [Enable building the documentation (default: ]default[)]), 19945bd32fd1Smrg [build_docs=$enableval], [build_docs=]default) 19955bd32fd1Smrgm4_undefine([default]) 19965bd32fd1SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes]) 19975bd32fd1SmrgAC_MSG_CHECKING([whether to build documentation]) 19985bd32fd1SmrgAC_MSG_RESULT([$build_docs]) 19995bd32fd1Smrg]) # XORG_ENABLE_DOCS 20005bd32fd1Smrg 20015bd32fd1Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes) 20025bd32fd1Smrg# ---------------- 20035bd32fd1Smrg# Minimum version: 1.6.0 20045bd32fd1Smrg# 20055bd32fd1Smrg# This macro enables a builder to skip all developer documentation. 20065bd32fd1Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 20075bd32fd1Smrg# maximum flexibilty in controlling documentation building. 20085bd32fd1Smrg# Refer to: 20095bd32fd1Smrg# XORG_WITH_XMLTO --with-xmlto 20105bd32fd1Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 20115bd32fd1Smrg# XORG_WITH_DOXYGEN --with-doxygen 20125bd32fd1Smrg# XORG_WITH_FOP --with-fop 20135bd32fd1Smrg# XORG_WITH_GROFF --with-groff 20145bd32fd1Smrg# XORG_WITH_PS2PDF --with-ps2pdf 20155bd32fd1Smrg# 20165bd32fd1Smrg# Interface to module: 20175bd32fd1Smrg# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs 20185bd32fd1Smrg# --enable-devel-docs: 'yes' user instructs the module to generate developer docs 20195bd32fd1Smrg# 'no' user instructs the module not to generate developer docs 20205bd32fd1Smrg# parm1: specify the default value, yes or no. 20215bd32fd1Smrg# 20225bd32fd1SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[ 20235bd32fd1Smrgm4_define([devel_default], m4_default([$1], [yes])) 20245bd32fd1SmrgAC_ARG_ENABLE(devel-docs, 20255bd32fd1Smrg AS_HELP_STRING([--enable-devel-docs], 20265bd32fd1Smrg [Enable building the developer documentation (default: ]devel_default[)]), 20275bd32fd1Smrg [build_devel_docs=$enableval], [build_devel_docs=]devel_default) 20285bd32fd1Smrgm4_undefine([devel_default]) 20295bd32fd1SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes]) 20305bd32fd1SmrgAC_MSG_CHECKING([whether to build developer documentation]) 20315bd32fd1SmrgAC_MSG_RESULT([$build_devel_docs]) 20325bd32fd1Smrg]) # XORG_ENABLE_DEVEL_DOCS 20335bd32fd1Smrg 20345bd32fd1Smrg# XORG_ENABLE_SPECS (enable_specs=yes) 20355bd32fd1Smrg# ---------------- 20365bd32fd1Smrg# Minimum version: 1.6.0 20375bd32fd1Smrg# 20385bd32fd1Smrg# This macro enables a builder to skip all functional specification targets. 20395bd32fd1Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides 20405bd32fd1Smrg# maximum flexibilty in controlling documentation building. 20415bd32fd1Smrg# Refer to: 20425bd32fd1Smrg# XORG_WITH_XMLTO --with-xmlto 20435bd32fd1Smrg# XORG_WITH_ASCIIDOC --with-asciidoc 20445bd32fd1Smrg# XORG_WITH_DOXYGEN --with-doxygen 20455bd32fd1Smrg# XORG_WITH_FOP --with-fop 20465bd32fd1Smrg# XORG_WITH_GROFF --with-groff 20475bd32fd1Smrg# XORG_WITH_PS2PDF --with-ps2pdf 20485bd32fd1Smrg# 20495bd32fd1Smrg# Interface to module: 20505bd32fd1Smrg# ENABLE_SPECS: used in makefiles to conditionally generate specs 20515bd32fd1Smrg# --enable-specs: 'yes' user instructs the module to generate specs 20525bd32fd1Smrg# 'no' user instructs the module not to generate specs 20535bd32fd1Smrg# parm1: specify the default value, yes or no. 20545bd32fd1Smrg# 20555bd32fd1SmrgAC_DEFUN([XORG_ENABLE_SPECS],[ 20565bd32fd1Smrgm4_define([spec_default], m4_default([$1], [yes])) 20575bd32fd1SmrgAC_ARG_ENABLE(specs, 20585bd32fd1Smrg AS_HELP_STRING([--enable-specs], 20595bd32fd1Smrg [Enable building the specs (default: ]spec_default[)]), 20605bd32fd1Smrg [build_specs=$enableval], [build_specs=]spec_default) 20615bd32fd1Smrgm4_undefine([spec_default]) 20625bd32fd1SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes]) 20635bd32fd1SmrgAC_MSG_CHECKING([whether to build functional specifications]) 20645bd32fd1SmrgAC_MSG_RESULT([$build_specs]) 20655bd32fd1Smrg]) # XORG_ENABLE_SPECS 20665bd32fd1Smrg 20678b22bf3fSmrg# XORG_CHECK_MALLOC_ZERO 20688b22bf3fSmrg# ---------------------- 20698b22bf3fSmrg# Minimum version: 1.0.0 20708b22bf3fSmrg# 20718b22bf3fSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 20728b22bf3fSmrg# malloc(0) returns NULL. Packages should add one of these cflags to 20738b22bf3fSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 20748b22bf3fSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 20758b22bf3fSmrgAC_ARG_ENABLE(malloc0returnsnull, 207696a81b41Smrg AS_HELP_STRING([--enable-malloc0returnsnull], 20778b22bf3fSmrg [malloc(0) returns NULL (default: auto)]), 20788b22bf3fSmrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 20798b22bf3fSmrg [MALLOC_ZERO_RETURNS_NULL=auto]) 20808b22bf3fSmrg 20818b22bf3fSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 20828b22bf3fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 20838b22bf3fSmrg AC_RUN_IFELSE([ 20848b22bf3fSmrgchar *malloc(); 20858b22bf3fSmrgchar *realloc(); 20868b22bf3fSmrgchar *calloc(); 20878b22bf3fSmrgmain() { 20888b22bf3fSmrg char *m0, *r0, *c0, *p; 20898b22bf3fSmrg m0 = malloc(0); 20908b22bf3fSmrg p = malloc(10); 20918b22bf3fSmrg r0 = realloc(p,0); 20928b22bf3fSmrg c0 = calloc(0); 20938b22bf3fSmrg exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); 20948b22bf3fSmrg}], 20958b22bf3fSmrg [MALLOC_ZERO_RETURNS_NULL=yes], 20965bd32fd1Smrg [MALLOC_ZERO_RETURNS_NULL=no], 20975bd32fd1Smrg [MALLOC_ZERO_RETURNS_NULL=yes]) 20988b22bf3fSmrgfi 20998b22bf3fSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 21008b22bf3fSmrg 21018b22bf3fSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 21028b22bf3fSmrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 21038b22bf3fSmrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 21048b22bf3fSmrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 21058b22bf3fSmrgelse 21068b22bf3fSmrg MALLOC_ZERO_CFLAGS="" 21078b22bf3fSmrg XMALLOC_ZERO_CFLAGS="" 21088b22bf3fSmrg XTMALLOC_ZERO_CFLAGS="" 21098b22bf3fSmrgfi 21108b22bf3fSmrg 21118b22bf3fSmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 21128b22bf3fSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 21138b22bf3fSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 21148b22bf3fSmrg]) # XORG_CHECK_MALLOC_ZERO 21158b22bf3fSmrg 21168b22bf3fSmrg# XORG_WITH_LINT() 21178b22bf3fSmrg# ---------------- 21188b22bf3fSmrg# Minimum version: 1.1.0 21198b22bf3fSmrg# 21205bd32fd1Smrg# This macro enables the use of a tool that flags some suspicious and 21215bd32fd1Smrg# non-portable constructs (likely to be bugs) in C language source code. 21225bd32fd1Smrg# It will attempt to locate the tool and use appropriate options. 21235bd32fd1Smrg# There are various lint type tools on different platforms. 21245bd32fd1Smrg# 21255bd32fd1Smrg# Interface to module: 21265bd32fd1Smrg# LINT: returns the path to the tool found on the platform 21275bd32fd1Smrg# or the value set to LINT on the configure cmd line 21285bd32fd1Smrg# also an Automake conditional 21295bd32fd1Smrg# LINT_FLAGS: an Automake variable with appropriate flags 21305bd32fd1Smrg# 21315bd32fd1Smrg# --with-lint: 'yes' user instructs the module to use lint 21325bd32fd1Smrg# 'no' user instructs the module not to use lint (default) 21335bd32fd1Smrg# 21345bd32fd1Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path. 21355bd32fd1Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim. 21368b22bf3fSmrg# 21378b22bf3fSmrgAC_DEFUN([XORG_WITH_LINT],[ 21388b22bf3fSmrg 21395bd32fd1SmrgAC_ARG_VAR([LINT], [Path to a lint-style command]) 21405bd32fd1SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command]) 214196a81b41SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint], 21428b22bf3fSmrg [Use a lint-style source code checker (default: disabled)])], 21438b22bf3fSmrg [use_lint=$withval], [use_lint=no]) 21445bd32fd1Smrg 21455bd32fd1Smrg# Obtain platform specific info like program name and options 21465bd32fd1Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris 21475bd32fd1Smrgcase $host_os in 21485bd32fd1Smrg *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*) 21495bd32fd1Smrg lint_name=splint 21505bd32fd1Smrg lint_options="-badflag" 21515bd32fd1Smrg ;; 21525bd32fd1Smrg *freebsd* | *netbsd*) 21535bd32fd1Smrg lint_name=lint 21545bd32fd1Smrg lint_options="-u -b" 21555bd32fd1Smrg ;; 21565bd32fd1Smrg *solaris*) 21575bd32fd1Smrg lint_name=lint 21585bd32fd1Smrg lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" 21595bd32fd1Smrg ;; 21605bd32fd1Smrgesac 21615bd32fd1Smrg 21625bd32fd1Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user) 21635bd32fd1Smrgif test "x$use_lint" = x"yes" ; then 21645bd32fd1Smrg AC_PATH_PROG([LINT], [$lint_name]) 21655bd32fd1Smrg if test "x$LINT" = "x"; then 21665bd32fd1Smrg AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH]) 21675bd32fd1Smrg fi 21685bd32fd1Smrgelif test "x$use_lint" = x"no" ; then 21695bd32fd1Smrg if test "x$LINT" != "x"; then 21705bd32fd1Smrg AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified]) 21715bd32fd1Smrg fi 21728b22bf3fSmrgelse 21735bd32fd1Smrg AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.]) 21748b22bf3fSmrgfi 21755bd32fd1Smrg 21765bd32fd1Smrg# User supplied flags override default flags 21775bd32fd1Smrgif test "x$LINT_FLAGS" != "x"; then 21785bd32fd1Smrg lint_options=$LINT_FLAGS 21798b22bf3fSmrgfi 21808b22bf3fSmrg 21815bd32fd1SmrgAC_SUBST([LINT_FLAGS],[$lint_options]) 21825bd32fd1SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x]) 21838b22bf3fSmrg 21848b22bf3fSmrg]) # XORG_WITH_LINT 21858b22bf3fSmrg 21868b22bf3fSmrg# XORG_LINT_LIBRARY(LIBNAME) 21878b22bf3fSmrg# -------------------------- 21888b22bf3fSmrg# Minimum version: 1.1.0 21898b22bf3fSmrg# 21908b22bf3fSmrg# Sets up flags for building lint libraries for checking programs that call 21918b22bf3fSmrg# functions in the library. 21928b22bf3fSmrg# 21935bd32fd1Smrg# Interface to module: 21945bd32fd1Smrg# LINTLIB - Automake variable with the name of lint library file to make 21955bd32fd1Smrg# MAKE_LINT_LIB - Automake conditional 21965bd32fd1Smrg# 21975bd32fd1Smrg# --enable-lint-library: - 'yes' user instructs the module to created a lint library 21985bd32fd1Smrg# - 'no' user instructs the module not to create a lint library (default) 21998b22bf3fSmrg 22008b22bf3fSmrgAC_DEFUN([XORG_LINT_LIBRARY],[ 22018b22bf3fSmrgAC_REQUIRE([XORG_WITH_LINT]) 220296a81b41SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library], 22038b22bf3fSmrg [Create lint library (default: disabled)])], 22048b22bf3fSmrg [make_lint_lib=$enableval], [make_lint_lib=no]) 22055bd32fd1Smrg 22065bd32fd1Smrgif test "x$make_lint_lib" = x"yes" ; then 22075bd32fd1Smrg LINTLIB=llib-l$1.ln 22085bd32fd1Smrg if test "x$LINT" = "x"; then 22095bd32fd1Smrg AC_MSG_ERROR([Cannot make lint library without --with-lint]) 22105bd32fd1Smrg fi 22115bd32fd1Smrgelif test "x$make_lint_lib" != x"no" ; then 22125bd32fd1Smrg AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.]) 22138b22bf3fSmrgfi 22145bd32fd1Smrg 22158b22bf3fSmrgAC_SUBST(LINTLIB) 22168b22bf3fSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) 22178b22bf3fSmrg 22188b22bf3fSmrg]) # XORG_LINT_LIBRARY 22198b22bf3fSmrg 222096a81b41Smrg# XORG_CWARNFLAGS 222196a81b41Smrg# --------------- 222296a81b41Smrg# Minimum version: 1.2.0 222396a81b41Smrg# 222496a81b41Smrg# Defines CWARNFLAGS to enable C compiler warnings. 222596a81b41Smrg# 222696a81b41SmrgAC_DEFUN([XORG_CWARNFLAGS], [ 22275bd32fd1SmrgAC_REQUIRE([AC_PROG_CC_C99]) 222896a81b41Smrgif test "x$GCC" = xyes ; then 222996a81b41Smrg CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \ 223096a81b41Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \ 22315bd32fd1Smrg-Wbad-function-cast -Wformat=2" 223296a81b41Smrg case `$CC -dumpversion` in 223396a81b41Smrg 3.4.* | 4.*) 223496a81b41Smrg CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement" 223596a81b41Smrg ;; 223696a81b41Smrg esac 223796a81b41Smrgelse 223896a81b41Smrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 223996a81b41Smrg if test "x$SUNCC" = "xyes"; then 224096a81b41Smrg CWARNFLAGS="-v" 224196a81b41Smrg fi 224296a81b41Smrgfi 224396a81b41SmrgAC_SUBST(CWARNFLAGS) 224496a81b41Smrg]) # XORG_CWARNFLAGS 224596a81b41Smrg 224696a81b41Smrg# XORG_STRICT_OPTION 224796a81b41Smrg# ----------------------- 224896a81b41Smrg# Minimum version: 1.3.0 224996a81b41Smrg# 225096a81b41Smrg# Add configure option to enable strict compilation 225196a81b41SmrgAC_DEFUN([XORG_STRICT_OPTION], [ 22525bd32fd1Smrg# If the module's configure.ac calls AC_PROG_CC later on, CC gets set to C89 225396a81b41SmrgAC_REQUIRE([AC_PROG_CC_C99]) 225496a81b41SmrgAC_REQUIRE([XORG_CWARNFLAGS]) 225596a81b41Smrg 225696a81b41SmrgAC_ARG_ENABLE(strict-compilation, 225796a81b41Smrg AS_HELP_STRING([--enable-strict-compilation], 225896a81b41Smrg [Enable all warnings from compiler and make them errors (default: disabled)]), 225996a81b41Smrg [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no]) 226096a81b41Smrgif test "x$STRICT_COMPILE" = "xyes"; then 226196a81b41Smrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 226296a81b41Smrg AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"]) 226396a81b41Smrg if test "x$GCC" = xyes ; then 226496a81b41Smrg STRICT_CFLAGS="-pedantic -Werror" 226596a81b41Smrg elif test "x$SUNCC" = "xyes"; then 226696a81b41Smrg STRICT_CFLAGS="-errwarn" 226796a81b41Smrg elif test "x$INTELCC" = "xyes"; then 226896a81b41Smrg STRICT_CFLAGS="-Werror" 226996a81b41Smrg fi 227096a81b41Smrgfi 227196a81b41SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS" 227296a81b41SmrgAC_SUBST([CWARNFLAGS]) 227396a81b41Smrg]) # XORG_STRICT_OPTION 227496a81b41Smrg 227596a81b41Smrg# XORG_DEFAULT_OPTIONS 227696a81b41Smrg# -------------------- 227796a81b41Smrg# Minimum version: 1.3.0 227896a81b41Smrg# 227996a81b41Smrg# Defines default options for X.Org modules. 228096a81b41Smrg# 228196a81b41SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [ 22825bd32fd1SmrgAC_REQUIRE([AC_PROG_INSTALL]) 228396a81b41SmrgXORG_CWARNFLAGS 228496a81b41SmrgXORG_STRICT_OPTION 228596a81b41SmrgXORG_RELEASE_VERSION 228696a81b41SmrgXORG_CHANGELOG 22875bd32fd1SmrgXORG_INSTALL 228896a81b41SmrgXORG_MANPAGE_SECTIONS 22895bd32fd1Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], 22905bd32fd1Smrg [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) 229196a81b41Smrg]) # XORG_DEFAULT_OPTIONS 22925bd32fd1Smrg 22935bd32fd1Smrg# XORG_INSTALL() 22945bd32fd1Smrg# ---------------- 22955bd32fd1Smrg# Minimum version: 1.4.0 22965bd32fd1Smrg# 22975bd32fd1Smrg# Defines the variable INSTALL_CMD as the command to copy 22985bd32fd1Smrg# INSTALL from $prefix/share/util-macros. 22995bd32fd1Smrg# 23005bd32fd1SmrgAC_DEFUN([XORG_INSTALL], [ 23015bd32fd1SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG]) 23025bd32fd1Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros` 23035bd32fd1SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \ 23045bd32fd1Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \ 23055bd32fd1Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \ 23065bd32fd1Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)" 23075bd32fd1SmrgAC_SUBST([INSTALL_CMD]) 23085bd32fd1Smrg]) # XORG_INSTALL 23098b22bf3fSmrgdnl Copyright 2005 Red Hat, Inc 23108b22bf3fSmrgdnl 23118b22bf3fSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its 23128b22bf3fSmrgdnl documentation for any purpose is hereby granted without fee, provided that 23138b22bf3fSmrgdnl the above copyright notice appear in all copies and that both that 23148b22bf3fSmrgdnl copyright notice and this permission notice appear in supporting 23158b22bf3fSmrgdnl documentation. 23168b22bf3fSmrgdnl 23178b22bf3fSmrgdnl The above copyright notice and this permission notice shall be included 23188b22bf3fSmrgdnl in all copies or substantial portions of the Software. 23198b22bf3fSmrgdnl 23208b22bf3fSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 23218b22bf3fSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23228b22bf3fSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23238b22bf3fSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 23248b22bf3fSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 23258b22bf3fSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23268b22bf3fSmrgdnl OTHER DEALINGS IN THE SOFTWARE. 23278b22bf3fSmrgdnl 23288b22bf3fSmrgdnl Except as contained in this notice, the name of the copyright holders shall 23298b22bf3fSmrgdnl not be used in advertising or otherwise to promote the sale, use or 23308b22bf3fSmrgdnl other dealings in this Software without prior written authorization 23318b22bf3fSmrgdnl from the copyright holders. 23328b22bf3fSmrgdnl 23338b22bf3fSmrg 23348b22bf3fSmrg# XORG_RELEASE_VERSION 23358b22bf3fSmrg# -------------------- 23365bd32fd1Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. 23378b22bf3fSmrg 23388b22bf3fSmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 23398b22bf3fSmrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], 23408b22bf3fSmrg [`echo $PACKAGE_VERSION | cut -d . -f 1`], 23418b22bf3fSmrg [Major version of this package]) 234296a81b41Smrg PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` 23438b22bf3fSmrg if test "x$PVM" = "x"; then 23448b22bf3fSmrg PVM="0" 23458b22bf3fSmrg fi 23468b22bf3fSmrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], 23478b22bf3fSmrg [$PVM], 23488b22bf3fSmrg [Minor version of this package]) 234996a81b41Smrg PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` 23508b22bf3fSmrg if test "x$PVP" = "x"; then 23518b22bf3fSmrg PVP="0" 23528b22bf3fSmrg fi 23538b22bf3fSmrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], 23548b22bf3fSmrg [$PVP], 23558b22bf3fSmrg [Patch version of this package]) 23568b22bf3fSmrg]) 23578b22bf3fSmrg 235896a81b41Smrg# XORG_CHANGELOG() 235996a81b41Smrg# ---------------- 236096a81b41Smrg# Minimum version: 1.2.0 236196a81b41Smrg# 236296a81b41Smrg# Defines the variable CHANGELOG_CMD as the command to generate 236396a81b41Smrg# ChangeLog from git. 236496a81b41Smrg# 236596a81b41Smrg# 236696a81b41SmrgAC_DEFUN([XORG_CHANGELOG], [ 23675bd32fd1SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \ 23685bd32fd1Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \ 23695bd32fd1Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \ 237096a81b41Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)" 237196a81b41SmrgAC_SUBST([CHANGELOG_CMD]) 237296a81b41Smrg]) # XORG_CHANGELOG 237396a81b41Smrg 2374