From: David MacKenzie Date: Thu, 1 Sep 1994 04:59:32 +0000 (+0000) Subject: removed dnls, fixed bugs, added autoheader.m4f X-Git-Tag: fsf-origin~486 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a6a0d2993968a9f01b6da2d0183be81e70413ee;p=thirdparty%2Fautoconf.git removed dnls, fixed bugs, added autoheader.m4f --- diff --git a/TODO b/TODO index f6610df0d..08960566e 100644 --- a/TODO +++ b/TODO @@ -4,24 +4,6 @@ Things it would be nice to maybe do someday: ------------------------------------------------------------------------------ -* Prevent AC_REQUIRE from interrupting messages. I have a patch to do this, -but it makes autoconf take 3 times as long to run. - ------------------------------------------------------------------------------- - -* Split up AC_SUBST substitutions using a loop to accomodate shells - with severely limited here document sizes, if it turns out to be a problem. - I'm not sure whether the limit is on lines or bytes; if bytes, it - will be less of a problem than it was with the long lines used for - creating a header file. - ------------------------------------------------------------------------------- - -* Look at Jim Avera's code to allow [ and ] in egrep patterns and -AC_DEFINE args. - ------------------------------------------------------------------------------- - * Replace the current ad-hoc macros for Dynix, SCO, ISC, etc. Perhaps there should be macros for certain functions (statfs, wait) or classes of functions (POSIX, NIS) that do everything necessary, instead. @@ -38,6 +20,19 @@ Select the right C compiler and POSIX/ANSI C options automatically. ------------------------------------------------------------------------------ +* Split up AC_SUBST substitutions using a loop to accomodate shells + with severely limited here document sizes, if it turns out to be a problem. + I'm not sure whether the limit is on lines or bytes; if bytes, it + will be less of a problem than it was with the long lines used for + creating a header file. + +------------------------------------------------------------------------------ + +* Look at Jim Avera's code to allow [ and ] in egrep patterns and +AC_DEFINE args. + +------------------------------------------------------------------------------ + * Supply a template Makefile.in that people can adapt (what GNU hello was going to be). diff --git a/acgeneral.m4 b/acgeneral.m4 index bba3c8c77..878b7c02c 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -21,32 +21,31 @@ dnl Written by David MacKenzie, with help from dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, dnl Roland McGrath, Noah Friedman, and david d zuhn. dnl -changequote([, ])dnl -undefine([eval])dnl -undefine([include])dnl -undefine([shift])dnl -undefine([format])dnl -dnl +divert(-1)dnl Throw away output until AC_INIT is called. +changequote([, ]) + +define(AC_ACVERSION, 1.110) + dnl Some old m4's don't support m4exit. But they provide dnl equivalent functionality by core dumping because of the dnl long macros we define. ifdef([__gnu__], , [errprint(Autoconf requires GNU m4. Install it before installing Autoconf or set the M4 environment variable to its path name. -)m4exit(2)])dnl -dnl -define(AC_ACVERSION, 1.109)dnl -dnl This is defined by the --version option of the autoconf script. -ifdef([AC_PRINT_VERSION], [Autoconf version AC_ACVERSION -m4exit(0)])dnl -dnl -dnl +)m4exit(2)]) + +undefine([eval]) +undefine([include]) +undefine([shift]) +undefine([format]) + + dnl ### Controlling Autoconf operation -dnl -dnl + + dnl m4 output diversions. We let m4 output them all in order at the end, dnl except that we explicitly undivert AC_DIVERSION_SED. -dnl + dnl AC_DIVERSION_NOTICE - 1 (= 0) AC_REQUIRE'd #!/bin/sh line define(AC_DIVERSION_NOTICE, 1)dnl copyright notice & option help strings define(AC_DIVERSION_INIT, 2)dnl initialization code @@ -56,25 +55,26 @@ define(AC_DIVERSION_NORMAL_3, 5)dnl AC_REQUIRE'd code, 3 level deep define(AC_DIVERSION_NORMAL_2, 6)dnl AC_REQUIRE'd code, 2 level deep define(AC_DIVERSION_NORMAL_1, 7)dnl AC_REQUIRE'd code, 1 level deep define(AC_DIVERSION_NORMAL, 8)dnl the tests and output code -dnl + dnl Change the diversion stream to STREAM, while stacking old values. dnl AC_DIVERT_PUSH(STREAM) define(AC_DIVERT_PUSH, [pushdef([AC_DIVERSION_CURRENT], $1)dnl divert(AC_DIVERSION_CURRENT)dnl -])dnl -dnl +]) + dnl Change the diversion stream to its previous value, unstacking it. dnl AC_DIVERT_POP() define(AC_DIVERT_POP, [popdef([AC_DIVERSION_CURRENT])dnl divert(AC_DIVERSION_CURRENT)dnl -])dnl -dnl +]) + dnl Initialize the diversion setup. -define(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL)dnl -AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl will be later POPed by AC_INIT -dnl +define([AC_DIVERSION_CURRENT], AC_DIVERSION_NORMAL) +dnl This will be popped by AC_REQUIRE in AC_INIT. +pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_NOTICE) + dnl The prologue for Autoconf macros. dnl AC_PRO(MACRO-NAME) define(AC_PRO, @@ -82,8 +82,8 @@ define(AC_PRO, ifelse(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL, [AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))], [pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_CURRENT)])dnl -])dnl -dnl +]) + dnl The Epilogue for Autoconf macros. dnl AC_EPI() define(AC_EPI, @@ -94,8 +94,8 @@ undivert(AC_DIVERSION_NORMAL_3)dnl undivert(AC_DIVERSION_NORMAL_2)dnl undivert(AC_DIVERSION_NORMAL_1)dnl ])dnl -])dnl -dnl +]) + dnl Define a macro which automatically provides itself. Add machinery dnl so the macro automatically switches expansion to the diversion dnl stack if it is not already using it. In this case, once finished, @@ -104,8 +104,8 @@ dnl This, combined with AC_REQUIRE, achieves the topological ordering of dnl macros. dnl AC_DEFUN(NAME, EXPANSION) define([AC_DEFUN], -[define($1, [AC_PRO([$1])$2[]AC_EPI()])])dnl -dnl +[define($1, [AC_PRO([$1])$2[]AC_EPI()])]) + dnl AC_INIT_NOTICE() AC_DEFUN(AC_INIT_NOTICE, [# Guess values for system-dependent variables and create Makefiles. @@ -126,8 +126,8 @@ AC_DEFUN(AC_INIT_NOTICE, # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -ac_help=])dnl -dnl +ac_help=]) + dnl AC_INIT_PARSE_ARGS() AC_DEFUN(AC_INIT_PARSE_ARGS, [# Save the original args to write them into config.status later. @@ -405,28 +405,28 @@ done if test -n "$ac_prev"; then AC_MSG_ERROR(missing argument to --`echo $ac_prev | sed 's/_/-/g'`) fi -])dnl -dnl +]) + dnl Try to have only one #! line, so the script doesn't look funny dnl for users of AC_REVISION. dnl AC_INIT_BINSH() AC_DEFUN(AC_INIT_BINSH, [#!/bin/sh -])dnl -dnl +]) + dnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR) AC_DEFUN(AC_INIT, [sinclude(acsite.m4)dnl sinclude(./aclocal.m4)dnl AC_REQUIRE([AC_INIT_BINSH])dnl AC_INIT_NOTICE -AC_DIVERT_POP()dnl to NORMAL +AC_DIVERT_POP()dnl to NORMAL AC_DIVERT_PUSH(AC_DIVERSION_INIT)dnl AC_INIT_PARSE_ARGS AC_INIT_PREPARE($1)dnl -AC_DIVERT_POP()dnl to NORMAL -])dnl -dnl +AC_DIVERT_POP()dnl to NORMAL +]) + dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR) AC_DEFUN(AC_INIT_PREPARE, [trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15 @@ -524,8 +524,8 @@ AC_SUBST(CFLAGS)dnl AC_SUBST(CXXFLAGS)dnl AC_SUBST(CPPFLAGS)dnl AC_SUBST(LDFLAGS)dnl -])dnl -dnl +]) + dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE]) AC_DEFUN(AC_ARG_ENABLE, [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl @@ -540,13 +540,13 @@ ifelse([$4], , , [else $4 ])dnl fi -])dnl -dnl +]) + AC_DEFUN(AC_ENABLE, [AC_OBSOLETE([$0], [; instead use AC_ARG_ENABLE])dnl AC_ARG_ENABLE([$1], [ --enable-$1], [$2], [$3])dnl -])dnl -dnl +]) + dnl AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE]) AC_DEFUN(AC_ARG_WITH, [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl @@ -561,34 +561,34 @@ ifelse([$4], , , [else $4 ])dnl fi -])dnl -dnl +]) + AC_DEFUN(AC_WITH, [AC_OBSOLETE([$0], [; instead use AC_ARG_WITH])dnl AC_ARG_WITH([$1], [ --with-$1], [$2], [$3])dnl -])dnl -dnl +]) + dnl AC_CONFIG_HEADER(HEADER-TO-CREATE ...) AC_DEFUN(AC_CONFIG_HEADER, -[define(AC_LIST_HEADER, $1)])dnl -dnl +[define(AC_LIST_HEADER, $1)]) + dnl AC_REVISION(REVISION-INFO) AC_DEFUN(AC_REVISION, [AC_REQUIRE([AC_INIT_BINSH])dnl -[# From configure.in] translit([$1], $")])dnl -dnl +[# From configure.in] translit([$1], $")]) + dnl Subroutines of AC_PREREQ. -dnl + dnl Change the dots in NUMBER into commas. dnl AC_PREREQ_SPLIT(NUMBER) AC_DEFUN(AC_PREREQ_SPLIT, -[translit($1, ., [, ])])dnl -dnl +[translit($1, ., [, ])]) + dnl Default the ternary version number to 0 (e.g., 1, 7 -> 1, 7, 0). dnl AC_PREREQ_CANON(MAJOR, MINOR [,TERNARY]) AC_DEFUN(AC_PREREQ_CANON, -[$1, $2, ifelse([$3], , 0, [$3])])dnl -dnl +[$1, $2, ifelse([$3], , 0, [$3])]) + dnl Complain and exit if version number 1 is less than version number 2. dnl PRINTABLE2 is the printable version of version number 2. dnl AC_PREREQ_COMPARE(MAJOR1, MINOR1, TERNARY1, MAJOR2, MINOR2, TERNARY2, @@ -597,14 +597,14 @@ AC_DEFUN(AC_PREREQ_COMPARE, [ifelse(builtin([eval], [$3 + $2 * 100 + $1 * 10000 < $6 + $5 * 100 + $4 * 10000]), 1, [errprint(Autoconf version $7 or higher is required for this script -)m4exit(3)])])dnl -dnl +)m4exit(3)])]) + dnl Complain and exit if the Autoconf version is less than VERSION. dnl AC_PREREQ(VERSION) AC_DEFUN(AC_PREREQ, [AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), -AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1])])dnl -dnl +AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1])]) + dnl Run configure in subdirectories DIR... dnl Not actually done until AC_OUTPUT_SUBDIRS. dnl AC_CONFIG_SUBDIRS(DIR ...) @@ -613,8 +613,8 @@ AC_DEFUN(AC_CONFIG_SUBDIRS, define([AC_LIST_SUBDIRS], [$1])dnl subdirs="AC_LIST_SUBDIRS" AC_SUBST(subdirs)dnl -])dnl -dnl +]) + dnl Guess the value for the `prefix' variable by looking for dnl the argument program along PATH and taking its parent. dnl Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc, @@ -636,24 +636,24 @@ changequote([, ])dnl fi fi undefine([AC_VAR_NAME])dnl -])dnl -dnl -dnl +]) + + dnl ### Canonicalizing the system type -dnl -dnl + + dnl Find install.sh, config.sub, config.guess, and Cygnus configure dnl in directory DIR. These are auxiliary files used in configuration. dnl DIR can be either absolute or relative to ${srcdir}. dnl AC_CONFIG_AUX_DIR(DIR) AC_DEFUN(AC_CONFIG_AUX_DIR, -[AC_CONFIG_AUX_DIRS($1 ${srcdir}/$1)])dnl -dnl +[AC_CONFIG_AUX_DIRS($1 ${srcdir}/$1)]) + dnl The default is `${srcdir}' or `${srcdir}/..' or `${srcdir}/../..'. dnl 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}/../..)])dnl -dnl +[AC_CONFIG_AUX_DIRS(${srcdir} ${srcdir}/.. ${srcdir}/../..)]) + dnl Internal subroutine. dnl Search for the configuration auxiliary files in directory list $1. dnl We look only for install.sh, so users of AC_PROG_INSTALL @@ -674,8 +674,8 @@ ac_config_sub=${ac_aux_dir}/config.sub ac_configure=${ac_aux_dir}/configure # This should be Cygnus configure. ac_install_sh="${ac_aux_dir}/install.sh -c" AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -])dnl -dnl +]) + dnl Canonicalize the host, target, and build system types. AC_DEFUN(AC_CANONICAL_SYSTEM, [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl @@ -708,10 +708,10 @@ fi AC_CANONICAL_HOST AC_CANONICAL_TARGET AC_CANONICAL_BUILD -])dnl -dnl +]) + dnl Subroutines of AC_CANONICAL_SYSTEM. -dnl + AC_DEFUN(AC_CANONICAL_HOST, [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_MSG_CHECKING(host system type) @@ -738,8 +738,8 @@ AC_SUBST(host_alias)dnl AC_SUBST(host_cpu)dnl AC_SUBST(host_vendor)dnl AC_SUBST(host_os)dnl -])dnl -dnl +]) + dnl Internal use only. AC_DEFUN(AC_CANONICAL_TARGET, [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl @@ -764,8 +764,8 @@ AC_SUBST(target_alias)dnl AC_SUBST(target_cpu)dnl AC_SUBST(target_vendor)dnl AC_SUBST(target_os)dnl -])dnl -dnl +]) + dnl Internal use only. AC_DEFUN(AC_CANONICAL_BUILD, [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl @@ -787,19 +787,19 @@ AC_SUBST(build_alias)dnl AC_SUBST(build_cpu)dnl AC_SUBST(build_vendor)dnl AC_SUBST(build_os)dnl -])dnl -dnl +]) + dnl Link each of the existing files FILE... to the corresponding dnl link name in LINK... dnl Not actually done until AC_OUTPUT_LINKS. dnl AC_LINK_FILES(LINK ..., FILE ...) AC_DEFUN(AC_LINK_FILES, -[define([AC_LIST_LINKS], [$1])define([AC_LIST_FILES], [$2])])dnl -dnl -dnl +[define([AC_LIST_LINKS], [$1])define([AC_LIST_FILES], [$2])]) + + dnl ### Caching test results -dnl -dnl + + dnl Look for site or system specific initialization scripts. dnl AC_SITE_LOAD() AC_DEFUN(AC_SITE_LOAD, @@ -821,8 +821,8 @@ for ac_site_file in $CONFIG_SITE; do . "$ac_site_file" fi done -])dnl -dnl +]) + dnl AC_CACHE_LOAD() AC_DEFUN(AC_CACHE_LOAD, [if test -r "$cache_file"; then @@ -832,8 +832,8 @@ else echo "creating cache $cache_file" > $cache_file fi -])dnl -dnl +]) + dnl AC_CACHE_SAVE() AC_DEFUN(AC_CACHE_SAVE, [if test -w $cache_file; then @@ -861,8 +861,8 @@ changequote([, ])dnl else echo "not updating unwritable cache $cache_file" fi -])dnl -dnl +]) + dnl The name of shell var CACHE-ID must contain `_cv_' in order to get saved. dnl AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT) AC_DEFUN(AC_CACHE_VAL, @@ -875,27 +875,27 @@ if eval "test \"`echo '${'$1'+set}'`\" = set"; then else $2 fi -])dnl -dnl -dnl +]) + + dnl ### Setting variables -dnl -dnl + + dnl Set VARIABLE to VALUE, verbatim, or 1. dnl AC_DEFINE(VARIABLE [, VALUE]) AC_DEFUN(AC_DEFINE, [cat >> confdefs.h <<\EOF [#define] $1 ifelse($#, 2, [$2], 1) EOF -])dnl -dnl +]) + dnl Similar, but perform shell substitutions $ ` \ once on VALUE. AC_DEFUN(AC_DEFINE_UNQUOTED, [cat >> confdefs.h <&AC_FD_MSG])dnl -dnl +echo $ac_n "checking $1""... $ac_c" 1>&AC_FD_MSG]) + dnl AC_CHECKING(FEATURE-DESCRIPTION) AC_DEFUN(AC_CHECKING, -[echo "checking $1" 1>&AC_FD_MSG])dnl -dnl +[echo "checking $1" 1>&AC_FD_MSG]) + dnl AC_MSG_RESULT(RESULT-DESCRIPTION) AC_DEFUN(AC_MSG_RESULT, [AC_REQUIRE([AC_PROG_ECHO_N])dnl -echo "$ac_t""$1" 1>&AC_FD_MSG])dnl -dnl +echo "$ac_t""$1" 1>&AC_FD_MSG]) + dnl AC_VERBOSE(RESULT-DESCRIPTION) AC_DEFUN(AC_VERBOSE, [AC_OBSOLETE([$0], [; instead use AC_MSG_RESULT])dnl -echo " $1" 1>&AC_FD_MSG])dnl -dnl +echo " $1" 1>&AC_FD_MSG]) + dnl AC_MSG_WARN(PROBLEM-DESCRIPTION) AC_DEFUN(AC_MSG_WARN, -[echo "configure: warning: $1" 1>&2])dnl -dnl +[echo "configure: warning: $1" 1>&2]) + dnl AC_MSG_ERROR(ERROR-DESCRIPTION) AC_DEFUN(AC_MSG_ERROR, -[{ echo "configure: $1" 1>&2; exit 1; }])dnl -dnl -dnl +[{ echo "configure: $1" 1>&2; exit 1; }]) + + dnl ### Selecting which language to use for testing -dnl -dnl + + dnl AC_LANG_C() AC_DEFUN(AC_LANG_C, [define([AC_LANG], [C])dnl @@ -959,8 +959,8 @@ ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='${CPP} $CPPFLAGS' ac_compile='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC' -])dnl -dnl +]) + dnl AC_LANG_CPLUSPLUS() AC_DEFUN(AC_LANG_CPLUSPLUS, [define([AC_LANG], [CPLUSPLUS])dnl @@ -968,49 +968,49 @@ ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='${CXXCPP} $CPPFLAGS' ac_compile='${CXX-gcc} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC' -])dnl -dnl +]) + dnl Push the current language on a stack. -dnl + dnl AC_LANG_SAVE() AC_DEFUN(AC_LANG_SAVE, -[pushdef([AC_LANG_STACK], AC_LANG)])dnl -dnl +[pushdef([AC_LANG_STACK], AC_LANG)]) + dnl Restore the current language from the stack. dnl AC_LANG_RESTORE() AC_DEFUN(AC_LANG_RESTORE, -[ifelse(AC_LANG_STACK, C, [ifelse(AC_LANG, C, , [AC_LANG_C])], [ifelse(AC_LANG, CPLUSPLUS, , [AC_LANG_CPLUSPLUS])])[]popdef([AC_LANG_STACK])])dnl -dnl -dnl +[ifelse(AC_LANG_STACK, C, [ifelse(AC_LANG, C, , [AC_LANG_C])], [ifelse(AC_LANG, CPLUSPLUS, , [AC_LANG_CPLUSPLUS])])[]popdef([AC_LANG_STACK])]) + + dnl ### Enforcing ordering constraints -dnl -dnl + + dnl AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME) -AC_DEFUN(AC_BEFORE, +define(AC_BEFORE, [ifdef([AC_PROVIDE_$2], [errprint(__file__:__line__: [$2 was called before $1 -])])])dnl -dnl +])])]) + dnl AC_REQUIRE(MACRO-NAME) -AC_DEFUN(AC_REQUIRE, +define(AC_REQUIRE, [ifdef([AC_PROVIDE_$1], , [AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))dnl indir([$1]) AC_DIVERT_POP()dnl -])])dnl -dnl +])]) + dnl AC_PROVIDE(MACRO-NAME) define(AC_PROVIDE, -[define([AC_PROVIDE_$1], )])dnl -dnl +[define([AC_PROVIDE_$1], )]) + dnl AC_OBSOLETE(THIS-MACRO-NAME [, SUGGESTION]) -AC_DEFUN(AC_OBSOLETE, +define(AC_OBSOLETE, [errprint(__file__:__line__: warning: [$1] is obsolete[$2] -)])dnl -dnl -dnl +)]) + + dnl ### Checking for files (caching) -dnl -dnl + + dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND dnl [, VALUE-IF-NOT-FOUND]) AC_DEFUN(AC_CHECK_PROG, @@ -1042,8 +1042,8 @@ else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl -])dnl -dnl +]) + dnl AC_PATH_PROG(VARIABLE, PROG-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND]) AC_DEFUN(AC_PATH_PROG, [# Extract the first word of "$2", so it can be a program name with args. @@ -1077,8 +1077,8 @@ else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl -])dnl -dnl +]) + dnl AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND]) AC_DEFUN(AC_CHECK_PROGS, [for ac_prog in $2 @@ -1087,8 +1087,8 @@ AC_CHECK_PROG($1, [$]ac_prog, [$]ac_prog, ) test -n "[$]$1" && break done ifelse([$3], , , [test -n "[$]$1" || $1="$3" -])])dnl -dnl +])]) + dnl AC_PATH_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND]) AC_DEFUN(AC_PATH_PROGS, [for ac_prog in $2 @@ -1097,8 +1097,8 @@ AC_PATH_PROG($1, [$]ac_prog) test -n "[$]$1" && break done ifelse([$3], , , [test -n "[$]$1" || $1="$3" -])])dnl -dnl +])]) + dnl AC_CHECK_LIB(LIBRARY, FUNCTION, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND dnl [, OTHER-LIBRARIES]]]) AC_DEFUN(AC_CHECK_LIB, @@ -1123,8 +1123,8 @@ else ifelse([$4], , , [$4 ])dnl fi -])dnl -dnl +]) + dnl AC_HAVE_LIBRARY(LIBRARY, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND dnl [, OTHER-LIBRARIES]]]) AC_DEFUN(AC_HAVE_LIBRARY, @@ -1153,17 +1153,17 @@ ifelse([$3], , , [else fi undefine([AC_LIB_NAME])dnl undefine([AC_CV_NAME])dnl -])dnl -dnl -dnl -dnl ### Checking for C features - primitive (no caching) -dnl -dnl +]) + + +dnl ### Checking C system output (no caching) + + dnl AC_EGREP_HEADER(PATTERN, HEADER-FILE, ACTION-IF-FOUND [, dnl ACTION-IF-NOT-FOUND]) AC_DEFUN(AC_EGREP_HEADER, -[AC_EGREP_CPP([$1], [#include <$2>], [$3], [$4])])dnl -dnl +[AC_EGREP_CPP([$1], [#include <$2>], [$3], [$4])]) + dnl Because this macro is used by AC_PROG_GCC_TRADITIONAL, which must dnl come early, it is not included in AC_BEFORE checks. dnl AC_EGREP_CPP(PATTERN, PROGRAM, ACTION-IF-FOUND [, @@ -1175,7 +1175,9 @@ cat > conftest.${ac_ext} <&AC_FD_CC | +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>&AC_FD_CC | egrep "$1" >/dev/null 2>&1; then ifelse([$3], , :, [rm -rf conftest* $3]) @@ -1185,8 +1187,8 @@ ifelse([$4], , , [else ])dnl fi rm -f conftest* -])dnl -dnl +]) + dnl AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY, dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) AC_DEFUN(AC_COMPILE_CHECK, @@ -1195,8 +1197,8 @@ dnl AC_OBSOLETE([$0], [; instead use AC_TRY_LINK])dnl ifelse([$1], , , [AC_CHECKING([for $1]) ])dnl AC_TRY_LINK([$2], [$3], [$4], [$5])dnl -])dnl -dnl +]) + dnl AC_TRY_LINK(INCLUDES, FUNCTION-BODY, dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) AC_DEFUN(AC_TRY_LINK, @@ -1224,17 +1226,19 @@ ifelse([$4], , , [else ])dnl fi rm -f conftest*] -)dnl -dnl +) + dnl AC_TRY_RUN(PROGRAM, ACTION-IF-TRUE [, ACTION-IF-FALSE dnl [, ACTION-IF-CROSS-COMPILING]]) AC_DEFUN(AC_TRY_RUN, [AC_REQUIRE([AC_C_CROSS])dnl if test "$cross_compiling" = yes; then - ifelse([$4], , AC_MSG_ERROR(can not run test program while cross compiling), - [AC_MSG_WARN(using default for cross-compiling) -$4 -]) + ifelse([$4], , + [ifdef([AC_PROVIDE_AC_CANONICAL_SYSTEM], + [errprint(__file__:__line__: warning: test program without default prevents cross compiling +)])dnl + AC_MSG_ERROR(can not run test program while cross compiling)], + [$4]) else cat > conftest.${ac_ext} < conftest.${ac_ext} </dev/null" 2>&1` +dnl eval is necessary to expand ac_cpp. +dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell. +dnl Coherent sh does redirections in the wrong order, so separate them. +# Note: sh -x echos commands on subshell stderr, making this test fail. +ac_err=`(eval "$ac_cpp conftest.${ac_ext} >/dev/null") 2>&1` if test -z "$ac_err"; then ifelse([$2], , :, [rm -rf conftest* $2]) @@ -1276,12 +1282,12 @@ ifelse([$3], , , [ rm -rf conftest* $3 ])dnl fi -rm -f conftest*])dnl -dnl -dnl -dnl ### Checking for C features - derived (caching) -dnl -dnl +rm -f conftest*]) + + +dnl ### Checking for C features (caching) + + dnl AC_CHECK_HEADER(HEADER-FILE, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) AC_DEFUN(AC_CHECK_HEADER, [dnl Do the transliteration at runtime so arg 1 can be a shell variable. @@ -1298,8 +1304,8 @@ else ifelse([$3], , , [$3 ])dnl fi -])dnl -dnl +]) + dnl AC_CHECK_FUNC(FUNCTION, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) AC_DEFUN(AC_CHECK_FUNC, [AC_MSG_CHECKING([for $1]) @@ -1328,8 +1334,8 @@ else ifelse([$3], , , [$3 ])dnl fi -])dnl -dnl +]) + dnl AC_CHECK_FUNCS(FUNCTION... [, ACTION]) AC_DEFUN(AC_CHECK_FUNCS, [for ac_func in $1 @@ -1340,8 +1346,8 @@ AC_CHECK_FUNC(${ac_func}, changequote([, ])dnl AC_DEFINE_UNQUOTED(${ac_tr_func}) $2])dnl done -])dnl -dnl +]) + dnl AC_CHECK_HEADERS(HEADER-FILE... [, ACTION]) AC_DEFUN(AC_CHECK_HEADERS, [AC_REQUIRE_CPP()dnl Make sure the cpp check happens outside the loop. @@ -1353,8 +1359,8 @@ AC_CHECK_HEADER(${ac_hdr}, changequote([, ])dnl AC_DEFINE_UNQUOTED(${ac_tr_hdr}) $2])dnl done -])dnl -dnl +]) + dnl AC_REPLACE_FUNCS(FUNCTION-NAME...) AC_DEFUN(AC_REPLACE_FUNCS, [for ac_func in $1 @@ -1362,8 +1368,8 @@ do AC_CHECK_FUNC(${ac_func}, , [LIBOBJS="$LIBOBJS ${ac_func}.o"]) done AC_SUBST(LIBOBJS)dnl -])dnl -dnl +]) + dnl AC_CHECK_SIZEOF(TYPE) AC_DEFUN(AC_CHECK_SIZEOF, [changequote(<<, >>)dnl @@ -1386,8 +1392,8 @@ AC_MSG_RESULT($AC_CV_NAME) AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) undefine([AC_TYPE_NAME])dnl undefine([AC_CV_NAME])dnl -])dnl -dnl +]) + dnl AC_CHECK_TYPE(TYPE, DEFAULT) AC_DEFUN(AC_CHECK_TYPE, [AC_MSG_CHECKING(for $1 in sys/types.h) @@ -1397,14 +1403,14 @@ AC_MSG_RESULT($ac_cv_type_$1) if test $ac_cv_type_$1 = no; then AC_DEFINE($1, $2) fi -])dnl -dnl -dnl +]) + + dnl ### The big finish -dnl -dnl + + dnl Produce config.status, config.h, and links, and configure subdirs. -dnl AC_OUTPUT([FILE...] [, EXTRA-CMDS]) +dnl AC_OUTPUT([FILE...] [, EXTRA-CMDS] [, INIT-CMDS]) AC_DEFUN(AC_OUTPUT, [AC_CACHE_SAVE @@ -1473,7 +1479,14 @@ ifdef([AC_LIST_HEADER], AC_OUTPUT_FILES($1) ifdef([AC_LIST_HEADER], [AC_OUTPUT_HEADER(AC_LIST_HEADER)])dnl ifdef([AC_LIST_LINKS], [AC_OUTPUT_LINKS(AC_LIST_LINKS, AC_LIST_FILES)])dnl +ifelse([$3], , , +[EOF +cat >> ${CONFIG_STATUS} <> ${CONFIG_STATUS} <<\EOF]) $2 +exit 0 EOF chmod +x ${CONFIG_STATUS} test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} ${CONFIG_STATUS} @@ -1838,5 +1851,4 @@ changequote([, ])dnl cd ${ac_popdir} done fi -])dnl -dnl +]) diff --git a/acspecific.m4 b/acspecific.m4 index 37434d523..04006ab32 100644 --- a/acspecific.m4 +++ b/acspecific.m4 @@ -19,11 +19,11 @@ dnl dnl Written by David MacKenzie, with help from dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, dnl Roland McGrath, and Noah Friedman. -dnl -dnl + + dnl ### Checks for programs -dnl -dnl + + dnl Check whether to use -n, \c, or newline-tab to separate dnl checking messages from result messages. dnl Idea borrowed from dist 3.0. @@ -40,8 +40,8 @@ AC_DEFUN(AC_PROG_ECHO_N, else ac_n= ac_c='\c' ac_t= fi -])dnl -dnl +]) + AC_DEFUN(AC_PROG_CC, [AC_BEFORE([$0], [AC_PROG_CPP])dnl AC_CHECK_PROG(CC, gcc, gcc, cc) @@ -66,8 +66,8 @@ else GCC= test "${CFLAGS+set}" = set || CFLAGS='-g' fi -])dnl -dnl +]) + AC_DEFUN(AC_PROG_CXX, [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx, gcc) @@ -91,8 +91,8 @@ else GXX= test "${CXXFLAGS+set}" = set || CXXFLAGS='-g' fi -])dnl -dnl +]) + AC_DEFUN(AC_PROG_GCC_TRADITIONAL, [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_CPP])dnl @@ -114,8 +114,8 @@ Autoconf TCGETA], CC="$CC -traditional" fi fi -])dnl -dnl +]) + AC_DEFUN(AC_PROG_CC_C_O, [if test "x$CC" != xcc; then AC_MSG_CHECKING(whether $CC and cc understand -c and -o together) @@ -152,8 +152,8 @@ else AC_MSG_RESULT(no) AC_DEFINE(NO_MINUS_C_MINUS_O) fi -])dnl -dnl +]) + dnl Define SET_MAKE to set ${MAKE} if make doesn't. AC_DEFUN(AC_PROG_MAKE_SET, [AC_MSG_CHECKING(whether ${MAKE-make} sets \$MAKE) @@ -181,17 +181,17 @@ else SET_MAKE="MAKE=${MAKE-make}" fi AC_SUBST([SET_MAKE])dnl -])dnl -dnl +]) + AC_DEFUN(AC_PROG_RANLIB, -[AC_CHECK_PROG(RANLIB, ranlib, ranlib, :)])dnl -dnl +[AC_CHECK_PROG(RANLIB, ranlib, ranlib, :)]) + AC_DEFUN(AC_PROG_AWK, -[AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )])dnl -dnl +[AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )]) + AC_DEFUN(AC_PROG_YACC, -[AC_CHECK_PROGS(YACC, 'bison -y' byacc, yacc)])dnl -dnl +[AC_CHECK_PROGS(YACC, 'bison -y' byacc, yacc)]) + AC_DEFUN(AC_PROG_CPP, [AC_MSG_CHECKING(how to run the C preprocessor) # On Suns, sometimes $CPP names a directory. @@ -215,8 +215,8 @@ fi CPP="$ac_cv_prog_CPP" AC_MSG_RESULT($CPP) AC_SUBST(CPP)dnl -])dnl -dnl +]) + AC_DEFUN(AC_PROG_CXXCPP, [AC_MSG_CHECKING(how to run the C++ preprocessor) if test -z "$CXXCPP"; then @@ -231,13 +231,13 @@ fi])dnl CXXCPP="$ac_cv_prog_CXXCPP" AC_MSG_RESULT($CXXCPP) AC_SUBST(CXXCPP)dnl -])dnl -dnl +]) + dnl Require finding the C or C++ preprocessor, whichever is the dnl current language. AC_DEFUN(AC_REQUIRE_CPP, -[ifelse(AC_LANG, C, [AC_REQUIRE([AC_PROG_CPP])], [AC_REQUIRE([AC_PROG_CXXCPP])])])dnl -dnl +[ifelse(AC_LANG, C, [AC_REQUIRE([AC_PROG_CPP])], [AC_REQUIRE([AC_PROG_CXXCPP])])]) + AC_DEFUN(AC_PROG_LEX, [AC_CHECK_PROG(LEX, flex, flex, lex) AC_MSG_CHECKING(for $LEX library) @@ -249,8 +249,8 @@ then esac fi AC_MSG_RESULT($LEXLIB) -AC_SUBST(LEXLIB)])dnl -dnl +AC_SUBST(LEXLIB)]) + AC_DEFUN(AC_DECL_YYTEXT, [AC_REQUIRE_CPP()dnl AC_REQUIRE([AC_PROG_LEX])dnl @@ -283,8 +283,8 @@ if test $ac_cv_prog_lex_yytext_pointer = yes; then AC_DEFINE(YYTEXT_POINTER) fi AC_SUBST(LEX_OUTPUT_ROOT)dnl -])dnl -dnl +]) + AC_DEFUN(AC_PROG_INSTALL, [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Make sure to not get an incompatible install: @@ -336,8 +336,8 @@ AC_SUBST(INSTALL_PROGRAM)dnl test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' AC_SUBST(INSTALL_DATA)dnl -])dnl -dnl +]) + AC_DEFUN(AC_PROG_LN_S, [AC_MSG_CHECKING(whether ln -s works) AC_CACHE_VAL(ac_cv_prog_LN_S, @@ -356,16 +356,16 @@ else AC_MSG_RESULT(no) fi AC_SUBST(LN_S)dnl -])dnl -dnl +]) + AC_DEFUN(AC_RSH, [errprint(__file__:__line__: [$0] has been removed; replace it with equivalent code -)m4exit(4)])dnl -dnl -dnl +)m4exit(4)]) + + dnl ### Checks for header files -dnl -dnl + + AC_DEFUN(AC_HEADER_STDC, [AC_REQUIRE_CPP()dnl AC_MSG_CHECKING(for ANSI C header files) @@ -394,26 +394,26 @@ AC_TRY_RUN([#include int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } -], , ac_stdc_headers=no) +], , ac_cv_header_stdc=no, ac_cv_header_stdc=no) fi])dnl AC_MSG_RESULT($ac_cv_header_stdc) if test $ac_cv_header_stdc = yes; then AC_DEFINE(STDC_HEADERS) fi -])dnl -dnl +]) + AC_DEFUN(AC_UNISTD_H, [AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(unistd.h)])dnl -AC_CHECK_HEADER(unistd.h, AC_DEFINE(HAVE_UNISTD_H))])dnl -dnl +AC_CHECK_HEADER(unistd.h, AC_DEFINE(HAVE_UNISTD_H))]) + AC_DEFUN(AC_USG, [AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(string.h) and HAVE_STRING_H])dnl AC_MSG_CHECKING([for BSD string and memory functions]) AC_TRY_LINK([#include ], [rindex(0, 0); bzero(0, 0);], , - [AC_MSG_RESULT(yes); AC_DEFINE(USG)], [AC_MSG_RESULT(no)])])dnl -dnl -dnl + [AC_MSG_RESULT(yes); AC_DEFINE(USG)], [AC_MSG_RESULT(no)])]) + + dnl If memchr and the like aren't declared in , include . dnl To avoid problems, don't check for gcc2 built-ins. AC_DEFUN(AC_MEMORY_H, @@ -424,8 +424,8 @@ AC_MSG_RESULT($ac_found) if test $ac_found = no; then AC_CHECK_HEADER(memory.h, [AC_DEFINE(NEED_MEMORY_H)]) fi -])dnl -dnl +]) + AC_DEFUN(AC_HEADER_MAJOR, [AC_MSG_CHECKING(whether sys/types.h defines makedev) AC_CACHE_VAL(ac_cv_header_sys_types_h_makedev, @@ -441,8 +441,8 @@ AC_CHECK_HEADER(sys/mkdev.h, [AC_DEFINE(MAJOR_IN_MKDEV)]) AC_CHECK_HEADER(sys/sysmacros.h, [AC_DEFINE(MAJOR_IN_SYSMACROS)]) fi fi -])dnl -dnl +]) + AC_DEFUN(AC_HEADER_DIRENT, [ac_header_dir=no AC_CHECK_HEADERS(dirent.h sys/ndir.h sys/dir.h ndir.h, @@ -458,8 +458,8 @@ AC_MSG_RESULT($ac_cv_func_closedir_void) if test $ac_cv_func_closedir_void = yes; then AC_DEFINE(CLOSEDIR_VOID) fi -])dnl -dnl +]) + dnl Obsolete. AC_DEFUN(AC_DIR_HEADER, [ac_header_dir=no @@ -484,8 +484,8 @@ AC_MSG_RESULT($ac_cv_func_closedir_void) if test $ac_cv_func_closedir_void = yes; then AC_DEFINE(VOID_CLOSEDIR) fi -])dnl -dnl +]) + AC_DEFUN(AC_HEADER_STAT, [AC_MSG_CHECKING(whether stat file-mode macros are broken) AC_CACHE_VAL(ac_cv_header_stat_broken, @@ -518,8 +518,8 @@ AC_MSG_RESULT($ac_cv_header_stat_broken) if test $ac_cv_header_stat_broken = yes; then AC_DEFINE(STAT_MACROS_BROKEN) fi -])dnl -dnl +]) + AC_DEFUN(AC_DECL_SYS_SIGLIST, [AC_MSG_CHECKING([for sys_siglist declaration in signal.h or unistd.h]) AC_CACHE_VAL(ac_cv_decl_sys_siglist, @@ -534,12 +534,12 @@ AC_MSG_RESULT($ac_cv_decl_sys_siglist) if test $ac_cv_decl_sys_siglist = yes; then AC_DEFINE(SYS_SIGLIST_DECLARED) fi -])dnl -dnl -dnl +]) + + dnl ### Checks for typedefs -dnl -dnl + + AC_DEFUN(AC_TYPE_GETGROUPS, [AC_REQUIRE([AC_TYPE_UID_T])dnl AC_MSG_CHECKING(type of array argument to getgroups) @@ -572,8 +572,8 @@ changequote([, ])dnl ac_cv_type_getgroups=gid_t, ac_cv_type_getgroups=int)])dnl AC_MSG_RESULT($ac_cv_type_getgroups) AC_DEFINE_UNQUOTED(GETGROUPS_T, $ac_cv_type_getgroups) -])dnl -dnl +]) + AC_DEFUN(AC_TYPE_UID_T, [AC_MSG_CHECKING(for uid_t in sys/types.h) AC_CACHE_VAL(ac_cv_type_uid_t, @@ -584,20 +584,20 @@ if test $ac_cv_type_uid_t = no; then AC_DEFINE(uid_t, int) AC_DEFINE(gid_t, int) fi -])dnl -dnl +]) + AC_DEFUN(AC_TYPE_SIZE_T, -[AC_CHECK_TYPE(size_t, unsigned)])dnl -dnl +[AC_CHECK_TYPE(size_t, unsigned)]) + AC_DEFUN(AC_TYPE_PID_T, -[AC_CHECK_TYPE(pid_t, int)])dnl -dnl +[AC_CHECK_TYPE(pid_t, int)]) + AC_DEFUN(AC_TYPE_OFF_T, -[AC_CHECK_TYPE(off_t, long)])dnl -dnl +[AC_CHECK_TYPE(off_t, long)]) + AC_DEFUN(AC_TYPE_MODE_T, -[AC_CHECK_TYPE(mode_t, int)])dnl -dnl +[AC_CHECK_TYPE(mode_t, int)]) + dnl Note that identifiers starting with SIG are reserved by ANSI C. AC_DEFUN(AC_TYPE_SIGNAL, [AC_MSG_CHECKING([return type of signal handlers]) @@ -611,12 +611,12 @@ extern void (*signal ()) ();], [int i;], ac_cv_type_signal=void, ac_cv_type_signal=int)])dnl AC_MSG_RESULT($ac_cv_type_signal) AC_DEFINE_UNQUOTED(RETSIGTYPE, $ac_cv_type_signal) -])dnl -dnl -dnl +]) + + dnl ### Checks for functions -dnl -dnl + + AC_DEFUN(AC_FUNC_MMAP, [AC_MSG_CHECKING(for working mmap) AC_CACHE_VAL(ac_cv_func_mmap, @@ -695,15 +695,15 @@ AC_MSG_RESULT($ac_cv_func_mmap) if test $ac_cv_func_mmap = yes; then AC_DEFINE(HAVE_MMAP) fi -])dnl -dnl +]) + AC_DEFUN(AC_FUNC_VPRINTF, [AC_CHECK_FUNC(vprintf, AC_DEFINE(HAVE_VPRINTF)) if test "$ac_cv_func_vprintf" != yes; then AC_CHECK_FUNC(_doprnt, AC_DEFINE(HAVE_DOPRNT)) fi -])dnl -dnl +]) + AC_DEFUN(AC_FUNC_VFORK, [AC_REQUIRE([AC_TYPE_PID_T])dnl AC_CHECK_HEADER(vfork.h, AC_DEFINE(HAVE_VFORK_H)) @@ -819,8 +819,8 @@ AC_MSG_RESULT($ac_cv_func_vfork) if test $ac_cv_func_vfork = no; then AC_DEFINE(vfork, fork) fi -])dnl -dnl +]) + AC_DEFUN(AC_FUNC_WAIT3, [AC_MSG_CHECKING(for wait3 that fills in rusage) AC_CACHE_VAL(ac_cv_func_wait3, @@ -855,8 +855,8 @@ AC_MSG_RESULT($ac_cv_func_wait3) if test $ac_cv_func_wait3 = yes; then AC_DEFINE(HAVE_WAIT3) fi -])dnl -dnl +]) + AC_DEFUN(AC_FUNC_ALLOCA, [AC_REQUIRE_CPP()dnl Set CPP; we run AC_EGREP_CPP conditionally. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works @@ -942,8 +942,8 @@ AC_MSG_RESULT($ac_cv_c_stack_direction) AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) fi AC_SUBST(ALLOCA)dnl -])dnl -dnl +]) + AC_DEFUN(AC_FUNC_GETLOADAVG, [# Some definitions of getloadavg require that the program be installed setgid. NEED_SETGID=false @@ -1038,8 +1038,8 @@ changequote([, ])dnl AC_MSG_RESULT($KMEM_GROUP) fi AC_SUBST(KMEM_GROUP)dnl -])dnl -dnl +]) + AC_DEFUN(AC_FUNC_UTIME_NULL, [AC_MSG_CHECKING(whether utime accepts a null argument) AC_CACHE_VAL(ac_cv_func_utime_null, @@ -1058,8 +1058,8 @@ AC_MSG_RESULT($ac_cv_func_utime_null) if test $ac_cv_func_utime_null = yes; then AC_DEFINE(HAVE_UTIME_NULL) fi -])dnl -dnl +]) + AC_DEFUN(AC_FUNC_STRCOLL, [AC_MSG_CHECKING(for strcoll) AC_CACHE_VAL(ac_cv_func_strcoll, @@ -1074,8 +1074,8 @@ AC_MSG_RESULT($ac_cv_func_strcoll) if test $ac_cv_func_strcoll = yes; then AC_DEFINE(HAVE_STRCOLL) fi -])dnl -dnl +]) + AC_DEFUN(AC_FUNC_SETVBUF_REVERSED, [AC_MSG_CHECKING(whether setvbuf arguments are reversed) AC_CACHE_VAL(ac_cv_func_setvbuf_reversed, @@ -1095,12 +1095,12 @@ AC_MSG_RESULT($ac_cv_func_setvbuf_reversed) if test $ac_cv_func_setvbuf_reversed = yes; then AC_DEFINE(SETVBUF_REVERSED) fi -])dnl -dnl -dnl +]) + + dnl ### Checks for structure members -dnl -dnl + + AC_DEFUN(AC_HEADER_TIME, [AC_MSG_CHECKING([whether time.h and sys/time.h may both be included]) AC_CACHE_VAL(ac_cv_header_time, @@ -1112,8 +1112,8 @@ AC_MSG_RESULT($ac_cv_header_time) if test $ac_cv_header_time = yes; then AC_DEFINE(TIME_WITH_SYS_TIME) fi -])dnl -dnl +]) + AC_DEFUN(AC_STRUCT_TM, [AC_MSG_CHECKING([whether struct tm is in sys/time.h or time.h]) AC_CACHE_VAL(ac_cv_struct_tm, @@ -1125,8 +1125,8 @@ AC_MSG_RESULT($ac_cv_struct_tm) if test $ac_cv_struct_tm = sys/time.h; then AC_DEFINE(TM_IN_SYS_TIME) fi -])dnl -dnl +]) + AC_DEFUN(AC_STRUCT_TIMEZONE, [AC_REQUIRE([AC_STRUCT_TM])dnl AC_MSG_CHECKING([for tm_zone in struct tm]) @@ -1153,8 +1153,8 @@ changequote([, ])dnl AC_DEFINE(HAVE_TZNAME) fi fi -])dnl -dnl +]) + AC_DEFUN(AC_STRUCT_ST_BLOCKS, [AC_MSG_CHECKING([for st_blocks in struct stat]) AC_CACHE_VAL(ac_cv_struct_st_blocks, @@ -1168,8 +1168,8 @@ else LIBOBJS="$LIBOBJS fileblocks.o" fi AC_SUBST(LIBOBJS)dnl -])dnl -dnl +]) + AC_DEFUN(AC_STRUCT_ST_BLKSIZE, [AC_MSG_CHECKING([for st_blksize in struct stat]) AC_CACHE_VAL(ac_cv_struct_st_blksize, @@ -1180,8 +1180,8 @@ AC_MSG_RESULT($ac_cv_struct_st_blksize) if test $ac_cv_struct_st_blksize = yes; then AC_DEFINE(HAVE_ST_BLKSIZE) fi -])dnl -dnl +]) + AC_DEFUN(AC_STRUCT_ST_RDEV, [AC_MSG_CHECKING([for st_rdev in struct stat]) AC_CACHE_VAL(ac_cv_struct_st_rdev, @@ -1192,12 +1192,12 @@ AC_MSG_RESULT($ac_cv_struct_st_rdev) if test $ac_cv_struct_st_rdev = yes; then AC_DEFINE(HAVE_ST_RDEV) fi -])dnl -dnl -dnl +]) + + dnl ### Checks for compiler characteristics -dnl -dnl + + AC_DEFUN(AC_C_CROSS, [# If we cannot run a trivial program, we must be cross compiling. AC_MSG_CHECKING(whether cross-compiling) @@ -1205,8 +1205,8 @@ AC_CACHE_VAL(ac_cv_c_cross, [AC_TRY_RUN([main(){exit(0);}], ac_cv_c_cross=no, ac_cv_c_cross=yes)])dnl cross_compiling=$ac_cv_c_cross AC_MSG_RESULT($ac_cv_c_cross) -])dnl -dnl +]) + AC_DEFUN(AC_C_CHAR_UNSIGNED, [AC_MSG_CHECKING(whether char is unsigned) AC_CACHE_VAL(ac_cv_c_char_unsigned, @@ -1223,8 +1223,8 @@ if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then # gcc predefines this symbol on systems where it applies. AC_DEFINE(__CHAR_UNSIGNED__) fi -])dnl -dnl +]) + AC_DEFUN(AC_C_LONG_DOUBLE, [AC_MSG_CHECKING(for long double) AC_CACHE_VAL(ac_cv_c_long_double, @@ -1242,24 +1242,24 @@ AC_MSG_RESULT($ac_cv_c_long_double) if test $ac_cv_c_long_double = yes; then AC_DEFINE(HAVE_LONG_DOUBLE) fi -])dnl -dnl +]) + AC_DEFUN(AC_INT_16_BITS, [AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(int)]) AC_MSG_CHECKING(whether int is 16 bits) AC_TRY_RUN([main() { exit(sizeof(int) != 2); }], [AC_MSG_RESULT(yes) AC_DEFINE(INT_16_BITS)], AC_MSG_RESULT(no)) -])dnl -dnl +]) + AC_DEFUN(AC_LONG_64_BITS, [AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(long)]) AC_MSG_CHECKING(whether long int is 64 bits) AC_TRY_RUN([main() { exit(sizeof(long int) != 8); }], [AC_MSG_RESULT(yes) AC_DEFINE(LONG_64_BITS)], AC_MSG_RESULT(no)) -])dnl -dnl +]) + AC_DEFUN(AC_C_BIGENDIAN, [AC_MSG_CHECKING(whether byte ordering is bigendian) AC_CACHE_VAL(ac_cv_c_bigendian, @@ -1277,8 +1277,8 @@ AC_MSG_RESULT($ac_cv_c_bigendian) if test $ac_cv_c_bigendian = yes; then AC_DEFINE(WORDS_BIGENDIAN) fi -])dnl -dnl +]) + AC_DEFUN(AC_C_INLINE, [AC_MSG_CHECKING([for inline]) AC_CACHE_VAL(ac_cv_c_inline, @@ -1291,7 +1291,8 @@ AC_MSG_RESULT($ac_cv_c_inline) if test $ac_cv_c_inline = no; then AC_DEFINE(inline, __inline) fi -])dnl +]) + AC_DEFUN(AC_C_CONST, [dnl This message is consistent in form with the other checking messages, dnl and with the result message. @@ -1345,16 +1346,16 @@ AC_MSG_RESULT($ac_cv_c_const) if test $ac_cv_c_const = no; then AC_DEFINE(const, ) fi -])dnl -dnl +]) + AC_DEFUN(AC_ARG_ARRAY, [errprint(__file__:__line__: [$0] has been removed; don't do unportable things with arguments -)m4exit(4)])dnl -dnl -dnl +)m4exit(4)]) + + dnl ### Checks for operating system services -dnl -dnl + + AC_DEFUN(AC_SYS_INTERPRETER, [# Pull the hash mark out of the macro call to avoid m4 problems. ac_msg="whether #! works in shell scripts" @@ -1372,12 +1373,12 @@ else fi rm -f conftest])dnl AC_MSG_RESULT($ac_cv_sys_interpreter) -])dnl -dnl +]) + AC_DEFUN(AC_HAVE_POUNDBANG, [errprint(__file__:__line__: [$0 has been replaced by AC_SYS_INTERPRETER, taking no arguments -])m4exit(4)])dnl -dnl +])m4exit(4)]) + AC_DEFUN(AC_SYS_LONG_FILE_NAMES, [AC_MSG_CHECKING(for long file names) AC_CACHE_VAL(ac_cv_sys_long_file_names, @@ -1407,8 +1408,8 @@ AC_MSG_RESULT($ac_cv_sys_long_file_names) if test $ac_cv_sys_long_file_names = yes; then AC_DEFINE(HAVE_LONG_FILE_NAMES) fi -])dnl -dnl +]) + AC_DEFUN(AC_SYS_RESTARTABLE_SYSCALLS, [AC_MSG_CHECKING(for restartable system calls) AC_CACHE_VAL(ac_cv_sys_restartable_syscalls, @@ -1432,8 +1433,8 @@ AC_MSG_RESULT($ac_cv_sys_restartable_syscalls) if test $ac_cv_sys_restartable_syscalls = yes; then AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS) fi -])dnl -dnl +]) + AC_DEFUN(AC_PATH_X, [AC_REQUIRE_CPP()dnl Set CPP; we run AC_PATH_X_DIRECT conditionally. # If we find X, set shell vars x_includes and x_libraries to the @@ -1472,8 +1473,8 @@ else ac_cv_path_x="no_x= ac_x_includes=$x_includes ac_x_libraries=$x_libraries" AC_MSG_RESULT([libraries $x_libraries, headers $x_includes]) fi -])dnl -dnl +]) + dnl Internal subroutine of AC_PATH_X. dnl Set ac_x_includes, ac_x_libraries, and no_x (initially yes). AC_DEFUN(AC_PATH_X_XMKMF, @@ -1506,14 +1507,16 @@ EOF cd .. rm -fr conftestdir fi -])dnl -dnl +]) + dnl Internal subroutine of AC_PATH_X. dnl Set ac_x_includes, ac_x_libraries, and no_x (initially yes). AC_DEFUN(AC_PATH_X_DIRECT, [test -z "$x_direct_test_library" && x_direct_test_library=Xt +test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h -AC_TRY_CPP([#include <$x_direct_test_include>], [no_x= ac_x_includes=], +AC_TRY_CPP([#include <$x_direct_test_include>], +[no_x= ac_x_includes=], [ for ac_dir in \ /usr/X11R6/include \ /usr/X11R5/include \ @@ -1557,10 +1560,16 @@ AC_TRY_CPP([#include <$x_direct_test_include>], [no_x= ac_x_includes=], fi done]) -# Check for the libraries. First see if replacing the include by -# lib works. -AC_CHECK_LIB("$x_direct_test_library", main, [no_x= ac_x_libraries=], -[for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ +# Check for the libraries. +# See if we find them without any special options. +# Don't add to $LIBS permanently. +ac_save_LIBS="${LIBS}" +LIBS="${LIBS} -l$x_direct_test_library" +AC_TRY_LINK(, [${x_direct_test_function}()], +[LIBS="${ac_save_LIBS}" no_x= ac_x_libraries=], +[LIBS="${ac_save_LIBS}" +# First see if replacing the include by lib works. +for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ /usr/X11R6/lib \ /usr/X11R5/lib \ /usr/X11R4/lib \ @@ -1603,13 +1612,12 @@ do break 2 fi done -done])])dnl -dnl +done])]) + dnl Find additional X libraries, magic flags, etc. AC_DEFUN(AC_PATH_XTRA, [AC_REQUIRE([AC_OS_ISC])dnl AC_REQUIRE([AC_PATH_X])dnl -AC_CHECKING(for additional X libraries and flags) if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. X_CFLAGS="$X_CFLAGS -DX_DISPLAY_MISSING" @@ -1645,9 +1653,8 @@ else # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). - AC_CHECK_LIB(dnet, dnet_ntoa, - [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" ac_have_dnet=yes], ac_have_dnet=no) - if test "$ac_have_dnet" = no; then + AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"]) + if test $ac_cv_lib_dnet = no; then AC_CHECK_LIB(dnet_stub, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"]) fi @@ -1669,13 +1676,13 @@ fi AC_SUBST(X_CFLAGS)dnl AC_SUBST(X_LIBS)dnl AC_SUBST(X_EXTRA_LIBS)dnl -])dnl -dnl -dnl +]) + + dnl ### Checks for UNIX variants dnl These are kludges; we need a more systematic approach. -dnl -dnl + + AC_DEFUN(AC_OS_AIX, [AC_BEFORE([$0], [AC_TRY_LINK])dnl AC_BEFORE([$0], [AC_TRY_RUN])dnl @@ -1685,8 +1692,8 @@ AC_EGREP_CPP(yes, yes #endif ], [AC_MSG_RESULT(yes); AC_DEFINE(_ALL_SOURCE)], AC_MSG_RESULT(no)) -])dnl -dnl +]) + AC_DEFUN(AC_OS_MINIX, [AC_BEFORE([$0], [AC_TRY_LINK])dnl AC_BEFORE([$0], [AC_TRY_RUN])dnl @@ -1697,8 +1704,8 @@ if test "$MINIX" = yes; then AC_DEFINE(_POSIX_1_SOURCE, 2) AC_DEFINE(_MINIX) fi -])dnl -dnl +]) + AC_DEFUN(AC_OS_ISC, [AC_BEFORE([$0], [AC_TRY_LINK])dnl AC_BEFORE([$0], [AC_TRY_RUN])dnl @@ -1718,8 +1725,8 @@ else AC_MSG_RESULT(no) ISC= fi -])dnl -dnl +]) + AC_DEFUN(AC_OS_XENIX, [AC_REQUIRE([AC_DIR_HEADER])dnl AC_MSG_CHECKING(for Xenix) @@ -1734,16 +1741,16 @@ if test "$XENIX" = yes; then LIBS="-ldir $LIBS" # Make sure -ldir precedes -lx. fi fi -])dnl -dnl +]) + AC_DEFUN(AC_OS_SCO, [AC_CHECK_LIB(intl, strftime, LIBS="$LIBS -lintl") -])dnl -dnl +]) + AC_DEFUN(AC_OS_IRIX, [AC_CHECK_LIB(sun, getmntent, LIBS="$LIBS -lsun") -])dnl -dnl +]) + AC_DEFUN(AC_OS_DYNIX, [AC_CHECK_LIB(seq, getmntent, LIBS="$LIBS -lseq") -])dnl +]) diff --git a/autoconf.in b/autoconf.in index 63b776e36..846560f9b 100644 --- a/autoconf.in +++ b/autoconf.in @@ -40,7 +40,7 @@ case "${M4}" in esac tmpout=/tmp/acout.$$ -print_version= +show_version=no while test $# -gt 0 ; do case "${1}" in @@ -55,9 +55,7 @@ while test $# -gt 0 ; do AC_MACRODIR="${1}" shift ;; -v | --version | --v* ) - print_version="-DAC_PRINT_VERSION" - infile=/dev/null - shift ;; + show_version=yes; shift ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -69,23 +67,28 @@ while test $# -gt 0 ; do esac done -if test -z "$print_version"; then - case $# in - 0) infile=configure.in ;; - 1) infile="$1" ;; - *) echo "$usage" >&2; exit 1 ;; - esac - - trap 'rm -f $tmpin $tmpout; exit 1' 1 2 15 - - if test z$infile = z-; then - tmpin=/tmp/acin.$$ - infile=$tmpin - cat > $infile - elif test ! -r "${infile}"; then - echo "autoconf: ${infile}: No such file or directory" >&2 - exit 1 - fi +if test $show_version = yes; then + version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \ + $AC_MACRODIR/acgeneral.m4` + echo "Autoconf version $version" + exit 0 +fi + +case $# in + 0) infile=configure.in ;; + 1) infile="$1" ;; + *) echo "$usage" >&2; exit 1 ;; +esac + +trap 'rm -f $tmpin $tmpout; exit 1' 1 2 15 + +if test z$infile = z-; then + tmpin=/tmp/acin.$$ + infile=$tmpin + cat > $infile +elif test ! -r "${infile}"; then + echo "autoconf: ${infile}: No such file or directory" >&2 + exit 1 fi # Use the frozen version of Autoconf if available. @@ -97,13 +100,7 @@ case `$M4 --help < /dev/null 2>&1` in *) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;; esac -$M4 -I$AC_MACRODIR $print_version $r autoconf.m4$f $infile > $tmpout || { rm -f $tmpin $tmpout; exit 2; } - -if test -n "$print_version"; then - cat $tmpout - rm -f $tmpout - exit 0 -fi +$M4 -I$AC_MACRODIR $r autoconf.m4$f $infile > $tmpout || { rm -f $tmpin $tmpout; exit 2; } # You could add your own prefixes to pattern if you wanted to check for # them too, e.g. pattern="AC_\|ILT_", except that UNIX sed doesn't do diff --git a/autoconf.sh b/autoconf.sh index 63b776e36..846560f9b 100644 --- a/autoconf.sh +++ b/autoconf.sh @@ -40,7 +40,7 @@ case "${M4}" in esac tmpout=/tmp/acout.$$ -print_version= +show_version=no while test $# -gt 0 ; do case "${1}" in @@ -55,9 +55,7 @@ while test $# -gt 0 ; do AC_MACRODIR="${1}" shift ;; -v | --version | --v* ) - print_version="-DAC_PRINT_VERSION" - infile=/dev/null - shift ;; + show_version=yes; shift ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -69,23 +67,28 @@ while test $# -gt 0 ; do esac done -if test -z "$print_version"; then - case $# in - 0) infile=configure.in ;; - 1) infile="$1" ;; - *) echo "$usage" >&2; exit 1 ;; - esac - - trap 'rm -f $tmpin $tmpout; exit 1' 1 2 15 - - if test z$infile = z-; then - tmpin=/tmp/acin.$$ - infile=$tmpin - cat > $infile - elif test ! -r "${infile}"; then - echo "autoconf: ${infile}: No such file or directory" >&2 - exit 1 - fi +if test $show_version = yes; then + version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \ + $AC_MACRODIR/acgeneral.m4` + echo "Autoconf version $version" + exit 0 +fi + +case $# in + 0) infile=configure.in ;; + 1) infile="$1" ;; + *) echo "$usage" >&2; exit 1 ;; +esac + +trap 'rm -f $tmpin $tmpout; exit 1' 1 2 15 + +if test z$infile = z-; then + tmpin=/tmp/acin.$$ + infile=$tmpin + cat > $infile +elif test ! -r "${infile}"; then + echo "autoconf: ${infile}: No such file or directory" >&2 + exit 1 fi # Use the frozen version of Autoconf if available. @@ -97,13 +100,7 @@ case `$M4 --help < /dev/null 2>&1` in *) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;; esac -$M4 -I$AC_MACRODIR $print_version $r autoconf.m4$f $infile > $tmpout || { rm -f $tmpin $tmpout; exit 2; } - -if test -n "$print_version"; then - cat $tmpout - rm -f $tmpout - exit 0 -fi +$M4 -I$AC_MACRODIR $r autoconf.m4$f $infile > $tmpout || { rm -f $tmpin $tmpout; exit 2; } # You could add your own prefixes to pattern if you wanted to check for # them too, e.g. pattern="AC_\|ILT_", except that UNIX sed doesn't do diff --git a/autoconf.texi b/autoconf.texi index 3ce904f6d..7cf12d15d 100644 --- a/autoconf.texi +++ b/autoconf.texi @@ -6,8 +6,8 @@ @c @setchapternewpage odd @c %**end of header -@set EDITION 1.109 -@set VERSION 1.109 +@set EDITION 1.110 +@set VERSION 1.110 @set UPDATED August 1994 @iftex @@ -650,9 +650,11 @@ scripts in a directory tree. @table @code @item --help +@itemx -h Print a summary of the command line options and exit. @item --macrodir=@var{dir} +@itemx -m @var{dir} Look for the Autoconf macro files in directory @var{dir} instead of the default installation directory. @@ -700,7 +702,6 @@ Look for the Autoconf macro files in directory @var{dir} instead of the default installation directory. @item --version -@itemx -v Print the version number of @code{autoupdate} and exit. @end table @@ -800,7 +801,7 @@ directory). This macro also sets the shell and @code{make} variable subdirectories to recurse into. @end defmac -@defmac AC_OUTPUT (@r{[}@var{file}@dots{}@r{] [,}@var{extra-cmds}@r{]}) +@defmac AC_OUTPUT (@r{[}@var{file}@dots{}@r{] [,}@var{extra-cmds}@r{] [,}@var{init-cmds}@r{]}) @maindex OUTPUT Create output files (typically one or more @file{Makefile}s) and @file{config.status}. If @code{AC_CONFIG_HEADER} has been called, also @@ -821,7 +822,12 @@ AC_OUTPUT(Makefile:templates/top.mk lib/Makefile:templates/lib.mk) @end example If you pass @var{extra-cmds}, those commands will be inserted into -@file{config.status} to be run after all its other processing. +@file{config.status} to be run after all its other processing. If +@var{init-cmds} are given, they are inserted just before +@var{extra-cmds}, with shell variable, command, and backslash +substitutions performed on them in @code{configure}. You can use +@var{init-cmds} to pass variables from @code{configure} to the +@var{extra-cmds}. @end defmac @node Package Options, Versions, Output, Operation @@ -2054,20 +2060,20 @@ supports @samp{#!}, @samp{no} if not. @defmac AC_PATH_X @maindex PATH_X -Try to locate the X Window System include files and libraries. Try -first by running @code{xmkmf} on a trivial @file{Imakefile} and -examining the @file{Makefile} that it produces. If that fails (such as -if @code{xmkmf} is not present), look for them in several directories -where they often reside. If either method is successful, set the shell -variables @code{x_includes} and @code{x_libraries} to their locations, -unless they are in directories the compiler searches by default. +Try to locate the X Window System include files and libraries. If the +user gave the command line options @samp{--x-includes=@var{dir}} and +@samp{--x-libraries=@var{dir}}, use those directories. If either or +both were not given, get the missing values by running @code{xmkmf} on a +trivial @file{Imakefile} and examining the @file{Makefile} that it +produces. If that fails (such as if @code{xmkmf} is not present), look +for them in several directories where they often reside. If either +method is successful, set the shell variables @code{x_includes} and +@code{x_libraries} to their locations, unless they are in directories +the compiler searches by default. If both methods fail, or the user gave the command line option @samp{--without-x}, set the shell variable @code{no_x} to @samp{yes}; otherwise set it to the empty string. - -The command line options @samp{--x-includes=@var{dir}} and -@samp{--x-libraries=@var{dir}} override the values chosen by this macro. @end defmac @defmac AC_PATH_XTRA @@ -2187,9 +2193,10 @@ section below, the macros are listed in alphabetical order. These macros check the output of the C compiler system. They @emph{do not} cache the results of their tests for future use (@pxref{Caching Values}), because they don't know enough about the information they are -checking for to generate a cache variable name. The checks for -particular kinds of C features call these macros and do cache their -results. +checking for to generate a cache variable name. They also do not print +any messages, for the same reason. The checks for particular kinds of C +features call these macros and do cache their results and print messages +about what they're checking for. @defmac AC_COMPILE_CHECK (@var{echo-text}, @var{includes}, @var{function-body}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]}) @maindex COMPILE_CHECK @@ -2216,7 +2223,7 @@ been called already. If the output of running the preprocessor on the system header file @var{header-file} contains the @code{egrep} regular expression @var{pattern}, execute shell commands @var{action-if-found}, otherwise -execute +execute @var{action-if-not-found}. This macro calls @code{AC_PROG_CPP} or @code{AC_PROG_CXXCPP} (depending on which language is current, @pxref{Language Choice}), if it hasn't @@ -2599,22 +2606,20 @@ macro which is used to constrain the order in which macros are called An Autoconf macro definition looks like this: @example -AC_DEFUN(@var{macro-name}, [@var{macro-body}])dnl +AC_DEFUN(@var{macro-name}, [@var{macro-body}]) @end example @noindent The square brackets here do not indicate optional text: they should -literally be present in the macro definition. - -The @code{m4} builtin @code{dnl} prevents a newline from being inserted -in the output where the macro is defined; without it, the generated -@code{configure} script would begin with dozens of blank lines. -@code{dnl} is also used to introduce comments in @code{m4}; it causes -@code{m4} to discard the rest of the input line. +literally be present in the macro definition to avoid macro expansion +problems (@pxref{Quoting}). You can refer to any arguments passed to +the macro as @samp{$1}, @samp{$2}, etc. -You should quote the entire macro body with square brackets to avoid -macro expansion problems (@pxref{Quoting}). You can refer to any -arguments passed to the macro as @samp{$1}, @samp{$2}, etc. +The @code{m4} builtin @code{dnl} is used to introduce comments in +@code{m4}; it causes @code{m4} to discard the text through the next +newline. It is not needed between macro definitions in @file{acsite.m4} +and @file{aclocal.m4}, because all output is discarded until +@code{AC_INIT} is called. @xref{Definitions, , How to define new macros, m4.info, GNU m4}, for more complete information on writing @code{m4} macros. @@ -2904,15 +2909,19 @@ well; for example, don't rely on @code{ln} having a @samp{-f} option or @node Checking for Files, Checking for Symbols, Portable Shell, Writing Macros @section Checking for Files -If you need to check whether a file other than a C header file exists, -use @samp{test -f @var{filename}}. If you need to make multiple checks -using @code{test}, combine them with the shell operators @samp{&&} and -@samp{||} instead of using the @code{test} operators @samp{-a} and -@samp{-o}. On System V, the precedence of @samp{-a} and @samp{-o} is -wrong relative to the unary operators; consequently, POSIX does not -specify them, so using them is nonportable. If you combine @samp{&&} -and @samp{||} in the same statement, keep in mind that they have equal -precedence. +To enable @code{configure} scripts to support cross-compilation, they +shouldn't do anything that tests features of the host system instead of +the target system. But occasionally you may find it necessary to check +whether some arbitrary file exists. + +To do so, use @samp{test -f @var{filename}}. If you need to make +multiple checks using @code{test}, combine them with the shell operators +@samp{&&} and @samp{||} instead of using the @code{test} operators +@samp{-a} and @samp{-o}. On System V, the precedence of @samp{-a} and +@samp{-o} is wrong relative to the unary operators; consequently, POSIX +does not specify them, so using them is nonportable. If you combine +@samp{&&} and @samp{||} in the same statement, keep in mind that they +have equal precedence. Do not use @samp{test -x}, because 4.3BSD does not have it. Use @samp{test -f} or @samp{test -r} instead. @@ -2980,10 +2989,6 @@ a test results cache file with the correct values for the target system choose a value for those parameters based on the canonical system name (@pxref{Manual Configuration}). -To enable @code{configure} scripts to support cross-compilation, they -shouldn't do anything that tests features of the host system instead of -the target system. - @menu * Guidelines:: General rules for writing test programs. * Test Functions:: Special ways to work around problems. @@ -4176,7 +4181,17 @@ of the program. I made the messages showing results of the checks less ambiguous, always printing a result. I regularized the names of the macros and cleaned up coding style inconsistencies. I added some auxiliary utilities that I had developed to help convert source code -packages to use Autoconf. And I began a testsuite, because experience +packages to use Autoconf. With the help of +@ifinfo +Franc,ois +@end ifinfo +@tex +Fran\c cois +@end tex +Pinard, I made the macros not interrupt each others' messages. +(That feature revealed some performance bottlenecks in GNU @code{m4}, +which he hastily rewrote!) +And I began a testsuite, because experience had shown that Autoconf has a pronounced tendency to regress when we change it. diff --git a/autoheader.in b/autoheader.in index ccf74a48f..e8f091324 100644 --- a/autoheader.in +++ b/autoheader.in @@ -41,7 +41,7 @@ case "${M4}" in test -f "${M4}" || M4=m4 ;; esac -print_version="" +show_version=no while test $# -gt 0 ; do case "z${1}" in z-h | z--help | z--h* ) @@ -55,8 +55,7 @@ while test $# -gt 0 ; do AC_MACRODIR="${1}" shift ;; z-v | z--version | z--v* ) - print_version="-DAC_PRINT_VERSION" - shift ;; + show_version=yes; shift ;; z-- ) # Stop option processing shift; break ;; z- ) # Use stdin as input. @@ -68,13 +67,18 @@ while test $# -gt 0 ; do esac done +if test $show_version = yes; then + version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \ + $AC_MACRODIR/acgeneral.m4` + echo "Autoconf version $version" + exit 0 +fi + TEMPLATES="${AC_MACRODIR}/acconfig.h" test -r acconfig.h && TEMPLATES="${TEMPLATES} acconfig.h" case $# in - 0) if test -n "$print_version" - then infile=/dev/null - else infile=configure.in; fi ;; + 0) infile=configure.in ;; 1) infile=$1 ;; *) echo "$usage" >&2; exit 1 ;; esac @@ -98,7 +102,7 @@ esac # Extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the # modified autoconf processing of the input file. The sed hair is # necessary to win for multi-line macro invocations. -eval "`$M4 -I$AC_MACRODIR $print_version $r autoheader.m4$f $infile | +eval "`$M4 -I$AC_MACRODIR $r autoheader.m4$f $infile | sed -n -e ' : again /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p @@ -109,8 +113,6 @@ eval "`$M4 -I$AC_MACRODIR $print_version $r autoheader.m4$f $infile | b again }'`" -test -n "$print_version" && exit 0 - # Make SYMS newline-separated rather than blank-separated, and remove dups. # Start each symbol with a blank (to match the blank after "#undef") # to reduce the possibility of mistakenly matching another symbol that @@ -170,26 +172,33 @@ echo "$types" | tr , \\012 | sort | uniq | while read ctype; do #undef SIZEOF_${sym}" done -for func in `for x in $funcs; do echo $x; done | sort | uniq`; do - sym="`echo ${func} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" - echo " +# /bin/sh on the Alpha gives `for' a random value if $funcs is empty. +if test -n "$funcs"; then + for func in `for x in $funcs; do echo $x; done | sort | uniq`; do + sym="`echo ${func} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" + echo " /* Define if you have the ${func} function. */ #undef HAVE_${sym}" -done + done +fi -for header in `for x in $headers; do echo $x; done | sort | uniq`; do - sym="`echo ${header} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" - echo " +if test -n "$headers"; then + for header in `for x in $headers; do echo $x; done | sort | uniq`; do + sym="`echo ${header} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" + echo " /* Define if you have the <${header}> header file. */ #undef HAVE_${sym}" -done + done +fi -for lib in `for x in $libs; do echo $x; done | sort | uniq`; do - sym="`echo ${lib} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" - echo " +if test -n "$libs"; then + for lib in `for x in $libs; do echo $x; done | sort | uniq`; do + sym="`echo ${lib} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" + echo " /* Define if you have the ${lib} library (-l${lib}). */ #undef HAVE_LIB${sym}" -done + done +fi test -r acconfig.h && grep @BOTTOM@ acconfig.h >/dev/null && sed '1,/@BOTTOM@/d' acconfig.h diff --git a/autoheader.sh b/autoheader.sh index ccf74a48f..e8f091324 100644 --- a/autoheader.sh +++ b/autoheader.sh @@ -41,7 +41,7 @@ case "${M4}" in test -f "${M4}" || M4=m4 ;; esac -print_version="" +show_version=no while test $# -gt 0 ; do case "z${1}" in z-h | z--help | z--h* ) @@ -55,8 +55,7 @@ while test $# -gt 0 ; do AC_MACRODIR="${1}" shift ;; z-v | z--version | z--v* ) - print_version="-DAC_PRINT_VERSION" - shift ;; + show_version=yes; shift ;; z-- ) # Stop option processing shift; break ;; z- ) # Use stdin as input. @@ -68,13 +67,18 @@ while test $# -gt 0 ; do esac done +if test $show_version = yes; then + version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \ + $AC_MACRODIR/acgeneral.m4` + echo "Autoconf version $version" + exit 0 +fi + TEMPLATES="${AC_MACRODIR}/acconfig.h" test -r acconfig.h && TEMPLATES="${TEMPLATES} acconfig.h" case $# in - 0) if test -n "$print_version" - then infile=/dev/null - else infile=configure.in; fi ;; + 0) infile=configure.in ;; 1) infile=$1 ;; *) echo "$usage" >&2; exit 1 ;; esac @@ -98,7 +102,7 @@ esac # Extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the # modified autoconf processing of the input file. The sed hair is # necessary to win for multi-line macro invocations. -eval "`$M4 -I$AC_MACRODIR $print_version $r autoheader.m4$f $infile | +eval "`$M4 -I$AC_MACRODIR $r autoheader.m4$f $infile | sed -n -e ' : again /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p @@ -109,8 +113,6 @@ eval "`$M4 -I$AC_MACRODIR $print_version $r autoheader.m4$f $infile | b again }'`" -test -n "$print_version" && exit 0 - # Make SYMS newline-separated rather than blank-separated, and remove dups. # Start each symbol with a blank (to match the blank after "#undef") # to reduce the possibility of mistakenly matching another symbol that @@ -170,26 +172,33 @@ echo "$types" | tr , \\012 | sort | uniq | while read ctype; do #undef SIZEOF_${sym}" done -for func in `for x in $funcs; do echo $x; done | sort | uniq`; do - sym="`echo ${func} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" - echo " +# /bin/sh on the Alpha gives `for' a random value if $funcs is empty. +if test -n "$funcs"; then + for func in `for x in $funcs; do echo $x; done | sort | uniq`; do + sym="`echo ${func} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" + echo " /* Define if you have the ${func} function. */ #undef HAVE_${sym}" -done + done +fi -for header in `for x in $headers; do echo $x; done | sort | uniq`; do - sym="`echo ${header} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" - echo " +if test -n "$headers"; then + for header in `for x in $headers; do echo $x; done | sort | uniq`; do + sym="`echo ${header} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" + echo " /* Define if you have the <${header}> header file. */ #undef HAVE_${sym}" -done + done +fi -for lib in `for x in $libs; do echo $x; done | sort | uniq`; do - sym="`echo ${lib} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" - echo " +if test -n "$libs"; then + for lib in `for x in $libs; do echo $x; done | sort | uniq`; do + sym="`echo ${lib} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" + echo " /* Define if you have the ${lib} library (-l${lib}). */ #undef HAVE_LIB${sym}" -done + done +fi test -r acconfig.h && grep @BOTTOM@ acconfig.h >/dev/null && sed '1,/@BOTTOM@/d' acconfig.h diff --git a/autoreconf.in b/autoreconf.in index dd7dd883e..4b51cf446 100644 --- a/autoreconf.in +++ b/autoreconf.in @@ -17,8 +17,8 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. usage="\ -Usage: autoreconf [--help] [--macrodir=dir] [--verbose] [--version] - [directory...]" +Usage: autoreconf [-h] [--help] [-m dir] [--macrodir=dir] + [--verbose] [--version] [directory...]" verbose=no show_version=no @@ -27,7 +27,7 @@ export AC_MACRODIR # Pass it down to autoconf and autoheader. while test $# -gt 0; do case "$1" in - --help | --hel | --he | --h) + -h | --help | --hel | --he | --h) echo "$usage"; exit 0 ;; --macrodir=* | --m*=* ) AC_MACRODIR="`echo \"$1\" | sed -e 's/^[^=]*=//'`" diff --git a/autoreconf.sh b/autoreconf.sh index dd7dd883e..4b51cf446 100644 --- a/autoreconf.sh +++ b/autoreconf.sh @@ -17,8 +17,8 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. usage="\ -Usage: autoreconf [--help] [--macrodir=dir] [--verbose] [--version] - [directory...]" +Usage: autoreconf [-h] [--help] [-m dir] [--macrodir=dir] + [--verbose] [--version] [directory...]" verbose=no show_version=no @@ -27,7 +27,7 @@ export AC_MACRODIR # Pass it down to autoconf and autoheader. while test $# -gt 0; do case "$1" in - --help | --hel | --he | --h) + -h | --help | --hel | --he | --h) echo "$usage"; exit 0 ;; --macrodir=* | --m*=* ) AC_MACRODIR="`echo \"$1\" | sed -e 's/^[^=]*=//'`" diff --git a/bin/autoconf.in b/bin/autoconf.in index 63b776e36..846560f9b 100644 --- a/bin/autoconf.in +++ b/bin/autoconf.in @@ -40,7 +40,7 @@ case "${M4}" in esac tmpout=/tmp/acout.$$ -print_version= +show_version=no while test $# -gt 0 ; do case "${1}" in @@ -55,9 +55,7 @@ while test $# -gt 0 ; do AC_MACRODIR="${1}" shift ;; -v | --version | --v* ) - print_version="-DAC_PRINT_VERSION" - infile=/dev/null - shift ;; + show_version=yes; shift ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. @@ -69,23 +67,28 @@ while test $# -gt 0 ; do esac done -if test -z "$print_version"; then - case $# in - 0) infile=configure.in ;; - 1) infile="$1" ;; - *) echo "$usage" >&2; exit 1 ;; - esac - - trap 'rm -f $tmpin $tmpout; exit 1' 1 2 15 - - if test z$infile = z-; then - tmpin=/tmp/acin.$$ - infile=$tmpin - cat > $infile - elif test ! -r "${infile}"; then - echo "autoconf: ${infile}: No such file or directory" >&2 - exit 1 - fi +if test $show_version = yes; then + version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \ + $AC_MACRODIR/acgeneral.m4` + echo "Autoconf version $version" + exit 0 +fi + +case $# in + 0) infile=configure.in ;; + 1) infile="$1" ;; + *) echo "$usage" >&2; exit 1 ;; +esac + +trap 'rm -f $tmpin $tmpout; exit 1' 1 2 15 + +if test z$infile = z-; then + tmpin=/tmp/acin.$$ + infile=$tmpin + cat > $infile +elif test ! -r "${infile}"; then + echo "autoconf: ${infile}: No such file or directory" >&2 + exit 1 fi # Use the frozen version of Autoconf if available. @@ -97,13 +100,7 @@ case `$M4 --help < /dev/null 2>&1` in *) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;; esac -$M4 -I$AC_MACRODIR $print_version $r autoconf.m4$f $infile > $tmpout || { rm -f $tmpin $tmpout; exit 2; } - -if test -n "$print_version"; then - cat $tmpout - rm -f $tmpout - exit 0 -fi +$M4 -I$AC_MACRODIR $r autoconf.m4$f $infile > $tmpout || { rm -f $tmpin $tmpout; exit 2; } # You could add your own prefixes to pattern if you wanted to check for # them too, e.g. pattern="AC_\|ILT_", except that UNIX sed doesn't do diff --git a/bin/autoheader.in b/bin/autoheader.in index ccf74a48f..e8f091324 100644 --- a/bin/autoheader.in +++ b/bin/autoheader.in @@ -41,7 +41,7 @@ case "${M4}" in test -f "${M4}" || M4=m4 ;; esac -print_version="" +show_version=no while test $# -gt 0 ; do case "z${1}" in z-h | z--help | z--h* ) @@ -55,8 +55,7 @@ while test $# -gt 0 ; do AC_MACRODIR="${1}" shift ;; z-v | z--version | z--v* ) - print_version="-DAC_PRINT_VERSION" - shift ;; + show_version=yes; shift ;; z-- ) # Stop option processing shift; break ;; z- ) # Use stdin as input. @@ -68,13 +67,18 @@ while test $# -gt 0 ; do esac done +if test $show_version = yes; then + version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \ + $AC_MACRODIR/acgeneral.m4` + echo "Autoconf version $version" + exit 0 +fi + TEMPLATES="${AC_MACRODIR}/acconfig.h" test -r acconfig.h && TEMPLATES="${TEMPLATES} acconfig.h" case $# in - 0) if test -n "$print_version" - then infile=/dev/null - else infile=configure.in; fi ;; + 0) infile=configure.in ;; 1) infile=$1 ;; *) echo "$usage" >&2; exit 1 ;; esac @@ -98,7 +102,7 @@ esac # Extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the # modified autoconf processing of the input file. The sed hair is # necessary to win for multi-line macro invocations. -eval "`$M4 -I$AC_MACRODIR $print_version $r autoheader.m4$f $infile | +eval "`$M4 -I$AC_MACRODIR $r autoheader.m4$f $infile | sed -n -e ' : again /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p @@ -109,8 +113,6 @@ eval "`$M4 -I$AC_MACRODIR $print_version $r autoheader.m4$f $infile | b again }'`" -test -n "$print_version" && exit 0 - # Make SYMS newline-separated rather than blank-separated, and remove dups. # Start each symbol with a blank (to match the blank after "#undef") # to reduce the possibility of mistakenly matching another symbol that @@ -170,26 +172,33 @@ echo "$types" | tr , \\012 | sort | uniq | while read ctype; do #undef SIZEOF_${sym}" done -for func in `for x in $funcs; do echo $x; done | sort | uniq`; do - sym="`echo ${func} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" - echo " +# /bin/sh on the Alpha gives `for' a random value if $funcs is empty. +if test -n "$funcs"; then + for func in `for x in $funcs; do echo $x; done | sort | uniq`; do + sym="`echo ${func} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" + echo " /* Define if you have the ${func} function. */ #undef HAVE_${sym}" -done + done +fi -for header in `for x in $headers; do echo $x; done | sort | uniq`; do - sym="`echo ${header} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" - echo " +if test -n "$headers"; then + for header in `for x in $headers; do echo $x; done | sort | uniq`; do + sym="`echo ${header} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" + echo " /* Define if you have the <${header}> header file. */ #undef HAVE_${sym}" -done + done +fi -for lib in `for x in $libs; do echo $x; done | sort | uniq`; do - sym="`echo ${lib} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" - echo " +if test -n "$libs"; then + for lib in `for x in $libs; do echo $x; done | sort | uniq`; do + sym="`echo ${lib} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" + echo " /* Define if you have the ${lib} library (-l${lib}). */ #undef HAVE_LIB${sym}" -done + done +fi test -r acconfig.h && grep @BOTTOM@ acconfig.h >/dev/null && sed '1,/@BOTTOM@/d' acconfig.h diff --git a/bin/autoreconf.in b/bin/autoreconf.in index dd7dd883e..4b51cf446 100644 --- a/bin/autoreconf.in +++ b/bin/autoreconf.in @@ -17,8 +17,8 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. usage="\ -Usage: autoreconf [--help] [--macrodir=dir] [--verbose] [--version] - [directory...]" +Usage: autoreconf [-h] [--help] [-m dir] [--macrodir=dir] + [--verbose] [--version] [directory...]" verbose=no show_version=no @@ -27,7 +27,7 @@ export AC_MACRODIR # Pass it down to autoconf and autoheader. while test $# -gt 0; do case "$1" in - --help | --hel | --he | --h) + -h | --help | --hel | --he | --h) echo "$usage"; exit 0 ;; --macrodir=* | --m*=* ) AC_MACRODIR="`echo \"$1\" | sed -e 's/^[^=]*=//'`" diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 3ce904f6d..7cf12d15d 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -6,8 +6,8 @@ @c @setchapternewpage odd @c %**end of header -@set EDITION 1.109 -@set VERSION 1.109 +@set EDITION 1.110 +@set VERSION 1.110 @set UPDATED August 1994 @iftex @@ -650,9 +650,11 @@ scripts in a directory tree. @table @code @item --help +@itemx -h Print a summary of the command line options and exit. @item --macrodir=@var{dir} +@itemx -m @var{dir} Look for the Autoconf macro files in directory @var{dir} instead of the default installation directory. @@ -700,7 +702,6 @@ Look for the Autoconf macro files in directory @var{dir} instead of the default installation directory. @item --version -@itemx -v Print the version number of @code{autoupdate} and exit. @end table @@ -800,7 +801,7 @@ directory). This macro also sets the shell and @code{make} variable subdirectories to recurse into. @end defmac -@defmac AC_OUTPUT (@r{[}@var{file}@dots{}@r{] [,}@var{extra-cmds}@r{]}) +@defmac AC_OUTPUT (@r{[}@var{file}@dots{}@r{] [,}@var{extra-cmds}@r{] [,}@var{init-cmds}@r{]}) @maindex OUTPUT Create output files (typically one or more @file{Makefile}s) and @file{config.status}. If @code{AC_CONFIG_HEADER} has been called, also @@ -821,7 +822,12 @@ AC_OUTPUT(Makefile:templates/top.mk lib/Makefile:templates/lib.mk) @end example If you pass @var{extra-cmds}, those commands will be inserted into -@file{config.status} to be run after all its other processing. +@file{config.status} to be run after all its other processing. If +@var{init-cmds} are given, they are inserted just before +@var{extra-cmds}, with shell variable, command, and backslash +substitutions performed on them in @code{configure}. You can use +@var{init-cmds} to pass variables from @code{configure} to the +@var{extra-cmds}. @end defmac @node Package Options, Versions, Output, Operation @@ -2054,20 +2060,20 @@ supports @samp{#!}, @samp{no} if not. @defmac AC_PATH_X @maindex PATH_X -Try to locate the X Window System include files and libraries. Try -first by running @code{xmkmf} on a trivial @file{Imakefile} and -examining the @file{Makefile} that it produces. If that fails (such as -if @code{xmkmf} is not present), look for them in several directories -where they often reside. If either method is successful, set the shell -variables @code{x_includes} and @code{x_libraries} to their locations, -unless they are in directories the compiler searches by default. +Try to locate the X Window System include files and libraries. If the +user gave the command line options @samp{--x-includes=@var{dir}} and +@samp{--x-libraries=@var{dir}}, use those directories. If either or +both were not given, get the missing values by running @code{xmkmf} on a +trivial @file{Imakefile} and examining the @file{Makefile} that it +produces. If that fails (such as if @code{xmkmf} is not present), look +for them in several directories where they often reside. If either +method is successful, set the shell variables @code{x_includes} and +@code{x_libraries} to their locations, unless they are in directories +the compiler searches by default. If both methods fail, or the user gave the command line option @samp{--without-x}, set the shell variable @code{no_x} to @samp{yes}; otherwise set it to the empty string. - -The command line options @samp{--x-includes=@var{dir}} and -@samp{--x-libraries=@var{dir}} override the values chosen by this macro. @end defmac @defmac AC_PATH_XTRA @@ -2187,9 +2193,10 @@ section below, the macros are listed in alphabetical order. These macros check the output of the C compiler system. They @emph{do not} cache the results of their tests for future use (@pxref{Caching Values}), because they don't know enough about the information they are -checking for to generate a cache variable name. The checks for -particular kinds of C features call these macros and do cache their -results. +checking for to generate a cache variable name. They also do not print +any messages, for the same reason. The checks for particular kinds of C +features call these macros and do cache their results and print messages +about what they're checking for. @defmac AC_COMPILE_CHECK (@var{echo-text}, @var{includes}, @var{function-body}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]}) @maindex COMPILE_CHECK @@ -2216,7 +2223,7 @@ been called already. If the output of running the preprocessor on the system header file @var{header-file} contains the @code{egrep} regular expression @var{pattern}, execute shell commands @var{action-if-found}, otherwise -execute +execute @var{action-if-not-found}. This macro calls @code{AC_PROG_CPP} or @code{AC_PROG_CXXCPP} (depending on which language is current, @pxref{Language Choice}), if it hasn't @@ -2599,22 +2606,20 @@ macro which is used to constrain the order in which macros are called An Autoconf macro definition looks like this: @example -AC_DEFUN(@var{macro-name}, [@var{macro-body}])dnl +AC_DEFUN(@var{macro-name}, [@var{macro-body}]) @end example @noindent The square brackets here do not indicate optional text: they should -literally be present in the macro definition. - -The @code{m4} builtin @code{dnl} prevents a newline from being inserted -in the output where the macro is defined; without it, the generated -@code{configure} script would begin with dozens of blank lines. -@code{dnl} is also used to introduce comments in @code{m4}; it causes -@code{m4} to discard the rest of the input line. +literally be present in the macro definition to avoid macro expansion +problems (@pxref{Quoting}). You can refer to any arguments passed to +the macro as @samp{$1}, @samp{$2}, etc. -You should quote the entire macro body with square brackets to avoid -macro expansion problems (@pxref{Quoting}). You can refer to any -arguments passed to the macro as @samp{$1}, @samp{$2}, etc. +The @code{m4} builtin @code{dnl} is used to introduce comments in +@code{m4}; it causes @code{m4} to discard the text through the next +newline. It is not needed between macro definitions in @file{acsite.m4} +and @file{aclocal.m4}, because all output is discarded until +@code{AC_INIT} is called. @xref{Definitions, , How to define new macros, m4.info, GNU m4}, for more complete information on writing @code{m4} macros. @@ -2904,15 +2909,19 @@ well; for example, don't rely on @code{ln} having a @samp{-f} option or @node Checking for Files, Checking for Symbols, Portable Shell, Writing Macros @section Checking for Files -If you need to check whether a file other than a C header file exists, -use @samp{test -f @var{filename}}. If you need to make multiple checks -using @code{test}, combine them with the shell operators @samp{&&} and -@samp{||} instead of using the @code{test} operators @samp{-a} and -@samp{-o}. On System V, the precedence of @samp{-a} and @samp{-o} is -wrong relative to the unary operators; consequently, POSIX does not -specify them, so using them is nonportable. If you combine @samp{&&} -and @samp{||} in the same statement, keep in mind that they have equal -precedence. +To enable @code{configure} scripts to support cross-compilation, they +shouldn't do anything that tests features of the host system instead of +the target system. But occasionally you may find it necessary to check +whether some arbitrary file exists. + +To do so, use @samp{test -f @var{filename}}. If you need to make +multiple checks using @code{test}, combine them with the shell operators +@samp{&&} and @samp{||} instead of using the @code{test} operators +@samp{-a} and @samp{-o}. On System V, the precedence of @samp{-a} and +@samp{-o} is wrong relative to the unary operators; consequently, POSIX +does not specify them, so using them is nonportable. If you combine +@samp{&&} and @samp{||} in the same statement, keep in mind that they +have equal precedence. Do not use @samp{test -x}, because 4.3BSD does not have it. Use @samp{test -f} or @samp{test -r} instead. @@ -2980,10 +2989,6 @@ a test results cache file with the correct values for the target system choose a value for those parameters based on the canonical system name (@pxref{Manual Configuration}). -To enable @code{configure} scripts to support cross-compilation, they -shouldn't do anything that tests features of the host system instead of -the target system. - @menu * Guidelines:: General rules for writing test programs. * Test Functions:: Special ways to work around problems. @@ -4176,7 +4181,17 @@ of the program. I made the messages showing results of the checks less ambiguous, always printing a result. I regularized the names of the macros and cleaned up coding style inconsistencies. I added some auxiliary utilities that I had developed to help convert source code -packages to use Autoconf. And I began a testsuite, because experience +packages to use Autoconf. With the help of +@ifinfo +Franc,ois +@end ifinfo +@tex +Fran\c cois +@end tex +Pinard, I made the macros not interrupt each others' messages. +(That feature revealed some performance bottlenecks in GNU @code{m4}, +which he hastily rewrote!) +And I began a testsuite, because experience had shown that Autoconf has a pronounced tendency to regress when we change it. diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index bba3c8c77..878b7c02c 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -21,32 +21,31 @@ dnl Written by David MacKenzie, with help from dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, dnl Roland McGrath, Noah Friedman, and david d zuhn. dnl -changequote([, ])dnl -undefine([eval])dnl -undefine([include])dnl -undefine([shift])dnl -undefine([format])dnl -dnl +divert(-1)dnl Throw away output until AC_INIT is called. +changequote([, ]) + +define(AC_ACVERSION, 1.110) + dnl Some old m4's don't support m4exit. But they provide dnl equivalent functionality by core dumping because of the dnl long macros we define. ifdef([__gnu__], , [errprint(Autoconf requires GNU m4. Install it before installing Autoconf or set the M4 environment variable to its path name. -)m4exit(2)])dnl -dnl -define(AC_ACVERSION, 1.109)dnl -dnl This is defined by the --version option of the autoconf script. -ifdef([AC_PRINT_VERSION], [Autoconf version AC_ACVERSION -m4exit(0)])dnl -dnl -dnl +)m4exit(2)]) + +undefine([eval]) +undefine([include]) +undefine([shift]) +undefine([format]) + + dnl ### Controlling Autoconf operation -dnl -dnl + + dnl m4 output diversions. We let m4 output them all in order at the end, dnl except that we explicitly undivert AC_DIVERSION_SED. -dnl + dnl AC_DIVERSION_NOTICE - 1 (= 0) AC_REQUIRE'd #!/bin/sh line define(AC_DIVERSION_NOTICE, 1)dnl copyright notice & option help strings define(AC_DIVERSION_INIT, 2)dnl initialization code @@ -56,25 +55,26 @@ define(AC_DIVERSION_NORMAL_3, 5)dnl AC_REQUIRE'd code, 3 level deep define(AC_DIVERSION_NORMAL_2, 6)dnl AC_REQUIRE'd code, 2 level deep define(AC_DIVERSION_NORMAL_1, 7)dnl AC_REQUIRE'd code, 1 level deep define(AC_DIVERSION_NORMAL, 8)dnl the tests and output code -dnl + dnl Change the diversion stream to STREAM, while stacking old values. dnl AC_DIVERT_PUSH(STREAM) define(AC_DIVERT_PUSH, [pushdef([AC_DIVERSION_CURRENT], $1)dnl divert(AC_DIVERSION_CURRENT)dnl -])dnl -dnl +]) + dnl Change the diversion stream to its previous value, unstacking it. dnl AC_DIVERT_POP() define(AC_DIVERT_POP, [popdef([AC_DIVERSION_CURRENT])dnl divert(AC_DIVERSION_CURRENT)dnl -])dnl -dnl +]) + dnl Initialize the diversion setup. -define(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL)dnl -AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl will be later POPed by AC_INIT -dnl +define([AC_DIVERSION_CURRENT], AC_DIVERSION_NORMAL) +dnl This will be popped by AC_REQUIRE in AC_INIT. +pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_NOTICE) + dnl The prologue for Autoconf macros. dnl AC_PRO(MACRO-NAME) define(AC_PRO, @@ -82,8 +82,8 @@ define(AC_PRO, ifelse(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL, [AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))], [pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_CURRENT)])dnl -])dnl -dnl +]) + dnl The Epilogue for Autoconf macros. dnl AC_EPI() define(AC_EPI, @@ -94,8 +94,8 @@ undivert(AC_DIVERSION_NORMAL_3)dnl undivert(AC_DIVERSION_NORMAL_2)dnl undivert(AC_DIVERSION_NORMAL_1)dnl ])dnl -])dnl -dnl +]) + dnl Define a macro which automatically provides itself. Add machinery dnl so the macro automatically switches expansion to the diversion dnl stack if it is not already using it. In this case, once finished, @@ -104,8 +104,8 @@ dnl This, combined with AC_REQUIRE, achieves the topological ordering of dnl macros. dnl AC_DEFUN(NAME, EXPANSION) define([AC_DEFUN], -[define($1, [AC_PRO([$1])$2[]AC_EPI()])])dnl -dnl +[define($1, [AC_PRO([$1])$2[]AC_EPI()])]) + dnl AC_INIT_NOTICE() AC_DEFUN(AC_INIT_NOTICE, [# Guess values for system-dependent variables and create Makefiles. @@ -126,8 +126,8 @@ AC_DEFUN(AC_INIT_NOTICE, # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -ac_help=])dnl -dnl +ac_help=]) + dnl AC_INIT_PARSE_ARGS() AC_DEFUN(AC_INIT_PARSE_ARGS, [# Save the original args to write them into config.status later. @@ -405,28 +405,28 @@ done if test -n "$ac_prev"; then AC_MSG_ERROR(missing argument to --`echo $ac_prev | sed 's/_/-/g'`) fi -])dnl -dnl +]) + dnl Try to have only one #! line, so the script doesn't look funny dnl for users of AC_REVISION. dnl AC_INIT_BINSH() AC_DEFUN(AC_INIT_BINSH, [#!/bin/sh -])dnl -dnl +]) + dnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR) AC_DEFUN(AC_INIT, [sinclude(acsite.m4)dnl sinclude(./aclocal.m4)dnl AC_REQUIRE([AC_INIT_BINSH])dnl AC_INIT_NOTICE -AC_DIVERT_POP()dnl to NORMAL +AC_DIVERT_POP()dnl to NORMAL AC_DIVERT_PUSH(AC_DIVERSION_INIT)dnl AC_INIT_PARSE_ARGS AC_INIT_PREPARE($1)dnl -AC_DIVERT_POP()dnl to NORMAL -])dnl -dnl +AC_DIVERT_POP()dnl to NORMAL +]) + dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR) AC_DEFUN(AC_INIT_PREPARE, [trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15 @@ -524,8 +524,8 @@ AC_SUBST(CFLAGS)dnl AC_SUBST(CXXFLAGS)dnl AC_SUBST(CPPFLAGS)dnl AC_SUBST(LDFLAGS)dnl -])dnl -dnl +]) + dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE]) AC_DEFUN(AC_ARG_ENABLE, [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl @@ -540,13 +540,13 @@ ifelse([$4], , , [else $4 ])dnl fi -])dnl -dnl +]) + AC_DEFUN(AC_ENABLE, [AC_OBSOLETE([$0], [; instead use AC_ARG_ENABLE])dnl AC_ARG_ENABLE([$1], [ --enable-$1], [$2], [$3])dnl -])dnl -dnl +]) + dnl AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE]) AC_DEFUN(AC_ARG_WITH, [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl @@ -561,34 +561,34 @@ ifelse([$4], , , [else $4 ])dnl fi -])dnl -dnl +]) + AC_DEFUN(AC_WITH, [AC_OBSOLETE([$0], [; instead use AC_ARG_WITH])dnl AC_ARG_WITH([$1], [ --with-$1], [$2], [$3])dnl -])dnl -dnl +]) + dnl AC_CONFIG_HEADER(HEADER-TO-CREATE ...) AC_DEFUN(AC_CONFIG_HEADER, -[define(AC_LIST_HEADER, $1)])dnl -dnl +[define(AC_LIST_HEADER, $1)]) + dnl AC_REVISION(REVISION-INFO) AC_DEFUN(AC_REVISION, [AC_REQUIRE([AC_INIT_BINSH])dnl -[# From configure.in] translit([$1], $")])dnl -dnl +[# From configure.in] translit([$1], $")]) + dnl Subroutines of AC_PREREQ. -dnl + dnl Change the dots in NUMBER into commas. dnl AC_PREREQ_SPLIT(NUMBER) AC_DEFUN(AC_PREREQ_SPLIT, -[translit($1, ., [, ])])dnl -dnl +[translit($1, ., [, ])]) + dnl Default the ternary version number to 0 (e.g., 1, 7 -> 1, 7, 0). dnl AC_PREREQ_CANON(MAJOR, MINOR [,TERNARY]) AC_DEFUN(AC_PREREQ_CANON, -[$1, $2, ifelse([$3], , 0, [$3])])dnl -dnl +[$1, $2, ifelse([$3], , 0, [$3])]) + dnl Complain and exit if version number 1 is less than version number 2. dnl PRINTABLE2 is the printable version of version number 2. dnl AC_PREREQ_COMPARE(MAJOR1, MINOR1, TERNARY1, MAJOR2, MINOR2, TERNARY2, @@ -597,14 +597,14 @@ AC_DEFUN(AC_PREREQ_COMPARE, [ifelse(builtin([eval], [$3 + $2 * 100 + $1 * 10000 < $6 + $5 * 100 + $4 * 10000]), 1, [errprint(Autoconf version $7 or higher is required for this script -)m4exit(3)])])dnl -dnl +)m4exit(3)])]) + dnl Complain and exit if the Autoconf version is less than VERSION. dnl AC_PREREQ(VERSION) AC_DEFUN(AC_PREREQ, [AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), -AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1])])dnl -dnl +AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1])]) + dnl Run configure in subdirectories DIR... dnl Not actually done until AC_OUTPUT_SUBDIRS. dnl AC_CONFIG_SUBDIRS(DIR ...) @@ -613,8 +613,8 @@ AC_DEFUN(AC_CONFIG_SUBDIRS, define([AC_LIST_SUBDIRS], [$1])dnl subdirs="AC_LIST_SUBDIRS" AC_SUBST(subdirs)dnl -])dnl -dnl +]) + dnl Guess the value for the `prefix' variable by looking for dnl the argument program along PATH and taking its parent. dnl Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc, @@ -636,24 +636,24 @@ changequote([, ])dnl fi fi undefine([AC_VAR_NAME])dnl -])dnl -dnl -dnl +]) + + dnl ### Canonicalizing the system type -dnl -dnl + + dnl Find install.sh, config.sub, config.guess, and Cygnus configure dnl in directory DIR. These are auxiliary files used in configuration. dnl DIR can be either absolute or relative to ${srcdir}. dnl AC_CONFIG_AUX_DIR(DIR) AC_DEFUN(AC_CONFIG_AUX_DIR, -[AC_CONFIG_AUX_DIRS($1 ${srcdir}/$1)])dnl -dnl +[AC_CONFIG_AUX_DIRS($1 ${srcdir}/$1)]) + dnl The default is `${srcdir}' or `${srcdir}/..' or `${srcdir}/../..'. dnl 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}/../..)])dnl -dnl +[AC_CONFIG_AUX_DIRS(${srcdir} ${srcdir}/.. ${srcdir}/../..)]) + dnl Internal subroutine. dnl Search for the configuration auxiliary files in directory list $1. dnl We look only for install.sh, so users of AC_PROG_INSTALL @@ -674,8 +674,8 @@ ac_config_sub=${ac_aux_dir}/config.sub ac_configure=${ac_aux_dir}/configure # This should be Cygnus configure. ac_install_sh="${ac_aux_dir}/install.sh -c" AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -])dnl -dnl +]) + dnl Canonicalize the host, target, and build system types. AC_DEFUN(AC_CANONICAL_SYSTEM, [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl @@ -708,10 +708,10 @@ fi AC_CANONICAL_HOST AC_CANONICAL_TARGET AC_CANONICAL_BUILD -])dnl -dnl +]) + dnl Subroutines of AC_CANONICAL_SYSTEM. -dnl + AC_DEFUN(AC_CANONICAL_HOST, [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_MSG_CHECKING(host system type) @@ -738,8 +738,8 @@ AC_SUBST(host_alias)dnl AC_SUBST(host_cpu)dnl AC_SUBST(host_vendor)dnl AC_SUBST(host_os)dnl -])dnl -dnl +]) + dnl Internal use only. AC_DEFUN(AC_CANONICAL_TARGET, [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl @@ -764,8 +764,8 @@ AC_SUBST(target_alias)dnl AC_SUBST(target_cpu)dnl AC_SUBST(target_vendor)dnl AC_SUBST(target_os)dnl -])dnl -dnl +]) + dnl Internal use only. AC_DEFUN(AC_CANONICAL_BUILD, [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl @@ -787,19 +787,19 @@ AC_SUBST(build_alias)dnl AC_SUBST(build_cpu)dnl AC_SUBST(build_vendor)dnl AC_SUBST(build_os)dnl -])dnl -dnl +]) + dnl Link each of the existing files FILE... to the corresponding dnl link name in LINK... dnl Not actually done until AC_OUTPUT_LINKS. dnl AC_LINK_FILES(LINK ..., FILE ...) AC_DEFUN(AC_LINK_FILES, -[define([AC_LIST_LINKS], [$1])define([AC_LIST_FILES], [$2])])dnl -dnl -dnl +[define([AC_LIST_LINKS], [$1])define([AC_LIST_FILES], [$2])]) + + dnl ### Caching test results -dnl -dnl + + dnl Look for site or system specific initialization scripts. dnl AC_SITE_LOAD() AC_DEFUN(AC_SITE_LOAD, @@ -821,8 +821,8 @@ for ac_site_file in $CONFIG_SITE; do . "$ac_site_file" fi done -])dnl -dnl +]) + dnl AC_CACHE_LOAD() AC_DEFUN(AC_CACHE_LOAD, [if test -r "$cache_file"; then @@ -832,8 +832,8 @@ else echo "creating cache $cache_file" > $cache_file fi -])dnl -dnl +]) + dnl AC_CACHE_SAVE() AC_DEFUN(AC_CACHE_SAVE, [if test -w $cache_file; then @@ -861,8 +861,8 @@ changequote([, ])dnl else echo "not updating unwritable cache $cache_file" fi -])dnl -dnl +]) + dnl The name of shell var CACHE-ID must contain `_cv_' in order to get saved. dnl AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT) AC_DEFUN(AC_CACHE_VAL, @@ -875,27 +875,27 @@ if eval "test \"`echo '${'$1'+set}'`\" = set"; then else $2 fi -])dnl -dnl -dnl +]) + + dnl ### Setting variables -dnl -dnl + + dnl Set VARIABLE to VALUE, verbatim, or 1. dnl AC_DEFINE(VARIABLE [, VALUE]) AC_DEFUN(AC_DEFINE, [cat >> confdefs.h <<\EOF [#define] $1 ifelse($#, 2, [$2], 1) EOF -])dnl -dnl +]) + dnl Similar, but perform shell substitutions $ ` \ once on VALUE. AC_DEFUN(AC_DEFINE_UNQUOTED, [cat >> confdefs.h <&AC_FD_MSG])dnl -dnl +echo $ac_n "checking $1""... $ac_c" 1>&AC_FD_MSG]) + dnl AC_CHECKING(FEATURE-DESCRIPTION) AC_DEFUN(AC_CHECKING, -[echo "checking $1" 1>&AC_FD_MSG])dnl -dnl +[echo "checking $1" 1>&AC_FD_MSG]) + dnl AC_MSG_RESULT(RESULT-DESCRIPTION) AC_DEFUN(AC_MSG_RESULT, [AC_REQUIRE([AC_PROG_ECHO_N])dnl -echo "$ac_t""$1" 1>&AC_FD_MSG])dnl -dnl +echo "$ac_t""$1" 1>&AC_FD_MSG]) + dnl AC_VERBOSE(RESULT-DESCRIPTION) AC_DEFUN(AC_VERBOSE, [AC_OBSOLETE([$0], [; instead use AC_MSG_RESULT])dnl -echo " $1" 1>&AC_FD_MSG])dnl -dnl +echo " $1" 1>&AC_FD_MSG]) + dnl AC_MSG_WARN(PROBLEM-DESCRIPTION) AC_DEFUN(AC_MSG_WARN, -[echo "configure: warning: $1" 1>&2])dnl -dnl +[echo "configure: warning: $1" 1>&2]) + dnl AC_MSG_ERROR(ERROR-DESCRIPTION) AC_DEFUN(AC_MSG_ERROR, -[{ echo "configure: $1" 1>&2; exit 1; }])dnl -dnl -dnl +[{ echo "configure: $1" 1>&2; exit 1; }]) + + dnl ### Selecting which language to use for testing -dnl -dnl + + dnl AC_LANG_C() AC_DEFUN(AC_LANG_C, [define([AC_LANG], [C])dnl @@ -959,8 +959,8 @@ ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='${CPP} $CPPFLAGS' ac_compile='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC' -])dnl -dnl +]) + dnl AC_LANG_CPLUSPLUS() AC_DEFUN(AC_LANG_CPLUSPLUS, [define([AC_LANG], [CPLUSPLUS])dnl @@ -968,49 +968,49 @@ ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='${CXXCPP} $CPPFLAGS' ac_compile='${CXX-gcc} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC' -])dnl -dnl +]) + dnl Push the current language on a stack. -dnl + dnl AC_LANG_SAVE() AC_DEFUN(AC_LANG_SAVE, -[pushdef([AC_LANG_STACK], AC_LANG)])dnl -dnl +[pushdef([AC_LANG_STACK], AC_LANG)]) + dnl Restore the current language from the stack. dnl AC_LANG_RESTORE() AC_DEFUN(AC_LANG_RESTORE, -[ifelse(AC_LANG_STACK, C, [ifelse(AC_LANG, C, , [AC_LANG_C])], [ifelse(AC_LANG, CPLUSPLUS, , [AC_LANG_CPLUSPLUS])])[]popdef([AC_LANG_STACK])])dnl -dnl -dnl +[ifelse(AC_LANG_STACK, C, [ifelse(AC_LANG, C, , [AC_LANG_C])], [ifelse(AC_LANG, CPLUSPLUS, , [AC_LANG_CPLUSPLUS])])[]popdef([AC_LANG_STACK])]) + + dnl ### Enforcing ordering constraints -dnl -dnl + + dnl AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME) -AC_DEFUN(AC_BEFORE, +define(AC_BEFORE, [ifdef([AC_PROVIDE_$2], [errprint(__file__:__line__: [$2 was called before $1 -])])])dnl -dnl +])])]) + dnl AC_REQUIRE(MACRO-NAME) -AC_DEFUN(AC_REQUIRE, +define(AC_REQUIRE, [ifdef([AC_PROVIDE_$1], , [AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))dnl indir([$1]) AC_DIVERT_POP()dnl -])])dnl -dnl +])]) + dnl AC_PROVIDE(MACRO-NAME) define(AC_PROVIDE, -[define([AC_PROVIDE_$1], )])dnl -dnl +[define([AC_PROVIDE_$1], )]) + dnl AC_OBSOLETE(THIS-MACRO-NAME [, SUGGESTION]) -AC_DEFUN(AC_OBSOLETE, +define(AC_OBSOLETE, [errprint(__file__:__line__: warning: [$1] is obsolete[$2] -)])dnl -dnl -dnl +)]) + + dnl ### Checking for files (caching) -dnl -dnl + + dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND dnl [, VALUE-IF-NOT-FOUND]) AC_DEFUN(AC_CHECK_PROG, @@ -1042,8 +1042,8 @@ else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl -])dnl -dnl +]) + dnl AC_PATH_PROG(VARIABLE, PROG-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND]) AC_DEFUN(AC_PATH_PROG, [# Extract the first word of "$2", so it can be a program name with args. @@ -1077,8 +1077,8 @@ else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl -])dnl -dnl +]) + dnl AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND]) AC_DEFUN(AC_CHECK_PROGS, [for ac_prog in $2 @@ -1087,8 +1087,8 @@ AC_CHECK_PROG($1, [$]ac_prog, [$]ac_prog, ) test -n "[$]$1" && break done ifelse([$3], , , [test -n "[$]$1" || $1="$3" -])])dnl -dnl +])]) + dnl AC_PATH_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND]) AC_DEFUN(AC_PATH_PROGS, [for ac_prog in $2 @@ -1097,8 +1097,8 @@ AC_PATH_PROG($1, [$]ac_prog) test -n "[$]$1" && break done ifelse([$3], , , [test -n "[$]$1" || $1="$3" -])])dnl -dnl +])]) + dnl AC_CHECK_LIB(LIBRARY, FUNCTION, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND dnl [, OTHER-LIBRARIES]]]) AC_DEFUN(AC_CHECK_LIB, @@ -1123,8 +1123,8 @@ else ifelse([$4], , , [$4 ])dnl fi -])dnl -dnl +]) + dnl AC_HAVE_LIBRARY(LIBRARY, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND dnl [, OTHER-LIBRARIES]]]) AC_DEFUN(AC_HAVE_LIBRARY, @@ -1153,17 +1153,17 @@ ifelse([$3], , , [else fi undefine([AC_LIB_NAME])dnl undefine([AC_CV_NAME])dnl -])dnl -dnl -dnl -dnl ### Checking for C features - primitive (no caching) -dnl -dnl +]) + + +dnl ### Checking C system output (no caching) + + dnl AC_EGREP_HEADER(PATTERN, HEADER-FILE, ACTION-IF-FOUND [, dnl ACTION-IF-NOT-FOUND]) AC_DEFUN(AC_EGREP_HEADER, -[AC_EGREP_CPP([$1], [#include <$2>], [$3], [$4])])dnl -dnl +[AC_EGREP_CPP([$1], [#include <$2>], [$3], [$4])]) + dnl Because this macro is used by AC_PROG_GCC_TRADITIONAL, which must dnl come early, it is not included in AC_BEFORE checks. dnl AC_EGREP_CPP(PATTERN, PROGRAM, ACTION-IF-FOUND [, @@ -1175,7 +1175,9 @@ cat > conftest.${ac_ext} <&AC_FD_CC | +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>&AC_FD_CC | egrep "$1" >/dev/null 2>&1; then ifelse([$3], , :, [rm -rf conftest* $3]) @@ -1185,8 +1187,8 @@ ifelse([$4], , , [else ])dnl fi rm -f conftest* -])dnl -dnl +]) + dnl AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY, dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) AC_DEFUN(AC_COMPILE_CHECK, @@ -1195,8 +1197,8 @@ dnl AC_OBSOLETE([$0], [; instead use AC_TRY_LINK])dnl ifelse([$1], , , [AC_CHECKING([for $1]) ])dnl AC_TRY_LINK([$2], [$3], [$4], [$5])dnl -])dnl -dnl +]) + dnl AC_TRY_LINK(INCLUDES, FUNCTION-BODY, dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) AC_DEFUN(AC_TRY_LINK, @@ -1224,17 +1226,19 @@ ifelse([$4], , , [else ])dnl fi rm -f conftest*] -)dnl -dnl +) + dnl AC_TRY_RUN(PROGRAM, ACTION-IF-TRUE [, ACTION-IF-FALSE dnl [, ACTION-IF-CROSS-COMPILING]]) AC_DEFUN(AC_TRY_RUN, [AC_REQUIRE([AC_C_CROSS])dnl if test "$cross_compiling" = yes; then - ifelse([$4], , AC_MSG_ERROR(can not run test program while cross compiling), - [AC_MSG_WARN(using default for cross-compiling) -$4 -]) + ifelse([$4], , + [ifdef([AC_PROVIDE_AC_CANONICAL_SYSTEM], + [errprint(__file__:__line__: warning: test program without default prevents cross compiling +)])dnl + AC_MSG_ERROR(can not run test program while cross compiling)], + [$4]) else cat > conftest.${ac_ext} < conftest.${ac_ext} </dev/null" 2>&1` +dnl eval is necessary to expand ac_cpp. +dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell. +dnl Coherent sh does redirections in the wrong order, so separate them. +# Note: sh -x echos commands on subshell stderr, making this test fail. +ac_err=`(eval "$ac_cpp conftest.${ac_ext} >/dev/null") 2>&1` if test -z "$ac_err"; then ifelse([$2], , :, [rm -rf conftest* $2]) @@ -1276,12 +1282,12 @@ ifelse([$3], , , [ rm -rf conftest* $3 ])dnl fi -rm -f conftest*])dnl -dnl -dnl -dnl ### Checking for C features - derived (caching) -dnl -dnl +rm -f conftest*]) + + +dnl ### Checking for C features (caching) + + dnl AC_CHECK_HEADER(HEADER-FILE, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) AC_DEFUN(AC_CHECK_HEADER, [dnl Do the transliteration at runtime so arg 1 can be a shell variable. @@ -1298,8 +1304,8 @@ else ifelse([$3], , , [$3 ])dnl fi -])dnl -dnl +]) + dnl AC_CHECK_FUNC(FUNCTION, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) AC_DEFUN(AC_CHECK_FUNC, [AC_MSG_CHECKING([for $1]) @@ -1328,8 +1334,8 @@ else ifelse([$3], , , [$3 ])dnl fi -])dnl -dnl +]) + dnl AC_CHECK_FUNCS(FUNCTION... [, ACTION]) AC_DEFUN(AC_CHECK_FUNCS, [for ac_func in $1 @@ -1340,8 +1346,8 @@ AC_CHECK_FUNC(${ac_func}, changequote([, ])dnl AC_DEFINE_UNQUOTED(${ac_tr_func}) $2])dnl done -])dnl -dnl +]) + dnl AC_CHECK_HEADERS(HEADER-FILE... [, ACTION]) AC_DEFUN(AC_CHECK_HEADERS, [AC_REQUIRE_CPP()dnl Make sure the cpp check happens outside the loop. @@ -1353,8 +1359,8 @@ AC_CHECK_HEADER(${ac_hdr}, changequote([, ])dnl AC_DEFINE_UNQUOTED(${ac_tr_hdr}) $2])dnl done -])dnl -dnl +]) + dnl AC_REPLACE_FUNCS(FUNCTION-NAME...) AC_DEFUN(AC_REPLACE_FUNCS, [for ac_func in $1 @@ -1362,8 +1368,8 @@ do AC_CHECK_FUNC(${ac_func}, , [LIBOBJS="$LIBOBJS ${ac_func}.o"]) done AC_SUBST(LIBOBJS)dnl -])dnl -dnl +]) + dnl AC_CHECK_SIZEOF(TYPE) AC_DEFUN(AC_CHECK_SIZEOF, [changequote(<<, >>)dnl @@ -1386,8 +1392,8 @@ AC_MSG_RESULT($AC_CV_NAME) AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) undefine([AC_TYPE_NAME])dnl undefine([AC_CV_NAME])dnl -])dnl -dnl +]) + dnl AC_CHECK_TYPE(TYPE, DEFAULT) AC_DEFUN(AC_CHECK_TYPE, [AC_MSG_CHECKING(for $1 in sys/types.h) @@ -1397,14 +1403,14 @@ AC_MSG_RESULT($ac_cv_type_$1) if test $ac_cv_type_$1 = no; then AC_DEFINE($1, $2) fi -])dnl -dnl -dnl +]) + + dnl ### The big finish -dnl -dnl + + dnl Produce config.status, config.h, and links, and configure subdirs. -dnl AC_OUTPUT([FILE...] [, EXTRA-CMDS]) +dnl AC_OUTPUT([FILE...] [, EXTRA-CMDS] [, INIT-CMDS]) AC_DEFUN(AC_OUTPUT, [AC_CACHE_SAVE @@ -1473,7 +1479,14 @@ ifdef([AC_LIST_HEADER], AC_OUTPUT_FILES($1) ifdef([AC_LIST_HEADER], [AC_OUTPUT_HEADER(AC_LIST_HEADER)])dnl ifdef([AC_LIST_LINKS], [AC_OUTPUT_LINKS(AC_LIST_LINKS, AC_LIST_FILES)])dnl +ifelse([$3], , , +[EOF +cat >> ${CONFIG_STATUS} <> ${CONFIG_STATUS} <<\EOF]) $2 +exit 0 EOF chmod +x ${CONFIG_STATUS} test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} ${CONFIG_STATUS} @@ -1838,5 +1851,4 @@ changequote([, ])dnl cd ${ac_popdir} done fi -])dnl -dnl +]) diff --git a/lib/autoconf/specific.m4 b/lib/autoconf/specific.m4 index 37434d523..04006ab32 100644 --- a/lib/autoconf/specific.m4 +++ b/lib/autoconf/specific.m4 @@ -19,11 +19,11 @@ dnl dnl Written by David MacKenzie, with help from dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, dnl Roland McGrath, and Noah Friedman. -dnl -dnl + + dnl ### Checks for programs -dnl -dnl + + dnl Check whether to use -n, \c, or newline-tab to separate dnl checking messages from result messages. dnl Idea borrowed from dist 3.0. @@ -40,8 +40,8 @@ AC_DEFUN(AC_PROG_ECHO_N, else ac_n= ac_c='\c' ac_t= fi -])dnl -dnl +]) + AC_DEFUN(AC_PROG_CC, [AC_BEFORE([$0], [AC_PROG_CPP])dnl AC_CHECK_PROG(CC, gcc, gcc, cc) @@ -66,8 +66,8 @@ else GCC= test "${CFLAGS+set}" = set || CFLAGS='-g' fi -])dnl -dnl +]) + AC_DEFUN(AC_PROG_CXX, [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx, gcc) @@ -91,8 +91,8 @@ else GXX= test "${CXXFLAGS+set}" = set || CXXFLAGS='-g' fi -])dnl -dnl +]) + AC_DEFUN(AC_PROG_GCC_TRADITIONAL, [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_CPP])dnl @@ -114,8 +114,8 @@ Autoconf TCGETA], CC="$CC -traditional" fi fi -])dnl -dnl +]) + AC_DEFUN(AC_PROG_CC_C_O, [if test "x$CC" != xcc; then AC_MSG_CHECKING(whether $CC and cc understand -c and -o together) @@ -152,8 +152,8 @@ else AC_MSG_RESULT(no) AC_DEFINE(NO_MINUS_C_MINUS_O) fi -])dnl -dnl +]) + dnl Define SET_MAKE to set ${MAKE} if make doesn't. AC_DEFUN(AC_PROG_MAKE_SET, [AC_MSG_CHECKING(whether ${MAKE-make} sets \$MAKE) @@ -181,17 +181,17 @@ else SET_MAKE="MAKE=${MAKE-make}" fi AC_SUBST([SET_MAKE])dnl -])dnl -dnl +]) + AC_DEFUN(AC_PROG_RANLIB, -[AC_CHECK_PROG(RANLIB, ranlib, ranlib, :)])dnl -dnl +[AC_CHECK_PROG(RANLIB, ranlib, ranlib, :)]) + AC_DEFUN(AC_PROG_AWK, -[AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )])dnl -dnl +[AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )]) + AC_DEFUN(AC_PROG_YACC, -[AC_CHECK_PROGS(YACC, 'bison -y' byacc, yacc)])dnl -dnl +[AC_CHECK_PROGS(YACC, 'bison -y' byacc, yacc)]) + AC_DEFUN(AC_PROG_CPP, [AC_MSG_CHECKING(how to run the C preprocessor) # On Suns, sometimes $CPP names a directory. @@ -215,8 +215,8 @@ fi CPP="$ac_cv_prog_CPP" AC_MSG_RESULT($CPP) AC_SUBST(CPP)dnl -])dnl -dnl +]) + AC_DEFUN(AC_PROG_CXXCPP, [AC_MSG_CHECKING(how to run the C++ preprocessor) if test -z "$CXXCPP"; then @@ -231,13 +231,13 @@ fi])dnl CXXCPP="$ac_cv_prog_CXXCPP" AC_MSG_RESULT($CXXCPP) AC_SUBST(CXXCPP)dnl -])dnl -dnl +]) + dnl Require finding the C or C++ preprocessor, whichever is the dnl current language. AC_DEFUN(AC_REQUIRE_CPP, -[ifelse(AC_LANG, C, [AC_REQUIRE([AC_PROG_CPP])], [AC_REQUIRE([AC_PROG_CXXCPP])])])dnl -dnl +[ifelse(AC_LANG, C, [AC_REQUIRE([AC_PROG_CPP])], [AC_REQUIRE([AC_PROG_CXXCPP])])]) + AC_DEFUN(AC_PROG_LEX, [AC_CHECK_PROG(LEX, flex, flex, lex) AC_MSG_CHECKING(for $LEX library) @@ -249,8 +249,8 @@ then esac fi AC_MSG_RESULT($LEXLIB) -AC_SUBST(LEXLIB)])dnl -dnl +AC_SUBST(LEXLIB)]) + AC_DEFUN(AC_DECL_YYTEXT, [AC_REQUIRE_CPP()dnl AC_REQUIRE([AC_PROG_LEX])dnl @@ -283,8 +283,8 @@ if test $ac_cv_prog_lex_yytext_pointer = yes; then AC_DEFINE(YYTEXT_POINTER) fi AC_SUBST(LEX_OUTPUT_ROOT)dnl -])dnl -dnl +]) + AC_DEFUN(AC_PROG_INSTALL, [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Make sure to not get an incompatible install: @@ -336,8 +336,8 @@ AC_SUBST(INSTALL_PROGRAM)dnl test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' AC_SUBST(INSTALL_DATA)dnl -])dnl -dnl +]) + AC_DEFUN(AC_PROG_LN_S, [AC_MSG_CHECKING(whether ln -s works) AC_CACHE_VAL(ac_cv_prog_LN_S, @@ -356,16 +356,16 @@ else AC_MSG_RESULT(no) fi AC_SUBST(LN_S)dnl -])dnl -dnl +]) + AC_DEFUN(AC_RSH, [errprint(__file__:__line__: [$0] has been removed; replace it with equivalent code -)m4exit(4)])dnl -dnl -dnl +)m4exit(4)]) + + dnl ### Checks for header files -dnl -dnl + + AC_DEFUN(AC_HEADER_STDC, [AC_REQUIRE_CPP()dnl AC_MSG_CHECKING(for ANSI C header files) @@ -394,26 +394,26 @@ AC_TRY_RUN([#include int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } -], , ac_stdc_headers=no) +], , ac_cv_header_stdc=no, ac_cv_header_stdc=no) fi])dnl AC_MSG_RESULT($ac_cv_header_stdc) if test $ac_cv_header_stdc = yes; then AC_DEFINE(STDC_HEADERS) fi -])dnl -dnl +]) + AC_DEFUN(AC_UNISTD_H, [AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(unistd.h)])dnl -AC_CHECK_HEADER(unistd.h, AC_DEFINE(HAVE_UNISTD_H))])dnl -dnl +AC_CHECK_HEADER(unistd.h, AC_DEFINE(HAVE_UNISTD_H))]) + AC_DEFUN(AC_USG, [AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(string.h) and HAVE_STRING_H])dnl AC_MSG_CHECKING([for BSD string and memory functions]) AC_TRY_LINK([#include ], [rindex(0, 0); bzero(0, 0);], , - [AC_MSG_RESULT(yes); AC_DEFINE(USG)], [AC_MSG_RESULT(no)])])dnl -dnl -dnl + [AC_MSG_RESULT(yes); AC_DEFINE(USG)], [AC_MSG_RESULT(no)])]) + + dnl If memchr and the like aren't declared in , include . dnl To avoid problems, don't check for gcc2 built-ins. AC_DEFUN(AC_MEMORY_H, @@ -424,8 +424,8 @@ AC_MSG_RESULT($ac_found) if test $ac_found = no; then AC_CHECK_HEADER(memory.h, [AC_DEFINE(NEED_MEMORY_H)]) fi -])dnl -dnl +]) + AC_DEFUN(AC_HEADER_MAJOR, [AC_MSG_CHECKING(whether sys/types.h defines makedev) AC_CACHE_VAL(ac_cv_header_sys_types_h_makedev, @@ -441,8 +441,8 @@ AC_CHECK_HEADER(sys/mkdev.h, [AC_DEFINE(MAJOR_IN_MKDEV)]) AC_CHECK_HEADER(sys/sysmacros.h, [AC_DEFINE(MAJOR_IN_SYSMACROS)]) fi fi -])dnl -dnl +]) + AC_DEFUN(AC_HEADER_DIRENT, [ac_header_dir=no AC_CHECK_HEADERS(dirent.h sys/ndir.h sys/dir.h ndir.h, @@ -458,8 +458,8 @@ AC_MSG_RESULT($ac_cv_func_closedir_void) if test $ac_cv_func_closedir_void = yes; then AC_DEFINE(CLOSEDIR_VOID) fi -])dnl -dnl +]) + dnl Obsolete. AC_DEFUN(AC_DIR_HEADER, [ac_header_dir=no @@ -484,8 +484,8 @@ AC_MSG_RESULT($ac_cv_func_closedir_void) if test $ac_cv_func_closedir_void = yes; then AC_DEFINE(VOID_CLOSEDIR) fi -])dnl -dnl +]) + AC_DEFUN(AC_HEADER_STAT, [AC_MSG_CHECKING(whether stat file-mode macros are broken) AC_CACHE_VAL(ac_cv_header_stat_broken, @@ -518,8 +518,8 @@ AC_MSG_RESULT($ac_cv_header_stat_broken) if test $ac_cv_header_stat_broken = yes; then AC_DEFINE(STAT_MACROS_BROKEN) fi -])dnl -dnl +]) + AC_DEFUN(AC_DECL_SYS_SIGLIST, [AC_MSG_CHECKING([for sys_siglist declaration in signal.h or unistd.h]) AC_CACHE_VAL(ac_cv_decl_sys_siglist, @@ -534,12 +534,12 @@ AC_MSG_RESULT($ac_cv_decl_sys_siglist) if test $ac_cv_decl_sys_siglist = yes; then AC_DEFINE(SYS_SIGLIST_DECLARED) fi -])dnl -dnl -dnl +]) + + dnl ### Checks for typedefs -dnl -dnl + + AC_DEFUN(AC_TYPE_GETGROUPS, [AC_REQUIRE([AC_TYPE_UID_T])dnl AC_MSG_CHECKING(type of array argument to getgroups) @@ -572,8 +572,8 @@ changequote([, ])dnl ac_cv_type_getgroups=gid_t, ac_cv_type_getgroups=int)])dnl AC_MSG_RESULT($ac_cv_type_getgroups) AC_DEFINE_UNQUOTED(GETGROUPS_T, $ac_cv_type_getgroups) -])dnl -dnl +]) + AC_DEFUN(AC_TYPE_UID_T, [AC_MSG_CHECKING(for uid_t in sys/types.h) AC_CACHE_VAL(ac_cv_type_uid_t, @@ -584,20 +584,20 @@ if test $ac_cv_type_uid_t = no; then AC_DEFINE(uid_t, int) AC_DEFINE(gid_t, int) fi -])dnl -dnl +]) + AC_DEFUN(AC_TYPE_SIZE_T, -[AC_CHECK_TYPE(size_t, unsigned)])dnl -dnl +[AC_CHECK_TYPE(size_t, unsigned)]) + AC_DEFUN(AC_TYPE_PID_T, -[AC_CHECK_TYPE(pid_t, int)])dnl -dnl +[AC_CHECK_TYPE(pid_t, int)]) + AC_DEFUN(AC_TYPE_OFF_T, -[AC_CHECK_TYPE(off_t, long)])dnl -dnl +[AC_CHECK_TYPE(off_t, long)]) + AC_DEFUN(AC_TYPE_MODE_T, -[AC_CHECK_TYPE(mode_t, int)])dnl -dnl +[AC_CHECK_TYPE(mode_t, int)]) + dnl Note that identifiers starting with SIG are reserved by ANSI C. AC_DEFUN(AC_TYPE_SIGNAL, [AC_MSG_CHECKING([return type of signal handlers]) @@ -611,12 +611,12 @@ extern void (*signal ()) ();], [int i;], ac_cv_type_signal=void, ac_cv_type_signal=int)])dnl AC_MSG_RESULT($ac_cv_type_signal) AC_DEFINE_UNQUOTED(RETSIGTYPE, $ac_cv_type_signal) -])dnl -dnl -dnl +]) + + dnl ### Checks for functions -dnl -dnl + + AC_DEFUN(AC_FUNC_MMAP, [AC_MSG_CHECKING(for working mmap) AC_CACHE_VAL(ac_cv_func_mmap, @@ -695,15 +695,15 @@ AC_MSG_RESULT($ac_cv_func_mmap) if test $ac_cv_func_mmap = yes; then AC_DEFINE(HAVE_MMAP) fi -])dnl -dnl +]) + AC_DEFUN(AC_FUNC_VPRINTF, [AC_CHECK_FUNC(vprintf, AC_DEFINE(HAVE_VPRINTF)) if test "$ac_cv_func_vprintf" != yes; then AC_CHECK_FUNC(_doprnt, AC_DEFINE(HAVE_DOPRNT)) fi -])dnl -dnl +]) + AC_DEFUN(AC_FUNC_VFORK, [AC_REQUIRE([AC_TYPE_PID_T])dnl AC_CHECK_HEADER(vfork.h, AC_DEFINE(HAVE_VFORK_H)) @@ -819,8 +819,8 @@ AC_MSG_RESULT($ac_cv_func_vfork) if test $ac_cv_func_vfork = no; then AC_DEFINE(vfork, fork) fi -])dnl -dnl +]) + AC_DEFUN(AC_FUNC_WAIT3, [AC_MSG_CHECKING(for wait3 that fills in rusage) AC_CACHE_VAL(ac_cv_func_wait3, @@ -855,8 +855,8 @@ AC_MSG_RESULT($ac_cv_func_wait3) if test $ac_cv_func_wait3 = yes; then AC_DEFINE(HAVE_WAIT3) fi -])dnl -dnl +]) + AC_DEFUN(AC_FUNC_ALLOCA, [AC_REQUIRE_CPP()dnl Set CPP; we run AC_EGREP_CPP conditionally. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works @@ -942,8 +942,8 @@ AC_MSG_RESULT($ac_cv_c_stack_direction) AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) fi AC_SUBST(ALLOCA)dnl -])dnl -dnl +]) + AC_DEFUN(AC_FUNC_GETLOADAVG, [# Some definitions of getloadavg require that the program be installed setgid. NEED_SETGID=false @@ -1038,8 +1038,8 @@ changequote([, ])dnl AC_MSG_RESULT($KMEM_GROUP) fi AC_SUBST(KMEM_GROUP)dnl -])dnl -dnl +]) + AC_DEFUN(AC_FUNC_UTIME_NULL, [AC_MSG_CHECKING(whether utime accepts a null argument) AC_CACHE_VAL(ac_cv_func_utime_null, @@ -1058,8 +1058,8 @@ AC_MSG_RESULT($ac_cv_func_utime_null) if test $ac_cv_func_utime_null = yes; then AC_DEFINE(HAVE_UTIME_NULL) fi -])dnl -dnl +]) + AC_DEFUN(AC_FUNC_STRCOLL, [AC_MSG_CHECKING(for strcoll) AC_CACHE_VAL(ac_cv_func_strcoll, @@ -1074,8 +1074,8 @@ AC_MSG_RESULT($ac_cv_func_strcoll) if test $ac_cv_func_strcoll = yes; then AC_DEFINE(HAVE_STRCOLL) fi -])dnl -dnl +]) + AC_DEFUN(AC_FUNC_SETVBUF_REVERSED, [AC_MSG_CHECKING(whether setvbuf arguments are reversed) AC_CACHE_VAL(ac_cv_func_setvbuf_reversed, @@ -1095,12 +1095,12 @@ AC_MSG_RESULT($ac_cv_func_setvbuf_reversed) if test $ac_cv_func_setvbuf_reversed = yes; then AC_DEFINE(SETVBUF_REVERSED) fi -])dnl -dnl -dnl +]) + + dnl ### Checks for structure members -dnl -dnl + + AC_DEFUN(AC_HEADER_TIME, [AC_MSG_CHECKING([whether time.h and sys/time.h may both be included]) AC_CACHE_VAL(ac_cv_header_time, @@ -1112,8 +1112,8 @@ AC_MSG_RESULT($ac_cv_header_time) if test $ac_cv_header_time = yes; then AC_DEFINE(TIME_WITH_SYS_TIME) fi -])dnl -dnl +]) + AC_DEFUN(AC_STRUCT_TM, [AC_MSG_CHECKING([whether struct tm is in sys/time.h or time.h]) AC_CACHE_VAL(ac_cv_struct_tm, @@ -1125,8 +1125,8 @@ AC_MSG_RESULT($ac_cv_struct_tm) if test $ac_cv_struct_tm = sys/time.h; then AC_DEFINE(TM_IN_SYS_TIME) fi -])dnl -dnl +]) + AC_DEFUN(AC_STRUCT_TIMEZONE, [AC_REQUIRE([AC_STRUCT_TM])dnl AC_MSG_CHECKING([for tm_zone in struct tm]) @@ -1153,8 +1153,8 @@ changequote([, ])dnl AC_DEFINE(HAVE_TZNAME) fi fi -])dnl -dnl +]) + AC_DEFUN(AC_STRUCT_ST_BLOCKS, [AC_MSG_CHECKING([for st_blocks in struct stat]) AC_CACHE_VAL(ac_cv_struct_st_blocks, @@ -1168,8 +1168,8 @@ else LIBOBJS="$LIBOBJS fileblocks.o" fi AC_SUBST(LIBOBJS)dnl -])dnl -dnl +]) + AC_DEFUN(AC_STRUCT_ST_BLKSIZE, [AC_MSG_CHECKING([for st_blksize in struct stat]) AC_CACHE_VAL(ac_cv_struct_st_blksize, @@ -1180,8 +1180,8 @@ AC_MSG_RESULT($ac_cv_struct_st_blksize) if test $ac_cv_struct_st_blksize = yes; then AC_DEFINE(HAVE_ST_BLKSIZE) fi -])dnl -dnl +]) + AC_DEFUN(AC_STRUCT_ST_RDEV, [AC_MSG_CHECKING([for st_rdev in struct stat]) AC_CACHE_VAL(ac_cv_struct_st_rdev, @@ -1192,12 +1192,12 @@ AC_MSG_RESULT($ac_cv_struct_st_rdev) if test $ac_cv_struct_st_rdev = yes; then AC_DEFINE(HAVE_ST_RDEV) fi -])dnl -dnl -dnl +]) + + dnl ### Checks for compiler characteristics -dnl -dnl + + AC_DEFUN(AC_C_CROSS, [# If we cannot run a trivial program, we must be cross compiling. AC_MSG_CHECKING(whether cross-compiling) @@ -1205,8 +1205,8 @@ AC_CACHE_VAL(ac_cv_c_cross, [AC_TRY_RUN([main(){exit(0);}], ac_cv_c_cross=no, ac_cv_c_cross=yes)])dnl cross_compiling=$ac_cv_c_cross AC_MSG_RESULT($ac_cv_c_cross) -])dnl -dnl +]) + AC_DEFUN(AC_C_CHAR_UNSIGNED, [AC_MSG_CHECKING(whether char is unsigned) AC_CACHE_VAL(ac_cv_c_char_unsigned, @@ -1223,8 +1223,8 @@ if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then # gcc predefines this symbol on systems where it applies. AC_DEFINE(__CHAR_UNSIGNED__) fi -])dnl -dnl +]) + AC_DEFUN(AC_C_LONG_DOUBLE, [AC_MSG_CHECKING(for long double) AC_CACHE_VAL(ac_cv_c_long_double, @@ -1242,24 +1242,24 @@ AC_MSG_RESULT($ac_cv_c_long_double) if test $ac_cv_c_long_double = yes; then AC_DEFINE(HAVE_LONG_DOUBLE) fi -])dnl -dnl +]) + AC_DEFUN(AC_INT_16_BITS, [AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(int)]) AC_MSG_CHECKING(whether int is 16 bits) AC_TRY_RUN([main() { exit(sizeof(int) != 2); }], [AC_MSG_RESULT(yes) AC_DEFINE(INT_16_BITS)], AC_MSG_RESULT(no)) -])dnl -dnl +]) + AC_DEFUN(AC_LONG_64_BITS, [AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(long)]) AC_MSG_CHECKING(whether long int is 64 bits) AC_TRY_RUN([main() { exit(sizeof(long int) != 8); }], [AC_MSG_RESULT(yes) AC_DEFINE(LONG_64_BITS)], AC_MSG_RESULT(no)) -])dnl -dnl +]) + AC_DEFUN(AC_C_BIGENDIAN, [AC_MSG_CHECKING(whether byte ordering is bigendian) AC_CACHE_VAL(ac_cv_c_bigendian, @@ -1277,8 +1277,8 @@ AC_MSG_RESULT($ac_cv_c_bigendian) if test $ac_cv_c_bigendian = yes; then AC_DEFINE(WORDS_BIGENDIAN) fi -])dnl -dnl +]) + AC_DEFUN(AC_C_INLINE, [AC_MSG_CHECKING([for inline]) AC_CACHE_VAL(ac_cv_c_inline, @@ -1291,7 +1291,8 @@ AC_MSG_RESULT($ac_cv_c_inline) if test $ac_cv_c_inline = no; then AC_DEFINE(inline, __inline) fi -])dnl +]) + AC_DEFUN(AC_C_CONST, [dnl This message is consistent in form with the other checking messages, dnl and with the result message. @@ -1345,16 +1346,16 @@ AC_MSG_RESULT($ac_cv_c_const) if test $ac_cv_c_const = no; then AC_DEFINE(const, ) fi -])dnl -dnl +]) + AC_DEFUN(AC_ARG_ARRAY, [errprint(__file__:__line__: [$0] has been removed; don't do unportable things with arguments -)m4exit(4)])dnl -dnl -dnl +)m4exit(4)]) + + dnl ### Checks for operating system services -dnl -dnl + + AC_DEFUN(AC_SYS_INTERPRETER, [# Pull the hash mark out of the macro call to avoid m4 problems. ac_msg="whether #! works in shell scripts" @@ -1372,12 +1373,12 @@ else fi rm -f conftest])dnl AC_MSG_RESULT($ac_cv_sys_interpreter) -])dnl -dnl +]) + AC_DEFUN(AC_HAVE_POUNDBANG, [errprint(__file__:__line__: [$0 has been replaced by AC_SYS_INTERPRETER, taking no arguments -])m4exit(4)])dnl -dnl +])m4exit(4)]) + AC_DEFUN(AC_SYS_LONG_FILE_NAMES, [AC_MSG_CHECKING(for long file names) AC_CACHE_VAL(ac_cv_sys_long_file_names, @@ -1407,8 +1408,8 @@ AC_MSG_RESULT($ac_cv_sys_long_file_names) if test $ac_cv_sys_long_file_names = yes; then AC_DEFINE(HAVE_LONG_FILE_NAMES) fi -])dnl -dnl +]) + AC_DEFUN(AC_SYS_RESTARTABLE_SYSCALLS, [AC_MSG_CHECKING(for restartable system calls) AC_CACHE_VAL(ac_cv_sys_restartable_syscalls, @@ -1432,8 +1433,8 @@ AC_MSG_RESULT($ac_cv_sys_restartable_syscalls) if test $ac_cv_sys_restartable_syscalls = yes; then AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS) fi -])dnl -dnl +]) + AC_DEFUN(AC_PATH_X, [AC_REQUIRE_CPP()dnl Set CPP; we run AC_PATH_X_DIRECT conditionally. # If we find X, set shell vars x_includes and x_libraries to the @@ -1472,8 +1473,8 @@ else ac_cv_path_x="no_x= ac_x_includes=$x_includes ac_x_libraries=$x_libraries" AC_MSG_RESULT([libraries $x_libraries, headers $x_includes]) fi -])dnl -dnl +]) + dnl Internal subroutine of AC_PATH_X. dnl Set ac_x_includes, ac_x_libraries, and no_x (initially yes). AC_DEFUN(AC_PATH_X_XMKMF, @@ -1506,14 +1507,16 @@ EOF cd .. rm -fr conftestdir fi -])dnl -dnl +]) + dnl Internal subroutine of AC_PATH_X. dnl Set ac_x_includes, ac_x_libraries, and no_x (initially yes). AC_DEFUN(AC_PATH_X_DIRECT, [test -z "$x_direct_test_library" && x_direct_test_library=Xt +test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h -AC_TRY_CPP([#include <$x_direct_test_include>], [no_x= ac_x_includes=], +AC_TRY_CPP([#include <$x_direct_test_include>], +[no_x= ac_x_includes=], [ for ac_dir in \ /usr/X11R6/include \ /usr/X11R5/include \ @@ -1557,10 +1560,16 @@ AC_TRY_CPP([#include <$x_direct_test_include>], [no_x= ac_x_includes=], fi done]) -# Check for the libraries. First see if replacing the include by -# lib works. -AC_CHECK_LIB("$x_direct_test_library", main, [no_x= ac_x_libraries=], -[for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ +# Check for the libraries. +# See if we find them without any special options. +# Don't add to $LIBS permanently. +ac_save_LIBS="${LIBS}" +LIBS="${LIBS} -l$x_direct_test_library" +AC_TRY_LINK(, [${x_direct_test_function}()], +[LIBS="${ac_save_LIBS}" no_x= ac_x_libraries=], +[LIBS="${ac_save_LIBS}" +# First see if replacing the include by lib works. +for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ /usr/X11R6/lib \ /usr/X11R5/lib \ /usr/X11R4/lib \ @@ -1603,13 +1612,12 @@ do break 2 fi done -done])])dnl -dnl +done])]) + dnl Find additional X libraries, magic flags, etc. AC_DEFUN(AC_PATH_XTRA, [AC_REQUIRE([AC_OS_ISC])dnl AC_REQUIRE([AC_PATH_X])dnl -AC_CHECKING(for additional X libraries and flags) if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. X_CFLAGS="$X_CFLAGS -DX_DISPLAY_MISSING" @@ -1645,9 +1653,8 @@ else # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). - AC_CHECK_LIB(dnet, dnet_ntoa, - [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" ac_have_dnet=yes], ac_have_dnet=no) - if test "$ac_have_dnet" = no; then + AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"]) + if test $ac_cv_lib_dnet = no; then AC_CHECK_LIB(dnet_stub, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"]) fi @@ -1669,13 +1676,13 @@ fi AC_SUBST(X_CFLAGS)dnl AC_SUBST(X_LIBS)dnl AC_SUBST(X_EXTRA_LIBS)dnl -])dnl -dnl -dnl +]) + + dnl ### Checks for UNIX variants dnl These are kludges; we need a more systematic approach. -dnl -dnl + + AC_DEFUN(AC_OS_AIX, [AC_BEFORE([$0], [AC_TRY_LINK])dnl AC_BEFORE([$0], [AC_TRY_RUN])dnl @@ -1685,8 +1692,8 @@ AC_EGREP_CPP(yes, yes #endif ], [AC_MSG_RESULT(yes); AC_DEFINE(_ALL_SOURCE)], AC_MSG_RESULT(no)) -])dnl -dnl +]) + AC_DEFUN(AC_OS_MINIX, [AC_BEFORE([$0], [AC_TRY_LINK])dnl AC_BEFORE([$0], [AC_TRY_RUN])dnl @@ -1697,8 +1704,8 @@ if test "$MINIX" = yes; then AC_DEFINE(_POSIX_1_SOURCE, 2) AC_DEFINE(_MINIX) fi -])dnl -dnl +]) + AC_DEFUN(AC_OS_ISC, [AC_BEFORE([$0], [AC_TRY_LINK])dnl AC_BEFORE([$0], [AC_TRY_RUN])dnl @@ -1718,8 +1725,8 @@ else AC_MSG_RESULT(no) ISC= fi -])dnl -dnl +]) + AC_DEFUN(AC_OS_XENIX, [AC_REQUIRE([AC_DIR_HEADER])dnl AC_MSG_CHECKING(for Xenix) @@ -1734,16 +1741,16 @@ if test "$XENIX" = yes; then LIBS="-ldir $LIBS" # Make sure -ldir precedes -lx. fi fi -])dnl -dnl +]) + AC_DEFUN(AC_OS_SCO, [AC_CHECK_LIB(intl, strftime, LIBS="$LIBS -lintl") -])dnl -dnl +]) + AC_DEFUN(AC_OS_IRIX, [AC_CHECK_LIB(sun, getmntent, LIBS="$LIBS -lsun") -])dnl -dnl +]) + AC_DEFUN(AC_OS_DYNIX, [AC_CHECK_LIB(seq, getmntent, LIBS="$LIBS -lseq") -])dnl +])