aclocal.m4 revision 1568b75b
11568b75bSmrg# generated automatically by aclocal 1.11 -*- Autoconf -*- 27d5e3a19Smrg 37d5e3a19Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 41568b75bSmrg# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 57d5e3a19Smrg# This file is free software; the Free Software Foundation 67d5e3a19Smrg# gives unlimited permission to copy and/or distribute it, 77d5e3a19Smrg# with or without modifications, as long as this notice is preserved. 87d5e3a19Smrg 97d5e3a19Smrg# This program is distributed in the hope that it will be useful, 107d5e3a19Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 117d5e3a19Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 127d5e3a19Smrg# PARTICULAR PURPOSE. 137d5e3a19Smrg 141568b75bSmrgm4_ifndef([AC_AUTOCONF_VERSION], 151568b75bSmrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 161568b75bSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],, 171568b75bSmrg[m4_warning([this file was generated for autoconf 2.63. 181568b75bSmrgYou have another version of autoconf. It may work, but is not guaranteed to. 191568b75bSmrgIf you have problems, you may need to regenerate the build system entirely. 201568b75bSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])]) 217d5e3a19Smrg 221568b75bSmrg# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 231568b75bSmrg# 241568b75bSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 251568b75bSmrg# 261568b75bSmrg# This program is free software; you can redistribute it and/or modify 271568b75bSmrg# it under the terms of the GNU General Public License as published by 281568b75bSmrg# the Free Software Foundation; either version 2 of the License, or 291568b75bSmrg# (at your option) any later version. 301568b75bSmrg# 311568b75bSmrg# This program is distributed in the hope that it will be useful, but 321568b75bSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of 331568b75bSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 341568b75bSmrg# General Public License for more details. 351568b75bSmrg# 361568b75bSmrg# You should have received a copy of the GNU General Public License 371568b75bSmrg# along with this program; if not, write to the Free Software 381568b75bSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 391568b75bSmrg# 401568b75bSmrg# As a special exception to the GNU General Public License, if you 411568b75bSmrg# distribute this file as part of a program that contains a 421568b75bSmrg# configuration script generated by Autoconf, you may include it under 431568b75bSmrg# the same distribution terms that you use for the rest of that program. 441568b75bSmrg 451568b75bSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION]) 461568b75bSmrg# ---------------------------------- 471568b75bSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG], 481568b75bSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 491568b75bSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$]) 501568b75bSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl 511568b75bSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 521568b75bSmrg AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 531568b75bSmrgfi 541568b75bSmrgif test -n "$PKG_CONFIG"; then 551568b75bSmrg _pkg_min_version=m4_default([$1], [0.9.0]) 561568b75bSmrg AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) 571568b75bSmrg if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then 581568b75bSmrg AC_MSG_RESULT([yes]) 591568b75bSmrg else 601568b75bSmrg AC_MSG_RESULT([no]) 611568b75bSmrg PKG_CONFIG="" 621568b75bSmrg fi 631568b75bSmrg 641568b75bSmrgfi[]dnl 651568b75bSmrg])# PKG_PROG_PKG_CONFIG 661568b75bSmrg 671568b75bSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 681568b75bSmrg# 691568b75bSmrg# Check to see whether a particular set of modules exists. Similar 701568b75bSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors. 711568b75bSmrg# 721568b75bSmrg# 731568b75bSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of 741568b75bSmrg# this or PKG_CHECK_MODULES is called, or make sure to call 751568b75bSmrg# PKG_CHECK_EXISTS manually 761568b75bSmrg# -------------------------------------------------------------- 771568b75bSmrgAC_DEFUN([PKG_CHECK_EXISTS], 781568b75bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 791568b75bSmrgif test -n "$PKG_CONFIG" && \ 801568b75bSmrg AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 811568b75bSmrg m4_ifval([$2], [$2], [:]) 821568b75bSmrgm4_ifvaln([$3], [else 831568b75bSmrg $3])dnl 841568b75bSmrgfi]) 851568b75bSmrg 861568b75bSmrg 871568b75bSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 881568b75bSmrg# --------------------------------------------- 891568b75bSmrgm4_define([_PKG_CONFIG], 901568b75bSmrg[if test -n "$$1"; then 911568b75bSmrg pkg_cv_[]$1="$$1" 921568b75bSmrg elif test -n "$PKG_CONFIG"; then 931568b75bSmrg PKG_CHECK_EXISTS([$3], 941568b75bSmrg [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], 951568b75bSmrg [pkg_failed=yes]) 961568b75bSmrg else 971568b75bSmrg pkg_failed=untried 981568b75bSmrgfi[]dnl 991568b75bSmrg])# _PKG_CONFIG 1001568b75bSmrg 1011568b75bSmrg# _PKG_SHORT_ERRORS_SUPPORTED 1021568b75bSmrg# ----------------------------- 1031568b75bSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 1041568b75bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 1051568b75bSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 1061568b75bSmrg _pkg_short_errors_supported=yes 1071568b75bSmrgelse 1081568b75bSmrg _pkg_short_errors_supported=no 1091568b75bSmrgfi[]dnl 1101568b75bSmrg])# _PKG_SHORT_ERRORS_SUPPORTED 1111568b75bSmrg 1121568b75bSmrg 1131568b75bSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 1141568b75bSmrg# [ACTION-IF-NOT-FOUND]) 1151568b75bSmrg# 1161568b75bSmrg# 1171568b75bSmrg# Note that if there is a possibility the first call to 1181568b75bSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an 1191568b75bSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 1201568b75bSmrg# 1211568b75bSmrg# 1221568b75bSmrg# -------------------------------------------------------------- 1231568b75bSmrgAC_DEFUN([PKG_CHECK_MODULES], 1241568b75bSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 1251568b75bSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 1261568b75bSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 1271568b75bSmrg 1281568b75bSmrgpkg_failed=no 1291568b75bSmrgAC_MSG_CHECKING([for $1]) 1301568b75bSmrg 1311568b75bSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 1321568b75bSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 1331568b75bSmrg 1341568b75bSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 1351568b75bSmrgand $1[]_LIBS to avoid the need to call pkg-config. 1361568b75bSmrgSee the pkg-config man page for more details.]) 1371568b75bSmrg 1381568b75bSmrgif test $pkg_failed = yes; then 1391568b75bSmrg _PKG_SHORT_ERRORS_SUPPORTED 1401568b75bSmrg if test $_pkg_short_errors_supported = yes; then 1411568b75bSmrg $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` 1421568b75bSmrg else 1431568b75bSmrg $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` 1441568b75bSmrg fi 1451568b75bSmrg # Put the nasty error message in config.log where it belongs 1461568b75bSmrg echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD 1471568b75bSmrg 1481568b75bSmrg ifelse([$4], , [AC_MSG_ERROR(dnl 1491568b75bSmrg[Package requirements ($2) were not met: 1501568b75bSmrg 1511568b75bSmrg$$1_PKG_ERRORS 1521568b75bSmrg 1531568b75bSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you 1541568b75bSmrginstalled software in a non-standard prefix. 1551568b75bSmrg 1561568b75bSmrg_PKG_TEXT 1571568b75bSmrg])], 1581568b75bSmrg [AC_MSG_RESULT([no]) 1591568b75bSmrg $4]) 1601568b75bSmrgelif test $pkg_failed = untried; then 1611568b75bSmrg ifelse([$4], , [AC_MSG_FAILURE(dnl 1621568b75bSmrg[The pkg-config script could not be found or is too old. Make sure it 1631568b75bSmrgis in your PATH or set the PKG_CONFIG environment variable to the full 1641568b75bSmrgpath to pkg-config. 1651568b75bSmrg 1661568b75bSmrg_PKG_TEXT 1671568b75bSmrg 1681568b75bSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])], 1691568b75bSmrg [$4]) 1701568b75bSmrgelse 1711568b75bSmrg $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 1721568b75bSmrg $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 1731568b75bSmrg AC_MSG_RESULT([yes]) 1741568b75bSmrg ifelse([$3], , :, [$3]) 1751568b75bSmrgfi[]dnl 1761568b75bSmrg])# PKG_CHECK_MODULES 1771568b75bSmrg 1781568b75bSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 1797d5e3a19Smrg# 1807d5e3a19Smrg# This file is free software; the Free Software Foundation 1817d5e3a19Smrg# gives unlimited permission to copy and/or distribute it, 1827d5e3a19Smrg# with or without modifications, as long as this notice is preserved. 1837d5e3a19Smrg 1847d5e3a19Smrg# AM_AUTOMAKE_VERSION(VERSION) 1857d5e3a19Smrg# ---------------------------- 1867d5e3a19Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been 1877d5e3a19Smrg# generated from the m4 files accompanying Automake X.Y. 1887d5e3a19Smrg# (This private macro should not be called outside this file.) 1897d5e3a19SmrgAC_DEFUN([AM_AUTOMAKE_VERSION], 1901568b75bSmrg[am__api_version='1.11' 1917d5e3a19Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to 1927d5e3a19Smrgdnl require some minimum version. Point them to the right macro. 1931568b75bSmrgm4_if([$1], [1.11], [], 1947d5e3a19Smrg [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl 1957d5e3a19Smrg]) 1967d5e3a19Smrg 1977d5e3a19Smrg# _AM_AUTOCONF_VERSION(VERSION) 1987d5e3a19Smrg# ----------------------------- 1997d5e3a19Smrg# aclocal traces this macro to find the Autoconf version. 2007d5e3a19Smrg# This is a private macro too. Using m4_define simplifies 2017d5e3a19Smrg# the logic in aclocal, which can simply ignore this definition. 2027d5e3a19Smrgm4_define([_AM_AUTOCONF_VERSION], []) 2037d5e3a19Smrg 2047d5e3a19Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION 2057d5e3a19Smrg# ------------------------------- 2067d5e3a19Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. 2071568b75bSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. 2087d5e3a19SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 2091568b75bSmrg[AM_AUTOMAKE_VERSION([1.11])dnl 2101568b75bSmrgm4_ifndef([AC_AUTOCONF_VERSION], 2111568b75bSmrg [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl 2121568b75bSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) 2137d5e3a19Smrg 2147d5e3a19Smrg# AM_AUX_DIR_EXPAND -*- Autoconf -*- 2157d5e3a19Smrg 2167d5e3a19Smrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 2177d5e3a19Smrg# 2187d5e3a19Smrg# This file is free software; the Free Software Foundation 2197d5e3a19Smrg# gives unlimited permission to copy and/or distribute it, 2207d5e3a19Smrg# with or without modifications, as long as this notice is preserved. 2217d5e3a19Smrg 2227d5e3a19Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets 2237d5e3a19Smrg# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to 2247d5e3a19Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'. 2257d5e3a19Smrg# 2267d5e3a19Smrg# Of course, Automake must honor this variable whenever it calls a 2277d5e3a19Smrg# tool from the auxiliary directory. The problem is that $srcdir (and 2287d5e3a19Smrg# therefore $ac_aux_dir as well) can be either absolute or relative, 2297d5e3a19Smrg# depending on how configure is run. This is pretty annoying, since 2307d5e3a19Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top 2317d5e3a19Smrg# source directory, any form will work fine, but in subdirectories a 2327d5e3a19Smrg# relative path needs to be adjusted first. 2337d5e3a19Smrg# 2347d5e3a19Smrg# $ac_aux_dir/missing 2357d5e3a19Smrg# fails when called from a subdirectory if $ac_aux_dir is relative 2367d5e3a19Smrg# $top_srcdir/$ac_aux_dir/missing 2377d5e3a19Smrg# fails if $ac_aux_dir is absolute, 2387d5e3a19Smrg# fails when called from a subdirectory in a VPATH build with 2397d5e3a19Smrg# a relative $ac_aux_dir 2407d5e3a19Smrg# 2417d5e3a19Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir 2427d5e3a19Smrg# are both prefixed by $srcdir. In an in-source build this is usually 2437d5e3a19Smrg# harmless because $srcdir is `.', but things will broke when you 2447d5e3a19Smrg# start a VPATH build or use an absolute $srcdir. 2457d5e3a19Smrg# 2467d5e3a19Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, 2477d5e3a19Smrg# iff we strip the leading $srcdir from $ac_aux_dir. That would be: 2487d5e3a19Smrg# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` 2497d5e3a19Smrg# and then we would define $MISSING as 2507d5e3a19Smrg# MISSING="\${SHELL} $am_aux_dir/missing" 2517d5e3a19Smrg# This will work as long as MISSING is not called from configure, because 2527d5e3a19Smrg# unfortunately $(top_srcdir) has no meaning in configure. 2537d5e3a19Smrg# However there are other variables, like CC, which are often used in 2547d5e3a19Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir. 2557d5e3a19Smrg# 2567d5e3a19Smrg# Another solution, used here, is to always expand $ac_aux_dir to an 2577d5e3a19Smrg# absolute PATH. The drawback is that using absolute paths prevent a 2587d5e3a19Smrg# configured tree to be moved without reconfiguration. 2597d5e3a19Smrg 2607d5e3a19SmrgAC_DEFUN([AM_AUX_DIR_EXPAND], 2617d5e3a19Smrg[dnl Rely on autoconf to set up CDPATH properly. 2627d5e3a19SmrgAC_PREREQ([2.50])dnl 2637d5e3a19Smrg# expand $ac_aux_dir to an absolute path 2647d5e3a19Smrgam_aux_dir=`cd $ac_aux_dir && pwd` 2657d5e3a19Smrg]) 2667d5e3a19Smrg 2677d5e3a19Smrg# AM_CONDITIONAL -*- Autoconf -*- 2687d5e3a19Smrg 2691568b75bSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 2707d5e3a19Smrg# Free Software Foundation, Inc. 2717d5e3a19Smrg# 2727d5e3a19Smrg# This file is free software; the Free Software Foundation 2737d5e3a19Smrg# gives unlimited permission to copy and/or distribute it, 2747d5e3a19Smrg# with or without modifications, as long as this notice is preserved. 2757d5e3a19Smrg 2761568b75bSmrg# serial 9 2777d5e3a19Smrg 2787d5e3a19Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION) 2797d5e3a19Smrg# ------------------------------------- 2807d5e3a19Smrg# Define a conditional. 2817d5e3a19SmrgAC_DEFUN([AM_CONDITIONAL], 2827d5e3a19Smrg[AC_PREREQ(2.52)dnl 2837d5e3a19Smrg ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], 2847d5e3a19Smrg [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl 2857d5e3a19SmrgAC_SUBST([$1_TRUE])dnl 2867d5e3a19SmrgAC_SUBST([$1_FALSE])dnl 2877d5e3a19Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl 2887d5e3a19Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl 2891568b75bSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl 2907d5e3a19Smrgif $2; then 2917d5e3a19Smrg $1_TRUE= 2927d5e3a19Smrg $1_FALSE='#' 2937d5e3a19Smrgelse 2947d5e3a19Smrg $1_TRUE='#' 2957d5e3a19Smrg $1_FALSE= 2967d5e3a19Smrgfi 2977d5e3a19SmrgAC_CONFIG_COMMANDS_PRE( 2987d5e3a19Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then 2997d5e3a19Smrg AC_MSG_ERROR([[conditional "$1" was never defined. 3007d5e3a19SmrgUsually this means the macro was only invoked conditionally.]]) 3017d5e3a19Smrgfi])]) 3027d5e3a19Smrg 3031568b75bSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 3047d5e3a19Smrg# Free Software Foundation, Inc. 3057d5e3a19Smrg# 3067d5e3a19Smrg# This file is free software; the Free Software Foundation 3077d5e3a19Smrg# gives unlimited permission to copy and/or distribute it, 3087d5e3a19Smrg# with or without modifications, as long as this notice is preserved. 3097d5e3a19Smrg 3101568b75bSmrg# serial 10 3117d5e3a19Smrg 3127d5e3a19Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be 3137d5e3a19Smrg# written in clear, in which case automake, when reading aclocal.m4, 3147d5e3a19Smrg# will think it sees a *use*, and therefore will trigger all it's 3157d5e3a19Smrg# C support machinery. Also note that it means that autoscan, seeing 3167d5e3a19Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use... 3177d5e3a19Smrg 3187d5e3a19Smrg 3197d5e3a19Smrg# _AM_DEPENDENCIES(NAME) 3207d5e3a19Smrg# ---------------------- 3217d5e3a19Smrg# See how the compiler implements dependency checking. 3227d5e3a19Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC". 3237d5e3a19Smrg# We try a few techniques and use that to set a single cache variable. 3247d5e3a19Smrg# 3257d5e3a19Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was 3267d5e3a19Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular 3277d5e3a19Smrg# dependency, and given that the user is not expected to run this macro, 3287d5e3a19Smrg# just rely on AC_PROG_CC. 3297d5e3a19SmrgAC_DEFUN([_AM_DEPENDENCIES], 3307d5e3a19Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl 3317d5e3a19SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl 3327d5e3a19SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl 3337d5e3a19SmrgAC_REQUIRE([AM_DEP_TRACK])dnl 3347d5e3a19Smrg 3357d5e3a19Smrgifelse([$1], CC, [depcc="$CC" am_compiler_list=], 3367d5e3a19Smrg [$1], CXX, [depcc="$CXX" am_compiler_list=], 3377d5e3a19Smrg [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], 3387d5e3a19Smrg [$1], UPC, [depcc="$UPC" am_compiler_list=], 3397d5e3a19Smrg [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], 3407d5e3a19Smrg [depcc="$$1" am_compiler_list=]) 3417d5e3a19Smrg 3427d5e3a19SmrgAC_CACHE_CHECK([dependency style of $depcc], 3437d5e3a19Smrg [am_cv_$1_dependencies_compiler_type], 3447d5e3a19Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then 3457d5e3a19Smrg # We make a subdir and do the tests there. Otherwise we can end up 3467d5e3a19Smrg # making bogus files that we don't know about and never remove. For 3477d5e3a19Smrg # instance it was reported that on HP-UX the gcc test will end up 3487d5e3a19Smrg # making a dummy file named `D' -- because `-MD' means `put the output 3497d5e3a19Smrg # in D'. 3507d5e3a19Smrg mkdir conftest.dir 3517d5e3a19Smrg # Copy depcomp to subdir because otherwise we won't find it if we're 3527d5e3a19Smrg # using a relative directory. 3537d5e3a19Smrg cp "$am_depcomp" conftest.dir 3547d5e3a19Smrg cd conftest.dir 3557d5e3a19Smrg # We will build objects and dependencies in a subdirectory because 3567d5e3a19Smrg # it helps to detect inapplicable dependency modes. For instance 3577d5e3a19Smrg # both Tru64's cc and ICC support -MD to output dependencies as a 3587d5e3a19Smrg # side effect of compilation, but ICC will put the dependencies in 3597d5e3a19Smrg # the current directory while Tru64 will put them in the object 3607d5e3a19Smrg # directory. 3617d5e3a19Smrg mkdir sub 3627d5e3a19Smrg 3637d5e3a19Smrg am_cv_$1_dependencies_compiler_type=none 3647d5e3a19Smrg if test "$am_compiler_list" = ""; then 3657d5e3a19Smrg am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` 3667d5e3a19Smrg fi 3671568b75bSmrg am__universal=false 3681568b75bSmrg m4_case([$1], [CC], 3691568b75bSmrg [case " $depcc " in #( 3701568b75bSmrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 3711568b75bSmrg esac], 3721568b75bSmrg [CXX], 3731568b75bSmrg [case " $depcc " in #( 3741568b75bSmrg *\ -arch\ *\ -arch\ *) am__universal=true ;; 3751568b75bSmrg esac]) 3761568b75bSmrg 3777d5e3a19Smrg for depmode in $am_compiler_list; do 3787d5e3a19Smrg # Setup a source with many dependencies, because some compilers 3797d5e3a19Smrg # like to wrap large dependency lists on column 80 (with \), and 3807d5e3a19Smrg # we should not choose a depcomp mode which is confused by this. 3817d5e3a19Smrg # 3827d5e3a19Smrg # We need to recreate these files for each test, as the compiler may 3837d5e3a19Smrg # overwrite some of them when testing with obscure command lines. 3847d5e3a19Smrg # This happens at least with the AIX C compiler. 3857d5e3a19Smrg : > sub/conftest.c 3867d5e3a19Smrg for i in 1 2 3 4 5 6; do 3877d5e3a19Smrg echo '#include "conftst'$i'.h"' >> sub/conftest.c 3887d5e3a19Smrg # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with 3897d5e3a19Smrg # Solaris 8's {/usr,}/bin/sh. 3907d5e3a19Smrg touch sub/conftst$i.h 3917d5e3a19Smrg done 3927d5e3a19Smrg echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf 3937d5e3a19Smrg 3941568b75bSmrg # We check with `-c' and `-o' for the sake of the "dashmstdout" 3951568b75bSmrg # mode. It turns out that the SunPro C++ compiler does not properly 3961568b75bSmrg # handle `-M -o', and we need to detect this. Also, some Intel 3971568b75bSmrg # versions had trouble with output in subdirs 3981568b75bSmrg am__obj=sub/conftest.${OBJEXT-o} 3991568b75bSmrg am__minus_obj="-o $am__obj" 4007d5e3a19Smrg case $depmode in 4011568b75bSmrg gcc) 4021568b75bSmrg # This depmode causes a compiler race in universal mode. 4031568b75bSmrg test "$am__universal" = false || continue 4041568b75bSmrg ;; 4057d5e3a19Smrg nosideeffect) 4067d5e3a19Smrg # after this tag, mechanisms are not by side-effect, so they'll 4077d5e3a19Smrg # only be used when explicitly requested 4087d5e3a19Smrg if test "x$enable_dependency_tracking" = xyes; then 4097d5e3a19Smrg continue 4107d5e3a19Smrg else 4117d5e3a19Smrg break 4127d5e3a19Smrg fi 4137d5e3a19Smrg ;; 4141568b75bSmrg msvisualcpp | msvcmsys) 4151568b75bSmrg # This compiler won't grok `-c -o', but also, the minuso test has 4161568b75bSmrg # not run yet. These depmodes are late enough in the game, and 4171568b75bSmrg # so weak that their functioning should not be impacted. 4181568b75bSmrg am__obj=conftest.${OBJEXT-o} 4191568b75bSmrg am__minus_obj= 4201568b75bSmrg ;; 4217d5e3a19Smrg none) break ;; 4227d5e3a19Smrg esac 4237d5e3a19Smrg if depmode=$depmode \ 4241568b75bSmrg source=sub/conftest.c object=$am__obj \ 4257d5e3a19Smrg depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ 4261568b75bSmrg $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ 4277d5e3a19Smrg >/dev/null 2>conftest.err && 4287d5e3a19Smrg grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 4297d5e3a19Smrg grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && 4301568b75bSmrg grep $am__obj sub/conftest.Po > /dev/null 2>&1 && 4317d5e3a19Smrg ${MAKE-make} -s -f confmf > /dev/null 2>&1; then 4327d5e3a19Smrg # icc doesn't choke on unknown options, it will just issue warnings 4337d5e3a19Smrg # or remarks (even with -Werror). So we grep stderr for any message 4347d5e3a19Smrg # that says an option was ignored or not supported. 4357d5e3a19Smrg # When given -MP, icc 7.0 and 7.1 complain thusly: 4367d5e3a19Smrg # icc: Command line warning: ignoring option '-M'; no argument required 4377d5e3a19Smrg # The diagnosis changed in icc 8.0: 4387d5e3a19Smrg # icc: Command line remark: option '-MP' not supported 4397d5e3a19Smrg if (grep 'ignoring option' conftest.err || 4407d5e3a19Smrg grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else 4417d5e3a19Smrg am_cv_$1_dependencies_compiler_type=$depmode 4427d5e3a19Smrg break 4437d5e3a19Smrg fi 4447d5e3a19Smrg fi 4457d5e3a19Smrg done 4467d5e3a19Smrg 4477d5e3a19Smrg cd .. 4487d5e3a19Smrg rm -rf conftest.dir 4497d5e3a19Smrgelse 4507d5e3a19Smrg am_cv_$1_dependencies_compiler_type=none 4517d5e3a19Smrgfi 4527d5e3a19Smrg]) 4537d5e3a19SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) 4547d5e3a19SmrgAM_CONDITIONAL([am__fastdep$1], [ 4557d5e3a19Smrg test "x$enable_dependency_tracking" != xno \ 4567d5e3a19Smrg && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) 4577d5e3a19Smrg]) 4587d5e3a19Smrg 4597d5e3a19Smrg 4607d5e3a19Smrg# AM_SET_DEPDIR 4617d5e3a19Smrg# ------------- 4627d5e3a19Smrg# Choose a directory name for dependency files. 4637d5e3a19Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES 4647d5e3a19SmrgAC_DEFUN([AM_SET_DEPDIR], 4657d5e3a19Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl 4667d5e3a19SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl 4677d5e3a19Smrg]) 4687d5e3a19Smrg 4697d5e3a19Smrg 4707d5e3a19Smrg# AM_DEP_TRACK 4717d5e3a19Smrg# ------------ 4727d5e3a19SmrgAC_DEFUN([AM_DEP_TRACK], 4737d5e3a19Smrg[AC_ARG_ENABLE(dependency-tracking, 4747d5e3a19Smrg[ --disable-dependency-tracking speeds up one-time build 4757d5e3a19Smrg --enable-dependency-tracking do not reject slow dependency extractors]) 4767d5e3a19Smrgif test "x$enable_dependency_tracking" != xno; then 4777d5e3a19Smrg am_depcomp="$ac_aux_dir/depcomp" 4787d5e3a19Smrg AMDEPBACKSLASH='\' 4797d5e3a19Smrgfi 4807d5e3a19SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) 4817d5e3a19SmrgAC_SUBST([AMDEPBACKSLASH])dnl 4827d5e3a19Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl 4837d5e3a19Smrg]) 4847d5e3a19Smrg 4857d5e3a19Smrg# Generate code to set up dependency tracking. -*- Autoconf -*- 4867d5e3a19Smrg 4871568b75bSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 4887d5e3a19Smrg# Free Software Foundation, Inc. 4897d5e3a19Smrg# 4907d5e3a19Smrg# This file is free software; the Free Software Foundation 4917d5e3a19Smrg# gives unlimited permission to copy and/or distribute it, 4927d5e3a19Smrg# with or without modifications, as long as this notice is preserved. 4937d5e3a19Smrg 4941568b75bSmrg#serial 5 4957d5e3a19Smrg 4967d5e3a19Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS 4977d5e3a19Smrg# ------------------------------ 4987d5e3a19SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], 4991568b75bSmrg[{ 5001568b75bSmrg # Autoconf 2.62 quotes --file arguments for eval, but not when files 5011568b75bSmrg # are listed without --file. Let's play safe and only enable the eval 5021568b75bSmrg # if we detect the quoting. 5031568b75bSmrg case $CONFIG_FILES in 5041568b75bSmrg *\'*) eval set x "$CONFIG_FILES" ;; 5051568b75bSmrg *) set x $CONFIG_FILES ;; 5061568b75bSmrg esac 5071568b75bSmrg shift 5081568b75bSmrg for mf 5091568b75bSmrg do 5101568b75bSmrg # Strip MF so we end up with the name of the file. 5111568b75bSmrg mf=`echo "$mf" | sed -e 's/:.*$//'` 5121568b75bSmrg # Check whether this is an Automake generated Makefile or not. 5131568b75bSmrg # We used to match only the files named `Makefile.in', but 5141568b75bSmrg # some people rename them; so instead we look at the file content. 5151568b75bSmrg # Grep'ing the first line is not enough: some people post-process 5161568b75bSmrg # each Makefile.in and add a new line on top of each file to say so. 5171568b75bSmrg # Grep'ing the whole file is not good either: AIX grep has a line 5181568b75bSmrg # limit of 2048, but all sed's we know have understand at least 4000. 5191568b75bSmrg if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then 5201568b75bSmrg dirpart=`AS_DIRNAME("$mf")` 5211568b75bSmrg else 5221568b75bSmrg continue 5231568b75bSmrg fi 5241568b75bSmrg # Extract the definition of DEPDIR, am__include, and am__quote 5251568b75bSmrg # from the Makefile without running `make'. 5261568b75bSmrg DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` 5271568b75bSmrg test -z "$DEPDIR" && continue 5281568b75bSmrg am__include=`sed -n 's/^am__include = //p' < "$mf"` 5291568b75bSmrg test -z "am__include" && continue 5301568b75bSmrg am__quote=`sed -n 's/^am__quote = //p' < "$mf"` 5311568b75bSmrg # When using ansi2knr, U may be empty or an underscore; expand it 5321568b75bSmrg U=`sed -n 's/^U = //p' < "$mf"` 5331568b75bSmrg # Find all dependency output files, they are included files with 5341568b75bSmrg # $(DEPDIR) in their names. We invoke sed twice because it is the 5351568b75bSmrg # simplest approach to changing $(DEPDIR) to its actual value in the 5361568b75bSmrg # expansion. 5371568b75bSmrg for file in `sed -n " 5381568b75bSmrg s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ 5391568b75bSmrg sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do 5401568b75bSmrg # Make sure the directory exists. 5411568b75bSmrg test -f "$dirpart/$file" && continue 5421568b75bSmrg fdir=`AS_DIRNAME(["$file"])` 5431568b75bSmrg AS_MKDIR_P([$dirpart/$fdir]) 5441568b75bSmrg # echo "creating $dirpart/$file" 5451568b75bSmrg echo '# dummy' > "$dirpart/$file" 5461568b75bSmrg done 5477d5e3a19Smrg done 5481568b75bSmrg} 5497d5e3a19Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS 5507d5e3a19Smrg 5517d5e3a19Smrg 5527d5e3a19Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS 5537d5e3a19Smrg# ----------------------------- 5547d5e3a19Smrg# This macro should only be invoked once -- use via AC_REQUIRE. 5557d5e3a19Smrg# 5567d5e3a19Smrg# This code is only required when automatic dependency tracking 5577d5e3a19Smrg# is enabled. FIXME. This creates each `.P' file that we will 5587d5e3a19Smrg# need in order to bootstrap the dependency handling code. 5597d5e3a19SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], 5607d5e3a19Smrg[AC_CONFIG_COMMANDS([depfiles], 5617d5e3a19Smrg [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], 5627d5e3a19Smrg [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) 5637d5e3a19Smrg]) 5647d5e3a19Smrg 5657d5e3a19Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 5667d5e3a19Smrg# Free Software Foundation, Inc. 5677d5e3a19Smrg# 5687d5e3a19Smrg# This file is free software; the Free Software Foundation 5697d5e3a19Smrg# gives unlimited permission to copy and/or distribute it, 5707d5e3a19Smrg# with or without modifications, as long as this notice is preserved. 5717d5e3a19Smrg 5727d5e3a19Smrg# serial 8 5737d5e3a19Smrg 5747d5e3a19Smrg# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. 5757d5e3a19SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) 5767d5e3a19Smrg 5777d5e3a19Smrg# Do all the work for Automake. -*- Autoconf -*- 5787d5e3a19Smrg 5797d5e3a19Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 5801568b75bSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. 5817d5e3a19Smrg# 5827d5e3a19Smrg# This file is free software; the Free Software Foundation 5837d5e3a19Smrg# gives unlimited permission to copy and/or distribute it, 5847d5e3a19Smrg# with or without modifications, as long as this notice is preserved. 5857d5e3a19Smrg 5861568b75bSmrg# serial 16 5877d5e3a19Smrg 5887d5e3a19Smrg# This macro actually does too much. Some checks are only needed if 5897d5e3a19Smrg# your package does certain things. But this isn't really a big deal. 5907d5e3a19Smrg 5917d5e3a19Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) 5927d5e3a19Smrg# AM_INIT_AUTOMAKE([OPTIONS]) 5937d5e3a19Smrg# ----------------------------------------------- 5947d5e3a19Smrg# The call with PACKAGE and VERSION arguments is the old style 5957d5e3a19Smrg# call (pre autoconf-2.50), which is being phased out. PACKAGE 5967d5e3a19Smrg# and VERSION should now be passed to AC_INIT and removed from 5977d5e3a19Smrg# the call to AM_INIT_AUTOMAKE. 5987d5e3a19Smrg# We support both call styles for the transition. After 5997d5e3a19Smrg# the next Automake release, Autoconf can make the AC_INIT 6007d5e3a19Smrg# arguments mandatory, and then we can depend on a new Autoconf 6017d5e3a19Smrg# release and drop the old call support. 6027d5e3a19SmrgAC_DEFUN([AM_INIT_AUTOMAKE], 6031568b75bSmrg[AC_PREREQ([2.62])dnl 6047d5e3a19Smrgdnl Autoconf wants to disallow AM_ names. We explicitly allow 6057d5e3a19Smrgdnl the ones we care about. 6067d5e3a19Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl 6077d5e3a19SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl 6087d5e3a19SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl 6097d5e3a19Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then 6107d5e3a19Smrg # Use -I$(srcdir) only when $(srcdir) != ., so that make's output 6117d5e3a19Smrg # is not polluted with repeated "-I." 6127d5e3a19Smrg AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl 6137d5e3a19Smrg # test to see if srcdir already configured 6147d5e3a19Smrg if test -f $srcdir/config.status; then 6157d5e3a19Smrg AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) 6167d5e3a19Smrg fi 6177d5e3a19Smrgfi 6187d5e3a19Smrg 6197d5e3a19Smrg# test whether we have cygpath 6207d5e3a19Smrgif test -z "$CYGPATH_W"; then 6217d5e3a19Smrg if (cygpath --version) >/dev/null 2>/dev/null; then 6227d5e3a19Smrg CYGPATH_W='cygpath -w' 6237d5e3a19Smrg else 6247d5e3a19Smrg CYGPATH_W=echo 6257d5e3a19Smrg fi 6267d5e3a19Smrgfi 6277d5e3a19SmrgAC_SUBST([CYGPATH_W]) 6287d5e3a19Smrg 6297d5e3a19Smrg# Define the identity of the package. 6307d5e3a19Smrgdnl Distinguish between old-style and new-style calls. 6317d5e3a19Smrgm4_ifval([$2], 6327d5e3a19Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl 6337d5e3a19Smrg AC_SUBST([PACKAGE], [$1])dnl 6347d5e3a19Smrg AC_SUBST([VERSION], [$2])], 6357d5e3a19Smrg[_AM_SET_OPTIONS([$1])dnl 6367d5e3a19Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. 6377d5e3a19Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, 6387d5e3a19Smrg [m4_fatal([AC_INIT should be called with package and version arguments])])dnl 6397d5e3a19Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl 6407d5e3a19Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl 6417d5e3a19Smrg 6427d5e3a19Smrg_AM_IF_OPTION([no-define],, 6437d5e3a19Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) 6447d5e3a19Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl 6457d5e3a19Smrg 6467d5e3a19Smrg# Some tools Automake needs. 6477d5e3a19SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl 6487d5e3a19SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl 6497d5e3a19SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) 6507d5e3a19SmrgAM_MISSING_PROG(AUTOCONF, autoconf) 6517d5e3a19SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) 6527d5e3a19SmrgAM_MISSING_PROG(AUTOHEADER, autoheader) 6537d5e3a19SmrgAM_MISSING_PROG(MAKEINFO, makeinfo) 6541568b75bSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl 6551568b75bSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 6567d5e3a19SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl 6577d5e3a19Smrg# We need awk for the "check" target. The system "awk" is bad on 6587d5e3a19Smrg# some platforms. 6597d5e3a19SmrgAC_REQUIRE([AC_PROG_AWK])dnl 6607d5e3a19SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl 6617d5e3a19SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl 6627d5e3a19Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], 6631568b75bSmrg [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], 6641568b75bSmrg [_AM_PROG_TAR([v7])])]) 6657d5e3a19Smrg_AM_IF_OPTION([no-dependencies],, 6667d5e3a19Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC], 6671568b75bSmrg [_AM_DEPENDENCIES(CC)], 6681568b75bSmrg [define([AC_PROG_CC], 6691568b75bSmrg defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl 6707d5e3a19SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX], 6711568b75bSmrg [_AM_DEPENDENCIES(CXX)], 6721568b75bSmrg [define([AC_PROG_CXX], 6731568b75bSmrg defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl 6747d5e3a19SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC], 6751568b75bSmrg [_AM_DEPENDENCIES(OBJC)], 6761568b75bSmrg [define([AC_PROG_OBJC], 6771568b75bSmrg defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl 6787d5e3a19Smrg]) 6791568b75bSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl 6801568b75bSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the 6811568b75bSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro 6821568b75bSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below. 6831568b75bSmrgAC_CONFIG_COMMANDS_PRE(dnl 6841568b75bSmrg[m4_provide_if([_AM_COMPILER_EXEEXT], 6851568b75bSmrg [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl 6867d5e3a19Smrg]) 6877d5e3a19Smrg 6881568b75bSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not 6891568b75bSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further 6901568b75bSmrgdnl mangled by Autoconf and run in a shell conditional statement. 6911568b75bSmrgm4_define([_AC_COMPILER_EXEEXT], 6921568b75bSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) 6931568b75bSmrg 6947d5e3a19Smrg 6957d5e3a19Smrg# When config.status generates a header, we must update the stamp-h file. 6967d5e3a19Smrg# This file resides in the same directory as the config header 6977d5e3a19Smrg# that is generated. The stamp files are numbered to have different names. 6987d5e3a19Smrg 6997d5e3a19Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the 7007d5e3a19Smrg# loop where config.status creates the headers, so we can generate 7017d5e3a19Smrg# our stamp files there. 7027d5e3a19SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], 7037d5e3a19Smrg[# Compute $1's index in $config_headers. 7041568b75bSmrg_am_arg=$1 7057d5e3a19Smrg_am_stamp_count=1 7067d5e3a19Smrgfor _am_header in $config_headers :; do 7077d5e3a19Smrg case $_am_header in 7081568b75bSmrg $_am_arg | $_am_arg:* ) 7097d5e3a19Smrg break ;; 7107d5e3a19Smrg * ) 7117d5e3a19Smrg _am_stamp_count=`expr $_am_stamp_count + 1` ;; 7127d5e3a19Smrg esac 7137d5e3a19Smrgdone 7141568b75bSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) 7157d5e3a19Smrg 7161568b75bSmrg# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. 7177d5e3a19Smrg# 7187d5e3a19Smrg# This file is free software; the Free Software Foundation 7197d5e3a19Smrg# gives unlimited permission to copy and/or distribute it, 7207d5e3a19Smrg# with or without modifications, as long as this notice is preserved. 7217d5e3a19Smrg 7227d5e3a19Smrg# AM_PROG_INSTALL_SH 7237d5e3a19Smrg# ------------------ 7247d5e3a19Smrg# Define $install_sh. 7257d5e3a19SmrgAC_DEFUN([AM_PROG_INSTALL_SH], 7267d5e3a19Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 7271568b75bSmrgif test x"${install_sh}" != xset; then 7281568b75bSmrg case $am_aux_dir in 7291568b75bSmrg *\ * | *\ *) 7301568b75bSmrg install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; 7311568b75bSmrg *) 7321568b75bSmrg install_sh="\${SHELL} $am_aux_dir/install-sh" 7331568b75bSmrg esac 7341568b75bSmrgfi 7357d5e3a19SmrgAC_SUBST(install_sh)]) 7367d5e3a19Smrg 7377d5e3a19Smrg# Copyright (C) 2003, 2005 Free Software Foundation, Inc. 7387d5e3a19Smrg# 7397d5e3a19Smrg# This file is free software; the Free Software Foundation 7407d5e3a19Smrg# gives unlimited permission to copy and/or distribute it, 7417d5e3a19Smrg# with or without modifications, as long as this notice is preserved. 7427d5e3a19Smrg 7437d5e3a19Smrg# serial 2 7447d5e3a19Smrg 7457d5e3a19Smrg# Check whether the underlying file-system supports filenames 7467d5e3a19Smrg# with a leading dot. For instance MS-DOS doesn't. 7477d5e3a19SmrgAC_DEFUN([AM_SET_LEADING_DOT], 7487d5e3a19Smrg[rm -rf .tst 2>/dev/null 7497d5e3a19Smrgmkdir .tst 2>/dev/null 7507d5e3a19Smrgif test -d .tst; then 7517d5e3a19Smrg am__leading_dot=. 7527d5e3a19Smrgelse 7537d5e3a19Smrg am__leading_dot=_ 7547d5e3a19Smrgfi 7557d5e3a19Smrgrmdir .tst 2>/dev/null 7567d5e3a19SmrgAC_SUBST([am__leading_dot])]) 7577d5e3a19Smrg 7587d5e3a19Smrg# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- 7597d5e3a19Smrg# From Jim Meyering 7607d5e3a19Smrg 7611568b75bSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 7627d5e3a19Smrg# Free Software Foundation, Inc. 7637d5e3a19Smrg# 7647d5e3a19Smrg# This file is free software; the Free Software Foundation 7657d5e3a19Smrg# gives unlimited permission to copy and/or distribute it, 7667d5e3a19Smrg# with or without modifications, as long as this notice is preserved. 7677d5e3a19Smrg 7681568b75bSmrg# serial 5 7697d5e3a19Smrg 7701568b75bSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE]) 7711568b75bSmrg# ---------------------------------- 7721568b75bSmrg# Control maintainer-specific portions of Makefiles. 7731568b75bSmrg# Default is to disable them, unless `enable' is passed literally. 7741568b75bSmrg# For symmetry, `disable' may be passed as well. Anyway, the user 7751568b75bSmrg# can override the default with the --enable/--disable switch. 7767d5e3a19SmrgAC_DEFUN([AM_MAINTAINER_MODE], 7771568b75bSmrg[m4_case(m4_default([$1], [disable]), 7781568b75bSmrg [enable], [m4_define([am_maintainer_other], [disable])], 7791568b75bSmrg [disable], [m4_define([am_maintainer_other], [enable])], 7801568b75bSmrg [m4_define([am_maintainer_other], [enable]) 7811568b75bSmrg m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) 7821568b75bSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) 7831568b75bSmrg dnl maintainer-mode's default is 'disable' unless 'enable' is passed 7841568b75bSmrg AC_ARG_ENABLE([maintainer-mode], 7851568b75bSmrg[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful 7867d5e3a19Smrg (and sometimes confusing) to the casual installer], 7871568b75bSmrg [USE_MAINTAINER_MODE=$enableval], 7881568b75bSmrg [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) 7897d5e3a19Smrg AC_MSG_RESULT([$USE_MAINTAINER_MODE]) 7901568b75bSmrg AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) 7917d5e3a19Smrg MAINT=$MAINTAINER_MODE_TRUE 7921568b75bSmrg AC_SUBST([MAINT])dnl 7937d5e3a19Smrg] 7947d5e3a19Smrg) 7957d5e3a19Smrg 7967d5e3a19SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) 7977d5e3a19Smrg 7987d5e3a19Smrg# Check to see how 'make' treats includes. -*- Autoconf -*- 7997d5e3a19Smrg 8001568b75bSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. 8017d5e3a19Smrg# 8027d5e3a19Smrg# This file is free software; the Free Software Foundation 8037d5e3a19Smrg# gives unlimited permission to copy and/or distribute it, 8047d5e3a19Smrg# with or without modifications, as long as this notice is preserved. 8057d5e3a19Smrg 8061568b75bSmrg# serial 4 8077d5e3a19Smrg 8087d5e3a19Smrg# AM_MAKE_INCLUDE() 8097d5e3a19Smrg# ----------------- 8107d5e3a19Smrg# Check to see how make treats includes. 8117d5e3a19SmrgAC_DEFUN([AM_MAKE_INCLUDE], 8127d5e3a19Smrg[am_make=${MAKE-make} 8137d5e3a19Smrgcat > confinc << 'END' 8147d5e3a19Smrgam__doit: 8151568b75bSmrg @echo this is the am__doit target 8167d5e3a19Smrg.PHONY: am__doit 8177d5e3a19SmrgEND 8187d5e3a19Smrg# If we don't find an include directive, just comment out the code. 8197d5e3a19SmrgAC_MSG_CHECKING([for style of include used by $am_make]) 8207d5e3a19Smrgam__include="#" 8217d5e3a19Smrgam__quote= 8227d5e3a19Smrg_am_result=none 8237d5e3a19Smrg# First try GNU make style include. 8247d5e3a19Smrgecho "include confinc" > confmf 8251568b75bSmrg# Ignore all kinds of additional output from `make'. 8261568b75bSmrgcase `$am_make -s -f confmf 2> /dev/null` in #( 8271568b75bSmrg*the\ am__doit\ target*) 8281568b75bSmrg am__include=include 8291568b75bSmrg am__quote= 8301568b75bSmrg _am_result=GNU 8311568b75bSmrg ;; 8321568b75bSmrgesac 8337d5e3a19Smrg# Now try BSD make style include. 8347d5e3a19Smrgif test "$am__include" = "#"; then 8357d5e3a19Smrg echo '.include "confinc"' > confmf 8361568b75bSmrg case `$am_make -s -f confmf 2> /dev/null` in #( 8371568b75bSmrg *the\ am__doit\ target*) 8381568b75bSmrg am__include=.include 8391568b75bSmrg am__quote="\"" 8401568b75bSmrg _am_result=BSD 8411568b75bSmrg ;; 8421568b75bSmrg esac 8437d5e3a19Smrgfi 8447d5e3a19SmrgAC_SUBST([am__include]) 8457d5e3a19SmrgAC_SUBST([am__quote]) 8467d5e3a19SmrgAC_MSG_RESULT([$_am_result]) 8477d5e3a19Smrgrm -f confinc confmf 8487d5e3a19Smrg]) 8497d5e3a19Smrg 8507d5e3a19Smrg# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- 8517d5e3a19Smrg 8521568b75bSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 8537d5e3a19Smrg# Free Software Foundation, Inc. 8547d5e3a19Smrg# 8557d5e3a19Smrg# This file is free software; the Free Software Foundation 8567d5e3a19Smrg# gives unlimited permission to copy and/or distribute it, 8577d5e3a19Smrg# with or without modifications, as long as this notice is preserved. 8587d5e3a19Smrg 8591568b75bSmrg# serial 6 8607d5e3a19Smrg 8617d5e3a19Smrg# AM_MISSING_PROG(NAME, PROGRAM) 8627d5e3a19Smrg# ------------------------------ 8637d5e3a19SmrgAC_DEFUN([AM_MISSING_PROG], 8647d5e3a19Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN]) 8657d5e3a19Smrg$1=${$1-"${am_missing_run}$2"} 8667d5e3a19SmrgAC_SUBST($1)]) 8677d5e3a19Smrg 8687d5e3a19Smrg 8697d5e3a19Smrg# AM_MISSING_HAS_RUN 8707d5e3a19Smrg# ------------------ 8717d5e3a19Smrg# Define MISSING if not defined so far and test if it supports --run. 8727d5e3a19Smrg# If it does, set am_missing_run to use it, otherwise, to nothing. 8737d5e3a19SmrgAC_DEFUN([AM_MISSING_HAS_RUN], 8747d5e3a19Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl 8757d5e3a19SmrgAC_REQUIRE_AUX_FILE([missing])dnl 8761568b75bSmrgif test x"${MISSING+set}" != xset; then 8771568b75bSmrg case $am_aux_dir in 8781568b75bSmrg *\ * | *\ *) 8791568b75bSmrg MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; 8801568b75bSmrg *) 8811568b75bSmrg MISSING="\${SHELL} $am_aux_dir/missing" ;; 8821568b75bSmrg esac 8831568b75bSmrgfi 8847d5e3a19Smrg# Use eval to expand $SHELL 8857d5e3a19Smrgif eval "$MISSING --run true"; then 8867d5e3a19Smrg am_missing_run="$MISSING --run " 8877d5e3a19Smrgelse 8887d5e3a19Smrg am_missing_run= 8897d5e3a19Smrg AC_MSG_WARN([`missing' script is too old or missing]) 8907d5e3a19Smrgfi 8917d5e3a19Smrg]) 8927d5e3a19Smrg 8937d5e3a19Smrg# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 8947d5e3a19Smrg# 8957d5e3a19Smrg# This file is free software; the Free Software Foundation 8967d5e3a19Smrg# gives unlimited permission to copy and/or distribute it, 8977d5e3a19Smrg# with or without modifications, as long as this notice is preserved. 8987d5e3a19Smrg 8997d5e3a19Smrg# AM_PROG_MKDIR_P 9007d5e3a19Smrg# --------------- 9017d5e3a19Smrg# Check for `mkdir -p'. 9027d5e3a19SmrgAC_DEFUN([AM_PROG_MKDIR_P], 9037d5e3a19Smrg[AC_PREREQ([2.60])dnl 9047d5e3a19SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl 9057d5e3a19Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, 9067d5e3a19Smrgdnl while keeping a definition of mkdir_p for backward compatibility. 9077d5e3a19Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. 9087d5e3a19Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of 9097d5e3a19Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own 9107d5e3a19Smrgdnl adjustment using top_builddir (which is defined more often than 9117d5e3a19Smrgdnl MKDIR_P). 9127d5e3a19SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl 9137d5e3a19Smrgcase $mkdir_p in 9147d5e3a19Smrg [[\\/$]]* | ?:[[\\/]]*) ;; 9157d5e3a19Smrg */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 9167d5e3a19Smrgesac 9177d5e3a19Smrg]) 9187d5e3a19Smrg 9197d5e3a19Smrg# Helper functions for option handling. -*- Autoconf -*- 9207d5e3a19Smrg 9211568b75bSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. 9227d5e3a19Smrg# 9237d5e3a19Smrg# This file is free software; the Free Software Foundation 9247d5e3a19Smrg# gives unlimited permission to copy and/or distribute it, 9257d5e3a19Smrg# with or without modifications, as long as this notice is preserved. 9267d5e3a19Smrg 9271568b75bSmrg# serial 4 9287d5e3a19Smrg 9297d5e3a19Smrg# _AM_MANGLE_OPTION(NAME) 9307d5e3a19Smrg# ----------------------- 9317d5e3a19SmrgAC_DEFUN([_AM_MANGLE_OPTION], 9327d5e3a19Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) 9337d5e3a19Smrg 9347d5e3a19Smrg# _AM_SET_OPTION(NAME) 9357d5e3a19Smrg# ------------------------------ 9367d5e3a19Smrg# Set option NAME. Presently that only means defining a flag for this option. 9377d5e3a19SmrgAC_DEFUN([_AM_SET_OPTION], 9387d5e3a19Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) 9397d5e3a19Smrg 9407d5e3a19Smrg# _AM_SET_OPTIONS(OPTIONS) 9417d5e3a19Smrg# ---------------------------------- 9427d5e3a19Smrg# OPTIONS is a space-separated list of Automake options. 9437d5e3a19SmrgAC_DEFUN([_AM_SET_OPTIONS], 9441568b75bSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) 9457d5e3a19Smrg 9467d5e3a19Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) 9477d5e3a19Smrg# ------------------------------------------- 9487d5e3a19Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. 9497d5e3a19SmrgAC_DEFUN([_AM_IF_OPTION], 9507d5e3a19Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) 9517d5e3a19Smrg 9527d5e3a19Smrg# Check to make sure that the build environment is sane. -*- Autoconf -*- 9537d5e3a19Smrg 9541568b75bSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 9557d5e3a19Smrg# Free Software Foundation, Inc. 9567d5e3a19Smrg# 9577d5e3a19Smrg# This file is free software; the Free Software Foundation 9587d5e3a19Smrg# gives unlimited permission to copy and/or distribute it, 9597d5e3a19Smrg# with or without modifications, as long as this notice is preserved. 9607d5e3a19Smrg 9611568b75bSmrg# serial 5 9627d5e3a19Smrg 9637d5e3a19Smrg# AM_SANITY_CHECK 9647d5e3a19Smrg# --------------- 9657d5e3a19SmrgAC_DEFUN([AM_SANITY_CHECK], 9667d5e3a19Smrg[AC_MSG_CHECKING([whether build environment is sane]) 9677d5e3a19Smrg# Just in case 9687d5e3a19Smrgsleep 1 9697d5e3a19Smrgecho timestamp > conftest.file 9701568b75bSmrg# Reject unsafe characters in $srcdir or the absolute working directory 9711568b75bSmrg# name. Accept space and tab only in the latter. 9721568b75bSmrgam_lf=' 9731568b75bSmrg' 9741568b75bSmrgcase `pwd` in 9751568b75bSmrg *[[\\\"\#\$\&\'\`$am_lf]]*) 9761568b75bSmrg AC_MSG_ERROR([unsafe absolute working directory name]);; 9771568b75bSmrgesac 9781568b75bSmrgcase $srcdir in 9791568b75bSmrg *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) 9801568b75bSmrg AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; 9811568b75bSmrgesac 9821568b75bSmrg 9837d5e3a19Smrg# Do `set' in a subshell so we don't clobber the current shell's 9847d5e3a19Smrg# arguments. Must try -L first in case configure is actually a 9857d5e3a19Smrg# symlink; some systems play weird games with the mod time of symlinks 9867d5e3a19Smrg# (eg FreeBSD returns the mod time of the symlink's containing 9877d5e3a19Smrg# directory). 9887d5e3a19Smrgif ( 9891568b75bSmrg set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` 9907d5e3a19Smrg if test "$[*]" = "X"; then 9917d5e3a19Smrg # -L didn't work. 9921568b75bSmrg set X `ls -t "$srcdir/configure" conftest.file` 9937d5e3a19Smrg fi 9947d5e3a19Smrg rm -f conftest.file 9957d5e3a19Smrg if test "$[*]" != "X $srcdir/configure conftest.file" \ 9967d5e3a19Smrg && test "$[*]" != "X conftest.file $srcdir/configure"; then 9977d5e3a19Smrg 9987d5e3a19Smrg # If neither matched, then we have a broken ls. This can happen 9997d5e3a19Smrg # if, for instance, CONFIG_SHELL is bash and it inherits a 10007d5e3a19Smrg # broken ls alias from the environment. This has actually 10017d5e3a19Smrg # happened. Such a system could not be considered "sane". 10027d5e3a19Smrg AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken 10037d5e3a19Smrgalias in your environment]) 10047d5e3a19Smrg fi 10057d5e3a19Smrg 10067d5e3a19Smrg test "$[2]" = conftest.file 10077d5e3a19Smrg ) 10087d5e3a19Smrgthen 10097d5e3a19Smrg # Ok. 10107d5e3a19Smrg : 10117d5e3a19Smrgelse 10127d5e3a19Smrg AC_MSG_ERROR([newly created file is older than distributed files! 10137d5e3a19SmrgCheck your system clock]) 10147d5e3a19Smrgfi 10157d5e3a19SmrgAC_MSG_RESULT(yes)]) 10167d5e3a19Smrg 10177d5e3a19Smrg# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. 10187d5e3a19Smrg# 10197d5e3a19Smrg# This file is free software; the Free Software Foundation 10207d5e3a19Smrg# gives unlimited permission to copy and/or distribute it, 10217d5e3a19Smrg# with or without modifications, as long as this notice is preserved. 10227d5e3a19Smrg 10237d5e3a19Smrg# AM_PROG_INSTALL_STRIP 10247d5e3a19Smrg# --------------------- 10257d5e3a19Smrg# One issue with vendor `install' (even GNU) is that you can't 10267d5e3a19Smrg# specify the program used to strip binaries. This is especially 10277d5e3a19Smrg# annoying in cross-compiling environments, where the build's strip 10287d5e3a19Smrg# is unlikely to handle the host's binaries. 10297d5e3a19Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we 10307d5e3a19Smrg# always use install-sh in `make install-strip', and initialize 10317d5e3a19Smrg# STRIPPROG with the value of the STRIP variable (set by the user). 10327d5e3a19SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP], 10337d5e3a19Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl 10347d5e3a19Smrg# Installed binaries are usually stripped using `strip' when the user 10357d5e3a19Smrg# run `make install-strip'. However `strip' might not be the right 10367d5e3a19Smrg# tool to use in cross-compilation environments, therefore Automake 10377d5e3a19Smrg# will honor the `STRIP' environment variable to overrule this program. 10387d5e3a19Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'. 10397d5e3a19Smrgif test "$cross_compiling" != no; then 10407d5e3a19Smrg AC_CHECK_TOOL([STRIP], [strip], :) 10417d5e3a19Smrgfi 10427d5e3a19SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" 10437d5e3a19SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])]) 10447d5e3a19Smrg 10451568b75bSmrg# Copyright (C) 2006, 2008 Free Software Foundation, Inc. 10467d5e3a19Smrg# 10477d5e3a19Smrg# This file is free software; the Free Software Foundation 10487d5e3a19Smrg# gives unlimited permission to copy and/or distribute it, 10497d5e3a19Smrg# with or without modifications, as long as this notice is preserved. 10507d5e3a19Smrg 10511568b75bSmrg# serial 2 10521568b75bSmrg 10537d5e3a19Smrg# _AM_SUBST_NOTMAKE(VARIABLE) 10547d5e3a19Smrg# --------------------------- 10551568b75bSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. 10567d5e3a19Smrg# This macro is traced by Automake. 10577d5e3a19SmrgAC_DEFUN([_AM_SUBST_NOTMAKE]) 10587d5e3a19Smrg 10591568b75bSmrg# AM_SUBST_NOTMAKE(VARIABLE) 10601568b75bSmrg# --------------------------- 10611568b75bSmrg# Public sister of _AM_SUBST_NOTMAKE. 10621568b75bSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) 10631568b75bSmrg 10647d5e3a19Smrg# Check how to create a tarball. -*- Autoconf -*- 10657d5e3a19Smrg 10667d5e3a19Smrg# Copyright (C) 2004, 2005 Free Software Foundation, Inc. 10677d5e3a19Smrg# 10687d5e3a19Smrg# This file is free software; the Free Software Foundation 10697d5e3a19Smrg# gives unlimited permission to copy and/or distribute it, 10707d5e3a19Smrg# with or without modifications, as long as this notice is preserved. 10717d5e3a19Smrg 10727d5e3a19Smrg# serial 2 10737d5e3a19Smrg 10747d5e3a19Smrg# _AM_PROG_TAR(FORMAT) 10757d5e3a19Smrg# -------------------- 10767d5e3a19Smrg# Check how to create a tarball in format FORMAT. 10777d5e3a19Smrg# FORMAT should be one of `v7', `ustar', or `pax'. 10787d5e3a19Smrg# 10797d5e3a19Smrg# Substitute a variable $(am__tar) that is a command 10807d5e3a19Smrg# writing to stdout a FORMAT-tarball containing the directory 10817d5e3a19Smrg# $tardir. 10827d5e3a19Smrg# tardir=directory && $(am__tar) > result.tar 10837d5e3a19Smrg# 10847d5e3a19Smrg# Substitute a variable $(am__untar) that extract such 10857d5e3a19Smrg# a tarball read from stdin. 10867d5e3a19Smrg# $(am__untar) < result.tar 10877d5e3a19SmrgAC_DEFUN([_AM_PROG_TAR], 10887d5e3a19Smrg[# Always define AMTAR for backward compatibility. 10897d5e3a19SmrgAM_MISSING_PROG([AMTAR], [tar]) 10907d5e3a19Smrgm4_if([$1], [v7], 10917d5e3a19Smrg [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], 10927d5e3a19Smrg [m4_case([$1], [ustar],, [pax],, 10937d5e3a19Smrg [m4_fatal([Unknown tar format])]) 10947d5e3a19SmrgAC_MSG_CHECKING([how to create a $1 tar archive]) 10957d5e3a19Smrg# Loop over all known methods to create a tar archive until one works. 10967d5e3a19Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' 10977d5e3a19Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools} 10987d5e3a19Smrg# Do not fold the above two line into one, because Tru64 sh and 10997d5e3a19Smrg# Solaris sh will not grok spaces in the rhs of `-'. 11007d5e3a19Smrgfor _am_tool in $_am_tools 11017d5e3a19Smrgdo 11027d5e3a19Smrg case $_am_tool in 11037d5e3a19Smrg gnutar) 11047d5e3a19Smrg for _am_tar in tar gnutar gtar; 11057d5e3a19Smrg do 11067d5e3a19Smrg AM_RUN_LOG([$_am_tar --version]) && break 11077d5e3a19Smrg done 11087d5e3a19Smrg am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' 11097d5e3a19Smrg am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' 11107d5e3a19Smrg am__untar="$_am_tar -xf -" 11117d5e3a19Smrg ;; 11127d5e3a19Smrg plaintar) 11137d5e3a19Smrg # Must skip GNU tar: if it does not support --format= it doesn't create 11147d5e3a19Smrg # ustar tarball either. 11157d5e3a19Smrg (tar --version) >/dev/null 2>&1 && continue 11167d5e3a19Smrg am__tar='tar chf - "$$tardir"' 11177d5e3a19Smrg am__tar_='tar chf - "$tardir"' 11187d5e3a19Smrg am__untar='tar xf -' 11197d5e3a19Smrg ;; 11207d5e3a19Smrg pax) 11217d5e3a19Smrg am__tar='pax -L -x $1 -w "$$tardir"' 11227d5e3a19Smrg am__tar_='pax -L -x $1 -w "$tardir"' 11237d5e3a19Smrg am__untar='pax -r' 11247d5e3a19Smrg ;; 11257d5e3a19Smrg cpio) 11267d5e3a19Smrg am__tar='find "$$tardir" -print | cpio -o -H $1 -L' 11277d5e3a19Smrg am__tar_='find "$tardir" -print | cpio -o -H $1 -L' 11287d5e3a19Smrg am__untar='cpio -i -H $1 -d' 11297d5e3a19Smrg ;; 11307d5e3a19Smrg none) 11317d5e3a19Smrg am__tar=false 11327d5e3a19Smrg am__tar_=false 11337d5e3a19Smrg am__untar=false 11347d5e3a19Smrg ;; 11357d5e3a19Smrg esac 11367d5e3a19Smrg 11377d5e3a19Smrg # If the value was cached, stop now. We just wanted to have am__tar 11387d5e3a19Smrg # and am__untar set. 11397d5e3a19Smrg test -n "${am_cv_prog_tar_$1}" && break 11407d5e3a19Smrg 11417d5e3a19Smrg # tar/untar a dummy directory, and stop if the command works 11427d5e3a19Smrg rm -rf conftest.dir 11437d5e3a19Smrg mkdir conftest.dir 11447d5e3a19Smrg echo GrepMe > conftest.dir/file 11457d5e3a19Smrg AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) 11467d5e3a19Smrg rm -rf conftest.dir 11477d5e3a19Smrg if test -s conftest.tar; then 11487d5e3a19Smrg AM_RUN_LOG([$am__untar <conftest.tar]) 11497d5e3a19Smrg grep GrepMe conftest.dir/file >/dev/null 2>&1 && break 11507d5e3a19Smrg fi 11517d5e3a19Smrgdone 11527d5e3a19Smrgrm -rf conftest.dir 11537d5e3a19Smrg 11547d5e3a19SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) 11557d5e3a19SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])]) 11567d5e3a19SmrgAC_SUBST([am__tar]) 11577d5e3a19SmrgAC_SUBST([am__untar]) 11587d5e3a19Smrg]) # _AM_PROG_TAR 11597d5e3a19Smrg 11601568b75bSmrgdnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. 11617d5e3a19Smrgdnl 11627d5e3a19Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved. 11637d5e3a19Smrgdnl 11647d5e3a19Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a 11657d5e3a19Smrgdnl copy of this software and associated documentation files (the 11667d5e3a19Smrgdnl "Software"), to deal in the Software without restriction, including 11677d5e3a19Smrgdnl without limitation the rights to use, copy, modify, merge, publish, 11687d5e3a19Smrgdnl distribute, and/or sell copies of the Software, and to permit persons 11697d5e3a19Smrgdnl to whom the Software is furnished to do so, provided that the above 11707d5e3a19Smrgdnl copyright notice(s) and this permission notice appear in all copies of 11717d5e3a19Smrgdnl the Software and that both the above copyright notice(s) and this 11727d5e3a19Smrgdnl permission notice appear in supporting documentation. 11737d5e3a19Smrgdnl 11747d5e3a19Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 11757d5e3a19Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 11767d5e3a19Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 11777d5e3a19Smrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 11787d5e3a19Smrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL 11797d5e3a19Smrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING 11807d5e3a19Smrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 11817d5e3a19Smrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 11827d5e3a19Smrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 11837d5e3a19Smrgdnl 11847d5e3a19Smrgdnl Except as contained in this notice, the name of a copyright holder 11857d5e3a19Smrgdnl shall not be used in advertising or otherwise to promote the sale, use 11867d5e3a19Smrgdnl or other dealings in this Software without prior written authorization 11877d5e3a19Smrgdnl of the copyright holder. 11887d5e3a19Smrg 11897d5e3a19Smrg# XORG_MACROS_VERSION(required-version) 11907d5e3a19Smrg# ------------------------------------- 11917d5e3a19Smrg# Minimum version: 1.1.0 11927d5e3a19Smrg# 11937d5e3a19Smrg# If you're using a macro added in Version 1.1 or newer, include this in 11947d5e3a19Smrg# your configure.ac with the minimum required version, such as: 11957d5e3a19Smrg# XORG_MACROS_VERSION(1.1) 11967d5e3a19Smrg# 11971568b75bSmrg# To ensure that this macro is defined, also add: 11981568b75bSmrg# m4_ifndef([XORG_MACROS_VERSION], 11991568b75bSmrg# [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) 12007d5e3a19Smrg# 12017d5e3a19Smrg# 12027d5e3a19Smrg# See the "minimum version" comment for each macro you use to see what 12037d5e3a19Smrg# version you require. 12047d5e3a19SmrgAC_DEFUN([XORG_MACROS_VERSION],[ 12057d5e3a19Smrg [XORG_MACROS_needed_version=$1 12067d5e3a19Smrg XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'` 12077d5e3a19Smrg XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`] 12087d5e3a19Smrg AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}]) 12091568b75bSmrg [XORG_MACROS_version=1.2.1 12107d5e3a19Smrg XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'` 12117d5e3a19Smrg XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`] 12127d5e3a19Smrg if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then 12131568b75bSmrg AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_needed_major}.x]) 12147d5e3a19Smrg fi 12157d5e3a19Smrg if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then 12161568b75bSmrg AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}.0 or newer]) 12177d5e3a19Smrg fi 12187d5e3a19Smrg AC_MSG_RESULT([yes, $XORG_MACROS_version]) 12197d5e3a19Smrg]) # XORG_MACROS_VERSION 12207d5e3a19Smrg 12217d5e3a19Smrg# XORG_PROG_RAWCPP() 12227d5e3a19Smrg# ------------------ 12237d5e3a19Smrg# Minimum version: 1.0.0 12247d5e3a19Smrg# 12257d5e3a19Smrg# Find cpp program and necessary flags for use in pre-processing text files 12267d5e3a19Smrg# such as man pages and config files 12277d5e3a19SmrgAC_DEFUN([XORG_PROG_RAWCPP],[ 12287d5e3a19SmrgAC_REQUIRE([AC_PROG_CPP]) 12297d5e3a19SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 12307d5e3a19Smrg [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) 12317d5e3a19Smrg 12327d5e3a19Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined, 12337d5e3a19Smrg# which is not the best choice for supporting other OS'es, but covers most 12347d5e3a19Smrg# of the ones we need for now. 12357d5e3a19SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef]) 12367d5e3a19SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?]) 12377d5e3a19Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 12387d5e3a19Smrg AC_MSG_RESULT([no]) 12397d5e3a19Smrgelse 12407d5e3a19Smrg if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 12417d5e3a19Smrg RAWCPPFLAGS=-undef 12427d5e3a19Smrg AC_MSG_RESULT([yes]) 12431568b75bSmrg # under Cygwin unix is still defined even with -undef 12441568b75bSmrg elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then 12451568b75bSmrg RAWCPPFLAGS="-undef -ansi" 12461568b75bSmrg AC_MSG_RESULT([yes, with -ansi]) 12477d5e3a19Smrg else 12487d5e3a19Smrg AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) 12497d5e3a19Smrg fi 12507d5e3a19Smrgfi 12517d5e3a19Smrgrm -f conftest.$ac_ext 12527d5e3a19Smrg 12537d5e3a19SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional]) 12547d5e3a19SmrgAC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) 12557d5e3a19Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 12567d5e3a19Smrg AC_MSG_RESULT([no]) 12577d5e3a19Smrgelse 12587d5e3a19Smrg if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then 12597d5e3a19Smrg RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" 12607d5e3a19Smrg AC_MSG_RESULT([yes]) 12617d5e3a19Smrg else 12627d5e3a19Smrg AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) 12637d5e3a19Smrg fi 12647d5e3a19Smrgfi 12657d5e3a19Smrgrm -f conftest.$ac_ext 12667d5e3a19SmrgAC_SUBST(RAWCPPFLAGS) 12677d5e3a19Smrg]) # XORG_PROG_RAWCPP 12687d5e3a19Smrg 12697d5e3a19Smrg# XORG_MANPAGE_SECTIONS() 12707d5e3a19Smrg# ----------------------- 12717d5e3a19Smrg# Minimum version: 1.0.0 12727d5e3a19Smrg# 12737d5e3a19Smrg# Determine which sections man pages go in for the different man page types 12747d5e3a19Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. 12757d5e3a19Smrg# Not sure if there's any better way than just hardcoding by OS name. 12767d5e3a19Smrg# Override default settings by setting environment variables 12777d5e3a19Smrg 12787d5e3a19SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[ 12797d5e3a19SmrgAC_REQUIRE([AC_CANONICAL_HOST]) 12807d5e3a19Smrg 12817d5e3a19Smrgif test x$APP_MAN_SUFFIX = x ; then 12827d5e3a19Smrg APP_MAN_SUFFIX=1 12837d5e3a19Smrgfi 12847d5e3a19Smrgif test x$APP_MAN_DIR = x ; then 12857d5e3a19Smrg APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' 12867d5e3a19Smrgfi 12877d5e3a19Smrg 12887d5e3a19Smrgif test x$LIB_MAN_SUFFIX = x ; then 12897d5e3a19Smrg LIB_MAN_SUFFIX=3 12907d5e3a19Smrgfi 12917d5e3a19Smrgif test x$LIB_MAN_DIR = x ; then 12927d5e3a19Smrg LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' 12937d5e3a19Smrgfi 12947d5e3a19Smrg 12957d5e3a19Smrgif test x$FILE_MAN_SUFFIX = x ; then 12967d5e3a19Smrg case $host_os in 12977d5e3a19Smrg solaris*) FILE_MAN_SUFFIX=4 ;; 12987d5e3a19Smrg *) FILE_MAN_SUFFIX=5 ;; 12997d5e3a19Smrg esac 13007d5e3a19Smrgfi 13017d5e3a19Smrgif test x$FILE_MAN_DIR = x ; then 13027d5e3a19Smrg FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' 13037d5e3a19Smrgfi 13047d5e3a19Smrg 13057d5e3a19Smrgif test x$MISC_MAN_SUFFIX = x ; then 13067d5e3a19Smrg case $host_os in 13077d5e3a19Smrg solaris*) MISC_MAN_SUFFIX=5 ;; 13087d5e3a19Smrg *) MISC_MAN_SUFFIX=7 ;; 13097d5e3a19Smrg esac 13107d5e3a19Smrgfi 13117d5e3a19Smrgif test x$MISC_MAN_DIR = x ; then 13127d5e3a19Smrg MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' 13137d5e3a19Smrgfi 13147d5e3a19Smrg 13157d5e3a19Smrgif test x$DRIVER_MAN_SUFFIX = x ; then 13167d5e3a19Smrg case $host_os in 13177d5e3a19Smrg solaris*) DRIVER_MAN_SUFFIX=7 ;; 13187d5e3a19Smrg *) DRIVER_MAN_SUFFIX=4 ;; 13197d5e3a19Smrg esac 13207d5e3a19Smrgfi 13217d5e3a19Smrgif test x$DRIVER_MAN_DIR = x ; then 13227d5e3a19Smrg DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' 13237d5e3a19Smrgfi 13247d5e3a19Smrg 13257d5e3a19Smrgif test x$ADMIN_MAN_SUFFIX = x ; then 13267d5e3a19Smrg case $host_os in 13277d5e3a19Smrg solaris*) ADMIN_MAN_SUFFIX=1m ;; 13287d5e3a19Smrg *) ADMIN_MAN_SUFFIX=8 ;; 13297d5e3a19Smrg esac 13307d5e3a19Smrgfi 13317d5e3a19Smrgif test x$ADMIN_MAN_DIR = x ; then 13327d5e3a19Smrg ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' 13337d5e3a19Smrgfi 13347d5e3a19Smrg 13357d5e3a19Smrg 13367d5e3a19SmrgAC_SUBST([APP_MAN_SUFFIX]) 13377d5e3a19SmrgAC_SUBST([LIB_MAN_SUFFIX]) 13387d5e3a19SmrgAC_SUBST([FILE_MAN_SUFFIX]) 13397d5e3a19SmrgAC_SUBST([MISC_MAN_SUFFIX]) 13407d5e3a19SmrgAC_SUBST([DRIVER_MAN_SUFFIX]) 13417d5e3a19SmrgAC_SUBST([ADMIN_MAN_SUFFIX]) 13427d5e3a19SmrgAC_SUBST([APP_MAN_DIR]) 13437d5e3a19SmrgAC_SUBST([LIB_MAN_DIR]) 13447d5e3a19SmrgAC_SUBST([FILE_MAN_DIR]) 13457d5e3a19SmrgAC_SUBST([MISC_MAN_DIR]) 13467d5e3a19SmrgAC_SUBST([DRIVER_MAN_DIR]) 13477d5e3a19SmrgAC_SUBST([ADMIN_MAN_DIR]) 13487d5e3a19Smrg]) # XORG_MANPAGE_SECTIONS 13497d5e3a19Smrg 13507d5e3a19Smrg# XORG_CHECK_LINUXDOC 13517d5e3a19Smrg# ------------------- 13527d5e3a19Smrg# Minimum version: 1.0.0 13537d5e3a19Smrg# 13547d5e3a19Smrg# Defines the variable MAKE_TEXT if the necessary tools and 13557d5e3a19Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. 13567d5e3a19Smrg# Whether or not the necessary tools and files are found can be checked 13577d5e3a19Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC" 13587d5e3a19SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[ 13591568b75bSmrgif test x$XORG_SGML_PATH = x ; then 13601568b75bSmrg XORG_SGML_PATH=$prefix/share/sgml 13611568b75bSmrgfi 13627d5e3a19SmrgHAVE_DEFS_ENT= 13637d5e3a19Smrg 13641568b75bSmrgif test x"$cross_compiling" = x"yes" ; then 13651568b75bSmrg HAVE_DEFS_ENT=no 13661568b75bSmrgelse 13671568b75bSmrg AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes]) 13681568b75bSmrgfi 13697d5e3a19Smrg 13707d5e3a19SmrgAC_PATH_PROG(LINUXDOC, linuxdoc) 13717d5e3a19SmrgAC_PATH_PROG(PS2PDF, ps2pdf) 13727d5e3a19Smrg 13737d5e3a19SmrgAC_MSG_CHECKING([Whether to build documentation]) 13747d5e3a19Smrg 13757d5e3a19Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then 13767d5e3a19Smrg BUILDDOC=yes 13777d5e3a19Smrgelse 13787d5e3a19Smrg BUILDDOC=no 13797d5e3a19Smrgfi 13807d5e3a19Smrg 13817d5e3a19SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) 13827d5e3a19Smrg 13837d5e3a19SmrgAC_MSG_RESULT([$BUILDDOC]) 13847d5e3a19Smrg 13857d5e3a19SmrgAC_MSG_CHECKING([Whether to build pdf documentation]) 13867d5e3a19Smrg 13877d5e3a19Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then 13887d5e3a19Smrg BUILDPDFDOC=yes 13897d5e3a19Smrgelse 13907d5e3a19Smrg BUILDPDFDOC=no 13917d5e3a19Smrgfi 13927d5e3a19Smrg 13937d5e3a19SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 13947d5e3a19Smrg 13957d5e3a19SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 13967d5e3a19Smrg 13977d5e3a19SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt" 13987d5e3a19SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps" 13997d5e3a19SmrgMAKE_PDF="$PS2PDF" 14007d5e3a19SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0" 14017d5e3a19Smrg 14027d5e3a19SmrgAC_SUBST(MAKE_TEXT) 14037d5e3a19SmrgAC_SUBST(MAKE_PS) 14047d5e3a19SmrgAC_SUBST(MAKE_PDF) 14057d5e3a19SmrgAC_SUBST(MAKE_HTML) 14067d5e3a19Smrg]) # XORG_CHECK_LINUXDOC 14077d5e3a19Smrg 14087d5e3a19Smrg# XORG_CHECK_DOCBOOK 14097d5e3a19Smrg# ------------------- 14107d5e3a19Smrg# Minimum version: 1.0.0 14117d5e3a19Smrg# 14127d5e3a19Smrg# Checks for the ability to build output formats from SGML DocBook source. 14137d5e3a19Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC" 14147d5e3a19Smrg# indicates whether the necessary tools and files are found and, if set, 14157d5e3a19Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx. 14167d5e3a19SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[ 14171568b75bSmrgif test x$XORG_SGML_PATH = x ; then 14181568b75bSmrg XORG_SGML_PATH=$prefix/share/sgml 14191568b75bSmrgfi 14207d5e3a19SmrgHAVE_DEFS_ENT= 14217d5e3a19SmrgBUILDTXTDOC=no 14227d5e3a19SmrgBUILDPDFDOC=no 14237d5e3a19SmrgBUILDPSDOC=no 14247d5e3a19SmrgBUILDHTMLDOC=no 14257d5e3a19Smrg 14267d5e3a19SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes]) 14277d5e3a19Smrg 14287d5e3a19SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps) 14297d5e3a19SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf) 14307d5e3a19SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html) 14317d5e3a19SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt) 14327d5e3a19Smrg 14337d5e3a19SmrgAC_MSG_CHECKING([Whether to build text documentation]) 14347d5e3a19Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x && 14357d5e3a19Smrg test x$BUILD_TXTDOC != xno; then 14367d5e3a19Smrg BUILDTXTDOC=yes 14377d5e3a19Smrgfi 14387d5e3a19SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes]) 14397d5e3a19SmrgAC_MSG_RESULT([$BUILDTXTDOC]) 14407d5e3a19Smrg 14417d5e3a19SmrgAC_MSG_CHECKING([Whether to build PDF documentation]) 14427d5e3a19Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x && 14437d5e3a19Smrg test x$BUILD_PDFDOC != xno; then 14447d5e3a19Smrg BUILDPDFDOC=yes 14457d5e3a19Smrgfi 14467d5e3a19SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) 14477d5e3a19SmrgAC_MSG_RESULT([$BUILDPDFDOC]) 14487d5e3a19Smrg 14497d5e3a19SmrgAC_MSG_CHECKING([Whether to build PostScript documentation]) 14507d5e3a19Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x && 14517d5e3a19Smrg test x$BUILD_PSDOC != xno; then 14527d5e3a19Smrg BUILDPSDOC=yes 14537d5e3a19Smrgfi 14547d5e3a19SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes]) 14557d5e3a19SmrgAC_MSG_RESULT([$BUILDPSDOC]) 14567d5e3a19Smrg 14577d5e3a19SmrgAC_MSG_CHECKING([Whether to build HTML documentation]) 14587d5e3a19Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x && 14597d5e3a19Smrg test x$BUILD_HTMLDOC != xno; then 14607d5e3a19Smrg BUILDHTMLDOC=yes 14617d5e3a19Smrgfi 14627d5e3a19SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes]) 14637d5e3a19SmrgAC_MSG_RESULT([$BUILDHTMLDOC]) 14647d5e3a19Smrg 14657d5e3a19SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT" 14667d5e3a19SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS" 14677d5e3a19SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF" 14687d5e3a19SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML" 14697d5e3a19Smrg 14707d5e3a19SmrgAC_SUBST(MAKE_TEXT) 14717d5e3a19SmrgAC_SUBST(MAKE_PS) 14727d5e3a19SmrgAC_SUBST(MAKE_PDF) 14737d5e3a19SmrgAC_SUBST(MAKE_HTML) 14747d5e3a19Smrg]) # XORG_CHECK_DOCBOOK 14757d5e3a19Smrg 14767d5e3a19Smrg# XORG_CHECK_MALLOC_ZERO 14777d5e3a19Smrg# ---------------------- 14787d5e3a19Smrg# Minimum version: 1.0.0 14797d5e3a19Smrg# 14807d5e3a19Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if 14817d5e3a19Smrg# malloc(0) returns NULL. Packages should add one of these cflags to 14827d5e3a19Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. 14837d5e3a19SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ 14847d5e3a19SmrgAC_ARG_ENABLE(malloc0returnsnull, 14857d5e3a19Smrg AC_HELP_STRING([--enable-malloc0returnsnull], 14867d5e3a19Smrg [malloc(0) returns NULL (default: auto)]), 14877d5e3a19Smrg [MALLOC_ZERO_RETURNS_NULL=$enableval], 14887d5e3a19Smrg [MALLOC_ZERO_RETURNS_NULL=auto]) 14897d5e3a19Smrg 14907d5e3a19SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL]) 14917d5e3a19Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 14927d5e3a19Smrg AC_RUN_IFELSE([ 14937d5e3a19Smrgchar *malloc(); 14947d5e3a19Smrgchar *realloc(); 14957d5e3a19Smrgchar *calloc(); 14967d5e3a19Smrgmain() { 14977d5e3a19Smrg char *m0, *r0, *c0, *p; 14987d5e3a19Smrg m0 = malloc(0); 14997d5e3a19Smrg p = malloc(10); 15007d5e3a19Smrg r0 = realloc(p,0); 15017d5e3a19Smrg c0 = calloc(0); 15027d5e3a19Smrg exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); 15037d5e3a19Smrg}], 15047d5e3a19Smrg [MALLOC_ZERO_RETURNS_NULL=yes], 15057d5e3a19Smrg [MALLOC_ZERO_RETURNS_NULL=no]) 15067d5e3a19Smrgfi 15077d5e3a19SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) 15087d5e3a19Smrg 15097d5e3a19Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then 15107d5e3a19Smrg MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" 15117d5e3a19Smrg XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS 15127d5e3a19Smrg XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" 15137d5e3a19Smrgelse 15147d5e3a19Smrg MALLOC_ZERO_CFLAGS="" 15157d5e3a19Smrg XMALLOC_ZERO_CFLAGS="" 15167d5e3a19Smrg XTMALLOC_ZERO_CFLAGS="" 15177d5e3a19Smrgfi 15187d5e3a19Smrg 15197d5e3a19SmrgAC_SUBST([MALLOC_ZERO_CFLAGS]) 15207d5e3a19SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS]) 15217d5e3a19SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS]) 15227d5e3a19Smrg]) # XORG_CHECK_MALLOC_ZERO 15237d5e3a19Smrg 15247d5e3a19Smrg# XORG_WITH_LINT() 15257d5e3a19Smrg# ---------------- 15267d5e3a19Smrg# Minimum version: 1.1.0 15277d5e3a19Smrg# 15287d5e3a19Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint 15297d5e3a19Smrg# is specified. (Use --with-lint=sparse for sparse.) 15307d5e3a19Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint) 15317d5e3a19Smrg# Sets $LINT_FLAGS to flags to pass to source checker 15327d5e3a19Smrg# Sets LINT automake conditional if enabled (default: disabled) 15337d5e3a19Smrg# 15347d5e3a19SmrgAC_DEFUN([XORG_WITH_LINT],[ 15357d5e3a19Smrg 15367d5e3a19Smrg# Allow checking code with lint, sparse, etc. 15377d5e3a19SmrgAC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint], 15387d5e3a19Smrg [Use a lint-style source code checker (default: disabled)])], 15397d5e3a19Smrg [use_lint=$withval], [use_lint=no]) 15407d5e3a19Smrgif test "x$use_lint" = "xyes" ; then 15417d5e3a19Smrg LINT="lint" 15427d5e3a19Smrgelse 15437d5e3a19Smrg LINT="$use_lint" 15447d5e3a19Smrgfi 15457d5e3a19Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then 15467d5e3a19Smrg case $LINT in 15477d5e3a19Smrg lint|*/lint) 15487d5e3a19Smrg case $host_os in 15497d5e3a19Smrg solaris*) 15507d5e3a19Smrg LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" 15517d5e3a19Smrg ;; 15527d5e3a19Smrg esac 15537d5e3a19Smrg ;; 15547d5e3a19Smrg esac 15557d5e3a19Smrgfi 15567d5e3a19Smrg 15577d5e3a19SmrgAC_SUBST(LINT) 15587d5e3a19SmrgAC_SUBST(LINT_FLAGS) 15597d5e3a19SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno]) 15607d5e3a19Smrg 15617d5e3a19Smrg]) # XORG_WITH_LINT 15627d5e3a19Smrg 15637d5e3a19Smrg# XORG_LINT_LIBRARY(LIBNAME) 15647d5e3a19Smrg# -------------------------- 15657d5e3a19Smrg# Minimum version: 1.1.0 15667d5e3a19Smrg# 15677d5e3a19Smrg# Sets up flags for building lint libraries for checking programs that call 15687d5e3a19Smrg# functions in the library. 15697d5e3a19Smrg# Disabled by default, enable with --enable-lint-library 15707d5e3a19Smrg# Sets: 15717d5e3a19Smrg# @LINTLIB@ - name of lint library file to make 15727d5e3a19Smrg# MAKE_LINT_LIB - automake conditional 15737d5e3a19Smrg# 15747d5e3a19Smrg 15757d5e3a19SmrgAC_DEFUN([XORG_LINT_LIBRARY],[ 15767d5e3a19SmrgAC_REQUIRE([XORG_WITH_LINT]) 15777d5e3a19Smrg# Build lint "library" for more indepth checks of programs calling this library 15787d5e3a19SmrgAC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library], 15797d5e3a19Smrg [Create lint library (default: disabled)])], 15807d5e3a19Smrg [make_lint_lib=$enableval], [make_lint_lib=no]) 15817d5e3a19Smrgif test "x$make_lint_lib" != "xno" ; then 15827d5e3a19Smrg if test "x$LINT" = "xno" ; then 15837d5e3a19Smrg AC_MSG_ERROR([Cannot make lint library without --with-lint]) 15847d5e3a19Smrg fi 15857d5e3a19Smrg if test "x$make_lint_lib" = "xyes" ; then 15867d5e3a19Smrg LINTLIB=llib-l$1.ln 15877d5e3a19Smrg else 15887d5e3a19Smrg LINTLIB=$make_lint_lib 15897d5e3a19Smrg fi 15907d5e3a19Smrgfi 15917d5e3a19SmrgAC_SUBST(LINTLIB) 15927d5e3a19SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) 15937d5e3a19Smrg 15947d5e3a19Smrg]) # XORG_LINT_LIBRARY 15957d5e3a19Smrg 15961568b75bSmrg# XORG_CWARNFLAGS 15971568b75bSmrg# --------------- 15981568b75bSmrg# Minimum version: 1.2.0 15991568b75bSmrg# 16001568b75bSmrg# Defines CWARNFLAGS to enable C compiler warnings. 16011568b75bSmrg# 16021568b75bSmrgAC_DEFUN([XORG_CWARNFLAGS], [ 16031568b75bSmrgAC_REQUIRE([AC_PROG_CC]) 16041568b75bSmrgif test "x$GCC" = xyes ; then 16051568b75bSmrg CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \ 16061568b75bSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \ 16071568b75bSmrg-Wbad-function-cast" 16081568b75bSmrg case `gcc -dumpversion` in 16091568b75bSmrg 3.4.* | 4.*) 16101568b75bSmrg CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement" 16111568b75bSmrg ;; 16121568b75bSmrg esac 16131568b75bSmrgelse 16141568b75bSmrg AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) 16151568b75bSmrg if test "x$SUNCC" = "xyes"; then 16161568b75bSmrg CWARNFLAGS="-v" 16171568b75bSmrg fi 16181568b75bSmrgfi 16191568b75bSmrgAC_SUBST(CWARNFLAGS) 16201568b75bSmrg]) # XORG_CWARNFLAGS 16217d5e3a19Smrgdnl Copyright 2005 Red Hat, Inc 16227d5e3a19Smrgdnl 16237d5e3a19Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its 16247d5e3a19Smrgdnl documentation for any purpose is hereby granted without fee, provided that 16257d5e3a19Smrgdnl the above copyright notice appear in all copies and that both that 16267d5e3a19Smrgdnl copyright notice and this permission notice appear in supporting 16277d5e3a19Smrgdnl documentation. 16287d5e3a19Smrgdnl 16297d5e3a19Smrgdnl The above copyright notice and this permission notice shall be included 16307d5e3a19Smrgdnl in all copies or substantial portions of the Software. 16317d5e3a19Smrgdnl 16327d5e3a19Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 16337d5e3a19Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16347d5e3a19Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 16357d5e3a19Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 16367d5e3a19Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 16377d5e3a19Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 16387d5e3a19Smrgdnl OTHER DEALINGS IN THE SOFTWARE. 16397d5e3a19Smrgdnl 16407d5e3a19Smrgdnl Except as contained in this notice, the name of the copyright holders shall 16417d5e3a19Smrgdnl not be used in advertising or otherwise to promote the sale, use or 16427d5e3a19Smrgdnl other dealings in this Software without prior written authorization 16437d5e3a19Smrgdnl from the copyright holders. 16447d5e3a19Smrgdnl 16457d5e3a19Smrg 16467d5e3a19Smrg# XORG_RELEASE_VERSION 16477d5e3a19Smrg# -------------------- 16487d5e3a19Smrg# Adds --with/without-release-string and changes the PACKAGE and 16497d5e3a19Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If 16507d5e3a19Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. Also 16517d5e3a19Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. 16527d5e3a19Smrg 16537d5e3a19SmrgAC_DEFUN([XORG_RELEASE_VERSION],[ 16547d5e3a19Smrg AC_ARG_WITH(release-version, 16557d5e3a19Smrg AC_HELP_STRING([--with-release-version=STRING], 16567d5e3a19Smrg [Use release version string in package name]), 16577d5e3a19Smrg [RELEASE_VERSION="$withval"], 16587d5e3a19Smrg [RELEASE_VERSION=""]) 16597d5e3a19Smrg if test "x$RELEASE_VERSION" != "x"; then 16607d5e3a19Smrg PACKAGE="$PACKAGE-$RELEASE_VERSION" 16617d5e3a19Smrg PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" 16627d5e3a19Smrg AC_MSG_NOTICE([Building with package name set to $PACKAGE]) 16637d5e3a19Smrg fi 16647d5e3a19Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], 16657d5e3a19Smrg [`echo $PACKAGE_VERSION | cut -d . -f 1`], 16667d5e3a19Smrg [Major version of this package]) 16671568b75bSmrg PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1` 16687d5e3a19Smrg if test "x$PVM" = "x"; then 16697d5e3a19Smrg PVM="0" 16707d5e3a19Smrg fi 16717d5e3a19Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], 16727d5e3a19Smrg [$PVM], 16737d5e3a19Smrg [Minor version of this package]) 16741568b75bSmrg PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1` 16757d5e3a19Smrg if test "x$PVP" = "x"; then 16767d5e3a19Smrg PVP="0" 16777d5e3a19Smrg fi 16787d5e3a19Smrg AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], 16797d5e3a19Smrg [$PVP], 16807d5e3a19Smrg [Patch version of this package]) 16817d5e3a19Smrg]) 16827d5e3a19Smrg 16831568b75bSmrg# XORG_CHANGELOG() 16841568b75bSmrg# ---------------- 16851568b75bSmrg# Minimum version: 1.2.0 16867d5e3a19Smrg# 16871568b75bSmrg# Defines the variable CHANGELOG_CMD as the command to generate 16881568b75bSmrg# ChangeLog from git. 16897d5e3a19Smrg# 16901568b75bSmrg# Arrange that distcleancheck ignores ChangeLog left over by distclean. 16917d5e3a19Smrg# 16921568b75bSmrgAC_DEFUN([XORG_CHANGELOG], [ 16931568b75bSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \ 16941568b75bSmrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \ 16951568b75bSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)" 16961568b75bSmrgAC_SUBST([CHANGELOG_CMD]) 16971568b75bSmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print']) 16981568b75bSmrg]) # XORG_CHANGELOG 16997d5e3a19Smrg 1700