From 194f742fba53991366e1cc7bf7de38e8d692acad Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 30 Jun 2007 00:06:00 +0000 Subject: [PATCH] copy wxAutohacks into main tree git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47038 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- build/autoconf_prepend-include/Makefile | 26 + build/autoconf_prepend-include/autoconf/c.m4 | 1219 ++++++++ .../autoconf/general.m4 | 2521 +++++++++++++++++ .../autoconf_prepend-include/autoconf/libs.m4 | 498 ++++ .../autoconf/status.m4 | 1604 +++++++++++ 5 files changed, 5868 insertions(+) create mode 100644 build/autoconf_prepend-include/Makefile create mode 100644 build/autoconf_prepend-include/autoconf/c.m4 create mode 100644 build/autoconf_prepend-include/autoconf/general.m4 create mode 100644 build/autoconf_prepend-include/autoconf/libs.m4 create mode 100644 build/autoconf_prepend-include/autoconf/status.m4 diff --git a/build/autoconf_prepend-include/Makefile b/build/autoconf_prepend-include/Makefile new file mode 100644 index 0000000000..39354162fc --- /dev/null +++ b/build/autoconf_prepend-include/Makefile @@ -0,0 +1,26 @@ +# Created: 2005/03/12 +# Author: David Elliott + +# For autoconf: Debian in their infinite wisdom decided to improve upon +# the standard autoconf 2.59 macros. Thus Debian's autoconf generates +# a totally different configure script. This fixes it to look +# mostly like Debian's. There are also some fixes pulled in from the OS/2 +# fork of autoconf. + +# Rule to freeze the m4 so autoconf will actually use it. +# NOTE: VERY important to cd to somewhere there are no .m4 files. +# or at least no aclocal.m4 or else autom4te helpfully picks it up. +.PHONY: all +all: autoconf/autoconf.m4f + +AUTOCONF_SOURCES = \ + autoconf/c.m4 \ + autoconf/general.m4 \ + autoconf/libs.m4 \ + autoconf/status.m4 + +AUTOM4TE=autom4te + +autoconf/autoconf.m4f: $(AUTOCONF_SOURCES) + $(AUTOM4TE) -B . --language=Autoconf --freeze --output=autoconf/autoconf.m4f + diff --git a/build/autoconf_prepend-include/autoconf/c.m4 b/build/autoconf_prepend-include/autoconf/c.m4 new file mode 100644 index 0000000000..76865a886a --- /dev/null +++ b/build/autoconf_prepend-include/autoconf/c.m4 @@ -0,0 +1,1219 @@ +# This file is part of Autoconf. -*- Autoconf -*- +# Programming languages support. +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. +# +# As a special exception, the Free Software Foundation gives unlimited +# permission to copy, distribute and modify the configure scripts that +# are the output of Autoconf. You need not follow the terms of the GNU +# General Public License when using or distributing such scripts, even +# though portions of the text of Autoconf appear in them. The GNU +# General Public License (GPL) does govern all other use of the material +# that constitutes the Autoconf program. +# +# Certain portions of the Autoconf source text are designed to be copied +# (in certain cases, depending on the input) into the output of +# Autoconf. We call these the "data" portions. The rest of the Autoconf +# source text consists of comments plus executable code that decides which +# of the data portions to output in any given case. We call these +# comments and executable code the "non-data" portions. Autoconf never +# copies any of the non-data portions into its output. +# +# This special exception to the GPL applies to versions of Autoconf +# released by the Free Software Foundation. When you make and +# distribute a modified version of Autoconf, you may extend this special +# exception to the GPL to apply to your modified version as well, *unless* +# your modified version has the potential to copy into its output some +# of the text that was the non-data portion of the version that you started +# with. (In other words, unless your change moves or copies text from +# the non-data portions to the data portions.) If your modification has +# such potential, you must delete any notice of this special exception +# to the GPL from your modified version. +# +# Written by David MacKenzie, with help from +# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, +# Roland McGrath, Noah Friedman, david d zuhn, and many others. + + +# -------------------- # +# 1b. The C language. # +# -------------------- # + + +# AC_LANG(C) +# ---------- +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +m4_define([AC_LANG(C)], +[ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +]) + + +# AC_LANG_C +# --------- +AU_DEFUN([AC_LANG_C], [AC_LANG(C)]) + + +# _AC_LANG_ABBREV(C) +# ------------------ +m4_define([_AC_LANG_ABBREV(C)], [c]) + + +# _AC_LANG_PREFIX(C) +# ------------------ +m4_define([_AC_LANG_PREFIX(C)], [C]) + + +# ---------------------- # +# 1c. The C++ language. # +# ---------------------- # + + +# AC_LANG(C++) +# ------------ +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +m4_define([AC_LANG(C++)], +[ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +]) + + +# AC_LANG_CPLUSPLUS +# ----------------- +AU_DEFUN([AC_LANG_CPLUSPLUS], [AC_LANG(C++)]) + + +# _AC_LANG_ABBREV(C++) +# -------------------- +m4_define([_AC_LANG_ABBREV(C++)], [cxx]) + + +# _AC_LANG_PREFIX(C++) +# -------------------- +m4_define([_AC_LANG_PREFIX(C++)], [CXX]) + + + +## ---------------------- ## +## 2.Producing programs. ## +## ---------------------- ## + + +# --------------- # +# 2b. C sources. # +# --------------- # + +# AC_LANG_SOURCE(C)(BODY) +# ----------------------- +# This sometimes fails to find confdefs.h, for some reason. +# We can't use '#line $LINENO "configure"' here, since +# Sun c89 (Sun WorkShop 6 update 2 C 5.3 Patch 111679-08 2002/05/09) +# rejects $LINENO greater than 32767, and some configure scripts +# are longer than 32767 lines. +m4_define([AC_LANG_SOURCE(C)], +[/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$1]) + + +# AC_LANG_PROGRAM(C)([PROLOGUE], [BODY]) +# -------------------------------------- +m4_define([AC_LANG_PROGRAM(C)], +[$1 +m4_ifdef([_AC_LANG_PROGRAM_C_F77_HOOKS], [_AC_LANG_PROGRAM_C_F77_HOOKS])[]dnl +m4_ifdef([_AC_LANG_PROGRAM_C_FC_HOOKS], [_AC_LANG_PROGRAM_C_FC_HOOKS])[]dnl +int +main () +{ +dnl Do *not* indent the following line: there may be CPP directives. +dnl Don't move the `;' right after for the same reason. +$2 + ; + return 0; +}]) + + +# AC_LANG_CALL(C)(PROLOGUE, FUNCTION) +# ----------------------------------- +# Avoid conflicting decl of main. +m4_define([AC_LANG_CALL(C)], +[AC_LANG_PROGRAM([$1 +m4_if([$2], [main], , +[/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $2 ();])], [$2 ();])]) + + +# AC_LANG_FUNC_LINK_TRY(C)(FUNCTION) +# ---------------------------------- +# Don't include because on OSF/1 3.0 it includes +# which includes which contains a +# prototype for select. Similarly for bzero. +# +# This test used to merely assign f=$1 in main(), but that was +# optimized away by HP unbundled cc A.05.36 for ia64 under +O3, +# presumably on the basis that there's no need to do that store if the +# program is about to exit. Conversely, the AIX linker optimizes an +# unused external declaration that initializes f=$1. So this test +# program has both an external initialization of f, and a use of f in +# main that affects the exit status. +# +m4_define([AC_LANG_FUNC_LINK_TRY(C)], +[AC_LANG_PROGRAM( +[/* Define $1 to an innocuous variant, in case declares $1. + For example, HP-UX 11i declares gettimeofday. */ +#define $1 innocuous_$1 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $1 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $1 + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $1 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$1) || defined (__stub___$1) +choke me +#else +char (*f) () = $1; +#endif +#ifdef __cplusplus +} +#endif +], [return f != $1;])]) + + +# AC_LANG_BOOL_COMPILE_TRY(C)(PROLOGUE, EXPRESSION) +# ------------------------------------------------- +# Be sure to use this array to avoid `unused' warnings, which are even +# errors with `-W error'. +m4_define([AC_LANG_BOOL_COMPILE_TRY(C)], +[AC_LANG_PROGRAM([$1], [static int test_array @<:@1 - 2 * !($2)@:>@; +test_array @<:@0@:>@ = 0 +])]) + + +# AC_LANG_INT_SAVE(C)(PROLOGUE, EXPRESSION) +# ----------------------------------------- +# We need `stdio.h' to open a `FILE' and `stdlib.h' for `exit'. +# But we include them only after the EXPRESSION has been evaluated. +m4_define([AC_LANG_INT_SAVE(C)], +[AC_LANG_PROGRAM([$1 +long longval () { return $2; } +unsigned long ulongval () { return $2; } +@%:@include +@%:@include ], +[ + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (($2) < 0) + { + long i = longval (); + if (i != ($2)) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ($2)) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); +])]) + + +# ----------------- # +# 2c. C++ sources. # +# ----------------- # + +# AC_LANG_SOURCE(C++)(BODY) +# ------------------------- +m4_copy([AC_LANG_SOURCE(C)], [AC_LANG_SOURCE(C++)]) + + +# AC_LANG_PROGRAM(C++)([PROLOGUE], [BODY]) +# ---------------------------------------- +m4_copy([AC_LANG_PROGRAM(C)], [AC_LANG_PROGRAM(C++)]) + + +# AC_LANG_CALL(C++)(PROLOGUE, FUNCTION) +# ------------------------------------- +m4_copy([AC_LANG_CALL(C)], [AC_LANG_CALL(C++)]) + + +# AC_LANG_FUNC_LINK_TRY(C++)(FUNCTION) +# ------------------------------------ +m4_copy([AC_LANG_FUNC_LINK_TRY(C)], [AC_LANG_FUNC_LINK_TRY(C++)]) + + +# AC_LANG_BOOL_COMPILE_TRY(C++)(PROLOGUE, EXPRESSION) +# --------------------------------------------------- +m4_copy([AC_LANG_BOOL_COMPILE_TRY(C)], [AC_LANG_BOOL_COMPILE_TRY(C++)]) + + +# AC_LANG_INT_SAVE(C++)(PROLOGUE, EXPRESSION) +# ------------------------------------------- +m4_copy([AC_LANG_INT_SAVE(C)], [AC_LANG_INT_SAVE(C++)]) + + + +## -------------------------------------------- ## +## 3. Looking for Compilers and Preprocessors. ## +## -------------------------------------------- ## + +# -------------------- # +# 3b. The C compiler. # +# -------------------- # + + +# _AC_ARG_VAR_CPPFLAGS +# -------------------- +# Document and register CPPFLAGS, which is used by +# AC_PROG_{CC, CPP, CXX, CXXCPP}. +AC_DEFUN([_AC_ARG_VAR_CPPFLAGS], +[AC_ARG_VAR([CPPFLAGS], + [C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory ])]) + + +# _AC_ARG_VAR_LDFLAGS +# ------------------- +# Document and register LDFLAGS, which is used by +# AC_PROG_{CC, CXX, F77}. +AC_DEFUN([_AC_ARG_VAR_LDFLAGS], +[AC_ARG_VAR([LDFLAGS], + [linker flags, e.g. -L if you have libraries in a + nonstandard directory ])]) + + + +# AC_LANG_PREPROC(C) +# ------------------- +# Find the C preprocessor. Must be AC_DEFUN'd to be AC_REQUIRE'able. +AC_DEFUN([AC_LANG_PREPROC(C)], +[AC_REQUIRE([AC_PROG_CPP])]) + + +# _AC_PROG_PREPROC_WORKS_IFELSE(IF-WORKS, IF-NOT) +# ----------------------------------------------- +# Check if $ac_cpp is a working preprocessor that can flag absent +# includes either by the exit status or by warnings. +# Set ac_cpp_err to a non-empty value if the preprocessor failed. +# This macro is for all languages, not only C. +AC_DEFUN([_AC_PROG_PREPROC_WORKS_IFELSE], +[ac_preproc_ok=false +for ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + _AC_PREPROC_IFELSE([AC_LANG_SOURCE([[@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error]])], + [], + [# Broken: fails on valid input. +continue]) + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + _AC_PREPROC_IFELSE([AC_LANG_SOURCE([[@%:@include ]])], + [# Broken: success on invalid input. +continue], + [# Passes both tests. +ac_preproc_ok=: +break]) + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +AS_IF([$ac_preproc_ok], [$1], [$2])])# _AC_PROG_PREPROC_WORKS_IFELSE + + +# AC_PROG_CPP +# ----------- +# Find a working C preprocessor. +# We shouldn't have to require AC_PROG_CC, but this is due to the concurrency +# between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_CC. +AN_MAKEVAR([CPP], [AC_PROG_CPP]) +AN_PROGRAM([cpp], [AC_PROG_CPP]) +AC_DEFUN([AC_PROG_CPP], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_ARG_VAR([CPP], [C preprocessor])dnl +_AC_ARG_VAR_CPPFLAGS()dnl +AC_LANG_PUSH(C)dnl +AC_MSG_CHECKING([how to run the C preprocessor]) +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + AC_CACHE_VAL([ac_cv_prog_CPP], + [dnl + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + _AC_PROG_PREPROC_WORKS_IFELSE([break]) + done + ac_cv_prog_CPP=$CPP + ])dnl + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +AC_MSG_RESULT([$CPP]) +_AC_PROG_PREPROC_WORKS_IFELSE([], + [AC_MSG_FAILURE([C preprocessor "$CPP" fails sanity check])]) +AC_SUBST(CPP)dnl +AC_LANG_POP(C)dnl +])# AC_PROG_CPP + +# AC_PROG_CPP_WERROR +# ------------------ +# Treat warnings from the preprocessor as errors. +AC_DEFUN([AC_PROG_CPP_WERROR], +[AC_REQUIRE([AC_PROG_CPP])dnl +ac_c_preproc_warn_flag=yes])# AC_PROG_CPP_WERROR + +# AC_LANG_COMPILER(C) +# ------------------- +# Find the C compiler. Must be AC_DEFUN'd to be AC_REQUIRE'able. +AC_DEFUN([AC_LANG_COMPILER(C)], +[AC_REQUIRE([AC_PROG_CC])]) + + +# ac_cv_prog_gcc +# -------------- +# We used to name the cache variable this way. +AU_DEFUN([ac_cv_prog_gcc], +[ac_cv_c_compiler_gnu]) + + +# AC_PROG_CC([COMPILER ...]) +# -------------------------- +# COMPILER ... is a space separated list of C compilers to search for. +# This just gives the user an opportunity to specify an alternative +# search list for the C compiler. +AN_MAKEVAR([CC], [AC_PROG_CC]) +AN_PROGRAM([cc], [AC_PROG_CC]) +AN_PROGRAM([gcc], [AC_PROG_CC]) +AC_DEFUN([AC_PROG_CC], +[AC_LANG_PUSH(C)dnl +AC_ARG_VAR([CC], [C compiler command])dnl +AC_ARG_VAR([CFLAGS], [C compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +_AC_ARG_VAR_CPPFLAGS()dnl +m4_ifval([$1], + [AC_CHECK_TOOLS(CC, [$1])], +[AC_CHECK_TOOL(CC, gcc) +if test -z "$CC"; then + AC_CHECK_TOOL(CC, cc) +fi +if test -z "$CC"; then + AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) +fi +if test -z "$CC"; then + AC_CHECK_TOOLS(CC, cl) +fi +]) + +test -z "$CC" && AC_MSG_FAILURE([no acceptable C compiler found in \$PATH]) + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for _AC_LANG compiler version" >&AS_MESSAGE_LOG_FD +ac_compiler=`set X $ac_compile; echo $[2]` +_AC_EVAL([$ac_compiler --version &AS_MESSAGE_LOG_FD]) +_AC_EVAL([$ac_compiler -v &AS_MESSAGE_LOG_FD]) +_AC_EVAL([$ac_compiler -V &AS_MESSAGE_LOG_FD]) + +m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl +m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl +_AC_LANG_COMPILER_GNU +GCC=`test $ac_compiler_gnu = yes && echo yes` +_AC_PROG_CC_G +_AC_PROG_CC_STDC +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +_AC_COMPILE_IFELSE([@%:@ifndef __cplusplus + choke me +@%:@endif], + [_AC_PROG_CXX_EXIT_DECLARATION]) +AC_LANG_POP(C)dnl +])# AC_PROG_CC + + +# _AC_PROG_CC_G +# ------------- +# Check whether -g works, even if CFLAGS is set, in case the package +# plays around with CFLAGS (such as to build both debugging and normal +# versions of a library), tasteless as that idea is. +m4_define([_AC_PROG_CC_G], +[ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="$CFLAGS -g" +AC_CACHE_CHECK(whether $CC accepts -g, ac_cv_prog_cc_g, + [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ac_cv_prog_cc_g=yes], + [ac_cv_prog_cc_g=no])]) +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi[]dnl +])# _AC_PROG_CC_G + + +# AC_PROG_GCC_TRADITIONAL +# ----------------------- +AN_FUNCTION([ioctl], [AC_PROG_GCC_TRADITIONAL]) +AC_DEFUN([AC_PROG_GCC_TRADITIONAL], +[if test $ac_cv_c_compiler_gnu = yes; then + AC_CACHE_CHECK(whether $CC needs -traditional, + ac_cv_prog_gcc_traditional, +[ ac_pattern="Autoconf.*'x'" + AC_EGREP_CPP($ac_pattern, [#include +Autoconf TIOCGETP], + ac_cv_prog_gcc_traditional=yes, ac_cv_prog_gcc_traditional=no) + + if test $ac_cv_prog_gcc_traditional = no; then + AC_EGREP_CPP($ac_pattern, [#include +Autoconf TCGETA], + ac_cv_prog_gcc_traditional=yes) + fi]) + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi +])# AC_PROG_GCC_TRADITIONAL + + +# AC_PROG_CC_C_O +# -------------- +AC_DEFUN([AC_PROG_CC_C_O], +[AC_REQUIRE([AC_PROG_CC])dnl +if test "x$CC" != xcc; then + AC_MSG_CHECKING([whether $CC and cc understand -c and -o together]) +else + AC_MSG_CHECKING([whether cc understands -c and -o together]) +fi +set dummy $CC; ac_cc=`echo $[2] | + sed 's/[[^a-zA-Z0-9_]]/_/g;s/^[[0-9]]/_/'` +AC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o, +[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest.$ac_objext >&AS_MESSAGE_LOG_FD' +if AC_TRY_EVAL(ac_try) && + test -f conftest.$ac_objext && AC_TRY_EVAL(ac_try); +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if AC_TRY_COMMAND(cc -c conftest.$ac_ext >&AS_MESSAGE_LOG_FD); then + ac_try='cc -c conftest.$ac_ext -o conftest.$ac_objext >&AS_MESSAGE_LOG_FD' + if AC_TRY_EVAL(ac_try) && + test -f conftest.$ac_objext && AC_TRY_EVAL(ac_try); + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f conftest* +])dnl +if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) + AC_DEFINE(NO_MINUS_C_MINUS_O, 1, + [Define to 1 if your C compiler doesn't accept -c and -o together.]) +fi +])# AC_PROG_CC_C_O + + +# ---------------------- # +# 3c. The C++ compiler. # +# ---------------------- # + + +# AC_LANG_PREPROC(C++) +# --------------------- +# Find the C++ preprocessor. Must be AC_DEFUN'd to be AC_REQUIRE'able. +AC_DEFUN([AC_LANG_PREPROC(C++)], +[AC_REQUIRE([AC_PROG_CXXCPP])]) + + +# AC_PROG_CXXCPP +# -------------- +# Find a working C++ preprocessor. +# We shouldn't have to require AC_PROG_CC, but this is due to the concurrency +# between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_CXX. +AC_DEFUN([AC_PROG_CXXCPP], +[AC_REQUIRE([AC_PROG_CXX])dnl +AC_ARG_VAR([CXXCPP], [C++ preprocessor])dnl +_AC_ARG_VAR_CPPFLAGS()dnl +AC_LANG_PUSH(C++)dnl +AC_MSG_CHECKING([how to run the C++ preprocessor]) +if test -z "$CXXCPP"; then + AC_CACHE_VAL(ac_cv_prog_CXXCPP, + [dnl + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + _AC_PROG_PREPROC_WORKS_IFELSE([break]) + done + ac_cv_prog_CXXCPP=$CXXCPP + ])dnl + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +AC_MSG_RESULT([$CXXCPP]) +_AC_PROG_PREPROC_WORKS_IFELSE([], + [AC_MSG_FAILURE([C++ preprocessor "$CXXCPP" fails sanity check])]) +AC_SUBST(CXXCPP)dnl +AC_LANG_POP(C++)dnl +])# AC_PROG_CXXCPP + + +# AC_LANG_COMPILER(C++) +# --------------------- +# Find the C++ compiler. Must be AC_DEFUN'd to be AC_REQUIRE'able. +AC_DEFUN([AC_LANG_COMPILER(C++)], +[AC_REQUIRE([AC_PROG_CXX])]) + + +# ac_cv_prog_gxx +# -------------- +# We used to name the cache variable this way. +AU_DEFUN([ac_cv_prog_gxx], +[ac_cv_cxx_compiler_gnu]) + + +# AC_PROG_CXX([LIST-OF-COMPILERS]) +# -------------------------------- +# LIST-OF-COMPILERS is a space separated list of C++ compilers to search +# for (if not specified, a default list is used). This just gives the +# user an opportunity to specify an alternative search list for the C++ +# compiler. +# aCC HP-UX C++ compiler much better than `CC', so test before. +# FCC Fujitsu C++ compiler +# KCC KAI C++ compiler +# RCC Rational C++ +# xlC_r AIX C Set++ (with support for reentrant code) +# xlC AIX C Set++ +AN_MAKEVAR([CXX], [AC_PROG_CXX]) +AN_PROGRAM([CC], [AC_PROG_CXX]) +AN_PROGRAM([c++], [AC_PROG_CXX]) +AN_PROGRAM([g++], [AC_PROG_CXX]) +AC_DEFUN([AC_PROG_CXX], +[AC_LANG_PUSH(C++)dnl +AC_ARG_VAR([CXX], [C++ compiler command])dnl +AC_ARG_VAR([CXXFLAGS], [C++ compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +_AC_ARG_VAR_CPPFLAGS()dnl +AC_CHECK_TOOLS(CXX, + [$CCC m4_default([$1], + [g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC])], + g++) + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for _AC_LANG compiler version" >&AS_MESSAGE_LOG_FD +ac_compiler=`set X $ac_compile; echo $[2]` +_AC_EVAL([$ac_compiler --version &AS_MESSAGE_LOG_FD]) +_AC_EVAL([$ac_compiler -v &AS_MESSAGE_LOG_FD]) +_AC_EVAL([$ac_compiler -V &AS_MESSAGE_LOG_FD]) + +m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl +m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl +_AC_LANG_COMPILER_GNU +GXX=`test $ac_compiler_gnu = yes && echo yes` +_AC_PROG_CXX_G +_AC_PROG_CXX_EXIT_DECLARATION +AC_LANG_POP(C++)dnl +])# AC_PROG_CXX + + +# _AC_PROG_CXX_G +# -------------- +# Check whether -g works, even if CXXFLAGS is set, in case the package +# plays around with CXXFLAGS (such as to build both debugging and +# normal versions of a library), tasteless as that idea is. +m4_define([_AC_PROG_CXX_G], +[ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-g" +AC_CACHE_CHECK(whether $CXX accepts -g, ac_cv_prog_cxx_g, + [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], + [ac_cv_prog_cxx_g=yes], + [ac_cv_prog_cxx_g=no])]) +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="$CXXFLAGS -g -O2" + else + CXXFLAGS="$CXXFLAGS -g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi[]dnl +])# _AC_PROG_CXX_G + + +# _AC_PROG_CXX_EXIT_DECLARATION +# ----------------------------- +# If doesn't already provide a valid prototype for exit, +# determine the appropriate prototype and put it in confdefs.h. +# This macro is run only when testing a C++ compiler, but it generates +# a prototype that is also appropriate for C compilers in order to +# support a mixed C/C++ configuration environment. +# We don't need to worry about this for C, since we include +# if it is available, and that method works for all C compilers. +m4_define([_AC_PROG_CXX_EXIT_DECLARATION], +[for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration +@%:@include ], + [exit (42);])], + [], + [continue]) + _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration], + [exit (42);])], + [break]) +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi +])# _AC_PROG_CXX_EXIT_DECLARATION + + + + + + +## ------------------------------- ## +## 4. Compilers' characteristics. ## +## ------------------------------- ## + + +# -------------------------------- # +# 4b. C compiler characteristics. # +# -------------------------------- # + +# _AC_PROG_CC_STDC +# ---------------- +# If the C compiler in not in ANSI C mode by default, try to add an +# option to output variable @code{CC} to make it so. This macro tries +# various options that select ANSI C on some system or another. It +# considers the compiler to be in ANSI C mode if it handles function +# prototypes correctly. +AC_DEFUN([_AC_PROG_CC_STDC], +[AC_MSG_CHECKING([for $CC option to accept ANSI C]) +AC_CACHE_VAL(ac_cv_prog_cc_stdc, +[ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +AC_LANG_CONFTEST([AC_LANG_PROGRAM( +[[#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv;]], +[[return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];]])]) +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + _AC_COMPILE_IFELSE([], + [ac_cv_prog_cc_stdc=$ac_arg +break]) +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC +]) +case "x$ac_cv_prog_cc_stdc" in + x|xno) + AC_MSG_RESULT([none needed]) ;; + *) + AC_MSG_RESULT([$ac_cv_prog_cc_stdc]) + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac +])# _AC_PROG_CC_STDC + + +# AC_PROG_CC_STDC +# --------------- +# Has been merged into AC_PROG_CC. +AU_DEFUN([AC_PROG_CC_STDC], []) + + +# AC_C_BACKSLASH_A +# ---------------- +AC_DEFUN([AC_C_BACKSLASH_A], +[ + AC_CACHE_CHECK([whether backslash-a works in strings], ac_cv_c_backslash_a, + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], + [[ +#if '\a' == 'a' + syntax error; +#endif + char buf['\a' == 'a' ? -1 : 1]; + buf[0] = '\a'; + return buf[0] != "\a"[0]; + ]])], + [ac_cv_c_backslash_a=yes], + [ac_cv_c_backslash_a=no])]) + if test $ac_cv_c_backslash_a = yes; then + AC_DEFINE(HAVE_C_BACKSLASH_A, 1, + [Define if backslash-a works in C strings.]) + fi +]) + + +# AC_C_CROSS +# ---------- +# Has been merged into AC_PROG_CC. +AU_DEFUN([AC_C_CROSS], []) + + +# AC_C_CHAR_UNSIGNED +# ------------------ +AC_DEFUN([AC_C_CHAR_UNSIGNED], +[AH_VERBATIM([__CHAR_UNSIGNED__], +[/* Define to 1 if type `char' is unsigned and you are not using gcc. */ +#ifndef __CHAR_UNSIGNED__ +# undef __CHAR_UNSIGNED__ +#endif])dnl +AC_CACHE_CHECK(whether char is unsigned, ac_cv_c_char_unsigned, +[AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([])], + [((char) -1) < 0])], + ac_cv_c_char_unsigned=no, ac_cv_c_char_unsigned=yes)]) +if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then + AC_DEFINE(__CHAR_UNSIGNED__) +fi +])# AC_C_CHAR_UNSIGNED + + +# AC_C_LONG_DOUBLE +# ---------------- +AC_DEFUN([AC_C_LONG_DOUBLE], +[AC_CACHE_CHECK( + [for working long double with more range or precision than double], + [ac_cv_c_long_double], + [AC_COMPILE_IFELSE( + [AC_LANG_BOOL_COMPILE_TRY( + [#include + long double foo = 0.0;], + [/* Using '|' rather than '||' catches a GCC 2.95.2 x86 bug. */ + (DBL_MAX < LDBL_MAX) | (LDBL_EPSILON < DBL_EPSILON) + | (DBL_MAX_EXP < LDBL_MAX_EXP) | (DBL_MANT_DIG < LDBL_MANT_DIG)])], + ac_cv_c_long_double=yes, + ac_cv_c_long_double=no)]) +if test $ac_cv_c_long_double = yes; then + AC_DEFINE(HAVE_LONG_DOUBLE, 1, + [Define to 1 if long double works and has more range or precision than double.]) +fi +])# AC_C_LONG_DOUBLE + + +# AC_C_BIGENDIAN ([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN]) +# ------------------------------------------------------------------------- +AC_DEFUN([AC_C_BIGENDIAN], +[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian, +[# See if sys/param.h defines the BYTE_ORDER macro. +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include +#include +], +[#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif +])], +[# It does; now see whether it defined to BIG_ENDIAN or not. +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include +#include +], [#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif +])], [ac_cv_c_bigendian=yes], [ac_cv_c_bigendian=no])], +[# It does not; compile a test program. +AC_RUN_IFELSE( +[AC_LANG_SOURCE([[int +main () +{ + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); +}]])], + [ac_cv_c_bigendian=no], + [ac_cv_c_bigendian=yes], +[# try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[[short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }]], +[[ _ascii (); _ebcdic (); ]])], +[if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi +fi])])])]) +case $ac_cv_c_bigendian in + yes) + m4_default([$1], + [AC_DEFINE([WORDS_BIGENDIAN], 1, + [Define to 1 if your processor stores words with the most significant + byte first (like Motorola and SPARC, unlike Intel and VAX).])]) ;; + no) + $2 ;; + *) + m4_default([$3], + [AC_MSG_ERROR([unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help])]) ;; +esac +])# AC_C_BIGENDIAN + + +# AC_C_INLINE +# ----------- +# Do nothing if the compiler accepts the inline keyword. +# Otherwise define inline to __inline__ or __inline if one of those work, +# otherwise define inline to be empty. +# +# HP C version B.11.11.04 doesn't allow a typedef as the return value for an +# inline function, only builtin types. +# +AN_IDENTIFIER([inline], [AC_C_INLINE]) +AC_DEFUN([AC_C_INLINE], +[AC_CACHE_CHECK([for inline], ac_cv_c_inline, +[ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + AC_COMPILE_IFELSE([AC_LANG_SOURCE( +[#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif +])], + [ac_cv_c_inline=$ac_kw; break]) +done +]) +AH_VERBATIM([inline], +[/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif]) +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac +])# AC_C_INLINE + + +# AC_C_CONST +# ---------- +AN_IDENTIFIER([const], [AC_C_CONST]) +AC_DEFUN([AC_C_CONST], +[AC_CACHE_CHECK([for an ANSI C-conforming const], ac_cv_c_const, +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], +[[/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } +#endif +]])], + [ac_cv_c_const=yes], + [ac_cv_c_const=no])]) +if test $ac_cv_c_const = no; then + AC_DEFINE(const,, + [Define to empty if `const' does not conform to ANSI C.]) +fi +])# AC_C_CONST + + +# AC_C_RESTRICT +# ------------- +# based on acx_restrict.m4, from the GNU Autoconf Macro Archive at: +# http://www.gnu.org/software/ac-archive/htmldoc/acx_restrict.html +# +# Determine whether the C/C++ compiler supports the "restrict" keyword +# introduced in ANSI C99, or an equivalent. Do nothing if the compiler +# accepts it. Otherwise, if the compiler supports an equivalent, +# define "restrict" to be that. Here are some variants: +# - GCC supports both __restrict and __restrict__ +# - older DEC Alpha C compilers support only __restrict +# - _Restrict is the only spelling accepted by Sun WorkShop 6 update 2 C +# Otherwise, define "restrict" to be empty. +AN_IDENTIFIER([restrict], [AC_C_RESTRICT]) +AC_DEFUN([AC_C_RESTRICT], +[AC_CACHE_CHECK([for C/C++ restrict keyword], ac_cv_c_restrict, + [ac_cv_c_restrict=no + # Try the official restrict keyword, then gcc's __restrict, and + # the less common variants. + for ac_kw in restrict __restrict __restrict__ _Restrict; do + AC_COMPILE_IFELSE([AC_LANG_SOURCE( + [float * $ac_kw x;])], + [ac_cv_c_restrict=$ac_kw; break]) + done + ]) + case $ac_cv_c_restrict in + restrict) ;; + no) AC_DEFINE(restrict,, + [Define to equivalent of C99 restrict keyword, or to nothing if this + is not supported. Do not define if restrict is supported directly.]) ;; + *) AC_DEFINE_UNQUOTED(restrict, $ac_cv_c_restrict) ;; + esac +])# AC_C_RESTRICT + + +# AC_C_VOLATILE +# ------------- +# Note that, unlike const, #defining volatile to be the empty string can +# actually turn a correct program into an incorrect one, since removing +# uses of volatile actually grants the compiler permission to perform +# optimizations that could break the user's code. So, do not #define +# volatile away unless it is really necessary to allow the user's code +# to compile cleanly. Benign compiler failures should be tolerated. +AN_IDENTIFIER([volatile], [AC_C_VOLATILE]) +AC_DEFUN([AC_C_VOLATILE], +[AC_CACHE_CHECK([for working volatile], ac_cv_c_volatile, +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [ +volatile int x; +int * volatile y;])], + [ac_cv_c_volatile=yes], + [ac_cv_c_volatile=no])]) +if test $ac_cv_c_volatile = no; then + AC_DEFINE(volatile,, + [Define to empty if the keyword `volatile' does not work. + Warning: valid code using `volatile' can become incorrect + without. Disable with care.]) +fi +])# AC_C_VOLATILE + + +# AC_C_STRINGIZE +# -------------- +# Checks if `#' can be used to glue strings together at the CPP level. +# Defines HAVE_STRINGIZE if positive. +AC_DEFUN([AC_C_STRINGIZE], +[AC_CACHE_CHECK([for preprocessor stringizing operator], + [ac_cv_c_stringize], +[AC_EGREP_CPP([@%:@teststring], + [@%:@define x(y) #y + +char *s = x(teststring);], + [ac_cv_c_stringize=no], + [ac_cv_c_stringize=yes])]) +if test $ac_cv_c_stringize = yes; then + AC_DEFINE(HAVE_STRINGIZE, 1, + [Define to 1 if cpp supports the ANSI @%:@ stringizing operator.]) +fi +])# AC_C_STRINGIZE + + +# AC_C_PROTOTYPES +# --------------- +# Check if the C compiler supports prototypes, included if it needs +# options. +AC_DEFUN([AC_C_PROTOTYPES], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_MSG_CHECKING([for function prototypes]) +if test "$ac_cv_prog_cc_stdc" != no; then + AC_MSG_RESULT([yes]) + AC_DEFINE(PROTOTYPES, 1, + [Define to 1 if the C compiler supports function prototypes.]) + AC_DEFINE(__PROTOTYPES, 1, + [Define like PROTOTYPES; this can be used by system headers.]) +else + AC_MSG_RESULT([no]) +fi +])# AC_C_PROTOTYPES diff --git a/build/autoconf_prepend-include/autoconf/general.m4 b/build/autoconf_prepend-include/autoconf/general.m4 new file mode 100644 index 0000000000..dd52f9cf4d --- /dev/null +++ b/build/autoconf_prepend-include/autoconf/general.m4 @@ -0,0 +1,2521 @@ +# This file is part of Autoconf. -*- Autoconf -*- +# Parameterized macros. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# As a special exception, the Free Software Foundation gives unlimited +# permission to copy, distribute and modify the configure scripts that +# are the output of Autoconf. You need not follow the terms of the GNU +# General Public License when using or distributing such scripts, even +# though portions of the text of Autoconf appear in them. The GNU +# General Public License (GPL) does govern all other use of the material +# that constitutes the Autoconf program. +# +# Certain portions of the Autoconf source text are designed to be copied +# (in certain cases, depending on the input) into the output of +# Autoconf. We call these the "data" portions. The rest of the Autoconf +# source text consists of comments plus executable code that decides which +# of the data portions to output in any given case. We call these +# comments and executable code the "non-data" portions. Autoconf never +# copies any of the non-data portions into its output. +# +# This special exception to the GPL applies to versions of Autoconf +# released by the Free Software Foundation. When you make and +# distribute a modified version of Autoconf, you may extend this special +# exception to the GPL to apply to your modified version as well, *unless* +# your modified version has the potential to copy into its output some +# of the text that was the non-data portion of the version that you started +# with. (In other words, unless your change moves or copies text from +# the non-data portions to the data portions.) If your modification has +# such potential, you must delete any notice of this special exception +# to the GPL from your modified version. +# +# Written by David MacKenzie, with help from +# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, +# Roland McGrath, Noah Friedman, david d zuhn, and many others. + + +## ---------------- ## +## The diversions. ## +## ---------------- ## + + +# We heavily use m4's diversions both for the initializations and for +# required macros (see AC_REQUIRE), because in both cases we have to +# issue high in `configure' something which is discovered late. +# +# KILL is only used to suppress output. +# +# The layers of `configure'. We let m4 undivert them by itself, when +# it reaches the end of `configure.ac'. +# +# - BINSH +# #! /bin/sh +# - HEADER-REVISION +# Sent by AC_REVISION +# - HEADER-COMMENT +# Purpose of the script. +# - HEADER-COPYRIGHT +# Copyright notice(s) +# - M4SH-INIT +# Initialization of bottom layers. +# +# - DEFAULTS +# early initializations (defaults) +# - PARSE_ARGS +# initialization code, option handling loop. +# +# - HELP_BEGIN +# Handling `configure --help'. +# - HELP_CANON +# Help msg for AC_CANONICAL_* +# - HELP_ENABLE +# Help msg from AC_ARG_ENABLE. +# - HELP_WITH +# Help msg from AC_ARG_WITH. +# - HELP_VAR +# Help msg from AC_ARG_VAR. +# - HELP_VAR_END +# A small paragraph on the use of the variables. +# - HELP_END +# Tail of the handling of --help. +# +# - VERSION_BEGIN +# Head of the handling of --version. +# - VERSION_FSF +# FSF copyright notice for --version. +# - VERSION_USER +# User copyright notice for --version. +# - VERSION_END +# Tail of the handling of --version. +# +# - INIT_PREPARE +# Tail of initialization code. +# +# - BODY +# the tests and output code +# + + +# _m4_divert(DIVERSION-NAME) +# -------------------------- +# Convert a diversion name into its number. Otherwise, return +# DIVERSION-NAME which is supposed to be an actual diversion number. +# Of course it would be nicer to use m4_case here, instead of zillions +# of little macros, but it then takes twice longer to run `autoconf'! +# +# From M4sugar: +# -1. KILL +# 10000. GROW +# +# From M4sh: +# 0. BINSH +# 1. HEADER-REVISION +# 2. HEADER-COMMENT +# 3. HEADER-COPYRIGHT +# 4. M4SH-INIT +# 1000. BODY +m4_define([_m4_divert(DEFAULTS)], 10) +m4_define([_m4_divert(PARSE_ARGS)], 20) + +m4_define([_m4_divert(HELP_BEGIN)], 100) +m4_define([_m4_divert(HELP_CANON)], 101) +m4_define([_m4_divert(HELP_ENABLE)], 102) +m4_define([_m4_divert(HELP_WITH)], 103) +m4_define([_m4_divert(HELP_VAR)], 104) +m4_define([_m4_divert(HELP_VAR_END)], 105) +m4_define([_m4_divert(HELP_END)], 106) + +m4_define([_m4_divert(VERSION_BEGIN)], 200) +m4_define([_m4_divert(VERSION_FSF)], 201) +m4_define([_m4_divert(VERSION_USER)], 202) +m4_define([_m4_divert(VERSION_END)], 203) + +m4_define([_m4_divert(INIT_PREPARE)], 300) + + + +# AC_DIVERT_PUSH(DIVERSION-NAME) +# AC_DIVERT_POP +# ------------------------------ +m4_copy([m4_divert_push],[AC_DIVERT_PUSH]) +m4_copy([m4_divert_pop], [AC_DIVERT_POP]) + + + +## ------------------------------------ ## +## Defining/requiring Autoconf macros. ## +## ------------------------------------ ## + + +# AC_DEFUN(NAME, EXPANSION) +# AC_DEFUN_ONCE(NAME, EXPANSION) +# AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME) +# AC_REQUIRE(STRING) +# AC_PROVIDE(MACRO-NAME) +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +m4_copy([m4_defun], [AC_DEFUN]) +m4_copy([m4_defun_once], [AC_DEFUN_ONCE]) +m4_copy([m4_before], [AC_BEFORE]) +m4_copy([m4_require], [AC_REQUIRE]) +m4_copy([m4_provide], [AC_PROVIDE]) +m4_copy([m4_provide_if], [AC_PROVIDE_IFELSE]) + + +# AC_OBSOLETE(THIS-MACRO-NAME, [SUGGESTION]) +# ------------------------------------------ +m4_define([AC_OBSOLETE], +[AC_DIAGNOSE([obsolete], [$1 is obsolete$2])]) + + + +## ----------------------------- ## +## Implementing Autoconf loops. ## +## ----------------------------- ## + + +# AC_FOREACH(VARIABLE, LIST, EXPRESSION) +# -------------------------------------- +# +# Compute EXPRESSION assigning to VARIABLE each value of the LIST. +# LIST is a /bin/sh list, i.e., it has the form ` item_1 item_2 +# ... item_n ': white spaces are separators, and leading and trailing +# spaces are meaningless. +# +# This macro is robust to active symbols: +# AC_FOREACH([Var], [ active +# b act\ +# ive ], [-Var-])end +# => -active--b--active-end +m4_define([AC_FOREACH], +[m4_foreach([$1], m4_split(m4_normalize([$2])), [$3])]) + + + + +## ----------------------------------- ## +## Helping macros to display strings. ## +## ----------------------------------- ## + + +# AU::AC_HELP_STRING(LHS, RHS, [COLUMN]) +# -------------------------------------- +AU_ALIAS([AC_HELP_STRING], [AS_HELP_STRING]) + + + +## ---------------------------------------------- ## +## Information on the package being Autoconf'ed. ## +## ---------------------------------------------- ## + + +# It is suggested that the macros in this section appear before +# AC_INIT in `configure.ac'. Nevertheless, this is just stylistic, +# and from the implementation point of, AC_INIT *must* be expanded +# beforehand: it puts data in diversions which must appear before the +# data provided by the macros of this section. + +# The solution is to require AC_INIT in each of these macros. AC_INIT +# has the needed magic so that it can't be expanded twice. + + + +# _AC_INIT_PACKAGE(PACKAGE-NAME, VERSION, BUG-REPORT, [TARNAME]) +# -------------------------------------------------------------- +m4_define([_AC_INIT_PACKAGE], +[AS_LITERAL_IF([$1], [], [m4_warn([syntax], [AC_INIT: not a literal: $1])]) +AS_LITERAL_IF([$2], [], [m4_warn([syntax], [AC_INIT: not a literal: $2])]) +AS_LITERAL_IF([$3], [], [m4_warn([syntax], [AC_INIT: not a literal: $3])]) +m4_ifndef([AC_PACKAGE_NAME], + [m4_define([AC_PACKAGE_NAME], [$1])]) +m4_ifndef([AC_PACKAGE_TARNAME], + [m4_define([AC_PACKAGE_TARNAME], + m4_default([$4], + [m4_bpatsubst(m4_tolower(m4_bpatsubst([[[$1]]], + [GNU ])), + [[^_abcdefghijklmnopqrstuvwxyz0123456789]], + [-])]))]) +m4_ifndef([AC_PACKAGE_VERSION], + [m4_define([AC_PACKAGE_VERSION], [$2])]) +m4_ifndef([AC_PACKAGE_STRING], + [m4_define([AC_PACKAGE_STRING], [$1 $2])]) +m4_ifndef([AC_PACKAGE_BUGREPORT], + [m4_define([AC_PACKAGE_BUGREPORT], [$3])]) +]) + + +# AC_COPYRIGHT(TEXT, [VERSION-DIVERSION = VERSION_USER]) +# ------------------------------------------------------ +# Append Copyright information in the top of `configure'. TEXT is +# evaluated once, hence TEXT can use macros. Note that we do not +# prepend `# ' but `@%:@ ', since m4 does not evaluate the comments. +# Had we used `# ', the Copyright sent in the beginning of `configure' +# would have not been evaluated. Another solution, a bit fragile, +# would have be to use m4_quote to force an evaluation: +# +# m4_bpatsubst(m4_quote($1), [^], [# ]) +m4_define([AC_COPYRIGHT], +[m4_divert_text([HEADER-COPYRIGHT], +[m4_bpatsubst([ +$1], [^], [@%:@ ])])dnl +m4_divert_text(m4_default([$2], [VERSION_USER]), +[ +$1])dnl +])# AC_COPYRIGHT + + +# AC_REVISION(REVISION-INFO) +# -------------------------- +# The second quote in the translit is just to cope with font-lock-mode +# which sees the opening of a string. +m4_define([AC_REVISION], +[m4_divert_text([HEADER-REVISION], + [@%:@ From __file__ m4_translit([$1], [$""]).])dnl +]) + + + + +## ---------------------------------------- ## +## Requirements over the Autoconf version. ## +## ---------------------------------------- ## + + +# AU::AC_PREREQ(VERSION) +# ---------------------- +# Update this `AC_PREREQ' statement to require the current version of +# Autoconf. But fail if ever this autoupdate is too old. +# +# Note that `m4_defn([m4_PACKAGE_VERSION])' below are expanded before +# calling `AU_DEFUN', i.e., it is hard coded. Otherwise it would be +# quite complex for autoupdate to import the value of +# `m4_PACKAGE_VERSION'. We could `AU_DEFUN' `m4_PACKAGE_VERSION', but +# this would replace all its occurrences with the current version of +# Autoconf, which is certainly not what the user intended. +AU_DEFUN([AC_PREREQ], +[m4_version_prereq([$1])[]dnl +[AC_PREREQ(]]m4_defn([m4_PACKAGE_VERSION])[[)]]) + + +# AC_PREREQ(VERSION) +# ------------------ +# Complain and exit if the Autoconf version is less than VERSION. +m4_copy([m4_version_prereq], [AC_PREREQ]) + + + + + + +## ---------------- ## +## Initialization. ## +## ---------------- ## + + +# All the following macros are used by AC_INIT. Ideally, they should +# be presented in the order in which they are output. Please, help us +# sorting it, or at least, don't augment the entropy. + + +# _AC_INIT_NOTICE +# --------------- +m4_define([_AC_INIT_NOTICE], +[m4_divert_text([HEADER-COMMENT], +[@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by m4_PACKAGE_STRING[]dnl +m4_ifset([AC_PACKAGE_STRING], [ for AC_PACKAGE_STRING]).]) + +m4_ifset([AC_PACKAGE_BUGREPORT], + [m4_divert_text([HEADER-COMMENT], + [@%:@ +@%:@ Report bugs to .])]) +]) + + +# _AC_INIT_COPYRIGHT +# ------------------ +# We dump to VERSION_FSF to make sure we are inserted before the +# user copyrights, and after the setup of the --version handling. +m4_define([_AC_INIT_COPYRIGHT], +[AC_COPYRIGHT( +[Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it.], + [VERSION_FSF])dnl +]) + + +# File Descriptors +# ---------------- +# Set up the file descriptors used by `configure'. +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# AS_MESSAGE_LOG_FD compiler messages saved in config.log +# AS_MESSAGE_FD checking for... messages and results + +m4_define([AS_MESSAGE_FD], 6) +# That's how they used to be named. +AU_ALIAS([AC_FD_CC], [AS_MESSAGE_LOG_FD]) +AU_ALIAS([AC_FD_MSG], [AS_MESSAGE_FD]) + + +# _AC_INIT_DEFAULTS +# ----------------- +# Values which defaults can be set from `configure.ac'. +# `/bin/machine' is used in `glibcbug'. The others are used in config.* +m4_define([_AC_INIT_DEFAULTS], +[m4_divert_push([DEFAULTS])dnl + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec AS_MESSAGE_FD>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}])dnl +AC_SUBST([PATH_SEPARATOR])dnl + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +AC_SUBST([PACKAGE_NAME], + [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])])dnl +AC_SUBST([PACKAGE_TARNAME], + [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])])dnl +AC_SUBST([PACKAGE_VERSION], + [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])])dnl +AC_SUBST([PACKAGE_STRING], + [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])])dnl +AC_SUBST([PACKAGE_BUGREPORT], + [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])dnl + +m4_divert_pop([DEFAULTS])dnl +m4_wrap([m4_divert_text([DEFAULTS], +[ac_subst_vars='m4_ifdef([_AC_SUBST_VARS], [m4_defn([_AC_SUBST_VARS])])' +ac_subst_files='m4_ifdef([_AC_SUBST_FILES], [m4_defn([_AC_SUBST_FILES])])'])])dnl +])# _AC_INIT_DEFAULTS + + +# AC_PREFIX_DEFAULT(PREFIX) +# ------------------------- +AC_DEFUN([AC_PREFIX_DEFAULT], +[m4_divert_text([DEFAULTS], [ac_default_prefix=$1])]) + + +# AC_PREFIX_PROGRAM(PROGRAM) +# -------------------------- +# Guess the value for the `prefix' variable by looking for +# the argument program along PATH and taking its parent. +# Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc, +# set `prefix' to /usr/local/gnu. +# This comes too late to find a site file based on the prefix, +# and it might use a cached value for the path. +# No big loss, I think, since most configures don't use this macro anyway. +AC_DEFUN([AC_PREFIX_PROGRAM], +[if test "x$prefix" = xNONE; then +dnl We reimplement AC_MSG_CHECKING (mostly) to avoid the ... in the middle. + _AS_ECHO_N([checking for prefix by ]) + AC_PATH_PROG(ac_prefix_program, [$1]) + if test -n "$ac_prefix_program"; then + prefix=`AS_DIRNAME(["$ac_prefix_program"])` + prefix=`AS_DIRNAME(["$prefix"])` + fi +fi +])# AC_PREFIX_PROGRAM + + +# AC_CONFIG_SRCDIR([UNIQUE-FILE-IN-SOURCE-DIR]) +# --------------------------------------------- +# UNIQUE-FILE-IN-SOURCE-DIR is a filename unique to this package, +# relative to the directory that configure is in, which we can look +# for to find out if srcdir is correct. +AC_DEFUN([AC_CONFIG_SRCDIR], +[m4_divert_text([DEFAULTS], [ac_unique_file="$1"])]) + + +# _AC_INIT_SRCDIR +# --------------- +# Compute `srcdir' based on `$ac_unique_file'. +m4_define([_AC_INIT_SRCDIR], +[m4_divert_push([PARSE_ARGS])dnl + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`AS_DIRNAME(["$[0]"])` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + AC_MSG_ERROR([cannot find sources ($ac_unique_file) in $ac_confdir or ..]) + else + AC_MSG_ERROR([cannot find sources ($ac_unique_file) in $srcdir]) + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + AC_MSG_ERROR([sources are in $srcdir, but `cd $srcdir' does not work]) +dnl Double slashes in pathnames in object file debugging info +dnl mess up M-x gdb in Emacs. +srcdir=`echo "$srcdir" | sed 's%\([[^\\/]]\)[[\\/]]*$%\1%'` +m4_divert_pop([PARSE_ARGS])dnl +])# _AC_INIT_SRCDIR + + +# _AC_INIT_PARSE_ARGS +# ------------------- +m4_define([_AC_INIT_PARSE_ARGS], +[m4_divert_push([PARSE_ARGS])dnl + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +AC_SUBST(exec_prefix, NONE)dnl +no_create= +no_recursion= +AC_SUBST(prefix, NONE)dnl +program_prefix=NONE +program_suffix=NONE +AC_SUBST(program_transform_name, [s,x,x,])dnl +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +AC_SUBST([bindir], ['${exec_prefix}/bin'])dnl +AC_SUBST([sbindir], ['${exec_prefix}/sbin'])dnl +AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])dnl +AC_SUBST([datadir], ['${prefix}/share'])dnl +AC_SUBST([sysconfdir], ['${prefix}/etc'])dnl +AC_SUBST([sharedstatedir], ['${prefix}/com'])dnl +AC_SUBST([localstatedir], ['${prefix}/var'])dnl +AC_SUBST([libdir], ['${exec_prefix}/lib'])dnl +AC_SUBST([includedir], ['${prefix}/include'])dnl +AC_SUBST([oldincludedir], ['/usr/include'])dnl +AC_SUBST([infodir], ['${prefix}/info'])dnl +AC_SUBST([mandir], ['${prefix}/man'])dnl + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[[^=]]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : "[.*[^-_$as_cr_alnum]]" >/dev/null && + AC_MSG_ERROR([invalid feature name: $ac_feature]) + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([[^=]]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : "[.*[^-_$as_cr_alnum]]" >/dev/null && + AC_MSG_ERROR([invalid feature name: $ac_feature]) + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([[^=]]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : "[.*[^-_$as_cr_alnum]]" >/dev/null && + AC_MSG_ERROR([invalid package name: $ac_package]) + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : "[.*[^-_$as_cr_alnum]]" >/dev/null && + AC_MSG_ERROR([invalid package name: $ac_package]) + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) AC_MSG_ERROR([unrecognized option: $ac_option +Try `$[0] --help' for more information.]) + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([[^=]]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : "[.*[^_$as_cr_alnum]]" >/dev/null && + AC_MSG_ERROR([invalid variable name: $ac_envvar]) + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + AC_MSG_WARN([you should use --build, --host, --target]) + expr "x$ac_option" : "[.*[^-._$as_cr_alnum]]" >/dev/null && + AC_MSG_WARN([invalid host type: $ac_option]) + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + AC_MSG_ERROR([missing argument to $ac_option]) +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [[\\/$]]* | ?:[[\\/]]* | NONE | '' ) ;; + *) AC_MSG_ERROR([expected an absolute directory name for --$ac_var: $ac_val]);; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [[\\/$]]* | ?:[[\\/]]* ) ;; + *) AC_MSG_ERROR([expected an absolute directory name for --$ac_var: $ac_val]);; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + AC_MSG_WARN([If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used.]) + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec AS_MESSAGE_FD>/dev/null + +m4_divert_pop([PARSE_ARGS])dnl +])# _AC_INIT_PARSE_ARGS + + +# _AC_INIT_HELP +# ------------- +# Handle the `configure --help' message. +m4_define([_AC_INIT_HELP], +[m4_divert_push([HELP_BEGIN])dnl + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures m4_ifset([AC_PACKAGE_STRING], + [AC_PACKAGE_STRING], + [this package]) to adapt to many kinds of systems. + +Usage: $[0] [[OPTION]]... [[VAR=VALUE]]... + +[To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF] +m4_divert_pop([HELP_BEGIN])dnl +dnl The order of the diversions here is +dnl - HELP_BEGIN +dnl which may be extended by extra generic options such as with X or +dnl AC_ARG_PROGRAM. Displayed only in long --help. +dnl +dnl - HELP_CANON +dnl Support for cross compilation (--build, --host and --target). +dnl Display only in long --help. +dnl +dnl - HELP_ENABLE +dnl which starts with the trailer of the HELP_BEGIN, HELP_CANON section, +dnl then implements the header of the non generic options. +dnl +dnl - HELP_WITH +dnl +dnl - HELP_VAR +dnl +dnl - HELP_VAR_END +dnl +dnl - HELP_END +dnl initialized below, in which we dump the trailer (handling of the +dnl recursion for instance). +m4_divert_push([HELP_ENABLE])dnl +_ACEOF +fi + +if test -n "$ac_init_help"; then +m4_ifset([AC_PACKAGE_STRING], +[ case $ac_init_help in + short | recursive ) echo "Configuration of AC_PACKAGE_STRING:";; + esac]) + cat <<\_ACEOF +m4_divert_pop([HELP_ENABLE])dnl +m4_divert_push([HELP_END])dnl +m4_ifset([AC_PACKAGE_BUGREPORT], [ +Report bugs to .]) +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + _AC_SRCPATHS(["$ac_dir"]) + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + AC_MSG_WARN([no configuration information is in $ac_dir]) + fi + cd "$ac_popdir" + done +fi + +test -n "$ac_init_help" && exit 0 +m4_divert_pop([HELP_END])dnl +])# _AC_INIT_HELP + + +# _AC_INIT_VERSION +# ---------------- +# Handle the `configure --version' message. +m4_define([_AC_INIT_VERSION], +[m4_divert_text([VERSION_BEGIN], +[if $ac_init_version; then + cat <<\_ACEOF])dnl +m4_ifset([AC_PACKAGE_STRING], + [m4_divert_text([VERSION_BEGIN], + [dnl +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])configure[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +generated by m4_PACKAGE_STRING])]) +m4_divert_text([VERSION_END], +[_ACEOF + exit 0 +fi])dnl +])# _AC_INIT_VERSION + + +# _AC_INIT_CONFIG_LOG +# ------------------- +# Initialize the config.log file descriptor and write header to it. +m4_define([_AC_INIT_CONFIG_LOG], +[m4_divert_text([INIT_PREPARE], +[m4_define([AS_MESSAGE_LOG_FD], 5)dnl +exec AS_MESSAGE_LOG_FD>config.log +cat >&AS_MESSAGE_LOG_FD <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])dnl +$as_me[]m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]), which was +generated by m4_PACKAGE_STRING. Invocation command line was + + $ $[0] $[@] + +_ACEOF +AS_UNAME >&AS_MESSAGE_LOG_FD + +cat >&AS_MESSAGE_LOG_FD <<_ACEOF + + +m4_text_box([Core tests.]) + +_ACEOF +])])# _AC_INIT_CONFIG_LOG + + +# _AC_INIT_PREPARE +# ---------------- +# Called by AC_INIT to build the preamble of the `configure' scripts. +# 1. Trap and clean up various tmp files. +# 2. Set up the fd and output files +# 3. Remember the options given to `configure' for `config.status --recheck'. +# 4. Ensure a correct environment +# 5. Required macros (cache, default AC_SUBST etc.) +m4_define([_AC_INIT_PREPARE], +[m4_divert_push([INIT_PREPARE])dnl + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; +dnl If you change this globbing pattern, test it on an old shell -- +dnl it's sensitive. Putting any kind of quote in it causes syntax errors. + [ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)] + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" +dnl If trying to remove duplicates, be sure to (i) keep the *last* +dnl value (e.g. --prefix=1 --prefix=2 --prefix=1 might keep 2 only), +dnl and (ii) not to strip long options (--prefix foo --prefix bar might +dnl give --prefix foo bar). + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in +dnl Use broad patterns, as arguments that would have already made configure +dnl exit don't matter. + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +AS_UNSET(ac_configure_args0) +AS_UNSET(ac_configure_args1) + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + AS_BOX([Cache variables.]) + echo + m4_bpatsubsts(m4_defn([_AC_CACHE_DUMP]), + [^ *\(#.*\)? +], [], + ['], ['"'"']) + echo + + AS_BOX([Output variables.]) + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + AS_BOX([Output files.]) + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + AS_BOX([confdefs.h.]) + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&AS_MESSAGE_LOG_FD + rm -f core *.core && + rm -rf conftest* confdefs* conf$[$]* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; AS_EXIT([1])' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. +AC_DEFINE_UNQUOTED([PACKAGE_NAME], ["$PACKAGE_NAME"], + [Define to the full name of this package.]) +AC_DEFINE_UNQUOTED([PACKAGE_TARNAME], ["$PACKAGE_TARNAME"], + [Define to the one symbol short name of this package.]) +AC_DEFINE_UNQUOTED([PACKAGE_VERSION], ["$PACKAGE_VERSION"], + [Define to the version of this package.]) +AC_DEFINE_UNQUOTED([PACKAGE_STRING], ["$PACKAGE_STRING"], + [Define to the full name and version of this package.]) +AC_DEFINE_UNQUOTED([PACKAGE_BUGREPORT], ["$PACKAGE_BUGREPORT"], + [Define to the address where bug reports for this package + should be sent.]) + +# Let the site file select an alternate cache file if it wants to. +AC_SITE_LOAD +AC_CACHE_LOAD +_AC_ARG_VAR_VALIDATE +_AC_ARG_VAR_PRECIOUS([build_alias])dnl +_AC_ARG_VAR_PRECIOUS([host_alias])dnl +_AC_ARG_VAR_PRECIOUS([target_alias])dnl +AC_LANG_PUSH(C) + +dnl Substitute for predefined variables. +AC_SUBST([DEFS])dnl +AC_SUBST([ECHO_C])dnl +AC_SUBST([ECHO_N])dnl +AC_SUBST([ECHO_T])dnl +AC_SUBST([LIBS])dnl +m4_divert_pop([INIT_PREPARE])dnl +])# _AC_INIT_PREPARE + + +# AU::AC_INIT([UNIQUE-FILE-IN-SOURCE-DIR]) +# ---------------------------------------- +# This macro is used only for Autoupdate. +AU_DEFUN([AC_INIT], +[m4_ifval([$2], [[AC_INIT($@)]], + [m4_ifval([$1], +[[AC_INIT] +AC_CONFIG_SRCDIR([$1])], [[AC_INIT]])])[]dnl +]) + + +# AC_INIT([PACKAGE, VERSION, [BUG-REPORT]) +# ---------------------------------------- +# Include the user macro files, prepare the diversions, and output the +# preamble of the `configure' script. +# Note that the order is important: first initialize, then set the +# AC_CONFIG_SRCDIR. +m4_define([AC_INIT], +[# Forbidden tokens and exceptions. +m4_pattern_forbid([^_?A[CHUM]_]) +m4_pattern_forbid([_AC_]) +m4_pattern_forbid([^LIBOBJS$], + [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +# Actually reserved by M4sh. +m4_pattern_allow([^AS_FLAGS$]) +AS_INIT +AS_PREPARE +m4_ifval([$2], [_AC_INIT_PACKAGE($@)]) +_AC_INIT_DEFAULTS +_AC_INIT_PARSE_ARGS +_AC_INIT_SRCDIR +_AC_INIT_HELP +_AC_INIT_VERSION +_AC_INIT_CONFIG_LOG +_AC_INIT_PREPARE +_AC_INIT_NOTICE +_AC_INIT_COPYRIGHT +m4_ifval([$2], , [m4_ifval([$1], [AC_CONFIG_SRCDIR([$1])])])dnl +]) + + + + +## ----------------------------- ## +## Selecting optional features. ## +## ----------------------------- ## + + +# AC_ARG_ENABLE(FEATURE, HELP-STRING, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# ------------------------------------------------------------------------ +AC_DEFUN([AC_ARG_ENABLE], +[m4_divert_once([HELP_ENABLE], [[ +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes]]])dnl +m4_divert_once([HELP_ENABLE], [$2])dnl +# Check whether --enable-$1 or --disable-$1 was given. +if test "[${enable_]m4_bpatsubst([$1], -, _)+set}" = set; then + enableval="[$enable_]m4_bpatsubst([$1], -, _)" + $3 +m4_ifvaln([$4], [else + $4])dnl +fi; dnl +])# AC_ARG_ENABLE + + +AU_DEFUN([AC_ENABLE], +[AC_ARG_ENABLE([$1], [ --enable-$1], [$2], [$3])]) + + +## ------------------------------ ## +## Working with optional software ## +## ------------------------------ ## + + + +# AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, [ACTION-IF-FALSE]) +# -------------------------------------------------------------------- +AC_DEFUN([AC_ARG_WITH], +[m4_divert_once([HELP_WITH], [[ +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)]]) +m4_divert_once([HELP_WITH], [$2])dnl +# Check whether --with-$1 or --without-$1 was given. +if test "[${with_]m4_bpatsubst([$1], -, _)+set}" = set; then + withval="[$with_]m4_bpatsubst([$1], -, _)" + $3 +m4_ifvaln([$4], [else + $4])dnl +fi; dnl +])# AC_ARG_WITH + +AU_DEFUN([AC_WITH], +[AC_ARG_WITH([$1], [ --with-$1], [$2], [$3])]) + + + +## ----------------------------------------- ## +## Remembering variables for reconfiguring. ## +## ----------------------------------------- ## + + +# _AC_ARG_VAR_PRECIOUS(VARNAME) +# ----------------------------- +# Declare VARNAME is precious. +# +# We try to diagnose when precious variables have changed. To do this, +# make two early snapshots (after the option processing to take +# explicit variables into account) of those variables: one (ac_env_) +# which represents the current run, and a second (ac_cv_env_) which, +# at the first run, will be saved in the cache. As an exception to +# the cache mechanism, its loading will override these variables (non +# `ac_cv_env_' cache value are only set when unset). +# +# In subsequent runs, after having loaded the cache, compare +# ac_cv_env_foo against ac_env_foo. See _AC_ARG_VAR_VALIDATE. +m4_define([_AC_ARG_VAR_PRECIOUS], +[AC_SUBST([$1])dnl +m4_divert_once([PARSE_ARGS], +[ac_env_$1_set=${$1+set} +ac_env_$1_value=$$1 +ac_cv_env_$1_set=${$1+set} +ac_cv_env_$1_value=$$1])dnl +]) + + +# _AC_ARG_VAR_VALIDATE +# -------------------- +# The precious variables are saved twice at the beginning of +# configure. E.g., PRECIOUS is saved as `ac_env_PRECIOUS_SET' and +# `ac_env_PRECIOUS_VALUE' on the one hand and `ac_cv_env_PRECIOUS_SET' +# and `ac_cv_env_PRECIOUS_VALUE' on the other hand. +# +# Now the cache has just been loaded, so `ac_cv_env_' represents the +# content of the cached values, while `ac_env_' represents that of the +# current values. +# +# So we check that `ac_env_' and `ac_cv_env_' are consistent. If +# they aren't, die. +m4_define([_AC_ARG_VAR_VALIDATE], +[# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([[a-zA-Z_0-9]]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + AS_MESSAGE([error: `$ac_var' was set to `$ac_old_val' in the previous run], 2) + ac_cache_corrupted=: ;; + ,set) + AS_MESSAGE([error: `$ac_var' was not set in the previous run], 2) + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + AS_MESSAGE([error: `$ac_var' has changed since the previous run:], 2) + AS_MESSAGE([ former value: $ac_old_val], 2) + AS_MESSAGE([ current value: $ac_new_val], 2) + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in +dnl If you change this globbing pattern, test it on an old shell -- +dnl it's sensitive. Putting any kind of quote in it causes syntax errors. +[ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)] + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + AS_MESSAGE([error: changes in the environment can compromise the build], 2) + AS_ERROR([run `make distclean' and/or `rm $cache_file' and start over]) +fi +])# _AC_ARG_VAR_VALIDATE + + +# AC_ARG_VAR(VARNAME, DOCUMENTATION) +# ---------------------------------- +# Register VARNAME as a precious variable, and document it in +# `configure --help' (but only once). +AC_DEFUN([AC_ARG_VAR], +[m4_divert_once([HELP_VAR], [[ +Some influential environment variables:]])dnl +m4_divert_once([HELP_VAR_END], [[ +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations.]])dnl +m4_expand_once([m4_divert_once([HELP_VAR], + [AS_HELP_STRING([$1], [$2], [ ])])], + [$0($1)])dnl +_AC_ARG_VAR_PRECIOUS([$1])dnl +])# AC_ARG_VAR + + + + + +## ---------------------------- ## +## Transforming program names. ## +## ---------------------------- ## + + +# AC_ARG_PROGRAM +# -------------- +# This macro is expanded only once, to avoid that `foo' ends up being +# installed as `ggfoo'. +AC_DEFUN_ONCE([AC_ARG_PROGRAM], +[dnl Document the options. +m4_divert_push([HELP_BEGIN])dnl + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +m4_divert_pop([HELP_BEGIN])dnl +test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +[s/[\\$]/&&/g;s/;s,x,x,$//] +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed +])# AC_ARG_PROGRAM + + + + + +## ------------------------- ## +## Finding auxiliary files. ## +## ------------------------- ## + + +# AC_CONFIG_AUX_DIR(DIR) +# ---------------------- +# Find install-sh, config.sub, config.guess, and Cygnus configure +# in directory DIR. These are auxiliary files used in configuration. +# DIR can be either absolute or relative to $srcdir. +AC_DEFUN([AC_CONFIG_AUX_DIR], +[AC_CONFIG_AUX_DIRS($1 $srcdir/$1)]) + + +# AC_CONFIG_AUX_DIR_DEFAULT +# ------------------------- +# The default is `$srcdir' or `$srcdir/..' or `$srcdir/../..'. +# There's no need to call this macro explicitly; just AC_REQUIRE it. +AC_DEFUN([AC_CONFIG_AUX_DIR_DEFAULT], +[AC_CONFIG_AUX_DIRS($srcdir $srcdir/.. $srcdir/../..)]) + + +# AC_CONFIG_AUX_DIRS(DIR ...) +# --------------------------- +# Internal subroutine. +# Search for the configuration auxiliary files in directory list $1. +# We look only for install-sh, so users of AC_PROG_INSTALL +# do not automatically need to distribute the other auxiliary files. +AC_DEFUN([AC_CONFIG_AUX_DIRS], +[ac_aux_dir= +for ac_dir in $1; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + AC_MSG_ERROR([cannot find install-sh or install.sh in $1]) +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. +AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +])# AC_CONFIG_AUX_DIRS + + + + +## ------------------------ ## +## Finding aclocal macros. ## +## ------------------------ ## + + +# AC_CONFIG_MACRO_DIR(DIR) +# ------------------------ +# Declare directory containing additional macros for aclocal. +# DIR can be either absolute or relative to $srcdir. +AC_DEFUN([AC_CONFIG_MACRO_DIR], +[case $1 in + [[\\/]]* | ?:[[\\/]]* ) ac_macro_dir=$1 ;; + *) ac_macro_dir=$srcdir/$1 ;; +esac +if test -d "$ac_macro_dir"; then : +else + AC_MSG_ERROR([cannot find macro directory `$1']) +fi +])# AC_CONFIG_MACRO_DIR + + + + +## ----------------------------------- ## +## Getting the canonical system type. ## +## ----------------------------------- ## + +# The inputs are: +# configure --host=HOST --target=TARGET --build=BUILD +# +# The rules are: +# 1. Build defaults to the current platform, as determined by config.guess. +# 2. Host defaults to build. +# 3. Target defaults to host. + + +# _AC_CANONICAL_SPLIT(THING) +# -------------------------- +# Generate the variables THING, THING_{alias cpu vendor os}. +m4_define([_AC_CANONICAL_SPLIT], +[AC_SUBST([$1], [$ac_cv_$1])dnl +dnl FIXME: AC_SUBST([$1_alias], [$ac_cv_$1_alias])dnl +AC_SUBST([$1_cpu], + [`echo $ac_cv_$1 | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\1/'`])dnl +AC_SUBST([$1_vendor], + [`echo $ac_cv_$1 | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\2/'`])dnl +AC_SUBST([$1_os], + [`echo $ac_cv_$1 | sed 's/^\([[^-]]*\)-\([[^-]]*\)-\(.*\)$/\3/'`])dnl +])# _AC_CANONICAL_SPLIT + + +# AC_CANONICAL_BUILD +# ------------------ +AC_DEFUN_ONCE([AC_CANONICAL_BUILD], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +m4_divert_text([HELP_CANON], +[[ +System types: + --build=BUILD configure for building on BUILD [guessed]]])dnl +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + AC_MSG_ERROR([cannot run $ac_config_sub]) + +AC_CACHE_CHECK([build system type], [ac_cv_build], +[ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + AC_MSG_ERROR([cannot guess build type; you must specify one]) +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + AC_MSG_ERROR([$ac_config_sub $ac_cv_build_alias failed]) +]) +_AC_CANONICAL_SPLIT(build) +])# AC_CANONICAL_BUILD + + +# AC_CANONICAL_HOST +# ----------------- +AC_DEFUN_ONCE([AC_CANONICAL_HOST], +[AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_divert_text([HELP_CANON], +[[ --host=HOST cross-compile to build programs to run on HOST [BUILD]]])dnl +AC_CACHE_CHECK([host system type], [ac_cv_host], +[ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + AC_MSG_ERROR([$ac_config_sub $ac_cv_host_alias failed]) +]) +_AC_CANONICAL_SPLIT([host]) +])# AC_CANONICAL_HOST + + +# AC_CANONICAL_TARGET +# ------------------- +AC_DEFUN_ONCE([AC_CANONICAL_TARGET], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_BEFORE([$0], [AC_ARG_PROGRAM])dnl +m4_divert_text([HELP_CANON], +[[ --target=TARGET configure for building compilers for TARGET [HOST]]])dnl +AC_CACHE_CHECK([target system type], [ac_cv_target], +[dnl Set target_alias. +ac_cv_target_alias=$target_alias +test "x$ac_cv_target_alias" = "x" && + ac_cv_target_alias=$ac_cv_host_alias +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || + AC_MSG_ERROR([$ac_config_sub $ac_cv_target_alias failed]) +]) +_AC_CANONICAL_SPLIT([target]) + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}-[]dnl +])# AC_CANONICAL_TARGET + + +AU_ALIAS([AC_CANONICAL_SYSTEM], [AC_CANONICAL_TARGET]) + + +# AU::AC_VALIDATE_CACHED_SYSTEM_TUPLE([CMD]) +# ------------------------------------------ +# If the cache file is inconsistent with the current host, +# target and build system types, execute CMD or print a default +# error message. Now handled via _AC_ARG_VAR_PRECIOUS. +AU_DEFUN([AC_VALIDATE_CACHED_SYSTEM_TUPLE], []) + + +## ---------------------- ## +## Caching test results. ## +## ---------------------- ## + + +# AC_SITE_LOAD +# ------------ +# Look for site or system specific initialization scripts. +m4_define([AC_SITE_LOAD], +[# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + AC_MSG_NOTICE([loading site script $ac_site_file]) + sed 's/^/| /' "$ac_site_file" >&AS_MESSAGE_LOG_FD + . "$ac_site_file" + fi +done +]) + + +# AC_CACHE_LOAD +# ------------- +m4_define([AC_CACHE_LOAD], +[if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + AC_MSG_NOTICE([loading cache $cache_file]) + case $cache_file in + [[\\/]]* | ?:[[\\/]]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + AC_MSG_NOTICE([creating cache $cache_file]) + >$cache_file +fi +])# AC_CACHE_LOAD + + +# _AC_CACHE_DUMP +# -------------- +# Dump the cache to stdout. It can be in a pipe (this is a requirement). +m4_define([_AC_CACHE_DUMP], +[# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + ["s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"] + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + ["s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"] + ;; + esac; +}dnl +])# _AC_CACHE_DUMP + + +# AC_CACHE_SAVE +# ------------- +# Save the cache. +# Allow a site initialization script to override cache values. +m4_define([AC_CACHE_SAVE], +[cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +_AC_CACHE_DUMP() | + sed [' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end'] >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache[]dnl +])# AC_CACHE_SAVE + + +# AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT) +# ------------------------------------------ +# The name of shell var CACHE-ID must contain `_cv_' in order to get saved. +# Should be dnl'ed. Try to catch common mistakes. +m4_defun([AC_CACHE_VAL], +[m4_bmatch([$2], [AC_DEFINE], + [AC_DIAGNOSE(syntax, +[$0($1, ...): suspicious presence of an AC_DEFINE in the second argument, ]dnl +[where no actions should be taken])])dnl +AS_VAR_SET_IF([$1], + [_AS_ECHO_N([(cached) ])], + [$2])]) + + +# AC_CACHE_CHECK(MESSAGE, CACHE-ID, COMMANDS) +# ------------------------------------------- +# Do not call this macro with a dnl right behind. +m4_defun([AC_CACHE_CHECK], +[AC_MSG_CHECKING([$1]) +AC_CACHE_VAL([$2], [$3])dnl +AC_MSG_RESULT_UNQUOTED([AS_VAR_GET([$2])])]) + + + +## ---------------------- ## +## Defining CPP symbols. ## +## ---------------------- ## + + +# AC_DEFINE_TRACE_LITERAL(LITERAL-CPP-SYMBOL) +# ------------------------------------------- +# This macro is useless, it is used only with --trace to collect the +# list of *literals* CPP values passed to AC_DEFINE/AC_DEFINE_UNQUOTED. +m4_define([AC_DEFINE_TRACE_LITERAL]) + + +# AC_DEFINE_TRACE(CPP-SYMBOL) +# --------------------------- +# This macro is a wrapper around AC_DEFINE_TRACE_LITERAL which filters +# out non literal symbols. +m4_define([AC_DEFINE_TRACE], +[AS_LITERAL_IF([$1], [AC_DEFINE_TRACE_LITERAL([$1])])]) + + +# AC_DEFINE(VARIABLE, [VALUE], [DESCRIPTION]) +# ------------------------------------------- +# Set VARIABLE to VALUE, verbatim, or 1. Remember the value +# and if VARIABLE is affected the same VALUE, do nothing, else +# die. The third argument is used by autoheader. +m4_define([AC_DEFINE], +[AC_DEFINE_TRACE([$1])dnl +m4_ifval([$3], [AH_TEMPLATE([$1], [$3])])dnl +cat >>confdefs.h <<\_ACEOF +[@%:@define] $1 m4_if($#, 2, [$2], $#, 3, [$2], 1) +_ACEOF +]) + + +# AC_DEFINE_UNQUOTED(VARIABLE, [VALUE], [DESCRIPTION]) +# ---------------------------------------------------- +# Similar, but perform shell substitutions $ ` \ once on VALUE. +m4_define([AC_DEFINE_UNQUOTED], +[AC_DEFINE_TRACE([$1])dnl +m4_ifval([$3], [AH_TEMPLATE([$1], [$3])])dnl +cat >>confdefs.h <<_ACEOF +[@%:@define] $1 m4_if($#, 2, [$2], $#, 3, [$2], 1) +_ACEOF +]) + + + +## -------------------------- ## +## Setting output variables. ## +## -------------------------- ## + + +# AC_SUBST(VARIABLE, [VALUE]) +# --------------------------- +# Create an output variable from a shell VARIABLE. If VALUE is given +# assign it to VARIABLE. Use `""' is you want to set VARIABLE to an +# empty value, not an empty second argument. +# +# Beware that if you change this macro, you also have to change the +# sed script at the top of _AC_OUTPUT_FILES. +m4_define([AC_SUBST], +[m4_ifvaln([$2], [$1=$2])[]dnl +m4_append_uniq([_AC_SUBST_VARS], [$1], [ ])dnl +])# AC_SUBST + + +# AC_SUBST_FILE(VARIABLE) +# ----------------------- +# Read the comments of the preceding macro. +m4_define([AC_SUBST_FILE], +[m4_append_uniq([_AC_SUBST_FILES], [$1], [ ])]) + + + +## --------------------------------------- ## +## Printing messages at autoconf runtime. ## +## --------------------------------------- ## + +# In fact, I think we should promote the use of m4_warn and m4_fatal +# directly. This will also avoid to some people to get it wrong +# between AC_FATAL and AC_MSG_ERROR. + + +# AC_DIAGNOSE(CATEGORY, MESSAGE) +# AC_FATAL(MESSAGE, [EXIT-STATUS]) +# -------------------------------- +m4_define([AC_DIAGNOSE], [m4_warn($@)]) +m4_define([AC_FATAL], [m4_fatal($@)]) + + +# AC_WARNING(MESSAGE) +# ------------------- +# Report a MESSAGE to the user of autoconf if `-W' or `-W all' was +# specified. +m4_define([AC_WARNING], +[AC_DIAGNOSE([syntax], [$1])]) + + + + +## ---------------------------------------- ## +## Printing messages at configure runtime. ## +## ---------------------------------------- ## + + +# AC_MSG_CHECKING(FEATURE) +# ------------------------ +m4_define([AC_MSG_CHECKING], +[_AS_ECHO([$as_me:$LINENO: checking $1], AS_MESSAGE_LOG_FD) +_AS_ECHO_N([checking $1... ])[]dnl +]) + + +# AC_MSG_RESULT(RESULT) +# --------------------- +m4_define([AC_MSG_RESULT], +[_AS_ECHO([$as_me:$LINENO: result: $1], AS_MESSAGE_LOG_FD) +_AS_ECHO([${ECHO_T}$1])[]dnl +]) + + +# AC_MSG_RESULT_UNQUOTED(RESULT) +# ------------------------------ +# Likewise, but perform $ ` \ shell substitutions. +m4_define([AC_MSG_RESULT_UNQUOTED], +[_AS_ECHO_UNQUOTED([$as_me:$LINENO: result: $1], AS_MESSAGE_LOG_FD) +_AS_ECHO_UNQUOTED([${ECHO_T}$1])[]dnl +]) + + +# AC_MSG_WARN(PROBLEM) +# AC_MSG_NOTICE(STRING) +# AC_MSG_ERROR(ERROR, [EXIT-STATUS = 1]) +# AC_MSG_FAILURE(ERROR, [EXIT-STATUS = 1]) +# ---------------------------------------- +m4_copy([AS_WARN], [AC_MSG_WARN]) +m4_copy([AS_MESSAGE], [AC_MSG_NOTICE]) +m4_copy([AS_ERROR], [AC_MSG_ERROR]) +m4_define([AC_MSG_FAILURE], +[AC_MSG_ERROR([$1 +See `config.log' for more details.], [$2])]) + + +# _AC_MSG_LOG_CONFTEST +# -------------------- +m4_define([_AC_MSG_LOG_CONFTEST], +[echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD +sed 's/^/| /' conftest.$ac_ext >&AS_MESSAGE_LOG_FD +]) + + +# AU::AC_CHECKING(FEATURE) +# ------------------------ +AU_DEFUN([AC_CHECKING], +[AS_MESSAGE([checking $1...])]) + + +# AU::AC_VERBOSE(STRING) +# ---------------------- +AU_ALIAS([AC_VERBOSE], [AC_MSG_RESULT]) + + + + + + +## ---------------------------- ## +## Compiler-running mechanics. ## +## ---------------------------- ## + + +# _AC_RUN_LOG(COMMAND, LOG-COMMANDS) +# ---------------------------------- +# Eval COMMAND, save the exit status in ac_status, and log it. +AC_DEFUN([_AC_RUN_LOG], +[{ ($2) >&AS_MESSAGE_LOG_FD + ($1) 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + + +# _AC_RUN_LOG_STDERR(COMMAND, LOG-COMMANDS) +# ----------------------------------------- +# Run COMMAND, save its stderr into conftest.err, save the exit status +# in ac_status, and log it. Don't forget to clean up conftest.err after +# use. +# Note that when tracing, most shells will leave the traces in stderr +# starting with "+": that's what this macro tries to address. +AC_DEFUN([_AC_RUN_LOG_STDERR], +[{ ($2) >&AS_MESSAGE_LOG_FD + ($1) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + + +# _AC_EVAL(COMMAND) +# ----------------- +# Eval COMMAND, save the exit status in ac_status, and log it. +AC_DEFUN([_AC_EVAL], +[_AC_RUN_LOG([eval $1], + [eval echo "$as_me:$LINENO: \"$1\""])]) + + +# _AC_EVAL_STDERR(COMMAND) +# ------------------------ +# Same as _AC_RUN_LOG_STDERR, but evals (instead of the running) the +# COMMAND. +AC_DEFUN([_AC_EVAL_STDERR], +[_AC_RUN_LOG_STDERR([eval $1], + [eval echo "$as_me:$LINENO: \"$1\""])]) + + +# AC_TRY_EVAL(VARIABLE) +# --------------------- +# The purpose of this macro is to "configure:123: command line" +# written into config.log for every test run. +AC_DEFUN([AC_TRY_EVAL], +[_AC_EVAL([$$1])]) + + +# AC_TRY_COMMAND(COMMAND) +# ----------------------- +AC_DEFUN([AC_TRY_COMMAND], +[{ ac_try='$1' + _AC_EVAL([$ac_try]); }]) + + +# AC_RUN_LOG(COMMAND) +# ------------------- +AC_DEFUN([AC_RUN_LOG], +[_AC_RUN_LOG([$1], + [echo "$as_me:$LINENO: AS_ESCAPE([$1])"])]) + + + + +## ------------------------ ## +## Examining declarations. ## +## ------------------------ ## + + + +# _AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# ---------------------------------------------------------------- +# Try to preprocess PROGRAM. +# +# This macro can be used during the selection of a preprocessor. +# Run cpp and set ac_cpp_err to "yes" for an error, to +# "$ac_(c,cxx)_preproc_warn_flag" if there are warnings or to "" if +# neither warnings nor errors have been detected. eval is necessary +# to expand ac_cpp. +AC_DEFUN([_AC_PREPROC_IFELSE], +[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl +if _AC_EVAL_STDERR([$ac_cpp conftest.$ac_ext]) >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_[]_AC_LANG_ABBREV[]_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + m4_default([$2], :) +else + _AC_MSG_LOG_CONFTEST + $3 +fi +rm -f conftest.err m4_ifval([$1], [conftest.$ac_ext])[]dnl +])# _AC_PREPROC_IFELSE + + +# AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# --------------------------------------------------------------- +# Try to preprocess PROGRAM. Requires that the preprocessor for the +# current language was checked for, hence do not use this macro in macros +# looking for a preprocessor. +AC_DEFUN([AC_PREPROC_IFELSE], +[AC_LANG_PREPROC_REQUIRE()dnl +_AC_PREPROC_IFELSE($@)]) + + +# AC_TRY_CPP(INCLUDES, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# --------------------------------------------------------- +# AC_TRY_CPP is used to check whether particular header files exist. +# (But it actually tests whether INCLUDES produces no CPP errors.) +# +# INCLUDES are not defaulted and are double quoted. +AU_DEFUN([AC_TRY_CPP], +[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[$1]])], [$2], [$3])]) + + +# AC_EGREP_CPP(PATTERN, PROGRAM, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# ------------------------------------------------------ +# Because this macro is used by AC_PROG_GCC_TRADITIONAL, which must +# come early, it is not included in AC_BEFORE checks. +AC_DEFUN([AC_EGREP_CPP], +[AC_LANG_PREPROC_REQUIRE()dnl +AC_REQUIRE([AC_PROG_EGREP])dnl +AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])]) +dnl eval is necessary to expand ac_cpp. +dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell. +if (eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | +dnl Quote $1 to prevent m4 from eating character classes + $EGREP "[$1]" >/dev/null 2>&1; then + m4_default([$3], :) +m4_ifvaln([$4], [else + $4])dnl +fi +rm -f conftest* +])# AC_EGREP_CPP + + +# AC_EGREP_HEADER(PATTERN, HEADER-FILE, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# --------------------------------------------------------- +AC_DEFUN([AC_EGREP_HEADER], +[AC_EGREP_CPP([$1], +[#include <$2> +], [$3], [$4])]) + + + + +## ------------------ ## +## Examining syntax. ## +## ------------------ ## + + +# _AC_COMPILE_IFELSE(PROGRAM, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# --------------------------------------------------------------------- +# Try to compile PROGRAM. +# This macro can be used during the selection of a compiler. +m4_define([_AC_COMPILE_IFELSE], +[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl +rm -f conftest.$ac_objext +AS_IF([_AC_EVAL_STDERR($ac_compile) && + AC_TRY_COMMAND([test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" || test ! -s conftest.err]) && + AC_TRY_COMMAND([test -s conftest.$ac_objext])], + [$2], + [_AC_MSG_LOG_CONFTEST +m4_ifvaln([$3],[$3])dnl])dnl +rm -f conftest.err conftest.$ac_objext m4_ifval([$1], [conftest.$ac_ext])[]dnl +])# _AC_COMPILE_IFELSE + + +# AC_COMPILE_IFELSE(PROGRAM, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# -------------------------------------------------------------------- +# Try to compile PROGRAM. Requires that the compiler for the current +# language was checked for, hence do not use this macro in macros looking +# for a compiler. +AC_DEFUN([AC_COMPILE_IFELSE], +[AC_LANG_COMPILER_REQUIRE()dnl +_AC_COMPILE_IFELSE($@)]) + + +# AC_TRY_COMPILE(INCLUDES, FUNCTION-BODY, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# -------------------------------------------------------- +AU_DEFUN([AC_TRY_COMPILE], +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$1]], [[$2]])], [$3], [$4])]) + + + +## --------------------- ## +## Examining libraries. ## +## --------------------- ## + + +# _AC_LINK_IFELSE(PROGRAM, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# ------------------------------------------------------------------ +# Try to link PROGRAM. +# This macro can be used during the selection of a compiler. +m4_define([_AC_LINK_IFELSE], +[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl +rm -f conftest.$ac_objext conftest$ac_exeext +AS_IF([_AC_EVAL_STDERR($ac_link) && + AC_TRY_COMMAND([test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" || test ! -s conftest.err]) && + AC_TRY_COMMAND([test -s conftest$ac_exeext])], + [$2], + [_AC_MSG_LOG_CONFTEST +m4_ifvaln([$3], [$3])dnl])[]dnl +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl +])# _AC_LINK_IFELSE + + +# AC_LINK_IFELSE(PROGRAM, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# ----------------------------------------------------------------- +# Try to link PROGRAM. Requires that the compiler for the current +# language was checked for, hence do not use this macro in macros looking +# for a compiler. +AC_DEFUN([AC_LINK_IFELSE], +[AC_LANG_COMPILER_REQUIRE()dnl +_AC_LINK_IFELSE($@)]) + + +# AC_TRY_LINK(INCLUDES, FUNCTION-BODY, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# ----------------------------------------------------- +# Contrarily to AC_LINK_IFELSE, this macro double quote its first two args. +AU_DEFUN([AC_TRY_LINK], +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[$1]], [[$2]])], [$3], [$4])]) + + +# AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY, +# ACTION-IF-FOUND, [ACTION-IF-NOT-FOUND]) +# -------------------------------------------------------- +AU_DEFUN([AC_COMPILE_CHECK], +[m4_ifvaln([$1], [AC_CHECKING([for $1])])dnl +AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2]], [[$3]])], [$4], [$5]) +]) + + + + +## -------------------------------- ## +## Checking for run-time features. ## +## -------------------------------- ## + + +# _AC_RUN_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# ------------------------------------------------------------ +# Compile, link, and run. +# This macro can be used during the selection of a compiler. +# We also remove conftest.o as if the compilation fails, some compilers +# don't remove it. We remove gmon.out and bb.out, which may be +# created during the run if the program is built with profiling support. +m4_define([_AC_RUN_IFELSE], +[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl +rm -f conftest$ac_exeext +AS_IF([AC_TRY_EVAL(ac_link) && AC_TRY_COMMAND(./conftest$ac_exeext)], + [$2], + [echo "$as_me: program exited with status $ac_status" >&AS_MESSAGE_LOG_FD +_AC_MSG_LOG_CONFTEST +m4_ifvaln([$3], + [( exit $ac_status ) +$3])dnl])[]dnl +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext m4_ifval([$1], + [conftest.$ac_ext])[]dnl +])# _AC_RUN_IFELSE + + +# AC_RUN_IFELSE(PROGRAM, +# [ACTION-IF-TRUE], [ACTION-IF-FALSE], +# [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR]) +# ---------------------------------------------------------- +# Compile, link, and run. Requires that the compiler for the current +# language was checked for, hence do not use this macro in macros looking +# for a compiler. +AC_DEFUN([AC_RUN_IFELSE], +[AC_LANG_COMPILER_REQUIRE()dnl +m4_ifval([$4], [], + [AC_DIAGNOSE([cross], + [$0 called without default to allow cross compiling])])dnl +if test "$cross_compiling" = yes; then + m4_default([$4], + [AC_MSG_ERROR([internal error: not reached in cross-compile])]) +else + _AC_RUN_IFELSE($@) +fi]) + + +# AC_TRY_RUN(PROGRAM, +# [ACTION-IF-TRUE], [ACTION-IF-FALSE], +# [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR]) +# -------------------------------------------------------- +AU_DEFUN([AC_TRY_RUN], +[AC_RUN_IFELSE([AC_LANG_SOURCE([[$1]])], [$2], [$3], [$4])]) + + + +## ------------------------------------- ## +## Checking for the existence of files. ## +## ------------------------------------- ## + +# AC_CHECK_FILE(FILE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# ------------------------------------------------------------- +# +# Check for the existence of FILE. +AC_DEFUN([AC_CHECK_FILE], +[AC_DIAGNOSE([cross], + [cannot check for file existence when cross compiling])dnl +AS_VAR_PUSHDEF([ac_File], [ac_cv_file_$1])dnl +AC_CACHE_CHECK([for $1], ac_File, +[test "$cross_compiling" = yes && + AC_MSG_ERROR([cannot check for file existence when cross compiling]) +if test -r "$1"; then + AS_VAR_SET(ac_File, yes) +else + AS_VAR_SET(ac_File, no) +fi]) +AS_IF([test AS_VAR_GET(ac_File) = yes], [$2], [$3])[]dnl +AS_VAR_POPDEF([ac_File])dnl +])# AC_CHECK_FILE + + +# AC_CHECK_FILES(FILE..., [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# ----------------------------------------------------------------- +AC_DEFUN([AC_CHECK_FILES], +[AC_FOREACH([AC_FILE_NAME], [$1], + [AC_CHECK_FILE(AC_FILE_NAME, + [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]AC_FILE_NAME), 1, + [Define to 1 if you have the + file `]AC_File['.]) +$2], + [$3])])]) + + +## ------------------------------- ## +## Checking for declared symbols. ## +## ------------------------------- ## + + +# AC_CHECK_DECL(SYMBOL, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], +# [INCLUDES = DEFAULT-INCLUDES]) +# ------------------------------------------------------- +# Check if SYMBOL (a variable or a function) is declared. +AC_DEFUN([AC_CHECK_DECL], +[AS_VAR_PUSHDEF([ac_Symbol], [ac_cv_have_decl_$1])dnl +AC_CACHE_CHECK([whether $1 is declared], ac_Symbol, +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])], +[#ifndef $1 + char *p = (char *) $1; +#endif +])], + [AS_VAR_SET(ac_Symbol, yes)], + [AS_VAR_SET(ac_Symbol, no)])]) +AS_IF([test AS_VAR_GET(ac_Symbol) = yes], [$2], [$3])[]dnl +AS_VAR_POPDEF([ac_Symbol])dnl +])# AC_CHECK_DECL + + +# AC_CHECK_DECLS(SYMBOLS, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], +# [INCLUDES = DEFAULT-INCLUDES]) +# -------------------------------------------------------- +# Defines HAVE_DECL_SYMBOL to 1 if declared, 0 otherwise. See the +# documentation for a detailed explanation of this difference with +# other AC_CHECK_*S macros. SYMBOLS is an m4 list. +AC_DEFUN([AC_CHECK_DECLS], +[m4_foreach([AC_Symbol], [$1], + [AC_CHECK_DECL(AC_Symbol, + [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_DECL_]AC_Symbol), 1, + [Define to 1 if you have the declaration + of `]AC_Symbol[', and to 0 if you don't.]) +$2], + [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_DECL_]AC_Symbol), 0) +$3], + [$4])]) +])# AC_CHECK_DECLS + + + +## ---------------------------------- ## +## Replacement of library functions. ## +## ---------------------------------- ## + + +# AC_CONFIG_LIBOBJ_DIR(DIRNAME) +# ----------------------------- +# Announce LIBOBJ replacement files are in $top_srcdir/DIRNAME. +AC_DEFUN_ONCE([AC_CONFIG_LIBOBJ_DIR], +[m4_bmatch([$1], [^]m4_defn([m4_cr_symbols2]), + [AC_WARNING([invalid replacement directory: $1])])dnl +m4_divert_text([DEFAULTS], [ac_config_libobj_dir=$1])[]dnl +]) + + +# AC_LIBSOURCE(FILENAME) +# ---------------------- +# Announce we might need the file `FILENAME'. +m4_define([AC_LIBSOURCE], []) + + +# AC_LIBSOURCES([FILENAME1, ...]) +# ------------------------------- +# Announce we might need these files. +m4_define([AC_LIBSOURCES], +[m4_foreach([_AC_FILENAME], [$1], + [AC_LIBSOURCE(_AC_FILENAME)])]) + + +# _AC_LIBOBJ(FILENAME-NOEXT, ACTION-IF-INDIR) +# ------------------------------------------- +# We need `FILENAME-NOEXT.o', save this into `LIBOBJS'. +# We don't use AC_SUBST/2 because it forces an unnecessary eol. +m4_define([_AC_LIBOBJ], +[AS_LITERAL_IF([$1], + [AC_LIBSOURCE([$1.c])], + [$2])dnl +AC_SUBST([LIB@&t@OBJS])dnl +case $LIB@&t@OBJS in + "$1.$ac_objext" | \ + *" $1.$ac_objext" | \ + "$1.$ac_objext "* | \ + *" $1.$ac_objext "* ) ;; + *) LIB@&t@OBJS="$LIB@&t@OBJS $1.$ac_objext" ;; +esac +]) + + + +# AC_LIBOBJ(FILENAME-NOEXT) +# ------------------------- +# We need `FILENAME-NOEXT.o', save this into `LIBOBJS'. +# We don't use AC_SUBST/2 because it forces an unnecessary eol. +m4_define([AC_LIBOBJ], +[_AC_LIBOBJ([$1], + [AC_DIAGNOSE(syntax, + [$0($1): you should use literals])])dnl +]) + + +# _AC_LIBOBJS_NORMALIZE +# --------------------- +# Clean up LIBOBJS abd LTLIBOBJS so that they work with 1. ac_objext, +# 2. Automake's ANSI2KNR, 3. Libtool, 4. combination of the three. +# Used with AC_CONFIG_COMMANDS_PRE. +AC_DEFUN([_AC_LIBOBJS_NORMALIZE], +[ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) +AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) +]) + + +## ----------------------------------- ## +## Checking compiler characteristics. ## +## ----------------------------------- ## + + +# _AC_COMPUTE_INT_COMPILE(EXPRESSION, VARIABLE, [INCLUDES], [IF-FAILS]) +# --------------------------------------------------------------------- +# Compute the integer EXPRESSION and store the result in the VARIABLE. +# Works OK if cross compiling, but assumes twos-complement arithmetic. +m4_define([_AC_COMPUTE_INT_COMPILE], +[# Depending upon the size, compute the lo and hi bounds. +AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= 0])], + [ac_lo=0 ac_mid=0 + while :; do + AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_mid])], + [ac_hi=$ac_mid; break], + [ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1`]) + done], +[AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) < 0])], + [ac_hi=-1 ac_mid=-1 + while :; do + AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= $ac_mid])], + [ac_lo=$ac_mid; break], + [ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid`]) + done], + [ac_lo= ac_hi=])]) +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_mid])], + [ac_hi=$ac_mid], [ac_lo=`expr '(' $ac_mid ')' + 1`]) +done +case $ac_lo in +?*) $2=$ac_lo;; +'') $4 ;; +esac[]dnl +])# _AC_COMPUTE_INT_COMPILE + + +# _AC_COMPUTE_INT_RUN(EXPRESSION, VARIABLE, [INCLUDES], [IF-FAILS]) +# ----------------------------------------------------------------- +# Store the evaluation of the integer EXPRESSION in VARIABLE. +m4_define([_AC_COMPUTE_INT_RUN], +[AC_RUN_IFELSE([AC_LANG_INT_SAVE([$3], [$1])], + [$2=`cat conftest.val`], [$4])]) + + +# _AC_COMPUTE_INT(EXPRESSION, VARIABLE, INCLUDES, IF-FAILS) +# --------------------------------------------------------- +m4_define([_AC_COMPUTE_INT], +[if test "$cross_compiling" = yes; then + _AC_COMPUTE_INT_COMPILE([$1], [$2], [$3], [$4]) +else + _AC_COMPUTE_INT_RUN([$1], [$2], [$3], [$4]) +fi +rm -f conftest.val[]dnl +])# _AC_COMPUTE_INT diff --git a/build/autoconf_prepend-include/autoconf/libs.m4 b/build/autoconf_prepend-include/autoconf/libs.m4 new file mode 100644 index 0000000000..9f2611f0a6 --- /dev/null +++ b/build/autoconf_prepend-include/autoconf/libs.m4 @@ -0,0 +1,498 @@ +# This file is part of Autoconf. -*- Autoconf -*- +# Checking for libraries. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# As a special exception, the Free Software Foundation gives unlimited +# permission to copy, distribute and modify the configure scripts that +# are the output of Autoconf. You need not follow the terms of the GNU +# General Public License when using or distributing such scripts, even +# though portions of the text of Autoconf appear in them. The GNU +# General Public License (GPL) does govern all other use of the material +# that constitutes the Autoconf program. +# +# Certain portions of the Autoconf source text are designed to be copied +# (in certain cases, depending on the input) into the output of +# Autoconf. We call these the "data" portions. The rest of the Autoconf +# source text consists of comments plus executable code that decides which +# of the data portions to output in any given case. We call these +# comments and executable code the "non-data" portions. Autoconf never +# copies any of the non-data portions into its output. +# +# This special exception to the GPL applies to versions of Autoconf +# released by the Free Software Foundation. When you make and +# distribute a modified version of Autoconf, you may extend this special +# exception to the GPL to apply to your modified version as well, *unless* +# your modified version has the potential to copy into its output some +# of the text that was the non-data portion of the version that you started +# with. (In other words, unless your change moves or copies text from +# the non-data portions to the data portions.) If your modification has +# such potential, you must delete any notice of this special exception +# to the GPL from your modified version. +# +# Written by David MacKenzie, with help from +# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, +# Roland McGrath, Noah Friedman, david d zuhn, and many others. + +# Table of contents +# +# 1. Generic tests for libraries +# 2. Tests for specific libraries + + +## --------------------------------- ## +## 1. Generic tests for libraries.## ## +## --------------------------------- ## + + + +# AC_SEARCH_LIBS(FUNCTION, SEARCH-LIBS, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], +# [OTHER-LIBRARIES]) +# -------------------------------------------------------- +# Search for a library defining FUNC, if it's not already available. +AC_DEFUN([AC_SEARCH_LIBS], +[AC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1], +[ac_func_search_save_LIBS=$LIBS +ac_cv_search_$1=no +AC_LINK_IFELSE([AC_LANG_CALL([], [$1])], + [ac_cv_search_$1="none required"]) +if test "$ac_cv_search_$1" = no; then + for ac_lib in $2; do + LIBS="-l$ac_lib $5 $ac_func_search_save_LIBS" + AC_LINK_IFELSE([AC_LANG_CALL([], [$1])], + [ac_cv_search_$1="-l$ac_lib" +break]) + done +fi +LIBS=$ac_func_search_save_LIBS]) +AS_IF([test "$ac_cv_search_$1" != no], + [test "$ac_cv_search_$1" = "none required" || LIBS="$ac_cv_search_$1 $LIBS" + $3], + [$4])dnl +]) + + + +# AC_CHECK_LIB(LIBRARY, FUNCTION, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], +# [OTHER-LIBRARIES]) +# ------------------------------------------------------ +# +# Use a cache variable name containing both the library and function name, +# because the test really is for library $1 defining function $2, not +# just for library $1. Separate tests with the same $1 and different $2s +# may have different results. +# +# Note that using directly AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2]) +# is asking for troubles, since AC_CHECK_LIB($lib, fun) would give +# ac_cv_lib_$lib_fun, which is definitely not what was meant. Hence +# the AS_LITERAL_IF indirection. +# +# FIXME: This macro is extremely suspicious. It DEFINEs unconditionally, +# whatever the FUNCTION, in addition to not being a *S macro. Note +# that the cache does depend upon the function we are looking for. +# +# It is on purpose we used `ac_check_lib_save_LIBS' and not just +# `ac_save_LIBS': there are many macros which don't want to see `LIBS' +# changed but still want to use AC_CHECK_LIB, so they save `LIBS'. +# And ``ac_save_LIBS' is too tempting a name, so let's leave them some +# freedom. +AC_DEFUN([AC_CHECK_LIB], +[m4_ifval([$3], , [AH_CHECK_LIB([$1])])dnl +AS_LITERAL_IF([$1], + [AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])], + [AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1''_$2])])dnl +AC_CACHE_CHECK([for $2 in -l$1], ac_Lib, +[ac_check_lib_save_LIBS=$LIBS +LIBS="-l$1 $5 $LIBS" +AC_LINK_IFELSE([AC_LANG_CALL([], [$2])], + [AS_VAR_SET(ac_Lib, yes)], + [AS_VAR_SET(ac_Lib, no)]) +LIBS=$ac_check_lib_save_LIBS]) +AS_IF([test AS_VAR_GET(ac_Lib) = yes], + [m4_default([$3], [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_LIB$1)) + LIBS="-l$1 $LIBS" +])], + [$4])dnl +AS_VAR_POPDEF([ac_Lib])dnl +])# AC_CHECK_LIB + + +# AH_CHECK_LIB(LIBNAME) +# --------------------- +m4_define([AH_CHECK_LIB], +[AH_TEMPLATE(AS_TR_CPP(HAVE_LIB$1), + [Define to 1 if you have the `]$1[' library (-l]$1[).])]) + + +# AC_HAVE_LIBRARY(LIBRARY, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], +# [OTHER-LIBRARIES]) +# --------------------------------------------------------- +# +# This macro is equivalent to calling `AC_CHECK_LIB' with a FUNCTION +# argument of `main'. In addition, LIBRARY can be written as any of +# `foo', `-lfoo', or `libfoo.a'. In all of those cases, the compiler +# is passed `-lfoo'. However, LIBRARY cannot be a shell variable; +# it must be a literal name. +AU_DEFUN([AC_HAVE_LIBRARY], +[m4_pushdef([AC_Lib_Name], + m4_bpatsubst(m4_bpatsubst([[$1]], + [lib\([^\.]*\)\.a], [\1]), + [-l], []))dnl +AC_CHECK_LIB(AC_Lib_Name, main, [$2], [$3], [$4])dnl +ac_cv_lib_[]AC_Lib_Name()=ac_cv_lib_[]AC_Lib_Name()_main +m4_popdef([AC_Lib_Name])dnl +]) + + + + +## --------------------------------- ## +## 2. Tests for specific libraries. ## +## --------------------------------- ## + + + +# --------------------- # +# Checks for X window. # +# --------------------- # + + +# _AC_PATH_X_XMKMF +# ---------------- +# Internal subroutine of _AC_PATH_X. +# Set ac_x_includes and/or ac_x_libraries. +m4_define([_AC_PATH_X_XMKMF], +[rm -fr conftest.dir +if mkdir conftest.dir; then + cd conftest.dir + # Make sure to not put "make" in the Imakefile rules, since we grep it out. + cat >Imakefile <<'_ACEOF' +acfindx: + @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' +_ACEOF + if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl; do + if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && + test -f $ac_im_libdir/libX11.$ac_extension; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. + case $ac_im_incroot in + /usr/include) ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; + esac + case $ac_im_usrlibdir in + /usr/lib | /lib) ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; + esac + fi + cd .. + rm -fr conftest.dir +fi +])# _AC_PATH_X_XMKMF + + +# _AC_PATH_X_DIRECT +# ----------------- +# Internal subroutine of _AC_PATH_X. +# Set ac_x_includes and/or ac_x_libraries. +m4_define([_AC_PATH_X_DIRECT], +[# Standard set of common directories for X headers. +# Check X11 before X11Rn because it is often a symlink to the current release. +ac_x_header_dirs=' +/usr/X11/include +/usr/X11R6/include +/usr/X11R5/include +/usr/X11R4/include + +/usr/include/X11 +/usr/include/X11R6 +/usr/include/X11R5 +/usr/include/X11R4 + +/usr/local/X11/include +/usr/local/X11R6/include +/usr/local/X11R5/include +/usr/local/X11R4/include + +/usr/local/include/X11 +/usr/local/include/X11R6 +/usr/local/include/X11R5 +/usr/local/include/X11R4 + +/usr/X386/include +/usr/x386/include +/usr/XFree86/include/X11 + +/usr/include +/usr/local/include +/usr/unsupported/include +/usr/athena/include +/usr/local/x11r5/include +/usr/lpp/Xamples/include + +/usr/openwin/include +/usr/openwin/share/include' + +if test "$ac_x_includes" = no; then + # Guess where to find include files, by looking for a specified header file. + # First, try using that file with no special directory specified. + AC_PREPROC_IFELSE([AC_LANG_SOURCE([@%:@include ])], +[# We can compile using X headers with no special include directory. +ac_x_includes=], +[for ac_dir in $ac_x_header_dirs; do + if test -r "$ac_dir/X11/Intrinsic.h"; then + ac_x_includes=$ac_dir + break + fi +done]) +fi # $ac_x_includes = no + +if test "$ac_x_libraries" = no; then + # Check for the libraries. + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS=$LIBS + LIBS="-lXt $LIBS" + AC_LINK_IFELSE([AC_LANG_PROGRAM([@%:@include ], + [XtMalloc (0)])], + [LIBS=$ac_save_LIBS +# We can link X programs with no special library path. +ac_x_libraries=], + [LIBS=$ac_save_LIBS +for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` +do + # Don't even attempt the hair of trying to link an X program! + for ac_extension in a so sl; do + if test -r $ac_dir/libXt.$ac_extension; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done]) +fi # $ac_x_libraries = no +])# _AC_PATH_X_DIRECT + + +# _AC_PATH_X +# ---------- +# Compute ac_cv_have_x. +AC_DEFUN([_AC_PATH_X], +[AC_CACHE_VAL(ac_cv_have_x, +[# One or both of the vars are not set, and there is no cached value. +ac_x_includes=no ac_x_libraries=no +_AC_PATH_X_XMKMF +_AC_PATH_X_DIRECT +if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then + # Didn't find X anywhere. Cache the known absence of X. + ac_cv_have_x="have_x=no" +else + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" +fi])dnl +]) + + +# AC_PATH_X +# --------- +# If we find X, set shell vars x_includes and x_libraries to the +# paths, otherwise set no_x=yes. +# Uses ac_ vars as temps to allow command line to override cache and checks. +# --without-x overrides everything else, but does not touch the cache. +AN_HEADER([X11/Xlib.h], [AC_PATH_X]) +AC_DEFUN([AC_PATH_X], +[dnl Document the X abnormal options inherited from history. +m4_divert_once([HELP_BEGIN], [ +X features: + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR])dnl + +if test "x$ac_path_x_has_been_run" != xyes; then + AC_MSG_CHECKING([for X]) + +ac_path_x_has_been_run=yes +AC_ARG_WITH(x, [ --with-x use the X Window System]) +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then + # Both variables are already set. + have_x=yes + else + _AC_PATH_X + fi + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then + AC_MSG_RESULT([$have_x]) + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$x_includes ac_x_libraries=$x_libraries" + # It might be that x_includes is empty (headers are found in the + # standard search path. Then output the corresponding message + ac_out_x_includes=$x_includes + test "x$x_includes" = x && ac_out_x_includes="in standard search path" + AC_MSG_RESULT([libraries $x_libraries, headers $ac_out_x_includes]) +fi + +fi])# AC_PATH_X + + + +# AC_PATH_XTRA +# ------------ +# Find additional X libraries, magic flags, etc. +AC_DEFUN([AC_PATH_XTRA], +[AC_REQUIRE([AC_PATH_X])dnl +if test "$no_x" = yes; then + # Not all programs may use this symbol, but it does not hurt to define it. + AC_DEFINE([X_DISPLAY_MISSING], 1, + [Define to 1 if the X Window System is missing or not being used.]) + X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= +else + if test -n "$x_includes"; then + X_CFLAGS="$X_CFLAGS -I$x_includes" + fi + + # It would also be nice to do this for all -L options, not just this one. + if test -n "$x_libraries"; then + X_LIBS="$X_LIBS -L$x_libraries" +dnl FIXME: banish uname from this macro! + # For Solaris; some versions of Sun CC require a space after -R and + # others require no space. Words are not sufficient . . . . + case `(uname -sr) 2>/dev/null` in + "SunOS 5"*) + AC_MSG_CHECKING([whether -R must be followed by a space]) + ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" + AC_LINK_IFELSE([AC_LANG_PROGRAM()], ac_R_nospace=yes, ac_R_nospace=no) + if test $ac_R_nospace = yes; then + AC_MSG_RESULT([no]) + X_LIBS="$X_LIBS -R$x_libraries" + else + LIBS="$ac_xsave_LIBS -R $x_libraries" + AC_LINK_IFELSE([AC_LANG_PROGRAM()], ac_R_space=yes, ac_R_space=no) + if test $ac_R_space = yes; then + AC_MSG_RESULT([yes]) + X_LIBS="$X_LIBS -R $x_libraries" + else + AC_MSG_RESULT([neither works]) + fi + fi + LIBS=$ac_xsave_LIBS + esac + fi + + # Check for system-dependent libraries X programs must link with. + # Do this before checking for the system-independent R6 libraries + # (-lICE), since we may need -lsocket or whatever for X linking. + + if test "$ISC" = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" + else + # Martyn Johnson says this is needed for Ultrix, if the X + # libraries were built with DECnet support. And Karl Berry says + # the Alpha needs dnet_stub (dnet does not exist). + ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" + AC_LINK_IFELSE([AC_LANG_CALL([], [XOpenDisplay])], + [], + [AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"]) + if test $ac_cv_lib_dnet_dnet_ntoa = no; then + AC_CHECK_LIB(dnet_stub, dnet_ntoa, + [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"]) + fi]) + LIBS="$ac_xsave_LIBS" + + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) + # needs -lnsl. + # The nsl library prevents programs from opening the X display + # on Irix 5.2, according to T.E. Dickey. + # The functions gethostbyname, getservbyname, and inet_addr are + # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. + AC_CHECK_FUNC(gethostbyname) + if test $ac_cv_func_gethostbyname = no; then + AC_CHECK_LIB(nsl, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl") + if test $ac_cv_lib_nsl_gethostbyname = no; then + AC_CHECK_LIB(bsd, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd") + fi + fi + + # lieder@skyler.mavd.honeywell.com says without -lsocket, + # socket/setsockopt and other routines are undefined under SCO ODT + # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary + # on later versions), says Simon Leinen: it contains gethostby* + # variants that don't use the name server (or something). -lsocket + # must be given before -lnsl if both are needed. We assume that + # if connect needs -lnsl, so does gethostbyname. + AC_CHECK_FUNC(connect) + if test $ac_cv_func_connect = no; then + AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", , + $X_EXTRA_LIBS) + fi + + # Guillermo Gomez says -lposix is necessary on A/UX. + AC_CHECK_FUNC(remove) + if test $ac_cv_func_remove = no; then + AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix") + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + AC_CHECK_FUNC(shmat) + if test $ac_cv_func_shmat = no; then + AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc") + fi + fi + + # Check for libraries that X11R6 Xt/Xaw programs need. + ac_save_LDFLAGS=$LDFLAGS + test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" + # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to + # check for ICE first), but we must link in the order -lSM -lICE or + # we get undefined symbols. So assume we have SM if we have ICE. + # These have to be linked with before -lX11, unlike the other + # libraries we check for below, so use a different variable. + # John Interrante, Karl Berry + AC_CHECK_LIB(ICE, IceConnectionNumber, + [X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"], , $X_EXTRA_LIBS) + LDFLAGS=$ac_save_LDFLAGS + +fi +AC_SUBST(X_CFLAGS)dnl +AC_SUBST(X_PRE_LIBS)dnl +AC_SUBST(X_LIBS)dnl +AC_SUBST(X_EXTRA_LIBS)dnl +])# AC_PATH_XTRA diff --git a/build/autoconf_prepend-include/autoconf/status.m4 b/build/autoconf_prepend-include/autoconf/status.m4 new file mode 100644 index 0000000000..f01959179b --- /dev/null +++ b/build/autoconf_prepend-include/autoconf/status.m4 @@ -0,0 +1,1604 @@ +# This file is part of Autoconf. -*- Autoconf -*- +# Parameterizing and creating config.status. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# As a special exception, the Free Software Foundation gives unlimited +# permission to copy, distribute and modify the configure scripts that +# are the output of Autoconf. You need not follow the terms of the GNU +# General Public License when using or distributing such scripts, even +# though portions of the text of Autoconf appear in them. The GNU +# General Public License (GPL) does govern all other use of the material +# that constitutes the Autoconf program. +# +# Certain portions of the Autoconf source text are designed to be copied +# (in certain cases, depending on the input) into the output of +# Autoconf. We call these the "data" portions. The rest of the Autoconf +# source text consists of comments plus executable code that decides which +# of the data portions to output in any given case. We call these +# comments and executable code the "non-data" portions. Autoconf never +# copies any of the non-data portions into its output. +# +# This special exception to the GPL applies to versions of Autoconf +# released by the Free Software Foundation. When you make and +# distribute a modified version of Autoconf, you may extend this special +# exception to the GPL to apply to your modified version as well, *unless* +# your modified version has the potential to copy into its output some +# of the text that was the non-data portion of the version that you started +# with. (In other words, unless your change moves or copies text from +# the non-data portions to the data portions.) If your modification has +# such potential, you must delete any notice of this special exception +# to the GPL from your modified version. +# +# Written by David MacKenzie, with help from +# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, +# Roland McGrath, Noah Friedman, david d zuhn, and many others. + + +# This file handles about all the preparation aspects for +# `config.status': registering the configuration files, the headers, +# the links, and the commands `config.status' will run. There is a +# little mixture though of things actually handled by `configure', +# such as running the `configure' in the sub directories. Minor +# detail. +# +# There are two kinds of commands: +# +# COMMANDS: +# +# They are output into `config.status' via a quoted here doc. These +# commands are always associated to a tag which the user can use to +# tell `config.status' what are the commands she wants to run. +# +# INIT-CMDS: +# +# They are output via an *unquoted* here-doc. As a consequence $var +# will be output as the value of VAR. This is typically used by +# `configure' to give `config,.status' some variables it needs to run +# the COMMANDS. At the difference of `COMMANDS', the INIT-CMDS are +# always run. +# +# +# Some uniformity exists around here, please respect it! +# +# A macro named AC_CONFIG_FOOS has three args: the `TAG...' (or +# `FILE...' when it applies), the `COMMANDS' and the `INIT-CMDS'. It +# first checks that TAG was not registered elsewhere thanks to +# AC_CONFIG_UNIQUE. Then it registers `TAG...' in AC_LIST_FOOS, and for +# each `TAG', a special line in AC_LIST_FOOS_COMMANDS which is used in +# `config.status' like this: +# +# case $ac_tag in +# AC_LIST_FOOS_COMMANDS +# esac +# +# Finally, the `INIT-CMDS' are dumped into a special diversion, via +# `_AC_CONFIG_COMMANDS_INIT'. While `COMMANDS' are output once per TAG, +# `INIT-CMDS' are dumped only once per call to AC_CONFIG_FOOS. +# +# It also leave the TAG in the shell variable ac_config_foo which contains +# those which will actually be executed. In other words: +# +# if false; then +# AC_CONFIG_FOOS(bar, [touch bar]) +# fi +# +# will not create bar. +# +# AC_CONFIG_FOOS can be called several times (with different TAGs of +# course). +# +# Because these macros should not output anything, there should be `dnl' +# everywhere. A pain my friend, a pain. So instead in each macro we +# divert(-1) and restore the diversion at the end. +# +# +# Honorable members of this family are AC_CONFIG_FILES, +# AC_CONFIG_HEADERS, AC_CONFIG_LINKS and AC_CONFIG_COMMANDS. Bad boys +# are AC_LINK_FILES, AC_OUTPUT_COMMANDS and AC_OUTPUT when used with +# arguments. False members are AC_CONFIG_SRCDIR, AC_CONFIG_SUBDIRS +# and AC_CONFIG_AUX_DIR. Cousins are AC_CONFIG_COMMANDS_PRE and +# AC_CONFIG_COMMANDS_POST. + + +## ------------------ ## +## Auxiliary macros. ## +## ------------------ ## + +# _AC_SRCPATHS(BUILD-DIR-NAME) +# ---------------------------- +# Inputs: +# - BUILD-DIR-NAME is `top-build -> build' and `top-src -> src' +# - `$srcdir' is `top-build -> top-src' +# +# Ouputs: +# - `ac_builddir' is `.', for symmetry only. +# - `ac_top_builddir' is `build -> top_build'. +# If not empty, has a trailing slash. +# - `ac_srcdir' is `build -> src'. +# - `ac_top_srcdir' is `build -> top-src'. +# +# and `ac_abs_builddir' etc., the absolute paths. +m4_define([_AC_SRCPATHS], +[ac_builddir=. + +if test $1 != .; then + ac_dir_suffix=/`echo $1 | sed 's,^\.[[\\/]],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[[^\\/]]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [[\\/]]* | ?:[[\\/]]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +AS_SET_CATFILE([ac_abs_builddir], [`pwd`], [$1]) +AS_SET_CATFILE([ac_abs_top_builddir], + [$ac_abs_builddir], [${ac_top_builddir}.]) +AS_SET_CATFILE([ac_abs_srcdir], [$ac_abs_builddir], [$ac_srcdir]) +AS_SET_CATFILE([ac_abs_top_srcdir], [$ac_abs_builddir], [$ac_top_srcdir]) +])# _AC_SRCPATHS + + + +## ------------------------------------- ## +## Ensuring the uniqueness of the tags. ## +## ------------------------------------- ## + +# AC_CONFIG_IF_MEMBER(DEST, LIST-NAME, ACTION-IF-TRUE, ACTION-IF-FALSE) +# ---------------------------------------------------------------- +# If DEST is member of LIST-NAME, expand to ACTION-IF-TRUE, else +# ACTION-IF-FALSE. +# +# LIST is an AC_CONFIG list, i.e., a list of DEST[:SOURCE], separated +# with spaces. +# +# FIXME: This macro is badly designed, but I'm not guilty: m4 is. There +# is just no way to simply compare two strings in m4, but to use pattern +# matching. The big problem is then that the active characters should +# be quoted. Currently `+*.' are quoted. +m4_define([AC_CONFIG_IF_MEMBER], +[m4_bmatch(m4_defn([$2]), [\(^\| \)]m4_re_escape([$1])[\([: ]\|$\)], + [$3], [$4])]) + + +# AC_FILE_DEPENDENCY_TRACE(DEST, SOURCE1, [SOURCE2...]) +# ----------------------------------------------------- +# This macro does nothing, it's a hook to be read with `autoconf --trace'. +# It announces DEST depends upon the SOURCE1 etc. +m4_define([AC_FILE_DEPENDENCY_TRACE], []) + + +# _AC_CONFIG_DEPENDENCY(DEST, [SOURCE1], [SOURCE2...]) +# ---------------------------------------------------- +# Be sure that a missing dependency is expressed as a dependency upon +# `DEST.in'. +m4_define([_AC_CONFIG_DEPENDENCY], +[m4_ifval([$2], + [AC_FILE_DEPENDENCY_TRACE($@)], + [AC_FILE_DEPENDENCY_TRACE([$1], [$1.in])])]) + + +# _AC_CONFIG_DEPENDENCIES(DEST[:SOURCE1[:SOURCE2...]]...) +# ------------------------------------------------------- +# Declare the DESTs depend upon their SOURCE1 etc. +m4_define([_AC_CONFIG_DEPENDENCIES], +[AC_FOREACH([AC_File], [$1], + [_AC_CONFIG_DEPENDENCY(m4_bpatsubst(AC_File, [:], [,]))])dnl +]) + + +# _AC_CONFIG_UNIQUE(DEST[:SOURCE]...) +# ----------------------------------- +# +# Verify that there is no double definition of an output file +# (precisely, guarantees there is no common elements between +# CONFIG_HEADERS, CONFIG_FILES, CONFIG_LINKS, and CONFIG_SUBDIRS). +# +# Note that this macro does not check if the list $[1] itself +# contains doubles. +m4_define([_AC_CONFIG_UNIQUE], +[AC_FOREACH([AC_File], [$1], +[m4_pushdef([AC_Dest], m4_bpatsubst(AC_File, [:.*]))dnl + AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_HEADERS], + [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_HEADERS.])])dnl + AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_LINKS], + [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_LINKS.])])dnl + AC_CONFIG_IF_MEMBER(AC_Dest, [_AC_LIST_SUBDIRS], + [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_SUBDIRS.])])dnl + AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_COMMANDS], + [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_COMMANDS.])])dnl + AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_FILES], + [AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_FILES.])])dnl +m4_popdef([AC_Dest])])dnl +]) + + + +## ------------------------ ## +## Configuration commands. ## +## ------------------------ ## + + +# _AC_CONFIG_COMMANDS_INIT([INIT-COMMANDS]) +# ----------------------------------------- +# +# Register INIT-COMMANDS as command pasted *unquoted* in +# `config.status'. This is typically used to pass variables from +# `configure' to `config.status'. Note that $[1] is not over quoted as +# was the case in AC_OUTPUT_COMMANDS. +m4_define([_AC_CONFIG_COMMANDS_INIT], +[m4_ifval([$1], + [m4_append([_AC_OUTPUT_COMMANDS_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_AC_OUTPUT_COMMANDS_INIT]) + + +# _AC_CONFIG_COMMAND(NAME, [COMMANDS]) +# ------------------------------------ +# See below. +m4_define([_AC_CONFIG_COMMAND], +[_AC_CONFIG_UNIQUE([$1])dnl +m4_append([AC_LIST_COMMANDS], [ $1])dnl +m4_ifval([$2], +[m4_append([AC_LIST_COMMANDS_COMMANDS], +[ ]m4_bpatsubst([$1], [:.*])[ ) $2 ;; +])])dnl +]) + +# AC_CONFIG_COMMANDS(NAME...,[COMMANDS], [INIT-CMDS]) +# --------------------------------------------------- +# +# Specify additional commands to be run by config.status. This +# commands must be associated with a NAME, which should be thought +# as the name of a file the COMMANDS create. +AC_DEFUN([AC_CONFIG_COMMANDS], +[AC_FOREACH([AC_Name], [$1], [_AC_CONFIG_COMMAND(m4_defn([AC_Name]), [$2])])dnl +_AC_CONFIG_COMMANDS_INIT([$3])dnl +ac_config_commands="$ac_config_commands $1" +]) + +# Initialize the lists. +m4_define([AC_LIST_COMMANDS]) +m4_define([AC_LIST_COMMANDS_COMMANDS]) + + +# AC_OUTPUT_COMMANDS(EXTRA-CMDS, INIT-CMDS) +# ----------------------------------------- +# +# Add additional commands for AC_OUTPUT to put into config.status. +# +# This macro is an obsolete version of AC_CONFIG_COMMANDS. The only +# difficulty in mapping AC_OUTPUT_COMMANDS to AC_CONFIG_COMMANDS is +# to give a unique key. The scheme we have chosen is `default-1', +# `default-2' etc. for each call. +# +# Unfortunately this scheme is fragile: bad things might happen +# if you update an included file and configure.ac: you might have +# clashes :( On the other hand, I'd like to avoid weird keys (e.g., +# depending upon __file__ or the pid). +AU_DEFUN([AC_OUTPUT_COMMANDS], +[m4_define([_AC_OUTPUT_COMMANDS_CNT], m4_incr(_AC_OUTPUT_COMMANDS_CNT))dnl +dnl Double quoted since that was the case in the original macro. +AC_CONFIG_COMMANDS([default-]_AC_OUTPUT_COMMANDS_CNT, [[$1]], [[$2]])dnl +]) + +# Initialize. +AU_DEFUN([_AC_OUTPUT_COMMANDS_CNT], 0) + + +# AC_CONFIG_COMMANDS_PRE(CMDS) +# ---------------------------- +# Commands to run right before config.status is created. Accumulates. +AC_DEFUN([AC_CONFIG_COMMANDS_PRE], +[m4_append([AC_OUTPUT_COMMANDS_PRE], [$1 +])]) + + +# AC_OUTPUT_COMMANDS_PRE +# ---------------------- +# A *variable* in which we append all the actions that must be +# performed before *creating* config.status. For a start, clean +# up all the LIBOBJ mess. +m4_define([AC_OUTPUT_COMMANDS_PRE], +[_AC_LIBOBJS_NORMALIZE() +]) + + +# AC_CONFIG_COMMANDS_POST(CMDS) +# ----------------------------- +# Commands to run after config.status was created. Accumulates. +AC_DEFUN([AC_CONFIG_COMMANDS_POST], +[m4_append([AC_OUTPUT_COMMANDS_POST], [$1 +])]) + +# Initialize. +m4_define([AC_OUTPUT_COMMANDS_POST]) + + + +# _AC_OUTPUT_COMMANDS +# ------------------- +# This is a subroutine of AC_OUTPUT, in charge of issuing the code +# related to AC_CONFIG_COMMANDS. +# +# It has to send itself into $CONFIG_STATUS (eg, via here documents). +# Upon exit, no here document shall be opened. +m4_define([_AC_OUTPUT_COMMANDS], +[cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[[^:]]*:,,'` + ac_dir=`AS_DIRNAME(["$ac_dest"])` + AS_MKDIR_P(["$ac_dir"]) + _AC_SRCPATHS(["$ac_dir"]) + + AC_MSG_NOTICE([executing $ac_dest commands]) +dnl Some shells don't like empty case/esac +m4_ifset([AC_LIST_COMMANDS_COMMANDS], +[ case $ac_dest in +AC_LIST_COMMANDS_COMMANDS()dnl + esac +])dnl +done +_ACEOF +])# _AC_OUTPUT_COMMANDS + + + + +## ----------------------- ## +## Configuration headers. ## +## ----------------------- ## + + +# _AC_CONFIG_HEADER(HEADER, [COMMANDS]) +# ------------------------------------- +# See below. +m4_define([_AC_CONFIG_HEADER], +[_AC_CONFIG_UNIQUE([$1])dnl +m4_append([AC_LIST_HEADERS], [ $1])dnl +_AC_CONFIG_DEPENDENCIES([$1])dnl +dnl Register the commands +m4_ifval([$2], +[m4_append([AC_LIST_HEADERS_COMMANDS], +[ ]m4_bpatsubst([$1], [:.*])[ ) $2 ;; +])])dnl +]) + + +# AC_CONFIG_HEADERS(HEADERS..., [COMMANDS], [INIT-CMDS]) +# ------------------------------------------------------ +# Specify that the HEADERS are to be created by instantiation of the +# AC_DEFINEs. Associate the COMMANDS to the HEADERS. This macro +# accumulates if called several times. +# +# The commands are stored in a growing string AC_LIST_HEADERS_COMMANDS +# which should be used like this: +# +# case $ac_file in +# AC_LIST_HEADERS_COMMANDS +# esac +AC_DEFUN([AC_CONFIG_HEADERS], +[AC_FOREACH([AC_File], [$1], [_AC_CONFIG_HEADER(m4_defn([AC_File]), [$2])])dnl +_AC_CONFIG_COMMANDS_INIT([$3])dnl +ac_config_headers="$ac_config_headers m4_normalize([$1])" +]) + +# Initialize to empty. It is much easier and uniform to have a config +# list expand to empty when undefined, instead of special casing when +# not defined (since in this case, AC_CONFIG_FOO expands to AC_CONFIG_FOO). +m4_define([AC_LIST_HEADERS]) +m4_define([AC_LIST_HEADERS_COMMANDS]) + + +# AC_CONFIG_HEADER(HEADER-TO-CREATE ...) +# -------------------------------------- +# FIXME: Make it obsolete? +AC_DEFUN([AC_CONFIG_HEADER], +[AC_CONFIG_HEADERS([$1])]) + + +# _AC_OUTPUT_HEADERS +# ------------------ +# +# Output the code which instantiates the `config.h' files from their +# `config.h.in'. +# +# This is a subroutine of _AC_OUTPUT_CONFIG_STATUS. It has to send +# itself into $CONFIG_STATUS (eg, via here documents). Upon exit, no +# here document shall be opened. +# +# +# The code produced used to be extremely costly: there are was a +# single sed script (n lines) handling both `#define' templates, +# `#undef' templates with trailing space, and `#undef' templates +# without trailing spaces. The full script was run on each of the m +# lines of `config.h.in', i.e., about n x m. +# +# Now there are two scripts: `conftest.defines' for the `#define' +# templates, and `conftest.undef' for the `#undef' templates. +# +# Optimization 1. It is incredibly costly to run two `#undef' +# scripts, so just remove trailing spaces first. Removes about a +# third of the cost. +# +# Optimization 2. Since `#define' are rare and obsoleted, +# `conftest.defines' is built and run only if grep says there are +# `#define'. Improves by at least a factor 2, since in addition we +# avoid the cost of *producing* the sed script. +# +# Optimization 3. In each script, first check that the current input +# line is a template. This avoids running the full sed script on +# empty lines and comments (divides the cost by about 3 since each +# template chunk is typically a comment, a template, an empty line). +# +# Optimization 4. Once a substitution performed, since there can be +# only one per line, immediately restart the script on the next input +# line (using the `t' sed instruction). Divides by about 2. +# *Note:* In the case of the AC_SUBST sed script (_AC_OUTPUT_FILES) +# this optimization cannot be applied as is, because there can be +# several substitutions per line. +# +# +# The result is about, hm, ... times blah... plus.... Ahem. The +# result is about much faster. +m4_define([_AC_OUTPUT_HEADERS], +[cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +dnl Double quote for the `[ ]' and `define'. +[ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t'] + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[[^:]]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[[^:]]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && AC_MSG_NOTICE([creating $ac_file]) + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [[\\/$]]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || AC_MSG_ERROR([cannot find input file: $f]) + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + AC_MSG_ERROR([cannot find input file: $f]) + fi;; + esac + done` || AS_EXIT([1]) + # Remove the trailing spaces. + sed 's/[[ ]]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +dnl Double quote for `[ ]' and `define'. +[s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end] +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\_ACEOF +[s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,] +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep ["^[ ]*#[ ]*define"] $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo ['/^[ ]*#[ ]*define/!b'] >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo ['/^[ ]*#[ ]*undef/!b'] >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +dnl Now back to your regularly scheduled config.status. +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + AC_MSG_NOTICE([$ac_file is unchanged]) + else + ac_dir=`AS_DIRNAME(["$ac_file"])` + AS_MKDIR_P(["$ac_dir"]) + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +dnl If running for Automake, be ready to perform additional +dnl commands to set up the timestamp files. +m4_ifdef([_AC_AM_CONFIG_HEADER_HOOK], + [_AC_AM_CONFIG_HEADER_HOOK([$ac_file]) +])dnl +m4_ifset([AC_LIST_HEADERS_COMMANDS], +[ # Run the commands associated with the file. + case $ac_file in +AC_LIST_HEADERS_COMMANDS()dnl + esac +])dnl +done +_ACEOF +])# _AC_OUTPUT_HEADERS + + + +## --------------------- ## +## Configuration links. ## +## --------------------- ## + + +# _AC_CONFIG_LINK(DEST:SOURCE, [COMMANDS]) +# ---------------------------------------- +# See below. +m4_define([_AC_CONFIG_LINK], +[_AC_CONFIG_UNIQUE([$1])dnl +m4_append([AC_LIST_LINKS], [ $1])dnl +_AC_CONFIG_DEPENDENCIES([$1])dnl +m4_bmatch([$1], [^\.:\| \.:], [m4_fatal([$0: invalid destination: `.'])])dnl +dnl Register the commands +m4_ifval([$2], +[m4_append([AC_LIST_LINKS_COMMANDS], +[ ]m4_bpatsubst([$1], [:.*])[ ) $2 ;; +])])dnl +]) + +# AC_CONFIG_LINKS(DEST:SOURCE..., [COMMANDS], [INIT-CMDS]) +# -------------------------------------------------------- +# Specify that config.status should establish a (symbolic if possible) +# link from TOP_SRCDIR/SOURCE to TOP_SRCDIR/DEST. +# Reject DEST=., because it is makes it hard for ./config.status +# to guess the links to establish (`./config.status .'). +AC_DEFUN([AC_CONFIG_LINKS], +[AC_FOREACH([AC_File], [$1], [_AC_CONFIG_LINK(m4_defn([AC_File]), [$2])])dnl +_AC_CONFIG_COMMANDS_INIT([$3])dnl +ac_config_links="$ac_config_links m4_normalize([$1])" +]) + + +# Initialize the list. +m4_define([AC_LIST_LINKS]) +m4_define([AC_LIST_LINKS_COMMANDS]) + + +# AC_LINK_FILES(SOURCE..., DEST...) +# --------------------------------- +# Link each of the existing files SOURCE... to the corresponding +# link name in DEST... +# +# Unfortunately we can't provide a very good autoupdate service here, +# since in `AC_LINK_FILES($from, $to)' it is possible that `$from' +# and `$to' are actually lists. It would then be completely wrong to +# replace it with `AC_CONFIG_LINKS($to:$from). It is possible in the +# case of literal values though, but because I don't think there is any +# interest in creating config links with literal values, no special +# mechanism is implemented to handle them. +# +# _AC_LINK_CNT is used to be robust to multiple calls. +AU_DEFUN([AC_LINK_FILES], +[m4_if($#, 2, , + [m4_fatal([$0: incorrect number of arguments])])dnl +m4_define([_AC_LINK_FILES_CNT], m4_incr(_AC_LINK_FILES_CNT))dnl +ac_sources="$1" +ac_dests="$2" +while test -n "$ac_sources"; do + set $ac_dests; ac_dest=$[1]; shift; ac_dests=$[*] + set $ac_sources; ac_source=$[1]; shift; ac_sources=$[*] + [ac_config_links_]_AC_LINK_FILES_CNT="$[ac_config_links_]_AC_LINK_FILES_CNT $ac_dest:$ac_source" +done +AC_CONFIG_LINKS($[ac_config_links_]_AC_LINK_FILES_CNT)dnl +], +[ + It is technically impossible to `autoupdate' cleanly from AC_LINK_FILES + to AC_CONFIG_FILES. `autoupdate' provides a functional but inelegant + update, you should probably tune the result yourself.])# AC_LINK_FILES + + +# Initialize. +AU_DEFUN([_AC_LINK_FILES_CNT], 0) + +# _AC_OUTPUT_LINKS +# ---------------- +# This is a subroutine of AC_OUTPUT. +# +# It has to send itself into $CONFIG_STATUS (eg, via here documents). +# Upon exit, no here document shall be opened. +m4_define([_AC_OUTPUT_LINKS], +[cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_LINKS section. +# + +dnl Here we use : instead of .. because if AC_LINK_FILES was used +dnl with empty parameters (as in gettext.m4), then we obtain here +dnl `:', which we want to skip. So let's keep a single exception: `:'. +for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[[^:]]*:,,'` + + AC_MSG_NOTICE([linking $srcdir/$ac_source to $ac_dest]) + + if test ! -r $srcdir/$ac_source; then + AC_MSG_ERROR([$srcdir/$ac_source: file not found]) + fi + rm -f $ac_dest + + # Make relative symlinks. + ac_dest_dir=`AS_DIRNAME(["$ac_dest"])` + AS_MKDIR_P(["$ac_dest_dir"]) + _AC_SRCPATHS(["$ac_dest_dir"]) + + case $srcdir in + [[\\/$]]* | ?:[[\\/]]* ) ac_rel_source=$srcdir/$ac_source ;; + *) ac_rel_source=$ac_top_builddir$srcdir/$ac_source ;; + esac + + # Try a symlink, then a hard link, then a copy. + ln -s $ac_rel_source $ac_dest 2>/dev/null || + ln $srcdir/$ac_source $ac_dest 2>/dev/null || + cp -p $srcdir/$ac_source $ac_dest || + AC_MSG_ERROR([cannot link or copy $srcdir/$ac_source to $ac_dest]) +m4_ifset([AC_LIST_LINKS_COMMANDS], +[ # Run the commands associated with the file. + case $ac_file in +AC_LIST_LINKS_COMMANDS()dnl + esac +])dnl +done +_ACEOF +])# _AC_OUTPUT_LINKS + + + +## --------------------- ## +## Configuration files. ## +## --------------------- ## + + +# _AC_CONFIG_FILE(FILE..., [COMMANDS]) +# ------------------------------------ +# See below. +m4_define([_AC_CONFIG_FILE], +[_AC_CONFIG_UNIQUE([$1])dnl +m4_append([AC_LIST_FILES], [ $1])dnl +_AC_CONFIG_DEPENDENCIES([$1])dnl +dnl Register the commands. +m4_ifval([$2], +[m4_append([AC_LIST_FILES_COMMANDS], +[ ]m4_bpatsubst([$1], [:.*])[ ) $2 ;; +])])dnl +]) + +# AC_CONFIG_FILES(FILE..., [COMMANDS], [INIT-CMDS]) +# ------------------------------------------------- +# Specify output files, as with AC_OUTPUT, i.e., files that are +# configured with AC_SUBST. Associate the COMMANDS to each FILE, +# i.e., when config.status creates FILE, run COMMANDS afterwards. +# +# The commands are stored in a growing string AC_LIST_FILES_COMMANDS +# which should be used like this: +# +# case $ac_file in +# AC_LIST_FILES_COMMANDS +# esac +AC_DEFUN([AC_CONFIG_FILES], +[AC_FOREACH([AC_File], [$1], [_AC_CONFIG_FILE(m4_defn([AC_File]), [$2])])dnl +_AC_CONFIG_COMMANDS_INIT([$3])dnl +ac_config_files="$ac_config_files m4_normalize([$1])" +]) + +# Initialize the lists. +m4_define([AC_LIST_FILES]) +m4_define([AC_LIST_FILES_COMMANDS]) + + + +# _AC_OUTPUT_FILES +# ---------------- +# Do the variable substitutions to create the Makefiles or whatever. +# This is a subroutine of AC_OUTPUT. +# +# It has to send itself into $CONFIG_STATUS (eg, via here documents). +# Upon exit, no here document shall be opened. +m4_define([_AC_OUTPUT_FILES], +[cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. +dnl Please, pay attention that this sed code depends a lot on the shape +dnl of the sed commands issued by AC_SUBST. So if you change one, change +dnl the other too. +[ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF] +dnl These here document variables are unquoted when configure runs +dnl but quoted when config.status runs, so variables are expanded once. +dnl Insert the sed substitutions of variables. +m4_ifdef([_AC_SUBST_VARS], + [AC_FOREACH([AC_Var], m4_defn([_AC_SUBST_VARS]), +[s,@AC_Var@,$AC_Var,;t t +])])dnl +m4_ifdef([_AC_SUBST_FILES], + [AC_FOREACH([AC_Var], m4_defn([_AC_SUBST_FILES]), +[/@AC_Var@/r $AC_Var +s,@AC_Var@,,;t t +])])dnl +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. +dnl One cannot portably go further than 100 commands because of HP-UX. +dnl Here, there are 2 cmd per line, and two cmd are added later. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo [':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b'] && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[[^:]]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[[^:]]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`AS_DIRNAME(["$ac_file"])` + AS_MKDIR_P(["$ac_dir"]) + _AC_SRCPATHS(["$ac_dir"]) + +AC_PROVIDE_IFELSE([AC_PROG_INSTALL], +[ case $INSTALL in + [[\\/$]]* | ?:[[\\/]]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac +])dnl + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [[\\/$]]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || AC_MSG_ERROR([cannot find input file: $f]) + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + AC_MSG_ERROR([cannot find input file: $f]) + fi;; + esac + done` || AS_EXIT([1]) + + if test x"$ac_file" != x-; then + AC_MSG_NOTICE([creating $ac_file]) + rm -f "$ac_file" + fi +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +dnl Neutralize VPATH when `$srcdir' = `.'. + sed "$ac_vpsub +dnl Shell code in configure.ac might set extrasub. +dnl FIXME: do we really want to maintain this feature? +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +[/@[a-zA-Z_][a-zA-Z_0-9]*@/!b] +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +AC_PROVIDE_IFELSE([AC_PROG_INSTALL], [s,@INSTALL@,$ac_INSTALL,;t t +])dnl +dnl The parens around the eval prevent an "illegal io" in Ultrix sh. +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin +dnl This would break Makefile dependencies. +dnl if diff $ac_file $tmp/out >/dev/null 2>&1; then +dnl echo "$ac_file is unchanged" +dnl else +dnl rm -f $ac_file +dnl mv $tmp/out $ac_file +dnl fi + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +m4_ifset([AC_LIST_FILES_COMMANDS], +[ # Run the commands associated with the file. + case $ac_file in +AC_LIST_FILES_COMMANDS()dnl + esac +])dnl +done +_ACEOF +])# _AC_OUTPUT_FILES + + + +## ----------------------- ## +## Configuration subdirs. ## +## ----------------------- ## + + +# AC_CONFIG_SUBDIRS(DIR ...) +# -------------------------- +# We define two variables: +# - ac_subdirs_all +# is built in the `default' section, and should contain *all* +# the arguments of AC_CONFIG_SUBDIRS. It is used for --help=recursive. +# It makes no sense for arguments which are sh variables. +# - subdirs +# which is built at runtime, so some of these dirs might not be +# included, if for instance the user refused a part of the tree. +# This is used in _AC_OUTPUT_SUBDIRS. +# _AC_LIST_SUBDIRS is used only for _AC_CONFIG_UNIQUE. +AC_DEFUN([AC_CONFIG_SUBDIRS], +[_AC_CONFIG_UNIQUE([$1])dnl +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +m4_append([_AC_LIST_SUBDIRS], [ $1])dnl +AS_LITERAL_IF([$1], [], + [AC_DIAGNOSE(syntax, [$0: you should use literals])]) +m4_divert_text([DEFAULTS], + [ac_subdirs_all="$ac_subdirs_all m4_normalize([$1])"]) +AC_SUBST(subdirs, "$subdirs $1")dnl +]) + +# Initialize the list. +m4_define([_AC_LIST_SUBDIRS]) + + +# _AC_OUTPUT_SUBDIRS +# ------------------ +# This is a subroutine of AC_OUTPUT, but it does not go into +# config.status, rather, it is called after running config.status. +m4_define([_AC_OUTPUT_SUBDIRS], +[ +# +# CONFIG_SUBDIRS section. +# +if test "$no_recursion" != yes; then + + # Remove --cache-file and --srcdir arguments so they do not pile up. + ac_sub_configure_args= + ac_prev= + for ac_arg in $ac_configure_args; do + if test -n "$ac_prev"; then + ac_prev= + continue + fi + case $ac_arg in + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ + | --c=*) + ;; + --config-cache | -C) + ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + ;; + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + ;; + *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; + esac + done + + # Always prepend --prefix to ensure using the same prefix + # in subdir configurations. + ac_sub_configure_args="--prefix=$prefix $ac_sub_configure_args" + + ac_popdir=`pwd` + for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue + + # Do not complain, so a configure script can configure whichever + # parts of a large source tree are present. + test -d $srcdir/$ac_dir || continue + + AC_MSG_NOTICE([configuring in $ac_dir]) + AS_MKDIR_P(["$ac_dir"]) + _AC_SRCPATHS(["$ac_dir"]) + + cd $ac_dir + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + ac_sub_configure="$SHELL '$ac_srcdir/configure.gnu'" + elif test -f $ac_srcdir/configure; then + ac_sub_configure="$SHELL '$ac_srcdir/configure'" + elif test -f $ac_srcdir/configure.in; then + ac_sub_configure=$ac_configure + else + AC_MSG_WARN([no configuration information is in $ac_dir]) + ac_sub_configure= + fi + + # The recursion is here. + if test -n "$ac_sub_configure"; then + # Make the cache file name correct relative to the subdirectory. + case $cache_file in + [[\\/]]* | ?:[[\\/]]* ) ac_sub_cache_file=$cache_file ;; + *) # Relative path. + ac_sub_cache_file=$ac_top_builddir$cache_file ;; + esac + + AC_MSG_NOTICE([running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir]) + # The eval makes quoting arguments work. + eval $ac_sub_configure $ac_sub_configure_args \ + --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir || + AC_MSG_ERROR([$ac_sub_configure failed for $ac_dir]) + fi + + cd "$ac_popdir" + done +fi +])# _AC_OUTPUT_SUBDIRS + + + + +## -------------------------- ## +## Outputting config.status. ## +## -------------------------- ## + + +# autoupdate::AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS]) +# ------------------------------------------------------------------- +# +# If there are arguments given to AC_OUTPUT, dispatch them to the +# proper modern macros. +AU_DEFUN([AC_OUTPUT], +[m4_ifvaln([$1], + [AC_CONFIG_FILES([$1])])dnl +m4_ifvaln([$2$3], + [AC_CONFIG_COMMANDS(default, [[$2]], [[$3]])])dnl +[AC_OUTPUT]]) + + +# AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS]) +# ------------------------------------------------------- +# The big finish. +# Produce config.status, config.h, and links; and configure subdirs. +# The CONFIG_HEADERS are defined in the m4 variable AC_LIST_HEADERS. +# Pay special attention not to have too long here docs: some old +# shells die. Unfortunately the limit is not known precisely... +m4_define([AC_OUTPUT], +[dnl Dispatch the extra arguments to their native macros. +m4_ifval([$1], + [AC_CONFIG_FILES([$1])])dnl +m4_ifval([$2$3], + [AC_CONFIG_COMMANDS(default, [$2], [$3])])dnl +m4_ifval([$1$2$3], + [AC_DIAGNOSE([obsolete], + [$0 should be used without arguments. +You should run autoupdate.])])dnl +AC_CACHE_SAVE + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub=['/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}'] +fi + +m4_ifset([AC_LIST_HEADERS], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()]) + +dnl Commands to run before creating config.status. +AC_OUTPUT_COMMANDS_PRE()dnl + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +_AC_OUTPUT_CONFIG_STATUS()dnl +ac_clean_files=$ac_clean_files_save + +dnl Commands to run after config.status was created +AC_OUTPUT_COMMANDS_POST()dnl + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec AS_MESSAGE_LOG_FD>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec AS_MESSAGE_LOG_FD>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || AS_EXIT([1]) +fi +dnl config.status should not do recursion. +AC_PROVIDE_IFELSE([AC_CONFIG_SUBDIRS], [_AC_OUTPUT_SUBDIRS()])dnl +])# AC_OUTPUT + + +# _AC_OUTPUT_CONFIG_STATUS +# ------------------------ +# Produce config.status. Called by AC_OUTPUT. +# Pay special attention not to have too long here docs: some old +# shells die. Unfortunately the limit is not known precisely... +m4_define([_AC_OUTPUT_CONFIG_STATUS], +[AC_MSG_NOTICE([creating $CONFIG_STATUS]) +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +AS_SHELL_SANITIZE +dnl Watch out, this is directly the initializations, do not use +dnl AS_PREPARE, otherwise you'd get it output in the initialization +dnl of configure, not config.status. +_AS_PREPARE +exec AS_MESSAGE_FD>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD +cat >&AS_MESSAGE_LOG_FD <<_CSEOF + +This file was extended by m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])dnl +$as_me[]m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]), which was +generated by m4_PACKAGE_STRING. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $[0] $[@] + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&AS_MESSAGE_LOG_FD +echo >&AS_MESSAGE_LOG_FD +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $[0] [[OPTIONS]] [[FILE]]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions +m4_ifset([AC_LIST_FILES], +[[ --file=FILE[:TEMPLATE] + instantiate the configuration file FILE +]])dnl +m4_ifset([AC_LIST_HEADERS], +[[ --header=FILE[:TEMPLATE] + instantiate the configuration header FILE +]])dnl + +m4_ifset([AC_LIST_FILES], +[Configuration files: +$config_files + +])dnl +m4_ifset([AC_LIST_HEADERS], +[Configuration headers: +$config_headers + +])dnl +m4_ifset([AC_LIST_LINKS], +[Configuration links: +$config_links + +])dnl +m4_ifset([AC_LIST_COMMANDS], +[Configuration commands: +$config_commands + +])dnl +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.status[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING, + with options \\"`echo "$ac_configure_args" | sed 's/[[\\""\`\$]]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +AC_PROVIDE_IFELSE([AC_PROG_INSTALL], +[dnl Leave those double quotes here: this $INSTALL is evaluated in a +dnl here document, which might result in `INSTALL=/bin/install -c'. +INSTALL="$INSTALL" +])dnl +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $[#] != 0 +do + case $[1] in + --*=*) + ac_option=`expr "x$[1]" : 'x\([[^=]]*\)='` + ac_optarg=`expr "x$[1]" : 'x[[^=]]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$[1] + ac_optarg=$[2] + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$[1] + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + AC_MSG_ERROR([ambiguous option: $[1] +Try `$[0] --help' for more information.]);; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try `$[0] --help' for more information.]) ;; + + *) ac_config_targets="$ac_config_targets $[1]" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec AS_MESSAGE_FD>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $[0] " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&AS_MESSAGE_FD + exec $SHELL $[0] $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + +dnl We output the INIT-CMDS first for obvious reasons :) +m4_ifset([_AC_OUTPUT_COMMANDS_INIT], +[cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +_AC_OUTPUT_COMMANDS_INIT() +_ACEOF]) + + +dnl Issue this section only if there were actually config files. +dnl This checks if one of AC_LIST_HEADERS, AC_LIST_FILES, AC_LIST_COMMANDS, +dnl or AC_LIST_LINKS is set. +m4_ifval(AC_LIST_HEADERS()AC_LIST_LINKS()AC_LIST_FILES()AC_LIST_COMMANDS(), +[ +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. +AC_FOREACH([AC_File], AC_LIST_FILES, +[ "m4_bpatsubst(AC_File, [:.*])" )dnl + CONFIG_FILES="$CONFIG_FILES AC_File" ;; +])dnl +AC_FOREACH([AC_File], AC_LIST_LINKS, +[ "m4_bpatsubst(AC_File, [:.*])" )dnl + CONFIG_LINKS="$CONFIG_LINKS AC_File" ;; +])dnl +AC_FOREACH([AC_File], AC_LIST_COMMANDS, +[ "m4_bpatsubst(AC_File, [:.*])" )dnl + CONFIG_COMMANDS="$CONFIG_COMMANDS AC_File" ;; +])dnl +AC_FOREACH([AC_File], AC_LIST_HEADERS, +[ "m4_bpatsubst(AC_File, [:.*])" )dnl + CONFIG_HEADERS="$CONFIG_HEADERS AC_File" ;; +])dnl + *) AC_MSG_ERROR([invalid argument: $ac_config_target]);; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then +m4_ifset([AC_LIST_FILES], +[ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +])dnl +m4_ifset([AC_LIST_HEADERS], +[ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers +])dnl +m4_ifset([AC_LIST_LINKS], +[ test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links +])dnl +m4_ifset([AC_LIST_COMMANDS], +[ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +])dnl +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +AS_TMPDIR([confstat], [.]) + +_ACEOF +])[]dnl m4_ifval + +dnl The following four sections are in charge of their own here +dnl documenting into $CONFIG_STATUS. +m4_ifset([AC_LIST_FILES], [_AC_OUTPUT_FILES()])dnl +m4_ifset([AC_LIST_HEADERS], [_AC_OUTPUT_HEADERS()])dnl +m4_ifset([AC_LIST_LINKS], [_AC_OUTPUT_LINKS()])dnl +m4_ifset([AC_LIST_COMMANDS], [_AC_OUTPUT_COMMANDS()])dnl + +cat >>$CONFIG_STATUS <<\_ACEOF + +AS_EXIT(0) +_ACEOF +chmod +x $CONFIG_STATUS +])# _AC_OUTPUT_CONFIG_STATUS + + +# AC_OUTPUT_MAKE_DEFS +# ------------------- +# Set the DEFS variable to the -D options determined earlier. +# This is a subroutine of AC_OUTPUT. +# It is called inside configure, outside of config.status. +# Using a here document instead of a string reduces the quoting nightmare. +m4_define([AC_OUTPUT_MAKE_DEFS], +[[# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then we branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +cat >confdef2opt.sed <<\_ACEOF +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +t quote +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +t quote +d +: quote +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,\[,\\&,g +s,\],\\&,g +s,\$,$$,g +p +_ACEOF +# We use echo to avoid assuming a particular line-breaking character. +# The extra dot is to prevent the shell from consuming trailing +# line-breaks from the sub-command output. A line-break within +# single-quotes doesn't work because, if this script is created in a +# platform that uses two characters for line-breaks (e.g., DOS), tr +# would break. +ac_LF_and_DOT=`echo; echo .` +DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` +rm -f confdef2opt.sed +]])# AC_OUTPUT_MAKE_DEFS -- 2.45.2