]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
new stuff
authorDavid MacKenzie <djm@djmnet.org>
Wed, 22 Jun 1994 18:22:34 +0000 (18:22 +0000)
committerDavid MacKenzie <djm@djmnet.org>
Wed, 22 Jun 1994 18:22:34 +0000 (18:22 +0000)
Makefile.in
NEWS
acgeneral.m4
acspecific.m4
autoconf.texi
doc/Makefile.in
doc/autoconf.texi
lib/autoconf/general.m4
lib/autoconf/specific.m4

index a6f2495e9793e787663300ae7b4ac3e1f3fc2bca..701ee6d92f9c03f1198a900a243555c8d4978c93 100644 (file)
@@ -156,7 +156,7 @@ clean:
 mostlyclean: clean
 
 distclean: clean
-       rm -f Makefile config.status config.cache
+       rm -f Makefile config.status config.cache config.log
 
 realclean: distclean
        rm -f TAGS *.info*
diff --git a/NEWS b/NEWS
index 32fecf2feffce919815bc6ea8fa6367d8d0a6eb2..4dbe8fb6e6b0ad5c465d9b783514a828c2e1d41a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,26 +1,32 @@
 Major changes in release 2.0:
 
 ** New files:
-* Comes with config.sub and config.guess.
+* Comes with config.sub and config.guess, and uses them optionally.
 * Uses config.cache to cache test results.  An alternate cache file
   can be selected with the --cache-file=FILE option.
+* Uses optional shell scripts $exec_prefix/lib/config.site and
+  $prefix/lib/config.site to perform site or system specific initializations. 
+* configure saves compiler output to ./config.log for debugging.
 
 ** New macros:
 * AC_CACHE_VAL to share results of tests between configure runs.
-* AC_CONFIG_AUXDIR, AC_CANON_SYSTEM, AC_SUBST_FILE, AC_MAKE_LINKS to
+* AC_CONFIG_AUX_DIR, AC_CANONICAL_SYSTEM, AC_LINK_FILES to
   support deciding unguessable features based on the host and target types.
 * AC_CONFIG_SUBDIRS to recursively configure a source tree.
-* AC_TEST_LINK which should be used instead of AC_COMPILE_CHECK, in
-  order to use results caching.
-* AC_ARG_ENABLE and AC_ARG_WITH make AC_ENABLE and AC_WITH obsolete.
+* AC_TEST_LINK, which obsoletes AC_COMPILE_CHECK.
+* AC_TEST_RUN, which obsoletes AC_TEST_PROGRAM.
+* AC_PREFIX_PROGRAM, which obsoletes AC_PREFIX.
+* AC_ARG_ENABLE and AC_ARG_WITH, which obsolete AC_ENABLE and AC_WITH.
 
 ** Changed macros:
 * AC_OUTPUT adds the "automatically generated" comment after "#!" lines, 
   not before them.
 * AC_OUTPUT does not replace "prefix" and "exec_prefix" in generated
   files when they are not enclosed in @ signs.
+* AC_OUTPUT allows the optional environment variable CONFIG_STATUS to
+  override the file name "config.status".
 * AC_PROG_INSTALL looks for install.sh in the directory specified by
-  AC_CONFIG_AUX, or srcdir or srcdir/.. or srcdir/../.. by default.
+  AC_CONFIG_AUXDIR, or srcdir or srcdir/.. or srcdir/../.. by default.
 
 ** New utilities:
 * autoscan to generate a preliminary configure.in for a package by
index eeef4fc9f2202a20945b66a7d212adca24b07628..6c3e5cfdf779a18e6a921ee87b1acbacf3133d46 100644 (file)
@@ -29,35 +29,16 @@ dnl
 ifdef([__gnu__], , [errprint(Autoconf requires GNU m4
 )m4exit(2)])dnl
 dnl
-dnl
-dnl ### Utility functions for stamping the configure script.
-dnl
-dnl
-define(AC_ACVERSION, 1.91)dnl
+define(AC_ACVERSION, 1.93)dnl
 dnl This is defined by the --version option of the autoconf script.
 ifdef([AC_PRINT_VERSION], [errprint(Autoconf version AC_ACVERSION
-)])dnl
-dnl
-dnl These are currently not used, for the sake of people who diff
-dnl configure scripts and don't want spurious differences.
-dnl But they are too clever to just delete.
-dnl
-define(AC_USER, [esyscmd(
-changequote({,})dnl
-# Extract the user name from the first pair of parentheses.
-({ac_sedcmd='s/[^(]*(\([^)]*\)).*/\1/';}
-changequote([,])dnl
-whoami || id|sed "$ac_sedcmd") 2>/dev/null|tr -d '\012')])dnl
-dnl
-define(AC_HOST, [esyscmd((hostname || uname -n) 2>/dev/null|tr -d '\012')])dnl
-dnl
-define(AC_DATE, [esyscmd(date|tr -d '\012')])dnl
+)m4exit(0)])dnl
 dnl
 dnl
 dnl ### Controlling Autoconf operation
 dnl
 dnl
-dnl Diversions:
+dnl m4 diversions:
 define(AC_DIVERSION_NORMAL, 0)dnl      normal output
 define(AC_DIVERSION_SED, 1)dnl         sed substitutions for config.status
 define(AC_DIVERSION_VAR, 2)dnl         variable assignments for config.status
@@ -66,13 +47,9 @@ define(AC_DIVERSION_ARG_ENABLE, 4)dnl        --enable/--disable actions
 define(AC_DIVERSION_HELP_WITH, 5)dnl   --with/--without help strings
 define(AC_DIVERSION_ARG_WITH, 6)dnl    --with/--without actions
 dnl
-dnl This is separate from AC_INIT to prevent GNU m4 1.0 from coredumping
-dnl when AC_CONFIG_HEADER is used.
 define(AC_NOTICE,
 [# Guess values for system-dependent variables and create Makefiles.
-dnl [#] Generated automatically using autoconf.
 # Generated automatically using autoconf version] AC_ACVERSION [
-dnl [#] by AC_USER@AC_HOST on AC_DATE
 # Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
 #
 # This configure script is free software; you can redistribute it and/or
@@ -91,12 +68,13 @@ dnl [#] by AC_USER@AC_HOST on AC_DATE
 ])dnl
 dnl
 define(AC_PARSEARGS,
-[AC_BEFORE([$0], AC_ARG_ENABLE)dnl
-AC_BEFORE([$0], AC_ARG_WITH)dnl
+[AC_BEFORE([$0], [AC_ARG_ENABLE])dnl
+AC_BEFORE([$0], [AC_ARG_WITH])dnl
 # Save the original args to write them into config.status later.
 configure_args="[$]*"
 
-# Omit internal or obsolete options to make the list less imposing.
+# Omit some internal, obsolete, or unimplemented options to make the
+# list less imposing.
 changequote(,)dnl
 ac_usage="Usage: configure [options] [host]
 Options: [defaults in brackets after descriptions]
@@ -130,12 +108,12 @@ changequote([,])dnl
 # dashes changed to underlines.
 build=NONE
 cache_file=./config.cache
-exec_prefix=
+exec_prefix=NONE
 host=NONE
 no_create=
 nonopt=NONE
 norecursion=
-prefix=
+prefix=NONE
 program_prefix=
 program_suffix=
 program_transform_name=
@@ -382,8 +360,12 @@ AC_PREPARE($1)])dnl
 dnl
 dnl AC_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR)
 define(AC_PREPARE,
-[AC_BEFORE([$0], AC_ARG_ENABLE)dnl
-AC_BEFORE([$0], AC_ARG_WITH)dnl
+[AC_BEFORE([$0], [AC_ARG_ENABLE])dnl
+AC_BEFORE([$0], [AC_ARG_WITH])dnl
+AC_BEFORE([$0], [AC_CONFIG_HEADER])dnl
+AC_BEFORE([$0], [AC_REVISION])dnl
+AC_BEFORE([$0], [AC_PREREQ])dnl
+AC_BEFORE([$0], [AC_CONFIG_SUBDIRS])dnl
 trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
 trap 'rm -fr confdefs* $ac_clean_files' 0
 
@@ -392,8 +374,9 @@ trap 'rm -fr confdefs* $ac_clean_files' 0
 # 1 file creation
 # 2 errors and warnings
 # 3 unused; some systems may open it to /dev/tty
-# 4 checking for...
+# 4 checking for... messages
 # 5 test results
+# 6 compiler messages
 if test "$silent" = yes; then
   exec 4>/dev/null
 else
@@ -404,6 +387,12 @@ if test "$verbose" = yes; then
 else
   exec 5>/dev/null
 fi
+exec 6>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&6
 
 # Save the original args if we used an alternate arg parser.
 ac_configure_temp="${configure_args-[$]*}"
@@ -458,7 +447,12 @@ if test ! -r $srcdir/$ac_unique_file; then
     AC_ERROR(can not find sources in ${srcdir})
   fi
 fi
+
+ifdef([AC_LIST_PREFIX_PROGRAM], [AC_PREFIX(AC_LIST_PREFIX_PROGRAM)])dnl
+dnl Let the site file select an alternate cache file if it wants to.
+AC_SITE_LOAD
 AC_CACHE_LOAD
+
 AC_LANG_C
 undivert(AC_DIVERSION_ARG_ENABLE)dnl
 undivert(AC_DIVERSION_ARG_WITH)dnl
@@ -466,7 +460,8 @@ undivert(AC_DIVERSION_ARG_WITH)dnl
 dnl
 dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
 define(AC_ARG_ENABLE,
-[divert(AC_DIVERSION_HELP_ENABLE)dnl
+[AC_PROVIDE([$0])dnl
+divert(AC_DIVERSION_HELP_ENABLE)dnl
 $2
 divert(AC_DIVERSION_ARG_ENABLE)dnl
 AC_ENABLE_INTERNAL([$1], [$3], [$4])dnl
@@ -492,7 +487,8 @@ fi
 dnl
 dnl AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
 define(AC_ARG_WITH,
-[divert(AC_DIVERSION_HELP_WITH)dnl
+[AC_PROVIDE([$0])dnl
+divert(AC_DIVERSION_HELP_WITH)dnl
 $2
 divert(AC_DIVERSION_ARG_WITH)dnl
 AC_WITH_INTERNAL([$1], [$3], [$4])dnl
@@ -517,10 +513,10 @@ fi
 ])dnl
 dnl
 dnl AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
-define(AC_CONFIG_HEADER, [define(AC_LIST_HEADERS, $1)])dnl
+define(AC_CONFIG_HEADER, [AC_PROVIDE([$0])define(AC_LIST_HEADERS, $1)])dnl
 dnl
 dnl AC_REVISION(REVISION-INFO)
-define(AC_REVISION, [AC_REQUIRE([AC_BINSH])dnl
+define(AC_REVISION, [AC_PROVIDE([$0])AC_REQUIRE([AC_BINSH])dnl
 [# From configure.in] translit([$1],$")])dnl
 dnl
 dnl Subroutines of AC_PREREQ.
@@ -543,16 +539,44 @@ dnl
 dnl Complain and exit if the Autoconf version is less than $1.
 dnl AC_PREREQ(VERSION)
 define(AC_PREREQ,
-[AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
+[AC_PROVIDE([$0])dnl
+AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
 AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])),[$1])])dnl
 dnl
 dnl Run configure in subdirectories $1.
 dnl Not actually done until AC_OUTPUT_SUBDIRS.
 dnl AC_CONFIG_SUBDIRS(DIR ...)
 define(AC_CONFIG_SUBDIRS,
-[AC_REQUIRE([AC_CONFIG_AUXDIR_DEFAULT])dnl
+[AC_PROVIDE([$0])dnl
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 define([AC_LIST_SUBDIRS],[$1])])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,
+dnl set `prefix' to /usr/local/gnu.
+dnl AC_PREFIX_PROGRAM(PROGRAM)
+define(AC_PREFIX_PROGRAM, [define([AC_LIST_PREFIX_PROGRAM],[$1])])dnl
+define(AC_PREFIX_INTERNAL,
+[if test "x$prefix" = xNONE; then
+changequote(<<,>>)dnl
+define(<<AC_VAR_NAME>>, translit($1, [a-z], [A-Z]))dnl
+changequote([,])dnl
+AC_PROGRAM_PATH(AC_VAR_NAME, $1)
+changequote(<<,>>)dnl
+  if test -n "$ac_cv_path_<<>>AC_VAR_NAME"; then
+    prefix=`echo $ac_cv_path_<<>>AC_VAR_NAME|sed 's%/[^/][^/]*/[^/][^/]*$%%'`
+changequote([,])dnl
+dnl    test -z "$prefix" && prefix=/
+    AC_VERBOSE(setting installation directory prefix to ${prefix})
+  fi
+fi
+undefine(AC_VAR_NAME)dnl
+])dnl
+define(AC_PREFIX,
+[AC_OBSOLETE([$0], [; instead use AC_PREFIX_PROGRAM before AC_INIT])dnl
+AC_PREFIX_INTERNAL([$1])])dnl
+dnl
 dnl
 dnl ### Canonicalizing the system type
 dnl
@@ -560,21 +584,21 @@ dnl
 dnl Find install.sh, config.sub, config.guess, and Cygnus configure
 dnl in directory $1.  These are auxiliary files used in configuration.
 dnl $1 can be either absolute or relative to ${srcdir}.
-dnl AC_CONFIG_AUXDIR(DIR)
-define(AC_CONFIG_AUXDIR,
-[AC_CONFIG_AUXDIR_DIRS($1 ${srcdir}/$1)])dnl
+dnl AC_CONFIG_AUX_DIR(DIR)
+define(AC_CONFIG_AUX_DIR,
+[AC_CONFIG_AUX_DIRS($1 ${srcdir}/$1)])dnl
 dnl
 dnl The default is `${srcdir}' or `${srcdir}/..' or `${srcdir}/../..'.
 dnl There's no need to call this macro explicitly; just AC_REQUIRE it.
-define(AC_CONFIG_AUXDIR_DEFAULT,
-[AC_CONFIG_AUXDIR_DIRS(${srcdir} ${srcdir}/.. ${srcdir}/../..)])dnl
+define(AC_CONFIG_AUX_DIR_DEFAULT,
+[AC_CONFIG_AUX_DIRS(${srcdir} ${srcdir}/.. ${srcdir}/../..)])dnl
 dnl
 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
 dnl do not automatically need to distribute the other auxiliary files.
-dnl AC_CONFIG_AUXDIR_DIRS(DIR ...)
-define(AC_CONFIG_AUXDIR_DIRS,
+dnl AC_CONFIG_AUX_DIRS(DIR ...)
+define(AC_CONFIG_AUX_DIRS,
 [ac_aux_dir=
 for ac_dir in $1; do
   if test -f $ac_dir/install.sh; then
@@ -588,12 +612,12 @@ ac_config_guess=${ac_aux_dir}/config.guess
 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_AUXDIR_DEFAULT])dnl
+AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 ])dnl
 dnl
 dnl Canonicalize the host, target, and build system types.
-define(AC_CANON_SYSTEM,
-[AC_REQUIRE([AC_CONFIG_AUXDIR_DEFAULT])dnl
+define(AC_CANONICAL_SYSTEM,
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 # Do some error checking and defaulting for the host and target type.
 # The inputs are:
 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
@@ -623,14 +647,14 @@ if ${ac_config_sub} sun4 >/dev/null 2>&1; then :
 else AC_ERROR(can not run ${ac_config_sub})
 fi
 
-AC_CANON_HOST
-AC_CANON_TARGET
-AC_CANON_BUILD
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+AC_CANONICAL_BUILD
 ])dnl
 dnl
-dnl Subroutines of AC_CANON_SYSTEM.
+dnl Subroutines of AC_CANONICAL_SYSTEM.
 dnl
-define(AC_CANON_HOST,
+define(AC_CANONICAL_HOST,
 [AC_CHECKING(host type)
 
 case "${host_alias}" in
@@ -653,7 +677,7 @@ AC_SUBST(host)dnl
 AC_SUBST(host_alias)dnl
 ])dnl
 dnl
-define(AC_CANON_TARGET,
+define(AC_CANONICAL_TARGET,
 [AC_CHECKING(target type)
 
 case "${target_alias}" in
@@ -673,7 +697,7 @@ AC_SUBST(target)dnl
 AC_SUBST(target_alias)dnl
 ])dnl
 dnl
-define(AC_CANON_BUILD,
+define(AC_CANONICAL_BUILD,
 [AC_CHECKING(build type)
 
 case "${build_alias}" in
@@ -690,30 +714,38 @@ AC_SUBST(build)dnl
 AC_SUBST(build_alias)dnl
 ])dnl
 dnl
-dnl Put the contents of file $2 into Makefile variable $1.
-dnl Useful for inserting Makefile fragments into Makefiles.
-dnl AC_SUBST_FILE(VARIABLE, FILE)
-define(AC_SUBST_FILE,
-[AC_SUBST($1)dnl
-if test -f ${srcdir}/$2; then
-  AC_VERBOSE(using $2 for $1)
-  $1=`cat ${srcdir}/$2`
-fi
-])dnl
-dnl
 dnl Link each of the existing files in $2 to the corresponding
 dnl link name in $1.
 dnl Not actually done until AC_OUTPUT_LINKS.
-dnl AC_MAKE_LINKS(LINK ..., FILE ...)
-define(AC_MAKE_LINKS,
+dnl AC_LINK_FILES(LINK ..., FILE ...)
+define(AC_LINK_FILES,
 [define([AC_LIST_LINKS],[$1])define([AC_LIST_FILES],[$2])])dnl
 dnl
 dnl
 dnl ### Caching test results
 dnl
 dnl
+dnl Look for site or system specific initialization scripts.
+define(AC_SITE_LOAD,
+[ac_site_dirs=/usr/local
+if test "x$prefix" != xNONE; then
+  ac_site_dirs=$prefix
+fi
+# System dependent files override system independent ones in case of conflict.
+if test "x$exec_prefix" != xNONE && test "x$exec_prefix" != "x$prefix"; then
+  ac_site_dirs="$ac_site_dirs $exec_prefix"
+fi
+for ac_site_dir in $ac_site_dirs; do
+  ac_site_file=$ac_site_dir/lib/config.site
+  if test -r "$ac_site_file"; then
+    AC_VERBOSE(loading site initialization script $ac_site_file)
+    . $ac_site_file
+  fi
+done
+])dnl
+dnl
 define(AC_CACHE_LOAD,
-[if test -r $cache_file; then
+[if test -r "$cache_file"; then
   AC_VERBOSE(loading test results from cache file $cache_file)
   . $cache_file
 else
@@ -728,7 +760,7 @@ cat > $cache_file <<\CEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
 # scripts and configure runs.  It is not useful on other systems.
-# If its contents are invalid for some reason, you may edit or delete it.
+# If its contents are invalid for some reason, you may delete or edit it.
 #
 # By default, configure uses ./config.cache as the cache file,
 # creating it if it does not exist already.  You can give configure
@@ -739,7 +771,8 @@ cat > $cache_file <<\CEOF
 # --recheck option to rerun configure.
 CEOF
 changequote(,)dnl
-set | sed -n "/^[a-zA-Z0-9_]*_cv_/s/=\(.*\)/='\1'/p" >> $cache_file
+dnl Allow a site initialization script to override cache values.
+set | sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1-'\2'}/p" >> $cache_file
 changequote([,])dnl
 fi])dnl
 dnl
@@ -888,7 +921,7 @@ AC_PROVIDE([$0])dnl
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='${CPP}'
-ac_compile='${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS >/dev/null 2>&1'
+ac_compile='${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1>&6 2>&6'
 ])dnl
 dnl
 define(AC_LANG_CPLUSPLUS,
@@ -897,7 +930,7 @@ AC_PROVIDE([$0])dnl
 ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='${CXXCPP}'
-ac_compile='${CXX-gcc} $CXXFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS >/dev/null 2>&1'
+ac_compile='${CXX-gcc} $CXXFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1>&6 2>&6'
 ])dnl
 dnl
 dnl Push the current language on a stack.
@@ -940,25 +973,25 @@ define(AC_PROGRAM_CHECK,
 [# Extract the first word of "$2", so it can be a program name with args.
 set dummy $2; ac_word=[$]2
 AC_CHECKING([for $ac_word])
-AC_CACHE_VAL(ac_cv_program_$1,
+AC_CACHE_VAL(ac_cv_prog_$1,
 [if test -n "[$]$1"; then
-  ac_cv_program_$1="[$]$1" # Let the user override the test.
+  ac_cv_prog_$1="[$]$1" # Let the user override the test.
 else
   IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
   for ac_dir in $PATH; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_program_$1="$3"
+      ac_cv_prog_$1="$3"
       break
     fi
   done
   IFS="$ac_save_ifs"
 dnl If no 4th arg is given, leave the cache variable unset,
 dnl so AC_PROGRAMS_CHECK will keep looking.
-ifelse([$4],,, [  test -z "[$]ac_cv_program_$1" && ac_cv_program_$1="$4"
+ifelse([$4],,, [  test -z "[$]ac_cv_prog_$1" && ac_cv_prog_$1="$4"
 ])dnl
 fi])dnl
-$1="$ac_cv_program_$1"
+$1="$ac_cv_prog_$1"
 test -n "[$]$1" && AC_VERBOSE(setting $1 to [$]$1)
 AC_SUBST($1)dnl
 ])dnl
@@ -1018,28 +1051,6 @@ done
 ifelse([$3],,, [test -n "[$]$1" || $1="$3"
 ])])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,
-dnl set `prefix' to /usr/local/gnu.
-dnl AC_PREFIX(PROGRAM)
-define(AC_PREFIX,
-[if test -z "$prefix"; then
-changequote(<<,>>)dnl
-define(<<AC_VAR_NAME>>, translit($1, [a-z], [A-Z]))dnl
-changequote([,])dnl
-AC_PROGRAM_PATH(AC_VAR_NAME, $1)
-changequote(<<,>>)dnl
-  if test -n "$ac_cv_path_<<>>AC_VAR_NAME"; then
-    prefix=`echo $ac_cv_path_<<>>AC_VAR_NAME|sed 's%/[^/][^/]*/[^/][^/]*$%%'`
-changequote([,])dnl
-    test -z "$prefix" && prefix=/
-    AC_VERBOSE(setting installation directory prefix to ${prefix})
-  fi
-fi
-undefine(AC_VAR_NAME)dnl
-])dnl
-dnl
 dnl AC_HAVE_LIBRARY(LIBRARY [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
 define(AC_HAVE_LIBRARY, [dnl
 changequote(/,/)dnl
@@ -1106,7 +1117,8 @@ dnl AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY,
 dnl                  ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
 define(AC_COMPILE_CHECK,
 [AC_PROVIDE([$0])dnl
-AC_OBSOLETE([$0], [; instead use AC_TEST_LINK])dnl
+dnl It's actually ok to use this, if you don't care about caching.
+dnl AC_OBSOLETE([$0], [; instead use AC_TEST_LINK])dnl
 ifelse([$1], , , [AC_CHECKING([for $1])
 ])dnl
 AC_TEST_LINK([$2], [$3], [$4], [$5])dnl
@@ -1134,14 +1146,15 @@ fi
 rm -f conftest*]
 )dnl
 dnl
-dnl AC_TEST_PROGRAM(PROGRAM, ACTION-IF-TRUE [, ACTION-IF-FALSE
-dnl                 [, ACTION-IF-CROSS-COMPILING]])
-define(AC_TEST_PROGRAM,
+dnl AC_TEST_RUN(PROGRAM, ACTION-IF-TRUE [, ACTION-IF-FALSE
+dnl             [, ACTION-IF-CROSS-COMPILING]])
+define(AC_TEST_RUN,
 [AC_PROVIDE([$0])dnl
 AC_REQUIRE([AC_CROSS_CHECK])dnl
 if test -n "$cross_compiling"; then
   ifelse([$4], , AC_ERROR(can not run test program while cross compiling),
-  [$4
+  [AC_VERBOSE(using default for cross-compiling)
+$4
 ])
 else
 cat > conftest.${ac_ext} <<EOF
@@ -1157,6 +1170,9 @@ ifelse([$3], , , [else
 fi
 fi
 rm -fr conftest*])dnl
+dnl Obsolete name, which is less clear about what the macro does,
+dnl but is otherwise ok to use.
+define(AC_TEST_PROGRAM, [AC_TEST_RUN([$1], [$2], [$3], [$4])])dnl
 dnl
 dnl AC_TEST_CPP(INCLUDES, ACTION-IF-TRUE [, ACTION-IF-FALSE])
 define(AC_TEST_CPP,
@@ -1202,7 +1218,8 @@ dnl AC_FUNC_CHECK(FUNCTION, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
 define(AC_FUNC_CHECK,
 [AC_CHECKING([for $1])
 AC_CACHE_VAL(ac_cv_func_$1,
-[AC_TEST_LINK([#include <ctype.h>], [
+[AC_TEST_LINK(
+[#include <ctype.h> /* Arbitrary system header to define __stub macros. */], [
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
@@ -1266,15 +1283,14 @@ define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
 changequote([,])dnl
 AC_CHECKING(size of $1)
 AC_CACHE_VAL(AC_CV_NAME,
-[dnl If cross-compiling, the caller has to decide what to do; we can't.
-AC_TEST_PROGRAM([#include <stdio.h>
+[AC_TEST_RUN([#include <stdio.h>
 main()
 {
   FILE *f=fopen("conftestval", "w");
   if (!f) exit(1);
   fprintf(f, "%d\n", sizeof($1));
   exit(0);
-}], AC_CV_NAME=`cat conftestval`, AC_ERROR(can not determine size of $1))])dnl
+}], AC_CV_NAME=`cat conftestval`)])dnl
 AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
 undefine(AC_TYPE_NAME)dnl
 undefine(AC_CV_NAME)dnl
@@ -1288,9 +1304,9 @@ dnl AC_OUTPUT([FILE...] [,EXTRA-CMDS])
 define(AC_OUTPUT,
 [AC_CACHE_SAVE
 
-test -z "$prefix" && prefix=/usr/local
+test "x$prefix" = xNONE && prefix=/usr/local
 # Let make expand exec_prefix.
-test -z "$exec_prefix" && exec_prefix='${prefix}'
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
 # Any assignment to VPATH causes Sun make to only execute
 # the first set of double-colon rules, so remove it if not needed.
index c07b6c6d2b961108d73b4d43b4e8a058a0cb56e8..3024af70850af674f5fa7ad2bb15b634bac85ab3 100644 (file)
@@ -28,58 +28,60 @@ define(AC_PROG_CC,
 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
 AC_PROVIDE([$0])dnl
 AC_PROGRAM_CHECK(CC, gcc, gcc, cc)
+
 # Find out if we are using GNU C, under whatever name.
-cat > conftest.c <<EOF
+AC_CACHE_VAL(ac_cv_prog_gcc,
+[cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes
 #endif
 EOF
-${CC-cc} -E conftest.c > conftest.out 2>&1
-if egrep yes conftest.out >/dev/null 2>&1; then
-  GCC=yes
+if ${CC-cc} -E conftest.c 2>&6 | egrep yes >/dev/null 2>&1; then
+  ac_cv_prog_gcc=yes
 else
-  GCC=
-fi
-rm -f conftest*
+  ac_cv_prog_gcc=no
+fi])dnl
+if test "$ac_cv_prog_gcc" = yes; then GCC=yes; else GCC= ; fi
 ])dnl
 dnl
 define(AC_PROG_CXX,
 [AC_BEFORE([$0],[AC_PROG_CXXCPP])dnl
 AC_PROVIDE([$0])dnl
 AC_PROGRAMS_CHECK(CXX, $CCC c++ g++ gcc CC cxx, gcc)
+
 # Find out if we are using GNU C++, under whatever name.
-cat > conftest.C <<EOF
+AC_CACHE_VAL(ac_cv_prog_gxx,
+[cat > conftest.C <<EOF
 #ifdef __GNUC__
   yes
 #endif
 EOF
-${CXX-gcc} -E conftest.C > conftest.out 2>&1
-if egrep yes conftest.out >/dev/null 2>&1; then
-  GXX=yes
+if ${CXX-gcc} -E conftest.C 2>&6 | egrep yes >/dev/null 2>&1; then
+  ac_cv_prog_gxx=yes
 else
-  GXX=
-fi
-rm -f conftest*
+  ac_cv_prog_gxx=no
+fi])dnl
+if test "$ac_cv_prog_gxx" = yes; then GXX=yes; else GXX= ; fi
 ])dnl
 dnl
 define(AC_GCC_TRADITIONAL,
 [AC_REQUIRE([AC_PROG_CC])dnl
 AC_REQUIRE([AC_PROG_CPP])dnl
-if test "$GCC" = yes; then
+if test "$ac_cv_prog_gcc" = yes; then
   AC_CHECKING(whether -traditional is needed)
-changequote(,)dnl
-  ac_pattern="Autoconf.*'x'"
-changequote([,])dnl
+AC_CACHE_VAL(ac_cv_prog_gcc_traditional,
+[  ac_pattern="Autoconf.*'x'"
   ac_prog='#include <sgtty.h>
 Autoconf TIOCGETP'
-  AC_PROGRAM_EGREP($ac_pattern, $ac_prog, ac_need_trad=yes, ac_need_trad=no)
+  AC_PROGRAM_EGREP($ac_pattern, $ac_prog,
+  ac_cv_prog_gcc_traditional=yes, ac_cv_prog_gcc_traditional=no)
 
-  if test "$ac_need_trad" = no; then
+  if test "$ac_cv_prog_gcc_traditional" = no; then
     ac_prog='#include <termio.h>
 Autoconf TCGETA'
-    AC_PROGRAM_EGREP($ac_pattern, $ac_prog, ac_need_trad=yes)
-  fi
-  if test "$ac_need_trad" = yes; then
+    AC_PROGRAM_EGREP($ac_pattern, $ac_prog, ac_cv_prog_gcc_traditional=yes)
+  fi])dnl
+  if test "$ac_cv_prog_gcc_traditional" = yes; then
     CC="$CC -traditional"
     AC_VERBOSE(setting CC to $CC)
   fi
@@ -96,15 +98,15 @@ echo 'foo(){}' > conftest.c
 # Make sure it works both with $CC and with simple cc.
 # We do the test twice because some compilers refuse to overwrite an
 # existing .o file with -o, though they will create one.
-if ${CC-cc} -c conftest.c -o conftest.o >/dev/null 2>&1 \
- && test -f conftest.o && ${CC-cc} -c conftest.c -o conftest.o >/dev/null 2>&1
+if ${CC-cc} -c conftest.c -o conftest.o 1>&6 2>&6 &&
+  test -f conftest.o && ${CC-cc} -c conftest.c -o conftest.o 1>&6 2>&6
 then
   if test "x$CC" != xcc; then
     # Test first that cc exists at all.
-    if cc -c conftest.c >/dev/null 2>&1
+    if cc -c conftest.c 1>&6 2>&6
     then
-      if cc -c conftest.c -o conftest2.o >/dev/null 2>&1 && \
-         test -f conftest2.o && cc -c conftest.c -o conftest2.o >/dev/null 2>&1
+      if cc -c conftest.c -o conftest2.o 1>&6 2>&6 &&
+        test -f conftest2.o && cc -c conftest.c -o conftest2.o 1>&6 2>&6
       then
         :
       else
@@ -230,7 +232,7 @@ AC_SUBST(LEX_OUTPUT_ROOT)dnl
 ])dnl
 dnl
 define(AC_PROG_INSTALL,
-[AC_REQUIRE([AC_CONFIG_AUX_DEFAULT])dnl
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 # Make sure to not get the incompatible SysV /etc/install and
 # /usr/sbin/install, which might be in PATH before a BSD-like install,
 # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
@@ -249,7 +251,7 @@ define(AC_PROG_INSTALL,
 # by make from ./install.sh.
 AC_CHECKING(for a BSD compatible install)
 if test -z "${INSTALL}"; then
-AC_CACHE_VAL(ac_cv_path_INSTALL,
+AC_CACHE_VAL(ac_cv_path_install,
 [  IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
   for ac_dir in $PATH; do
     case "$ac_dir" in
@@ -264,7 +266,7 @@ AC_CACHE_VAL(ac_cv_path_INSTALL,
            # OSF/1 installbsd also uses dspmsg, but is usable.
            :
          else
-           ac_cv_path_INSTALL="$ac_dir/$ac_prog -c"
+           ac_cv_path_install="$ac_dir/$ac_prog -c"
            break 2
          fi
        fi
@@ -274,8 +276,8 @@ AC_CACHE_VAL(ac_cv_path_INSTALL,
   done
   IFS="$ac_save_ifs"
   # As a last resort, use the slow shell script.
-  test -z "$ac_cv_path_INSTALL" && ac_cv_path_INSTALL="$ac_install_sh"])dnl
-  INSTALL="$ac_cv_path_INSTALL"
+  test -z "$ac_cv_path_install" && ac_cv_path_install="$ac_install_sh"])dnl
+  INSTALL="$ac_cv_path_install"
 fi
 AC_SUBST(INSTALL)dnl
 AC_VERBOSE(setting INSTALL to $INSTALL)
@@ -348,7 +350,7 @@ fi
 
 if test "$ac_stdc_hdrs" = yes; then
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-AC_TEST_PROGRAM([#include <ctype.h>
+AC_TEST_RUN([#include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
 #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
@@ -402,14 +404,12 @@ AC_DIR_HEADER_CHECK(sys/dir.h, SYSDIR)
 AC_DIR_HEADER_CHECK(ndir.h, NDIR)
 
 AC_CHECKING(for closedir return value)
-AC_TEST_PROGRAM([#include <sys/types.h>
+AC_TEST_RUN([#include <sys/types.h>
 #include <$ac_dir_header>
 int closedir(); main() { exit(closedir(opendir(".")) != 0); }], ,
 AC_DEFINE(VOID_CLOSEDIR))
 ])dnl
 dnl Subroutine of AC_DIR_HEADER.
-dnl ??? I tried to put this define inside AC_DIR_HEADER, but when I did
-dnl that, $1 and $2 did not get expanded. --roland
 dnl Check if $1 is the winning directory library header file.
 dnl It must not only exist, but also correctly define the `DIR' type.
 dnl If it is really winning, define $2 and set shell var `ac_dir_header' to $1.
@@ -486,7 +486,7 @@ main()
   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
 }'
 changequote([,])dnl
-AC_TEST_PROGRAM([$ac_prog],
+AC_TEST_RUN([$ac_prog],
                AC_DEFINE(GETGROUPS_T, gid_t), AC_DEFINE(GETGROUPS_T, int))
 ])dnl
 dnl
@@ -535,7 +535,7 @@ dnl
 dnl
 define(AC_MMAP, [
 AC_CHECKING(for working mmap)
-AC_TEST_PROGRAM([/* Thanks to Mike Haertel and Jim Avera for this test. */
+AC_TEST_RUN([/* Thanks to Mike Haertel and Jim Avera for this test. */
 #include <sys/types.h>
 #include <fcntl.h>
 #include <sys/mman.h>
@@ -605,12 +605,9 @@ main()
 ])dnl
 dnl
 define(AC_VPRINTF,
-[AC_CHECKING([for vprintf])
-AC_TEST_LINK( , [vprintf();],
-  [ac_have_vprintf=yes AC_DEFINE(HAVE_VPRINTF)], ac_have_vprintf=no)
-if test "$ac_have_vprintf" = no; then
-AC_CHECKING([for _doprnt])
-AC_TEST_LINK( , [_doprnt();], AC_DEFINE(HAVE_DOPRNT))
+[AC_FUNC_CHECK(vprintf, AC_DEFINE(HAVE_VPRINTF))
+if test "$ac_cv_func_vprintf" != yes; then
+AC_FUNC_CHECK(_doprnt, AC_DEFINE(HAVE_DOPRNT))
 fi
 ])dnl
 dnl
@@ -619,7 +616,7 @@ define(AC_VFORK,
 AC_HEADER_CHECK(vfork.h, AC_DEFINE(HAVE_VFORK_H))
 AC_CHECKING(for working vfork)
 AC_REQUIRE([AC_RETSIGTYPE])
-AC_TEST_PROGRAM([/* Thanks to Paul Eggert for this test.  */
+AC_TEST_RUN([/* Thanks to Paul Eggert for this test.  */
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -704,7 +701,7 @@ main() {
 dnl
 define(AC_WAIT3,
 [AC_CHECKING(for wait3 that fills in rusage)
-AC_TEST_PROGRAM([#include <sys/types.h>
+AC_TEST_RUN([#include <sys/types.h>
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <stdio.h>
@@ -749,10 +746,12 @@ ac_decl="#ifdef __GNUC__
 #ifdef _AIX
  #pragma alloca
 #else
+#ifndef alloca /* predefined by HP cc +Olibcalls */
 char *alloca ();
 #endif
 #endif
 #endif
+#endif
 "
 AC_CHECKING([for alloca])
 AC_TEST_LINK($ac_decl,
@@ -780,7 +779,7 @@ AC_FUNC_CHECK([GETB67],AC_DEFINE([CRAY_STACKSEG_END],[GETB67]),
 AC_FUNC_CHECK([getb67],AC_DEFINE([CRAY_STACKSEG_END],[getb67])))))
 
 AC_CHECKING(stack direction for C alloca)
-AC_TEST_PROGRAM([find_stack_direction ()
+AC_TEST_RUN([find_stack_direction ()
 {
   static char *addr = 0;
   auto char dummy;
@@ -889,7 +888,7 @@ define(AC_UTIME_NULL,
 [AC_CHECKING(utime with null argument)
 rm -f conftestdata; > conftestdata
 # Sequent interprets utime(file, 0) to mean use start of epoch.  Wrong.
-AC_TEST_PROGRAM([#include <sys/types.h>
+AC_TEST_RUN([#include <sys/types.h>
 #include <sys/stat.h>
 main() {
 struct stat s, t;
@@ -901,7 +900,7 @@ rm -f core
 ])dnl
 dnl
 define(AC_STRCOLL, [AC_CHECKING(for strcoll)
-AC_TEST_PROGRAM([#include <string.h>
+AC_TEST_RUN([#include <string.h>
 main ()
 {
   exit (strcoll ("abc", "def") >= 0 ||
@@ -911,7 +910,7 @@ main ()
 dnl
 define(AC_SETVBUF_REVERSED,
 [AC_CHECKING(whether setvbuf arguments are reversed)
-AC_TEST_PROGRAM([#include <stdio.h>
+AC_TEST_RUN([#include <stdio.h>
 /* If setvbuf has the reversed format, exit 0. */
 main () {
   /* This call has the arguments reversed.
@@ -999,14 +998,14 @@ define(AC_CROSS_CHECK,
 [AC_PROVIDE([$0])dnl
 AC_CHECKING(whether cross-compiling)
 # If we cannot run a trivial program, we must be cross compiling.
-AC_TEST_PROGRAM([main(){exit(0);}], cross_compiling=, cross_compiling=yes)
+AC_TEST_RUN([main(){exit(0);}], cross_compiling=, cross_compiling=yes)
 if test "$cross_compiling" = yes; then
   AC_VERBOSE(we are cross-compiling)
 fi])dnl
 dnl
 define(AC_CHAR_UNSIGNED,
 [AC_CHECKING(for unsigned characters)
-AC_TEST_PROGRAM(
+AC_TEST_RUN(
 [/* volatile prevents gcc2 from optimizing the test away on sparcs.  */
 #if !__STDC__
 #define volatile
@@ -1023,10 +1022,10 @@ dnl
 define(AC_LONG_DOUBLE,
 [AC_REQUIRE([AC_PROG_CC])dnl
 AC_CHECKING(for long double)
-if test -n "$GCC"; then
+if test "$GCC" = yes; then
 AC_DEFINE(HAVE_LONG_DOUBLE)
 else
-AC_TEST_PROGRAM([int main() {
+AC_TEST_RUN([int main() {
 /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
 long double foo = 0.0;
 /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
@@ -1038,20 +1037,20 @@ dnl
 define(AC_INT_16_BITS,
 [AC_OBSOLETE([$0], [; instead use AC_SIZEOF_TYPE(int)])
 AC_CHECKING(integer size)
-AC_TEST_PROGRAM([main() { exit(sizeof(int) != 2); }],
+AC_TEST_RUN([main() { exit(sizeof(int) != 2); }],
  AC_DEFINE(INT_16_BITS))
 ])dnl
 dnl
 define(AC_LONG_64_BITS,
 [AC_OBSOLETE([$0], [; instead use AC_SIZEOF_TYPE(long)])
 AC_CHECKING(for 64-bit long ints)
-AC_TEST_PROGRAM([main() { exit(sizeof(long int) != 8); }],
+AC_TEST_RUN([main() { exit(sizeof(long int) != 8); }],
  AC_DEFINE(LONG_64_BITS))
 ])dnl
 dnl
 define(AC_WORDS_BIGENDIAN,
 [AC_CHECKING(byte ordering)
-AC_TEST_PROGRAM([main () {
+AC_TEST_RUN([main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
   union
   {
@@ -1065,7 +1064,7 @@ AC_TEST_PROGRAM([main () {
 dnl
 define(AC_ARG_ARRAY,
 [AC_CHECKING(whether the address of an argument can be used as an array)
-AC_TEST_PROGRAM([main() {
+AC_TEST_RUN([main() {
 /* Return 0 iff arg arrays are ok.  */
 exit(!x(1, 2, 3, 4));
 }
@@ -1186,7 +1185,7 @@ test "$ac_some_dir_failed" = yes || AC_DEFINE(HAVE_LONG_FILE_NAMES)
 dnl
 define(AC_RESTARTABLE_SYSCALLS,
 [AC_CHECKING(for restartable system calls)
-AC_TEST_PROGRAM(
+AC_TEST_RUN(
 [/* Exit 0 (true) if wait returns something other than -1,
    i.e. the pid of the child, which means that wait was restarted
    after getting the signal.  */
@@ -1373,8 +1372,8 @@ fi
 # It would also be nice to do this for all -L options, not just this one.
 if test -n "$x_libraries"; then
   X_LIBS="$X_LIBS -L$x_libraries"
-  if test "`(uname) 2>/dev/null`" = SunOS \
-     && uname -r | grep '^5' >/dev/null; then
+  if test "`(uname) 2>/dev/null`" = SunOS &&
+    uname -r | grep '^5' >/dev/null; then
     X_LIBS="$X_LIBS -R$x_libraries"
   fi
 fi
@@ -1410,13 +1409,13 @@ AC_SUBST(X_EXTRA_LIBS)dnl
 dnl
 dnl
 dnl ### Checks for UNIX variants
-dnl These are kludges; we need a better approach.
+dnl These are kludges; we need a more systematic approach.
 dnl
 dnl
 define(AC_AIX,
 [AC_CHECKING(for AIX)
 AC_BEFORE([$0], [AC_TEST_LINK])dnl
-AC_BEFORE([$0], [AC_TEST_PROGRAM])dnl
+AC_BEFORE([$0], [AC_TEST_RUN])dnl
 AC_BEFORE([$0], [AC_TEST_CPP])dnl
 AC_PROGRAM_EGREP(yes,
 [#ifdef _AIX
@@ -1427,7 +1426,7 @@ AC_PROGRAM_EGREP(yes,
 dnl
 define(AC_MINIX,
 [AC_BEFORE([$0], [AC_TEST_LINK])dnl
-AC_BEFORE([$0], [AC_TEST_PROGRAM])dnl
+AC_BEFORE([$0], [AC_TEST_RUN])dnl
 AC_BEFORE([$0], [AC_TEST_CPP])dnl
 AC_HEADER_CHECK(minix/config.h, MINIX=yes, MINIX=)
 # The Minix shell ca not assign to the same variable on the same line!
@@ -1441,7 +1440,7 @@ dnl
 define(AC_ISC_POSIX,
 [AC_PROVIDE([$0])dnl
 AC_BEFORE([$0], [AC_TEST_LINK])dnl
-AC_BEFORE([$0], [AC_TEST_PROGRAM])dnl
+AC_BEFORE([$0], [AC_TEST_RUN])dnl
 AC_BEFORE([$0], [AC_TEST_CPP])dnl
 AC_CHECKING(for POSIXized ISC)
 if test -d /etc/conf/kconfig.d &&
@@ -1449,7 +1448,7 @@ if test -d /etc/conf/kconfig.d &&
 then
   ISC=yes # If later tests want to check for ISC.
   AC_DEFINE(_POSIX_SOURCE)
-  if test -n "$GCC"; then
+  if test "$GCC" = yes; then
     CC="$CC -posix"
   else
     CC="$CC -Xp"
index 4172616bfc5958cb8aad06421c1c9c91075faf7b..654ae8463ddbfa66e5fbf728f22c24247b81d74e 100644 (file)
@@ -6,9 +6,9 @@
 @c @setchapternewpage odd
 @c %**end of header
 
-@set EDITION 1.91
-@set VERSION 1.91
-@set UPDATED May 1994
+@set EDITION 1.93
+@set VERSION 1.93
+@set UPDATED June 1994
 
 @iftex
 @finalout
@@ -91,17 +91,17 @@ package.  This is edition @value{EDITION}, for Autoconf version @value{VERSION}.
 @c The master menu, created with texinfo-master-menu, goes here.
 
 @menu
-* Introduction::               Autoconf's purpose, strengths, and weaknesses.
-* Distributing::               Legal restrictions on Autoconf output.
-* Making configure Scripts::   How to organize and produce Autoconf scripts.
-* Specific Tests::             Macros that check for particular features.
-* General Purpose Macros::     Macros that check for kinds of features.
-* Writing Macros::             How to add your own macros to Autoconf.
-* Makefiles::                  Information Autoconf uses in @file{Makefile}s.
-* Invoking configure::         How to use the Autoconf output.
-* Example::                    Sample Autoconf input files.
-* Preprocessor Symbol Index::  Index of C preprocessor symbols defined.
-* Macro Index::                        Index of Autoconf macros.
+* Introduction::                Autoconf's purpose, strengths, and weaknesses.
+* Distributing::                Legal restrictions on Autoconf output.
+* Making configure Scripts::    How to organize and produce Autoconf scripts.
+* Specific Tests::              Macros that check for particular features.
+* General Purpose Macros::      Macros that check for kinds of features.
+* Writing Macros::              How to add your own macros to Autoconf.
+* Makefiles::                   Information Autoconf uses in @file{Makefile}s.
+* Invoking configure::          How to use the Autoconf output.
+* Example::                     Sample Autoconf input files.
+* Preprocessor Symbol Index::   Index of C preprocessor symbols defined.
+* Macro Index::                 Index of Autoconf macros.
 
  --- The Detailed Node Listing ---
 
@@ -125,7 +125,8 @@ Specific Tests
 General Purpose Macros
 
 * Setup::                      Controlling Autoconf operation.
-* General Feature Tests::      Checking for kinds of features.
+* File Existence::              Checking whether particular files exist.
+* C Features::                  Checking for features of the C system.
 * Command Line::                Checking command line arguments.
 * Setting Variables::          Setting shell and @code{make} variables.
 * Printing Messages::           Notifying users of progress or problems.
@@ -226,7 +227,7 @@ those functions are available.  This problem does not exist with
 releases 1.06 and later of the GNU C library, which define C
 preprocessor macros that the Autoconf macros @code{AC_FUNC_CHECK} and
 @code{AC_REPLACE_FUNCS} test, indicating that certain functions are
-stubs (@pxref{General Feature Tests}, for more information on checking for
+stubs (@pxref{C Features}, for more information on checking for
 functions).
 
 @ifinfo
@@ -285,7 +286,15 @@ containing @code{#define} directives (@pxref{Setup});
 
 @item
 a shell script called @file{config.status} that, when run, will recreate
-the files listed above (@pxref{Invoking config.status}).
+the files listed above (@pxref{Invoking config.status});
+
+@item
+a shell script called @file{config.cache} that saves the results of
+running many of the tests;
+
+@item
+a file called @file{config.log} containing any messages produced by
+compilers, to help debugging if @code{configure} makes a mistake.
 @end itemize
 
 To create a @code{configure} script with Autoconf, you need to write an
@@ -308,6 +317,8 @@ configuration are produced.  Programs that are executed are suffixed by
 Files used in preparing a software package for distribution:
 @example
 @group
+your source files --> [autoscan*] --> [configure.scan] --> configure.in
+
 configure.in --.   .------> autoconf* -----> configure
                +---+ 
 [aclocal.m4] --'   `---.
@@ -348,27 +359,28 @@ Autoconf macros that test the system features your package needs or can
 use.  Autoconf macros already exist to check for many features; see
 @ref{Specific Tests}, for their descriptions.  For most other
 features, you can use Autoconf template macros to produce custom checks;
-see @ref{General Feature Tests}, for information about them.  For especially
+see @ref{General Purpose Macros}, for information about them.  For especially
 tricky or specialized features, @file{configure.in} might need to
 contain some hand-crafted shell commands.  @xref{Writing Macros}, for
 guidelines on writing tests from scratch.
 
-Every @file{configure.in} must begin with a call to @code{AC_INIT} and
-end with a call to @code{AC_OUTPUT} (@pxref{Setup}).  Other than that,
-the order in which @file{configure.in} calls the Autoconf macros is
-generally not important, except that some macros rely on other macros
-having been called first, because they check previously set values of
-some variables to decide what to do.  These macros are noted in the
-individual descriptions (@pxref{Specific Tests}).
+Other than that, the order in which @file{configure.in} calls the
+Autoconf macros is generally not important, with a few exceptions.
+Every @file{configure.in} must contain a call to @code{AC_INIT} before
+the checks, and a call to @code{AC_OUTPUT} at the end (@pxref{Setup}).
+Additionally, some macros rely on other macros having been called first,
+because they check previously set values of some variables to decide
+what to do.  These macros are noted in the individual descriptions
+(@pxref{Specific Tests}), and they also warn you if they are called out
+of order.
 
 To encourage consistency, here is a suggested order for calling the
-Autoconf macros.  A few macros need to be called in a different order
-from the one given here; they are noted in their individual descriptions
-(@pxref{Specific Tests}).  Note that there must not be any space
-between the macro name and the open parentheses.
+Autoconf macros.  Note that there must not be any space between a macro
+name and the open parentheses.
 
 @display
 @group
+macros that control Autoconf operation
 @code{AC_INIT(@var{file})}
 checks for alternative programs
 checks for UNIX variants that set C preprocessor variables
@@ -483,7 +495,7 @@ These macros test for particular operating system features that packages
 might need or want to use.  If you need to test for a feature that none
 of these macros check for, you can probably do it by calling one of the
 general purpose test macros with appropriate arguments (@pxref{General
-Feature Tests}).
+Purpose Macros}).
 
 All of these macros that set @code{make} variables call @code{AC_SUBST}
 on those variables (@pxref{Setting Variables}, for details about
@@ -547,9 +559,9 @@ finds.
 
 @defmac AC_PROG_CC
 @maindex PROG_CC
-If @code{gcc} is found, set @code{make} variable @code{CC} to @samp{gcc},
-and set shell variable @code{GCC} to @samp{yes} for use by macros such as
-@code{AC_GCC_TRADITIONAL}.  Otherwise set @code{GCC} to be empty.
+If @code{gcc} is found, set @code{make} variable @code{CC} to
+@samp{gcc}, and set shell variable @code{GCC} to @samp{yes}.  Otherwise
+set @code{GCC} to be empty.
 @end defmac
 
 @defmac AC_PROG_CPP
@@ -575,7 +587,7 @@ variable @code{CXX} to its value.  Otherwise search for a C++ compiler
 under likely names (@code{c++}, @code{g++}, @code{gcc}, and @code{CC}).
 If none of those checks succeed, as a last resort set @code{CXX} to
 @code{gcc}.  Also set shell variable @code{GXX} to @samp{yes} if it
-found the GNU C++ compiler, the empty string if not.
+found the GNU C++ compiler, empty otherwise.
 @end defmac
 
 @defmac AC_PROG_CXXCPP
@@ -598,8 +610,8 @@ this macro first if it hasn't been called already.  This macro calls
 Set @code{make} variable @code{INSTALL} to @samp{install -c} if
 @code{install} is found and is compatible with the BSD and GNU versions.
 Otherwise, set @code{INSTALL} to @samp{@var{dir}/install.sh -c}, where
-it checks the directories specified to @code{AC_CONFIG_AUX} (or its
-default directories) to determine @var{dir}.
+it checks the directories specified to @code{AC_CONFIG_AUX_DIR} (or its
+default directories) to determine @var{dir} (@pxref{Setup}).
 
 This macro screens out the false matches @file{/etc/install},
 @file{/usr/sbin/install}, and other instances of @code{install} known
@@ -973,7 +985,9 @@ rather than choke on it.
 #ifdef _AIX
  #pragma alloca
 #else /* not _AIX */
+#ifndef alloca /* predefined by HP cc +Olibcalls */
 char *alloca ();
+#endif /* not defined(alloca) */
 #endif /* not _AIX */
 #endif /* not HAVE_ALLOCA_H */
 #endif /* not __GNUC__ */
@@ -1185,8 +1199,8 @@ were an array of values.
 If the C compiler being used does not produce executables that can run
 on the system where @code{configure} is being run, set the shell
 variable @code{cross_compiling} to 1.  This information can be used by
-@code{AC_TEST_PROGRAM} to determine whether to take a default action
-instead of trying to run a test program (@pxref{General Feature Tests}).
+@code{AC_TEST_RUN} to determine whether to take a default action
+instead of trying to run a test program (@pxref{C Features}).
 @end defmac
 
 @defmac AC_CHAR_UNSIGNED
@@ -1224,7 +1238,7 @@ define @code{inline} to be @code{__inline}.  This macro calls
 @vindex INT_16_BITS
 If the C type @code{int} is 16 bits wide, define @code{INT_16_BITS}.
 This macro is obsolete; it is more general to use
-@samp{AC_SIZEOF_TYPE(int)} instead (@pxref{General Feature Tests}).
+@samp{AC_SIZEOF_TYPE(int)} instead (@pxref{C Features}).
 @end defmac
 
 @defmac AC_LONG_64_BITS
@@ -1232,7 +1246,7 @@ This macro is obsolete; it is more general to use
 @vindex LONG_64_BITS
 If the C type @code{long int} is 64 bits wide, define
 @code{LONG_64_BITS}.  This macro is obsolete; it is more general to use
-@samp{AC_SIZEOF_TYPE(long)} instead (@pxref{General Feature Tests}).
+@samp{AC_SIZEOF_TYPE(long)} instead (@pxref{C Features}).
 @end defmac
 
 @defmac AC_LONG_DOUBLE
@@ -1395,16 +1409,35 @@ that Autoconf produces or to check whether various kinds of features are
 available.  They all take arguments.  When calling these macros, there
 must not be any blank space between the macro name and the open
 parentheses.
-
 Arguments to these macros can be more than one line long if they are
 enclosed within the @code{m4} quote characters @samp{[} and @samp{]}.
 
+Many of these macros handle two
+cases: what to do if the given condition is met, and what to do if the
+condition is not met.  In some places you you might want to do something
+if a condition is true but do nothing if it's false, or vice versa.  To
+omit the true case, pass an empty value for the @var{action-if-found}
+argument to the macro.  To omit the false case, omit the
+@var{action-if-not-found} argument to the macro, including the comma
+before it.
+
+One shell programming construction that you should not use in the action
+arguments to these macros is
+@samp{@var{var}=$@{@var{var}:-@var{value}@}}.  Old BSD shells, including
+the Ultrix @code{sh}, don't understand the colon, and complain and die.
+If you omit the colon, it works fine:
+@samp{@var{var}=$@{@var{var}-@var{value}@}}.  Using the form without the
+colon has one small disadvantage.  Users can not select a default value
+by giving a variable an empty value, e.g., @samp{CC= configure}.
+Instead, they must unset the variable, e.g., @samp{unset CC; configure}.
+
 Within each section below, the macros are listed in alphabetical order.
 These macros are defined in the file @file{acgeneral.m4}.
 
 @menu
 * Setup::                      Controlling Autoconf operation.
-* General Feature Tests::      Checking for kinds of features.
+* File Existence::              Checking whether particular files exist.
+* C Features::                  Checking for features of the C system.
 * Command Line::                Checking command line arguments.
 * Setting Variables::          Setting shell and @code{make} variables.
 * Printing Messages::           Notifying users of progress or problems.
@@ -1412,21 +1445,36 @@ These macros are defined in the file @file{acgeneral.m4}.
 * Macro Ordering::             Enforcing ordering constraints.
 @end menu
 
-@node Setup, General Feature Tests, , General Purpose Macros
+@node Setup, File Existence, , General Purpose Macros
 @section Controlling Autoconf Setup
 
 The following macros control the kind of output that Autoconf produces.
+@file{configure.in} should call them before @code{AC_INIT} or
+@code{AC_PREPARE}.  Remember to put a @code{dnl} comment at the ends of
+the lines containing their calls, to avoid inserting blank lines at the
+beginning of @file{configure}.
+
+@defmac AC_CONFIG_AUX_DIR(@var{dir})
+@maindex CONFIG_AUX_DIR
+Use the @file{install.sh}, @file{config.sub}, @file{config.guess}, and
+Cygnus @file{configure} scripts that are in directory @var{dir}.  These
+are auxiliary files used in configuration.  @var{dir} can be either
+absolute or relative to @file{@var{srcdir}}.  The default is
+@file{@var{srcdir}} or @file{@var{srcdir}/..} or
+@file{@var{srcdir}/../..}, whichever is the first that contains
+@file{install.sh}.  The other files are not checked for, so that using
+@code{AC_PROG_INSTALL} does not automatically require distributing the
+other auxiliary files.
+@end defmac
 
 @defmac AC_CONFIG_HEADER (@var{header-to-create} @dots{})
 @maindex CONFIG_HEADER
 @vindex HAVE_CONFIG_H
-Make @code{AC_OUTPUT} create the file(s) in the
-whitespace-separated list @var{header-to-create} containing C
-preprocessor @code{#define} statements and replace @samp{@@DEFS@@} in
-generated files with @samp{-DHAVE_CONFIG_H} instead of the value of
-@code{DEFS}.  
-This macro should be called right after @code{AC_INIT}.  The usual name
-for @var{header-to-create} is @file{config.h}.
+Make @code{AC_OUTPUT} create the file(s) in the whitespace-separated
+list @var{header-to-create} containing C preprocessor @code{#define}
+statements and replace @samp{@@DEFS@@} in generated files with
+@samp{-DHAVE_CONFIG_H} instead of the value of @code{DEFS}.  The usual
+name for @var{header-to-create} is @file{config.h}.
 
 If @var{header-to-create} already exists and its contents are identical
 to what @code{AC_OUTPUT} would put in it, it is left alone.  Doing this
@@ -1444,6 +1492,20 @@ You can use the program @code{autoheader} to create
 @file{@var{header-to-create}.in} (@pxref{Invoking autoheader}).
 @end defmac
 
+@defmac AC_CONFIG_SUBDIRS (@var{dir} @dots{})
+@maindex CONFIG_SUBDIRS
+Run @code{configure} in each subdirectory @var{dir} in the given
+whitespace-separated list If a given @var{dir} is not found, no error is
+reported, so a @code{configure} script can configure whichever parts of
+a large source tree are present.  If a given @var{dir} contains
+@file{configure.in} but no @file{configure}, the Cygnus @code{configure}
+script found by @code{AC_CONFIG_AUXDIR} is used.
+
+The subdirectory @code{configure} scripts are given the same command
+line options that were given to this @code{configure} script, with minor
+changes if needed (e.g., to adjust a relative path for the cache file).
+@end defmac
+
 @defmac AC_INIT (@var{unique-file-in-source-dir})
 @maindex INIT
 Process the command-line arguments and find the source code directory.
@@ -1471,6 +1533,18 @@ If you pass @var{extra-cmds}, those commands will be inserted into
 @file{config.status} to be run after all its other processing.
 @end defmac
 
+@defmac AC_PREFIX_PROGRAM (@var{program})
+@maindex PREFIX_PROGRAM
+If the user did not specify an installation prefix (using the
+@samp{--prefix} option), guess a value for it by looking for
+@var{program} in @code{PATH}, the way the shell does.  If @var{program}
+is found, set the prefix to the parent of the directory containing
+@var{program}; otherwise leave the prefix specified in
+@file{Makefile.in} unchanged.  For example, if @var{program} is
+@code{gcc} and the @code{PATH} contains @file{/usr/local/gnu/bin/gcc},
+set the prefix to @file{/usr/local/gnu}.
+@end defmac
+
 @defmac AC_PREPARE (@var{unique-file-in-source-dir})
 @maindex PREPARE
 Find the source code directory and set up shell variables necessary for
@@ -1528,42 +1602,74 @@ produces this in @file{configure}:
 @end example
 @end defmac
 
-@node General Feature Tests, Command Line, Setup, General Purpose Macros
-@section Checking for Kinds of Features
+@node File Existence, C Features, Setup, General Purpose Macros
+@section Checking Whether Particular Files Exist
 
-These macros are templates that, when called with actual parameters,
-check for various kinds of features.  Many of these macros handle two
-cases: what to do if the given condition is met, and what to do if the
-condition is not met.  In some places you you might want to do something
-if a condition is true but do nothing if it's false, or vice versa.  To
-omit the true case, pass an empty value for the @var{action-if-found}
-argument to the macro.  To omit the false case, omit the
-@var{action-if-not-found} argument to the macro, including the comma
-before it.
+These macros check whether particular files exist.
 
-One shell programming construction that you should not use in the action
-arguments to these macros is
-@samp{@var{var}=$@{@var{var}:-@var{value}@}}.  Old BSD shells, including
-the Ultrix @code{sh}, don't understand the colon, and complain and die.
-If you omit the colon, it works fine:
-@samp{@var{var}=$@{@var{var}-@var{value}@}}.  Using the form without the
-colon has one small disadvantage.  Users can not select a default value
-by giving a variable an empty value, e.g., @samp{CC= configure}.
-Instead, they must unset the variable, e.g., @samp{unset CC; configure}.
+@defmac AC_HAVE_LIBRARY (@var{library} @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]]})
+@maindex HAVE_LIBRARY
+Create a test C program to see whether that program can be linked with
+the specified library.  @var{action-if-found} is a list of shell
+commands to run if the link succeeds (which means that the library is
+present); @var{action-if-not-found} is a list of shell commands to run
+if the link fails.  If @var{action-if-found} and
+@var{action-if-not-found} are not specified, the default action is to
+add @samp{-lfoo} to @code{LIBS} and define @samp{HAVE_LIBfoo}
+for library @samp{foo}.  @var{library} can be written as any of
+@samp{foo}, @samp{-lfoo}, or @samp{libfoo.a}.  In all of those cases,
+the compiler is passed @samp{-lfoo}.
+@end defmac
 
-@xref{Writing Macros}, for more information on how best to use these
-macros.
+@defmac AC_PREFIX (@var{program})
+@maindex PREFIX
+This macro is like @code{AC_PREFIX_PROGRAM}, except that it prevents
+finding the site-wide defaults file correctly, so it is obsolete.
+@end defmac
+
+@defmac AC_PROGRAM_CHECK (@var{variable}, @var{prog-to-check-for}, @var{value-if-found} @r{[}, @var{value-if-not-found}@r{]})
+@maindex PROGRAM_CHECK
+Check whether program @var{prog-to-check-for} exists in @code{PATH}.  If
+it is found, set @var{variable} to @var{value-if-found}, otherwise to
+@var{value-if-not-found}, if given.  If @var{variable} was already set,
+do nothing.  Calls @code{AC_SUBST} for @var{variable}.
+@end defmac
+
+@defmac AC_PROGRAM_PATH (@var{variable}, @var{prog-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
+@maindex PROGRAM_PATH
+Similar to @code{AC_PROGRAM_CHECK}, but set @var{variable} to the entire
+path of @var{prog-to-check-for} if found.  Otherwise, set @var{variable}
+to @var{value-if-not-found}, if given.  If @var{variable} was already
+set, do nothing.  Calls @code{AC_SUBST} for @var{variable}.
+@end defmac
+
+@defmac AC_PROGRAMS_CHECK (@var{variable}, @var{progs-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
+@maindex PROGRAMS_CHECK
+Check for each program in the whitespace-separated list
+@var{progs-to-check-for} exists in @code{PATH}.  If it is found, set
+@var{variable} to the name of that program.  Otherwise, continue
+checking the next program in the list.  If none of the programs in the
+list are found, set @var{variable} to @var{value-if-not-found}; if
+@var{value-if-not-found} is not specified, the value of @var{variable}
+is not changed.  Calls @code{AC_SUBST} for @var{variable}.
+@end defmac
+
+@defmac AC_PROGRAMS_PATH (@var{variable}, @var{progs-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
+@maindex PROGRAMS_PATH
+Like @code{AC_PROGRAMS_CHECK}, but if any of @var{progs-to-check-for}
+are found, set @var{variable} to the entire pathname of the program
+found.
+@end defmac
+
+@node C Features, Command Line, File Existence, General Purpose Macros
+@section Checking For C Features
+
+These macros check for features of the C compiler, libraries, and headers.
 
 @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
-
-Print @samp{checking for @var{echo-text}} to the standard output
-(using @code{AC_CHECKING}, @pxref{Printing Messages}).
-Create a test C program to see whether a function whose body consists of
-@var{function-body} can be compiled and linked; @var{includes} is any
-@code{#include} statements needed by the code in @var{function-body}.
-If the file compiles and links successfully, run shell commands
-@var{action-if-found}, otherwise run @var{action-if-not-found}.
+This is an obsolete alias for @code{AC_TEST_LINK}, with the addition that it
+prints @samp{checking for @var{echo-text}} to the standard output first.
 @end defmac
 
 @defmac AC_FUNC_CHECK (@var{function}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
@@ -1595,20 +1701,6 @@ list that exists, define @code{HAVE_@var{header-file}} (in all caps).
 it is used here.
 @end defmac
 
-@defmac AC_HAVE_LIBRARY (@var{library} @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]]})
-@maindex HAVE_LIBRARY
-Create a test C program to see whether that program can be linked with
-the specified library.  @var{action-if-found} is a list of shell
-commands to run if the link succeeds (which means that the library is
-present); @var{action-if-not-found} is a list of shell commands to run
-if the link fails.  If @var{action-if-found} and
-@var{action-if-not-found} are not specified, the default action is to
-add @samp{-lfoo} to @code{LIBS} and define @samp{HAVE_LIBfoo}
-for library @samp{foo}.  @var{library} can be written as any of
-@samp{foo}, @samp{-lfoo}, or @samp{libfoo.a}.  In all of those cases,
-the compiler is passed @samp{-lfoo}.
-@end defmac
-
 @defmac AC_HEADER_CHECK (@var{header-file}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
 @maindex HEADER_CHECK
 If @var{header-file} exists, execute shell commands
@@ -1634,14 +1726,6 @@ almost always detect them by simply using @code{#ifdef} directives in
 your programs.
 @end defmac
 
-@defmac AC_PROGRAM_CHECK (@var{variable}, @var{prog-to-check-for}, @var{value-if-found} @r{[}, @var{value-if-not-found}@r{]})
-@maindex PROGRAM_CHECK
-Check whether program @var{prog-to-check-for} exists in @code{PATH}.  If
-it is found, set @var{variable} to @var{value-if-found}, otherwise to
-@var{value-if-not-found}, if given.  If @var{variable} was already set,
-do nothing.  Calls @code{AC_SUBST} for @var{variable}.
-@end defmac
-
 @defmac AC_PROGRAM_EGREP (@var{pattern}, @var{program}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
 @maindex PROGRAM_EGREP
 @var{program} is the text of a C or C++ program, on which shell variable and
@@ -1657,32 +1741,6 @@ on which language is current, @pxref{Language Choice}), if it hasn't
 been called already.
 @end defmac
 
-@defmac AC_PROGRAM_PATH (@var{variable}, @var{prog-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
-@maindex PROGRAM_PATH
-Similar to @code{AC_PROGRAM_CHECK}, but set @var{variable} to the entire
-path of @var{prog-to-check-for} if found.  Otherwise, set @var{variable}
-to @var{value-if-not-found}, if given.  If @var{variable} was already
-set, do nothing.  Calls @code{AC_SUBST} for @var{variable}.
-@end defmac
-
-@defmac AC_PROGRAMS_CHECK (@var{variable}, @var{progs-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
-@maindex PROGRAMS_CHECK
-Check for each program in the whitespace-separated list
-@var{progs-to-check-for} exists in @code{PATH}.  If it is found, set
-@var{variable} to the name of that program.  Otherwise, continue
-checking the next program in the list.  If none of the programs in the
-list are found, set @var{variable} to @var{value-if-not-found}; if
-@var{value-if-not-found} is not specified, the value of @var{variable}
-is not changed.  Calls @code{AC_SUBST} for @var{variable}.
-@end defmac
-
-@defmac AC_PROGRAMS_PATH (@var{variable}, @var{progs-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
-@maindex PROGRAMS_PATH
-Like @code{AC_PROGRAMS_CHECK}, but if any of @var{progs-to-check-for}
-are found, set @var{variable} to the entire pathname of the program
-found.
-@end defmac
-
 @defmac AC_REPLACE_FUNCS (@var{function-name}@dots{})
 @maindex REPLACE_FUNCS
 For each given @var{function-name} in the whitespace-separated argument
@@ -1720,8 +1778,22 @@ on which language is current, @pxref{Language Choice}), if it hasn't
 been called already.
 @end defmac
 
+@defmac AC_TEST_LINK (@var{includes}, @var{function-body}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
+@maindex TEST_LINK
+Create a test C program to see whether a function whose body consists of
+@var{function-body} can be compiled and linked; @var{includes} is any
+@code{#include} statements needed by the code in @var{function-body}.
+If the file compiles and links successfully, run shell commands
+@var{action-if-found}, otherwise run @var{action-if-not-found}.
+@end defmac
+
 @defmac AC_TEST_PROGRAM (@var{program}, @var{action-if-true} @r{[}, @var{action-if-false} @r{[}, @var{action-if-cross-compiling}@r{]]})
 @maindex TEST_PROGRAM
+This is an obsolete alias for @code{AC_TEST_RUN}.
+@end defmac
+
+@defmac AC_TEST_RUN (@var{program}, @var{action-if-true} @r{[}, @var{action-if-false} @r{[}, @var{action-if-cross-compiling}@r{]]})
+@maindex TEST_RUN
 @var{program} is the text of a C program, on which shell variable and
 backquote substitutions are performed.  If it compiles and links
 successfully and returns an exit status of 0 when executed, run shell
@@ -1736,28 +1808,35 @@ run.  If that argument is given, this macro calls @code{AC_CROSS_CHECK}
 if it has not already been called (@pxref{Compiler Characteristics}).
 @end defmac
 
-@node Command Line, Setting Variables, General Feature Tests, General Purpose Macros
+@node Command Line, Setting Variables, C Features, General Purpose Macros
 @section Checking Command Line Arguments
 
 These macros check whether the user gave @code{configure} various
 command line arguments.  Like the general feature tests (@pxref{General
-Feature Tests}),  they may take an argument to use if the argument was
+Purpose Macros}),  they may take an argument to use if the argument was
 given and one for if it was not given.
 
-@defmac AC_ENABLE (@var{feature}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
-@maindex ENABLE
+@defmac AC_ARG_ENABLE (@var{feature}, @var{help-string}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
+@maindex ARG_ENABLE
 If the user gave @code{configure} the option
 @samp{--enable-@var{feature}} or @samp{--disable-@var{feature}}, run
 shell commands @var{action-if-true}.  Otherwise run shell commands
-@var{action-if-false}.  The name @var{feature} should consist only of
-alphanumeric characters and dashes.
+@var{action-if-false}.  @var{help-string} is a description of
+the option which looks like this:
+@example
+--enable-readline       support fancy command line editing
+@end example
+@noindent
+@var{help-string} may be more than one line long, if more detail is
+needed.  Just make sure the columns line up in @samp{configure --help}.
 
-The @var{feature} indicates an optional user-level facility.  This
-option allows users to choose which optional features to build and
-install.  @samp{--enable-@var{feature}} options should never make a
-feature behave differently or cause one feature to replace another.
-They should only cause parts of the program to be built rather than left
-out.
+The name @var{feature} should consist only of alphanumeric characters
+and dashes.  The @var{feature} indicates an optional user-level
+facility.  This option allows users to choose which optional features to
+build and install.  @samp{--enable-@var{feature}} options should never
+make a feature behave differently or cause one feature to replace
+another.  They should only cause parts of the program to be built rather
+than left out.
 
 The user can give an argument by following the feature name with
 @samp{=} and the argument.  Giving an argument of @samp{no} indicates
@@ -1770,34 +1849,28 @@ the shell variable @code{enableval}.  If no argument was given to
 @samp{--disable-@var{feature}} is equivalent to
 @samp{--enable-@var{feature}=no}.  At present, arguments containing blanks
 are not handled correctly; if you need an argument to contain a list,
-require the items to be separated by commas instead.  (This restriction
-might disappear in the future.)
+require the items to be separated by commas instead.
 @end defmac
 
-@defmac AC_PREFIX (@var{program})
-@maindex PREFIX
-If the user did not specify an installation prefix (using the
-@samp{--prefix} option), guess a value for it by looking for
-@var{program} in @code{PATH}, the way the shell does.  If @var{program}
-is found, set the prefix to the parent of the directory containing
-@var{program}; otherwise leave the prefix specified in
-@file{Makefile.in} unchanged.  For example, if @var{program} is
-@code{gcc} and the @code{PATH} contains @file{/usr/local/gnu/bin/gcc},
-set the prefix to @file{/usr/local/gnu}.
-@end defmac
-
-@defmac AC_WITH (@var{package}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
-@maindex WITH
+@defmac AC_ARG_WITH (@var{package}, @var{help-string}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
+@maindex ARG_WITH
 If the user gave @code{configure} the option @samp{--with-@var{package}}
 or @samp{--without-@var{package}}, run shell commands
 @var{action-if-true}.  Otherwise run shell commands
-@var{action-if-false}.  The name @var{package} should consist only of
-alphanumeric characters and dashes.
+@var{action-if-false}.    @var{help-string} is a description of
+the option which looks like this:
+@example
+--with-gnu-as           use the GNU assembler
+@end example
+@noindent
+@var{help-string} may be more than one line long, if more detail is
+needed.  Just make sure the columns line up in @samp{configure --help}.
 
-The @var{package} indicates another software package that this program
-should work with.  For example, @samp{--with-gnu-ld} means work with the
-GNU linker instead of some other linker.  @samp{--with-x11} means work
-with X11.
+The name @var{package} should consist only of alphanumeric characters
+and dashes.  The @var{package} indicates another software package that
+this program should work with.  For example, @samp{--with-gnu-ld} means
+work with the GNU linker instead of some other linker.
+@samp{--with-x11} means work with X11.
 
 The user can give an argument by following the package name with
 @samp{=} and the argument.  Giving an argument of @samp{no} is for
@@ -1813,8 +1886,19 @@ the shell variable @code{withval}.  If no argument was given to
 @samp{--without-@var{package}} is equivalent to
 @samp{--with-@var{package}=no}.  At present, arguments containing blanks
 are not handled correctly; if you need an argument to contain a list,
-require the items to be separated by commas instead.  (This restriction
-might disappear in the future.)
+require the items to be separated by commas instead.  
+@end defmac
+
+@defmac AC_ENABLE (@var{feature}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
+@maindex ENABLE
+This is an obsolete version of @code{AC_ARG_ENABLE} that does not
+provide a help string.
+@end defmac
+
+@defmac AC_WITH (@var{package}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
+@maindex WITH
+This is an obsolete version of @code{AC_ARG_WITH} that does not
+provide a help string.
 @end defmac
 
 @node Setting Variables, Printing Messages, Command Line, General Purpose Macros
@@ -1923,6 +2007,17 @@ LIBS="$LIBS -ltermcap"
 @end example
 @end defmac
 
+@ignore
+@defmac AC_SUBST_FILE (@var{variable}, @var{file})
+@maindex SUBST_FILE
+Substitute the contents of the file @file{@var{srcdir}/@var{file}} into
+@file{Makefile} variable @var{variable} when creating the output files
+(typically one or more @file{Makefile}s).  This macro is useful for
+inserting @file{Makefile} fragments for particular host or tartet types
+into @file{Makefile}s.
+@end defmac
+@end ignore
+
 @node Printing Messages, Language Choice, Setting Variables, General Purpose Macros
 @section Printing Messages
 
@@ -2272,19 +2367,19 @@ come later should contain a call to @code{AC_PROVIDE}.
 For example, @code{AC_AIX} contains
 
 @example
-AC_BEFORE([$0], [AC_COMPILE_CHECK])
+AC_BEFORE([$0], [AC_TEST_LINK])
 @end example
 
 @noindent
-and @code{AC_COMPILE_CHECK} contains
+and @code{AC_TEST_LINK} contains
 
 @example
 AC_PROVIDE([$0])
 @end example
 
 @noindent
-As a result, if @code{AC_AIX} is called after @code{AC_COMPILE_CHECK},
-it will note that @code{AC_COMPILE_CHECK} has already been called and
+As a result, if @code{AC_AIX} is called after @code{AC_TEST_LINK},
+it will note that @code{AC_TEST_LINK} has already been called and
 print a warning message.
 
 @node Checking for Files, Checking for Symbols, Dependencies Between Macros, Writing Macros
@@ -2308,7 +2403,7 @@ Do not use @samp{test -x}, because 4.3BSD does not have it.  Use
 
 If you need to check whether a symbol is defined in a C header file, you
 can use @code{AC_HEADER_EGREP} if the symbol is not a C preprocessor
-macro (@pxref{General Feature Tests}), or compile a small test program that includes
+macro (@pxref{C Features}), or compile a small test program that includes
 the file and references the symbol (@pxref{Test Programs}).  Don't
 directly @code{grep} for the symbol in the file, because on some systems
 it might be defined in another header file that the file you are
@@ -2355,16 +2450,16 @@ than scanning the libraries.
 
 If you need to check for a condition other than whether some symbol
 exists on the system or has a certain value, then you can't use
-@code{AC_COMPILE_CHECK} (@pxref{General Feature Tests}).  You have to write a
+@code{AC_TEST_LINK} (@pxref{C Features}).  You have to write a
 test program by hand.  You can compile and run it using
-@code{AC_TEST_PROGRAM} (@pxref{General Feature Tests}).
+@code{AC_TEST_RUN} (@pxref{C Features}).
 
 Try to avoid writing test programs if possible, because using them
 prevents people from configuring your package for cross-compiling.  If
 it's really best that you test for a run-time behavior, try to provide a
 default ``worst case'' value to use when cross-compiling makes run-time
 tests impossible.  You do this by passing the optional last argument to
-@code{AC_TEST_PROGRAM}.
+@code{AC_TEST_RUN}.
 
 @menu
 * Guidelines::                 General rules for writing test programs.
@@ -2526,7 +2621,7 @@ redundant.
 
 @defvar LIBOBJS
 Names of object files (ending in @file{.o}).  Set by
-@code{AC_REPLACE_FUNCS} (@pxref{General Feature Tests}).
+@code{AC_REPLACE_FUNCS} (@pxref{C Features}).
 @end defvar
 
 @node VPATH Substitutions, Automatic Remaking, Predefined Variables, Makefiles
@@ -2791,7 +2886,14 @@ The shell with which to run @code{configure} for the @samp{--recheck}
 option.  The default is @file{/bin/sh}.
 @end defvar
 
-The following two variables provide one way for separately distributed
+@defvar CONFIG_STATUS
+The file name to use for the shell script that records the
+configuration.  The default is @file{./config.status}.  This variable is
+useful when one package uses parts of another and the @file{configure}
+scripts shouldn't be merged because they are maintained separately.
+@end defvar
+
+The following variables provide one way for separately distributed
 packages to share the values computed by @code{configure}.  Doing so can
 be useful if some of the packages need a superset of the features that
 one of them, perhaps a common library, does.  These variables allow a
index a6f2495e9793e787663300ae7b4ac3e1f3fc2bca..701ee6d92f9c03f1198a900a243555c8d4978c93 100644 (file)
@@ -156,7 +156,7 @@ clean:
 mostlyclean: clean
 
 distclean: clean
-       rm -f Makefile config.status config.cache
+       rm -f Makefile config.status config.cache config.log
 
 realclean: distclean
        rm -f TAGS *.info*
index 4172616bfc5958cb8aad06421c1c9c91075faf7b..654ae8463ddbfa66e5fbf728f22c24247b81d74e 100644 (file)
@@ -6,9 +6,9 @@
 @c @setchapternewpage odd
 @c %**end of header
 
-@set EDITION 1.91
-@set VERSION 1.91
-@set UPDATED May 1994
+@set EDITION 1.93
+@set VERSION 1.93
+@set UPDATED June 1994
 
 @iftex
 @finalout
@@ -91,17 +91,17 @@ package.  This is edition @value{EDITION}, for Autoconf version @value{VERSION}.
 @c The master menu, created with texinfo-master-menu, goes here.
 
 @menu
-* Introduction::               Autoconf's purpose, strengths, and weaknesses.
-* Distributing::               Legal restrictions on Autoconf output.
-* Making configure Scripts::   How to organize and produce Autoconf scripts.
-* Specific Tests::             Macros that check for particular features.
-* General Purpose Macros::     Macros that check for kinds of features.
-* Writing Macros::             How to add your own macros to Autoconf.
-* Makefiles::                  Information Autoconf uses in @file{Makefile}s.
-* Invoking configure::         How to use the Autoconf output.
-* Example::                    Sample Autoconf input files.
-* Preprocessor Symbol Index::  Index of C preprocessor symbols defined.
-* Macro Index::                        Index of Autoconf macros.
+* Introduction::                Autoconf's purpose, strengths, and weaknesses.
+* Distributing::                Legal restrictions on Autoconf output.
+* Making configure Scripts::    How to organize and produce Autoconf scripts.
+* Specific Tests::              Macros that check for particular features.
+* General Purpose Macros::      Macros that check for kinds of features.
+* Writing Macros::              How to add your own macros to Autoconf.
+* Makefiles::                   Information Autoconf uses in @file{Makefile}s.
+* Invoking configure::          How to use the Autoconf output.
+* Example::                     Sample Autoconf input files.
+* Preprocessor Symbol Index::   Index of C preprocessor symbols defined.
+* Macro Index::                 Index of Autoconf macros.
 
  --- The Detailed Node Listing ---
 
@@ -125,7 +125,8 @@ Specific Tests
 General Purpose Macros
 
 * Setup::                      Controlling Autoconf operation.
-* General Feature Tests::      Checking for kinds of features.
+* File Existence::              Checking whether particular files exist.
+* C Features::                  Checking for features of the C system.
 * Command Line::                Checking command line arguments.
 * Setting Variables::          Setting shell and @code{make} variables.
 * Printing Messages::           Notifying users of progress or problems.
@@ -226,7 +227,7 @@ those functions are available.  This problem does not exist with
 releases 1.06 and later of the GNU C library, which define C
 preprocessor macros that the Autoconf macros @code{AC_FUNC_CHECK} and
 @code{AC_REPLACE_FUNCS} test, indicating that certain functions are
-stubs (@pxref{General Feature Tests}, for more information on checking for
+stubs (@pxref{C Features}, for more information on checking for
 functions).
 
 @ifinfo
@@ -285,7 +286,15 @@ containing @code{#define} directives (@pxref{Setup});
 
 @item
 a shell script called @file{config.status} that, when run, will recreate
-the files listed above (@pxref{Invoking config.status}).
+the files listed above (@pxref{Invoking config.status});
+
+@item
+a shell script called @file{config.cache} that saves the results of
+running many of the tests;
+
+@item
+a file called @file{config.log} containing any messages produced by
+compilers, to help debugging if @code{configure} makes a mistake.
 @end itemize
 
 To create a @code{configure} script with Autoconf, you need to write an
@@ -308,6 +317,8 @@ configuration are produced.  Programs that are executed are suffixed by
 Files used in preparing a software package for distribution:
 @example
 @group
+your source files --> [autoscan*] --> [configure.scan] --> configure.in
+
 configure.in --.   .------> autoconf* -----> configure
                +---+ 
 [aclocal.m4] --'   `---.
@@ -348,27 +359,28 @@ Autoconf macros that test the system features your package needs or can
 use.  Autoconf macros already exist to check for many features; see
 @ref{Specific Tests}, for their descriptions.  For most other
 features, you can use Autoconf template macros to produce custom checks;
-see @ref{General Feature Tests}, for information about them.  For especially
+see @ref{General Purpose Macros}, for information about them.  For especially
 tricky or specialized features, @file{configure.in} might need to
 contain some hand-crafted shell commands.  @xref{Writing Macros}, for
 guidelines on writing tests from scratch.
 
-Every @file{configure.in} must begin with a call to @code{AC_INIT} and
-end with a call to @code{AC_OUTPUT} (@pxref{Setup}).  Other than that,
-the order in which @file{configure.in} calls the Autoconf macros is
-generally not important, except that some macros rely on other macros
-having been called first, because they check previously set values of
-some variables to decide what to do.  These macros are noted in the
-individual descriptions (@pxref{Specific Tests}).
+Other than that, the order in which @file{configure.in} calls the
+Autoconf macros is generally not important, with a few exceptions.
+Every @file{configure.in} must contain a call to @code{AC_INIT} before
+the checks, and a call to @code{AC_OUTPUT} at the end (@pxref{Setup}).
+Additionally, some macros rely on other macros having been called first,
+because they check previously set values of some variables to decide
+what to do.  These macros are noted in the individual descriptions
+(@pxref{Specific Tests}), and they also warn you if they are called out
+of order.
 
 To encourage consistency, here is a suggested order for calling the
-Autoconf macros.  A few macros need to be called in a different order
-from the one given here; they are noted in their individual descriptions
-(@pxref{Specific Tests}).  Note that there must not be any space
-between the macro name and the open parentheses.
+Autoconf macros.  Note that there must not be any space between a macro
+name and the open parentheses.
 
 @display
 @group
+macros that control Autoconf operation
 @code{AC_INIT(@var{file})}
 checks for alternative programs
 checks for UNIX variants that set C preprocessor variables
@@ -483,7 +495,7 @@ These macros test for particular operating system features that packages
 might need or want to use.  If you need to test for a feature that none
 of these macros check for, you can probably do it by calling one of the
 general purpose test macros with appropriate arguments (@pxref{General
-Feature Tests}).
+Purpose Macros}).
 
 All of these macros that set @code{make} variables call @code{AC_SUBST}
 on those variables (@pxref{Setting Variables}, for details about
@@ -547,9 +559,9 @@ finds.
 
 @defmac AC_PROG_CC
 @maindex PROG_CC
-If @code{gcc} is found, set @code{make} variable @code{CC} to @samp{gcc},
-and set shell variable @code{GCC} to @samp{yes} for use by macros such as
-@code{AC_GCC_TRADITIONAL}.  Otherwise set @code{GCC} to be empty.
+If @code{gcc} is found, set @code{make} variable @code{CC} to
+@samp{gcc}, and set shell variable @code{GCC} to @samp{yes}.  Otherwise
+set @code{GCC} to be empty.
 @end defmac
 
 @defmac AC_PROG_CPP
@@ -575,7 +587,7 @@ variable @code{CXX} to its value.  Otherwise search for a C++ compiler
 under likely names (@code{c++}, @code{g++}, @code{gcc}, and @code{CC}).
 If none of those checks succeed, as a last resort set @code{CXX} to
 @code{gcc}.  Also set shell variable @code{GXX} to @samp{yes} if it
-found the GNU C++ compiler, the empty string if not.
+found the GNU C++ compiler, empty otherwise.
 @end defmac
 
 @defmac AC_PROG_CXXCPP
@@ -598,8 +610,8 @@ this macro first if it hasn't been called already.  This macro calls
 Set @code{make} variable @code{INSTALL} to @samp{install -c} if
 @code{install} is found and is compatible with the BSD and GNU versions.
 Otherwise, set @code{INSTALL} to @samp{@var{dir}/install.sh -c}, where
-it checks the directories specified to @code{AC_CONFIG_AUX} (or its
-default directories) to determine @var{dir}.
+it checks the directories specified to @code{AC_CONFIG_AUX_DIR} (or its
+default directories) to determine @var{dir} (@pxref{Setup}).
 
 This macro screens out the false matches @file{/etc/install},
 @file{/usr/sbin/install}, and other instances of @code{install} known
@@ -973,7 +985,9 @@ rather than choke on it.
 #ifdef _AIX
  #pragma alloca
 #else /* not _AIX */
+#ifndef alloca /* predefined by HP cc +Olibcalls */
 char *alloca ();
+#endif /* not defined(alloca) */
 #endif /* not _AIX */
 #endif /* not HAVE_ALLOCA_H */
 #endif /* not __GNUC__ */
@@ -1185,8 +1199,8 @@ were an array of values.
 If the C compiler being used does not produce executables that can run
 on the system where @code{configure} is being run, set the shell
 variable @code{cross_compiling} to 1.  This information can be used by
-@code{AC_TEST_PROGRAM} to determine whether to take a default action
-instead of trying to run a test program (@pxref{General Feature Tests}).
+@code{AC_TEST_RUN} to determine whether to take a default action
+instead of trying to run a test program (@pxref{C Features}).
 @end defmac
 
 @defmac AC_CHAR_UNSIGNED
@@ -1224,7 +1238,7 @@ define @code{inline} to be @code{__inline}.  This macro calls
 @vindex INT_16_BITS
 If the C type @code{int} is 16 bits wide, define @code{INT_16_BITS}.
 This macro is obsolete; it is more general to use
-@samp{AC_SIZEOF_TYPE(int)} instead (@pxref{General Feature Tests}).
+@samp{AC_SIZEOF_TYPE(int)} instead (@pxref{C Features}).
 @end defmac
 
 @defmac AC_LONG_64_BITS
@@ -1232,7 +1246,7 @@ This macro is obsolete; it is more general to use
 @vindex LONG_64_BITS
 If the C type @code{long int} is 64 bits wide, define
 @code{LONG_64_BITS}.  This macro is obsolete; it is more general to use
-@samp{AC_SIZEOF_TYPE(long)} instead (@pxref{General Feature Tests}).
+@samp{AC_SIZEOF_TYPE(long)} instead (@pxref{C Features}).
 @end defmac
 
 @defmac AC_LONG_DOUBLE
@@ -1395,16 +1409,35 @@ that Autoconf produces or to check whether various kinds of features are
 available.  They all take arguments.  When calling these macros, there
 must not be any blank space between the macro name and the open
 parentheses.
-
 Arguments to these macros can be more than one line long if they are
 enclosed within the @code{m4} quote characters @samp{[} and @samp{]}.
 
+Many of these macros handle two
+cases: what to do if the given condition is met, and what to do if the
+condition is not met.  In some places you you might want to do something
+if a condition is true but do nothing if it's false, or vice versa.  To
+omit the true case, pass an empty value for the @var{action-if-found}
+argument to the macro.  To omit the false case, omit the
+@var{action-if-not-found} argument to the macro, including the comma
+before it.
+
+One shell programming construction that you should not use in the action
+arguments to these macros is
+@samp{@var{var}=$@{@var{var}:-@var{value}@}}.  Old BSD shells, including
+the Ultrix @code{sh}, don't understand the colon, and complain and die.
+If you omit the colon, it works fine:
+@samp{@var{var}=$@{@var{var}-@var{value}@}}.  Using the form without the
+colon has one small disadvantage.  Users can not select a default value
+by giving a variable an empty value, e.g., @samp{CC= configure}.
+Instead, they must unset the variable, e.g., @samp{unset CC; configure}.
+
 Within each section below, the macros are listed in alphabetical order.
 These macros are defined in the file @file{acgeneral.m4}.
 
 @menu
 * Setup::                      Controlling Autoconf operation.
-* General Feature Tests::      Checking for kinds of features.
+* File Existence::              Checking whether particular files exist.
+* C Features::                  Checking for features of the C system.
 * Command Line::                Checking command line arguments.
 * Setting Variables::          Setting shell and @code{make} variables.
 * Printing Messages::           Notifying users of progress or problems.
@@ -1412,21 +1445,36 @@ These macros are defined in the file @file{acgeneral.m4}.
 * Macro Ordering::             Enforcing ordering constraints.
 @end menu
 
-@node Setup, General Feature Tests, , General Purpose Macros
+@node Setup, File Existence, , General Purpose Macros
 @section Controlling Autoconf Setup
 
 The following macros control the kind of output that Autoconf produces.
+@file{configure.in} should call them before @code{AC_INIT} or
+@code{AC_PREPARE}.  Remember to put a @code{dnl} comment at the ends of
+the lines containing their calls, to avoid inserting blank lines at the
+beginning of @file{configure}.
+
+@defmac AC_CONFIG_AUX_DIR(@var{dir})
+@maindex CONFIG_AUX_DIR
+Use the @file{install.sh}, @file{config.sub}, @file{config.guess}, and
+Cygnus @file{configure} scripts that are in directory @var{dir}.  These
+are auxiliary files used in configuration.  @var{dir} can be either
+absolute or relative to @file{@var{srcdir}}.  The default is
+@file{@var{srcdir}} or @file{@var{srcdir}/..} or
+@file{@var{srcdir}/../..}, whichever is the first that contains
+@file{install.sh}.  The other files are not checked for, so that using
+@code{AC_PROG_INSTALL} does not automatically require distributing the
+other auxiliary files.
+@end defmac
 
 @defmac AC_CONFIG_HEADER (@var{header-to-create} @dots{})
 @maindex CONFIG_HEADER
 @vindex HAVE_CONFIG_H
-Make @code{AC_OUTPUT} create the file(s) in the
-whitespace-separated list @var{header-to-create} containing C
-preprocessor @code{#define} statements and replace @samp{@@DEFS@@} in
-generated files with @samp{-DHAVE_CONFIG_H} instead of the value of
-@code{DEFS}.  
-This macro should be called right after @code{AC_INIT}.  The usual name
-for @var{header-to-create} is @file{config.h}.
+Make @code{AC_OUTPUT} create the file(s) in the whitespace-separated
+list @var{header-to-create} containing C preprocessor @code{#define}
+statements and replace @samp{@@DEFS@@} in generated files with
+@samp{-DHAVE_CONFIG_H} instead of the value of @code{DEFS}.  The usual
+name for @var{header-to-create} is @file{config.h}.
 
 If @var{header-to-create} already exists and its contents are identical
 to what @code{AC_OUTPUT} would put in it, it is left alone.  Doing this
@@ -1444,6 +1492,20 @@ You can use the program @code{autoheader} to create
 @file{@var{header-to-create}.in} (@pxref{Invoking autoheader}).
 @end defmac
 
+@defmac AC_CONFIG_SUBDIRS (@var{dir} @dots{})
+@maindex CONFIG_SUBDIRS
+Run @code{configure} in each subdirectory @var{dir} in the given
+whitespace-separated list If a given @var{dir} is not found, no error is
+reported, so a @code{configure} script can configure whichever parts of
+a large source tree are present.  If a given @var{dir} contains
+@file{configure.in} but no @file{configure}, the Cygnus @code{configure}
+script found by @code{AC_CONFIG_AUXDIR} is used.
+
+The subdirectory @code{configure} scripts are given the same command
+line options that were given to this @code{configure} script, with minor
+changes if needed (e.g., to adjust a relative path for the cache file).
+@end defmac
+
 @defmac AC_INIT (@var{unique-file-in-source-dir})
 @maindex INIT
 Process the command-line arguments and find the source code directory.
@@ -1471,6 +1533,18 @@ If you pass @var{extra-cmds}, those commands will be inserted into
 @file{config.status} to be run after all its other processing.
 @end defmac
 
+@defmac AC_PREFIX_PROGRAM (@var{program})
+@maindex PREFIX_PROGRAM
+If the user did not specify an installation prefix (using the
+@samp{--prefix} option), guess a value for it by looking for
+@var{program} in @code{PATH}, the way the shell does.  If @var{program}
+is found, set the prefix to the parent of the directory containing
+@var{program}; otherwise leave the prefix specified in
+@file{Makefile.in} unchanged.  For example, if @var{program} is
+@code{gcc} and the @code{PATH} contains @file{/usr/local/gnu/bin/gcc},
+set the prefix to @file{/usr/local/gnu}.
+@end defmac
+
 @defmac AC_PREPARE (@var{unique-file-in-source-dir})
 @maindex PREPARE
 Find the source code directory and set up shell variables necessary for
@@ -1528,42 +1602,74 @@ produces this in @file{configure}:
 @end example
 @end defmac
 
-@node General Feature Tests, Command Line, Setup, General Purpose Macros
-@section Checking for Kinds of Features
+@node File Existence, C Features, Setup, General Purpose Macros
+@section Checking Whether Particular Files Exist
 
-These macros are templates that, when called with actual parameters,
-check for various kinds of features.  Many of these macros handle two
-cases: what to do if the given condition is met, and what to do if the
-condition is not met.  In some places you you might want to do something
-if a condition is true but do nothing if it's false, or vice versa.  To
-omit the true case, pass an empty value for the @var{action-if-found}
-argument to the macro.  To omit the false case, omit the
-@var{action-if-not-found} argument to the macro, including the comma
-before it.
+These macros check whether particular files exist.
 
-One shell programming construction that you should not use in the action
-arguments to these macros is
-@samp{@var{var}=$@{@var{var}:-@var{value}@}}.  Old BSD shells, including
-the Ultrix @code{sh}, don't understand the colon, and complain and die.
-If you omit the colon, it works fine:
-@samp{@var{var}=$@{@var{var}-@var{value}@}}.  Using the form without the
-colon has one small disadvantage.  Users can not select a default value
-by giving a variable an empty value, e.g., @samp{CC= configure}.
-Instead, they must unset the variable, e.g., @samp{unset CC; configure}.
+@defmac AC_HAVE_LIBRARY (@var{library} @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]]})
+@maindex HAVE_LIBRARY
+Create a test C program to see whether that program can be linked with
+the specified library.  @var{action-if-found} is a list of shell
+commands to run if the link succeeds (which means that the library is
+present); @var{action-if-not-found} is a list of shell commands to run
+if the link fails.  If @var{action-if-found} and
+@var{action-if-not-found} are not specified, the default action is to
+add @samp{-lfoo} to @code{LIBS} and define @samp{HAVE_LIBfoo}
+for library @samp{foo}.  @var{library} can be written as any of
+@samp{foo}, @samp{-lfoo}, or @samp{libfoo.a}.  In all of those cases,
+the compiler is passed @samp{-lfoo}.
+@end defmac
 
-@xref{Writing Macros}, for more information on how best to use these
-macros.
+@defmac AC_PREFIX (@var{program})
+@maindex PREFIX
+This macro is like @code{AC_PREFIX_PROGRAM}, except that it prevents
+finding the site-wide defaults file correctly, so it is obsolete.
+@end defmac
+
+@defmac AC_PROGRAM_CHECK (@var{variable}, @var{prog-to-check-for}, @var{value-if-found} @r{[}, @var{value-if-not-found}@r{]})
+@maindex PROGRAM_CHECK
+Check whether program @var{prog-to-check-for} exists in @code{PATH}.  If
+it is found, set @var{variable} to @var{value-if-found}, otherwise to
+@var{value-if-not-found}, if given.  If @var{variable} was already set,
+do nothing.  Calls @code{AC_SUBST} for @var{variable}.
+@end defmac
+
+@defmac AC_PROGRAM_PATH (@var{variable}, @var{prog-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
+@maindex PROGRAM_PATH
+Similar to @code{AC_PROGRAM_CHECK}, but set @var{variable} to the entire
+path of @var{prog-to-check-for} if found.  Otherwise, set @var{variable}
+to @var{value-if-not-found}, if given.  If @var{variable} was already
+set, do nothing.  Calls @code{AC_SUBST} for @var{variable}.
+@end defmac
+
+@defmac AC_PROGRAMS_CHECK (@var{variable}, @var{progs-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
+@maindex PROGRAMS_CHECK
+Check for each program in the whitespace-separated list
+@var{progs-to-check-for} exists in @code{PATH}.  If it is found, set
+@var{variable} to the name of that program.  Otherwise, continue
+checking the next program in the list.  If none of the programs in the
+list are found, set @var{variable} to @var{value-if-not-found}; if
+@var{value-if-not-found} is not specified, the value of @var{variable}
+is not changed.  Calls @code{AC_SUBST} for @var{variable}.
+@end defmac
+
+@defmac AC_PROGRAMS_PATH (@var{variable}, @var{progs-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
+@maindex PROGRAMS_PATH
+Like @code{AC_PROGRAMS_CHECK}, but if any of @var{progs-to-check-for}
+are found, set @var{variable} to the entire pathname of the program
+found.
+@end defmac
+
+@node C Features, Command Line, File Existence, General Purpose Macros
+@section Checking For C Features
+
+These macros check for features of the C compiler, libraries, and headers.
 
 @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
-
-Print @samp{checking for @var{echo-text}} to the standard output
-(using @code{AC_CHECKING}, @pxref{Printing Messages}).
-Create a test C program to see whether a function whose body consists of
-@var{function-body} can be compiled and linked; @var{includes} is any
-@code{#include} statements needed by the code in @var{function-body}.
-If the file compiles and links successfully, run shell commands
-@var{action-if-found}, otherwise run @var{action-if-not-found}.
+This is an obsolete alias for @code{AC_TEST_LINK}, with the addition that it
+prints @samp{checking for @var{echo-text}} to the standard output first.
 @end defmac
 
 @defmac AC_FUNC_CHECK (@var{function}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
@@ -1595,20 +1701,6 @@ list that exists, define @code{HAVE_@var{header-file}} (in all caps).
 it is used here.
 @end defmac
 
-@defmac AC_HAVE_LIBRARY (@var{library} @r{[}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]]})
-@maindex HAVE_LIBRARY
-Create a test C program to see whether that program can be linked with
-the specified library.  @var{action-if-found} is a list of shell
-commands to run if the link succeeds (which means that the library is
-present); @var{action-if-not-found} is a list of shell commands to run
-if the link fails.  If @var{action-if-found} and
-@var{action-if-not-found} are not specified, the default action is to
-add @samp{-lfoo} to @code{LIBS} and define @samp{HAVE_LIBfoo}
-for library @samp{foo}.  @var{library} can be written as any of
-@samp{foo}, @samp{-lfoo}, or @samp{libfoo.a}.  In all of those cases,
-the compiler is passed @samp{-lfoo}.
-@end defmac
-
 @defmac AC_HEADER_CHECK (@var{header-file}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
 @maindex HEADER_CHECK
 If @var{header-file} exists, execute shell commands
@@ -1634,14 +1726,6 @@ almost always detect them by simply using @code{#ifdef} directives in
 your programs.
 @end defmac
 
-@defmac AC_PROGRAM_CHECK (@var{variable}, @var{prog-to-check-for}, @var{value-if-found} @r{[}, @var{value-if-not-found}@r{]})
-@maindex PROGRAM_CHECK
-Check whether program @var{prog-to-check-for} exists in @code{PATH}.  If
-it is found, set @var{variable} to @var{value-if-found}, otherwise to
-@var{value-if-not-found}, if given.  If @var{variable} was already set,
-do nothing.  Calls @code{AC_SUBST} for @var{variable}.
-@end defmac
-
 @defmac AC_PROGRAM_EGREP (@var{pattern}, @var{program}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
 @maindex PROGRAM_EGREP
 @var{program} is the text of a C or C++ program, on which shell variable and
@@ -1657,32 +1741,6 @@ on which language is current, @pxref{Language Choice}), if it hasn't
 been called already.
 @end defmac
 
-@defmac AC_PROGRAM_PATH (@var{variable}, @var{prog-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
-@maindex PROGRAM_PATH
-Similar to @code{AC_PROGRAM_CHECK}, but set @var{variable} to the entire
-path of @var{prog-to-check-for} if found.  Otherwise, set @var{variable}
-to @var{value-if-not-found}, if given.  If @var{variable} was already
-set, do nothing.  Calls @code{AC_SUBST} for @var{variable}.
-@end defmac
-
-@defmac AC_PROGRAMS_CHECK (@var{variable}, @var{progs-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
-@maindex PROGRAMS_CHECK
-Check for each program in the whitespace-separated list
-@var{progs-to-check-for} exists in @code{PATH}.  If it is found, set
-@var{variable} to the name of that program.  Otherwise, continue
-checking the next program in the list.  If none of the programs in the
-list are found, set @var{variable} to @var{value-if-not-found}; if
-@var{value-if-not-found} is not specified, the value of @var{variable}
-is not changed.  Calls @code{AC_SUBST} for @var{variable}.
-@end defmac
-
-@defmac AC_PROGRAMS_PATH (@var{variable}, @var{progs-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
-@maindex PROGRAMS_PATH
-Like @code{AC_PROGRAMS_CHECK}, but if any of @var{progs-to-check-for}
-are found, set @var{variable} to the entire pathname of the program
-found.
-@end defmac
-
 @defmac AC_REPLACE_FUNCS (@var{function-name}@dots{})
 @maindex REPLACE_FUNCS
 For each given @var{function-name} in the whitespace-separated argument
@@ -1720,8 +1778,22 @@ on which language is current, @pxref{Language Choice}), if it hasn't
 been called already.
 @end defmac
 
+@defmac AC_TEST_LINK (@var{includes}, @var{function-body}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
+@maindex TEST_LINK
+Create a test C program to see whether a function whose body consists of
+@var{function-body} can be compiled and linked; @var{includes} is any
+@code{#include} statements needed by the code in @var{function-body}.
+If the file compiles and links successfully, run shell commands
+@var{action-if-found}, otherwise run @var{action-if-not-found}.
+@end defmac
+
 @defmac AC_TEST_PROGRAM (@var{program}, @var{action-if-true} @r{[}, @var{action-if-false} @r{[}, @var{action-if-cross-compiling}@r{]]})
 @maindex TEST_PROGRAM
+This is an obsolete alias for @code{AC_TEST_RUN}.
+@end defmac
+
+@defmac AC_TEST_RUN (@var{program}, @var{action-if-true} @r{[}, @var{action-if-false} @r{[}, @var{action-if-cross-compiling}@r{]]})
+@maindex TEST_RUN
 @var{program} is the text of a C program, on which shell variable and
 backquote substitutions are performed.  If it compiles and links
 successfully and returns an exit status of 0 when executed, run shell
@@ -1736,28 +1808,35 @@ run.  If that argument is given, this macro calls @code{AC_CROSS_CHECK}
 if it has not already been called (@pxref{Compiler Characteristics}).
 @end defmac
 
-@node Command Line, Setting Variables, General Feature Tests, General Purpose Macros
+@node Command Line, Setting Variables, C Features, General Purpose Macros
 @section Checking Command Line Arguments
 
 These macros check whether the user gave @code{configure} various
 command line arguments.  Like the general feature tests (@pxref{General
-Feature Tests}),  they may take an argument to use if the argument was
+Purpose Macros}),  they may take an argument to use if the argument was
 given and one for if it was not given.
 
-@defmac AC_ENABLE (@var{feature}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
-@maindex ENABLE
+@defmac AC_ARG_ENABLE (@var{feature}, @var{help-string}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
+@maindex ARG_ENABLE
 If the user gave @code{configure} the option
 @samp{--enable-@var{feature}} or @samp{--disable-@var{feature}}, run
 shell commands @var{action-if-true}.  Otherwise run shell commands
-@var{action-if-false}.  The name @var{feature} should consist only of
-alphanumeric characters and dashes.
+@var{action-if-false}.  @var{help-string} is a description of
+the option which looks like this:
+@example
+--enable-readline       support fancy command line editing
+@end example
+@noindent
+@var{help-string} may be more than one line long, if more detail is
+needed.  Just make sure the columns line up in @samp{configure --help}.
 
-The @var{feature} indicates an optional user-level facility.  This
-option allows users to choose which optional features to build and
-install.  @samp{--enable-@var{feature}} options should never make a
-feature behave differently or cause one feature to replace another.
-They should only cause parts of the program to be built rather than left
-out.
+The name @var{feature} should consist only of alphanumeric characters
+and dashes.  The @var{feature} indicates an optional user-level
+facility.  This option allows users to choose which optional features to
+build and install.  @samp{--enable-@var{feature}} options should never
+make a feature behave differently or cause one feature to replace
+another.  They should only cause parts of the program to be built rather
+than left out.
 
 The user can give an argument by following the feature name with
 @samp{=} and the argument.  Giving an argument of @samp{no} indicates
@@ -1770,34 +1849,28 @@ the shell variable @code{enableval}.  If no argument was given to
 @samp{--disable-@var{feature}} is equivalent to
 @samp{--enable-@var{feature}=no}.  At present, arguments containing blanks
 are not handled correctly; if you need an argument to contain a list,
-require the items to be separated by commas instead.  (This restriction
-might disappear in the future.)
+require the items to be separated by commas instead.
 @end defmac
 
-@defmac AC_PREFIX (@var{program})
-@maindex PREFIX
-If the user did not specify an installation prefix (using the
-@samp{--prefix} option), guess a value for it by looking for
-@var{program} in @code{PATH}, the way the shell does.  If @var{program}
-is found, set the prefix to the parent of the directory containing
-@var{program}; otherwise leave the prefix specified in
-@file{Makefile.in} unchanged.  For example, if @var{program} is
-@code{gcc} and the @code{PATH} contains @file{/usr/local/gnu/bin/gcc},
-set the prefix to @file{/usr/local/gnu}.
-@end defmac
-
-@defmac AC_WITH (@var{package}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
-@maindex WITH
+@defmac AC_ARG_WITH (@var{package}, @var{help-string}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
+@maindex ARG_WITH
 If the user gave @code{configure} the option @samp{--with-@var{package}}
 or @samp{--without-@var{package}}, run shell commands
 @var{action-if-true}.  Otherwise run shell commands
-@var{action-if-false}.  The name @var{package} should consist only of
-alphanumeric characters and dashes.
+@var{action-if-false}.    @var{help-string} is a description of
+the option which looks like this:
+@example
+--with-gnu-as           use the GNU assembler
+@end example
+@noindent
+@var{help-string} may be more than one line long, if more detail is
+needed.  Just make sure the columns line up in @samp{configure --help}.
 
-The @var{package} indicates another software package that this program
-should work with.  For example, @samp{--with-gnu-ld} means work with the
-GNU linker instead of some other linker.  @samp{--with-x11} means work
-with X11.
+The name @var{package} should consist only of alphanumeric characters
+and dashes.  The @var{package} indicates another software package that
+this program should work with.  For example, @samp{--with-gnu-ld} means
+work with the GNU linker instead of some other linker.
+@samp{--with-x11} means work with X11.
 
 The user can give an argument by following the package name with
 @samp{=} and the argument.  Giving an argument of @samp{no} is for
@@ -1813,8 +1886,19 @@ the shell variable @code{withval}.  If no argument was given to
 @samp{--without-@var{package}} is equivalent to
 @samp{--with-@var{package}=no}.  At present, arguments containing blanks
 are not handled correctly; if you need an argument to contain a list,
-require the items to be separated by commas instead.  (This restriction
-might disappear in the future.)
+require the items to be separated by commas instead.  
+@end defmac
+
+@defmac AC_ENABLE (@var{feature}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
+@maindex ENABLE
+This is an obsolete version of @code{AC_ARG_ENABLE} that does not
+provide a help string.
+@end defmac
+
+@defmac AC_WITH (@var{package}, @var{action-if-true} @r{[}, @var{action-if-false}@r{]})
+@maindex WITH
+This is an obsolete version of @code{AC_ARG_WITH} that does not
+provide a help string.
 @end defmac
 
 @node Setting Variables, Printing Messages, Command Line, General Purpose Macros
@@ -1923,6 +2007,17 @@ LIBS="$LIBS -ltermcap"
 @end example
 @end defmac
 
+@ignore
+@defmac AC_SUBST_FILE (@var{variable}, @var{file})
+@maindex SUBST_FILE
+Substitute the contents of the file @file{@var{srcdir}/@var{file}} into
+@file{Makefile} variable @var{variable} when creating the output files
+(typically one or more @file{Makefile}s).  This macro is useful for
+inserting @file{Makefile} fragments for particular host or tartet types
+into @file{Makefile}s.
+@end defmac
+@end ignore
+
 @node Printing Messages, Language Choice, Setting Variables, General Purpose Macros
 @section Printing Messages
 
@@ -2272,19 +2367,19 @@ come later should contain a call to @code{AC_PROVIDE}.
 For example, @code{AC_AIX} contains
 
 @example
-AC_BEFORE([$0], [AC_COMPILE_CHECK])
+AC_BEFORE([$0], [AC_TEST_LINK])
 @end example
 
 @noindent
-and @code{AC_COMPILE_CHECK} contains
+and @code{AC_TEST_LINK} contains
 
 @example
 AC_PROVIDE([$0])
 @end example
 
 @noindent
-As a result, if @code{AC_AIX} is called after @code{AC_COMPILE_CHECK},
-it will note that @code{AC_COMPILE_CHECK} has already been called and
+As a result, if @code{AC_AIX} is called after @code{AC_TEST_LINK},
+it will note that @code{AC_TEST_LINK} has already been called and
 print a warning message.
 
 @node Checking for Files, Checking for Symbols, Dependencies Between Macros, Writing Macros
@@ -2308,7 +2403,7 @@ Do not use @samp{test -x}, because 4.3BSD does not have it.  Use
 
 If you need to check whether a symbol is defined in a C header file, you
 can use @code{AC_HEADER_EGREP} if the symbol is not a C preprocessor
-macro (@pxref{General Feature Tests}), or compile a small test program that includes
+macro (@pxref{C Features}), or compile a small test program that includes
 the file and references the symbol (@pxref{Test Programs}).  Don't
 directly @code{grep} for the symbol in the file, because on some systems
 it might be defined in another header file that the file you are
@@ -2355,16 +2450,16 @@ than scanning the libraries.
 
 If you need to check for a condition other than whether some symbol
 exists on the system or has a certain value, then you can't use
-@code{AC_COMPILE_CHECK} (@pxref{General Feature Tests}).  You have to write a
+@code{AC_TEST_LINK} (@pxref{C Features}).  You have to write a
 test program by hand.  You can compile and run it using
-@code{AC_TEST_PROGRAM} (@pxref{General Feature Tests}).
+@code{AC_TEST_RUN} (@pxref{C Features}).
 
 Try to avoid writing test programs if possible, because using them
 prevents people from configuring your package for cross-compiling.  If
 it's really best that you test for a run-time behavior, try to provide a
 default ``worst case'' value to use when cross-compiling makes run-time
 tests impossible.  You do this by passing the optional last argument to
-@code{AC_TEST_PROGRAM}.
+@code{AC_TEST_RUN}.
 
 @menu
 * Guidelines::                 General rules for writing test programs.
@@ -2526,7 +2621,7 @@ redundant.
 
 @defvar LIBOBJS
 Names of object files (ending in @file{.o}).  Set by
-@code{AC_REPLACE_FUNCS} (@pxref{General Feature Tests}).
+@code{AC_REPLACE_FUNCS} (@pxref{C Features}).
 @end defvar
 
 @node VPATH Substitutions, Automatic Remaking, Predefined Variables, Makefiles
@@ -2791,7 +2886,14 @@ The shell with which to run @code{configure} for the @samp{--recheck}
 option.  The default is @file{/bin/sh}.
 @end defvar
 
-The following two variables provide one way for separately distributed
+@defvar CONFIG_STATUS
+The file name to use for the shell script that records the
+configuration.  The default is @file{./config.status}.  This variable is
+useful when one package uses parts of another and the @file{configure}
+scripts shouldn't be merged because they are maintained separately.
+@end defvar
+
+The following variables provide one way for separately distributed
 packages to share the values computed by @code{configure}.  Doing so can
 be useful if some of the packages need a superset of the features that
 one of them, perhaps a common library, does.  These variables allow a
index eeef4fc9f2202a20945b66a7d212adca24b07628..6c3e5cfdf779a18e6a921ee87b1acbacf3133d46 100644 (file)
@@ -29,35 +29,16 @@ dnl
 ifdef([__gnu__], , [errprint(Autoconf requires GNU m4
 )m4exit(2)])dnl
 dnl
-dnl
-dnl ### Utility functions for stamping the configure script.
-dnl
-dnl
-define(AC_ACVERSION, 1.91)dnl
+define(AC_ACVERSION, 1.93)dnl
 dnl This is defined by the --version option of the autoconf script.
 ifdef([AC_PRINT_VERSION], [errprint(Autoconf version AC_ACVERSION
-)])dnl
-dnl
-dnl These are currently not used, for the sake of people who diff
-dnl configure scripts and don't want spurious differences.
-dnl But they are too clever to just delete.
-dnl
-define(AC_USER, [esyscmd(
-changequote({,})dnl
-# Extract the user name from the first pair of parentheses.
-({ac_sedcmd='s/[^(]*(\([^)]*\)).*/\1/';}
-changequote([,])dnl
-whoami || id|sed "$ac_sedcmd") 2>/dev/null|tr -d '\012')])dnl
-dnl
-define(AC_HOST, [esyscmd((hostname || uname -n) 2>/dev/null|tr -d '\012')])dnl
-dnl
-define(AC_DATE, [esyscmd(date|tr -d '\012')])dnl
+)m4exit(0)])dnl
 dnl
 dnl
 dnl ### Controlling Autoconf operation
 dnl
 dnl
-dnl Diversions:
+dnl m4 diversions:
 define(AC_DIVERSION_NORMAL, 0)dnl      normal output
 define(AC_DIVERSION_SED, 1)dnl         sed substitutions for config.status
 define(AC_DIVERSION_VAR, 2)dnl         variable assignments for config.status
@@ -66,13 +47,9 @@ define(AC_DIVERSION_ARG_ENABLE, 4)dnl        --enable/--disable actions
 define(AC_DIVERSION_HELP_WITH, 5)dnl   --with/--without help strings
 define(AC_DIVERSION_ARG_WITH, 6)dnl    --with/--without actions
 dnl
-dnl This is separate from AC_INIT to prevent GNU m4 1.0 from coredumping
-dnl when AC_CONFIG_HEADER is used.
 define(AC_NOTICE,
 [# Guess values for system-dependent variables and create Makefiles.
-dnl [#] Generated automatically using autoconf.
 # Generated automatically using autoconf version] AC_ACVERSION [
-dnl [#] by AC_USER@AC_HOST on AC_DATE
 # Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
 #
 # This configure script is free software; you can redistribute it and/or
@@ -91,12 +68,13 @@ dnl [#] by AC_USER@AC_HOST on AC_DATE
 ])dnl
 dnl
 define(AC_PARSEARGS,
-[AC_BEFORE([$0], AC_ARG_ENABLE)dnl
-AC_BEFORE([$0], AC_ARG_WITH)dnl
+[AC_BEFORE([$0], [AC_ARG_ENABLE])dnl
+AC_BEFORE([$0], [AC_ARG_WITH])dnl
 # Save the original args to write them into config.status later.
 configure_args="[$]*"
 
-# Omit internal or obsolete options to make the list less imposing.
+# Omit some internal, obsolete, or unimplemented options to make the
+# list less imposing.
 changequote(,)dnl
 ac_usage="Usage: configure [options] [host]
 Options: [defaults in brackets after descriptions]
@@ -130,12 +108,12 @@ changequote([,])dnl
 # dashes changed to underlines.
 build=NONE
 cache_file=./config.cache
-exec_prefix=
+exec_prefix=NONE
 host=NONE
 no_create=
 nonopt=NONE
 norecursion=
-prefix=
+prefix=NONE
 program_prefix=
 program_suffix=
 program_transform_name=
@@ -382,8 +360,12 @@ AC_PREPARE($1)])dnl
 dnl
 dnl AC_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR)
 define(AC_PREPARE,
-[AC_BEFORE([$0], AC_ARG_ENABLE)dnl
-AC_BEFORE([$0], AC_ARG_WITH)dnl
+[AC_BEFORE([$0], [AC_ARG_ENABLE])dnl
+AC_BEFORE([$0], [AC_ARG_WITH])dnl
+AC_BEFORE([$0], [AC_CONFIG_HEADER])dnl
+AC_BEFORE([$0], [AC_REVISION])dnl
+AC_BEFORE([$0], [AC_PREREQ])dnl
+AC_BEFORE([$0], [AC_CONFIG_SUBDIRS])dnl
 trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
 trap 'rm -fr confdefs* $ac_clean_files' 0
 
@@ -392,8 +374,9 @@ trap 'rm -fr confdefs* $ac_clean_files' 0
 # 1 file creation
 # 2 errors and warnings
 # 3 unused; some systems may open it to /dev/tty
-# 4 checking for...
+# 4 checking for... messages
 # 5 test results
+# 6 compiler messages
 if test "$silent" = yes; then
   exec 4>/dev/null
 else
@@ -404,6 +387,12 @@ if test "$verbose" = yes; then
 else
   exec 5>/dev/null
 fi
+exec 6>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&6
 
 # Save the original args if we used an alternate arg parser.
 ac_configure_temp="${configure_args-[$]*}"
@@ -458,7 +447,12 @@ if test ! -r $srcdir/$ac_unique_file; then
     AC_ERROR(can not find sources in ${srcdir})
   fi
 fi
+
+ifdef([AC_LIST_PREFIX_PROGRAM], [AC_PREFIX(AC_LIST_PREFIX_PROGRAM)])dnl
+dnl Let the site file select an alternate cache file if it wants to.
+AC_SITE_LOAD
 AC_CACHE_LOAD
+
 AC_LANG_C
 undivert(AC_DIVERSION_ARG_ENABLE)dnl
 undivert(AC_DIVERSION_ARG_WITH)dnl
@@ -466,7 +460,8 @@ undivert(AC_DIVERSION_ARG_WITH)dnl
 dnl
 dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
 define(AC_ARG_ENABLE,
-[divert(AC_DIVERSION_HELP_ENABLE)dnl
+[AC_PROVIDE([$0])dnl
+divert(AC_DIVERSION_HELP_ENABLE)dnl
 $2
 divert(AC_DIVERSION_ARG_ENABLE)dnl
 AC_ENABLE_INTERNAL([$1], [$3], [$4])dnl
@@ -492,7 +487,8 @@ fi
 dnl
 dnl AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
 define(AC_ARG_WITH,
-[divert(AC_DIVERSION_HELP_WITH)dnl
+[AC_PROVIDE([$0])dnl
+divert(AC_DIVERSION_HELP_WITH)dnl
 $2
 divert(AC_DIVERSION_ARG_WITH)dnl
 AC_WITH_INTERNAL([$1], [$3], [$4])dnl
@@ -517,10 +513,10 @@ fi
 ])dnl
 dnl
 dnl AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
-define(AC_CONFIG_HEADER, [define(AC_LIST_HEADERS, $1)])dnl
+define(AC_CONFIG_HEADER, [AC_PROVIDE([$0])define(AC_LIST_HEADERS, $1)])dnl
 dnl
 dnl AC_REVISION(REVISION-INFO)
-define(AC_REVISION, [AC_REQUIRE([AC_BINSH])dnl
+define(AC_REVISION, [AC_PROVIDE([$0])AC_REQUIRE([AC_BINSH])dnl
 [# From configure.in] translit([$1],$")])dnl
 dnl
 dnl Subroutines of AC_PREREQ.
@@ -543,16 +539,44 @@ dnl
 dnl Complain and exit if the Autoconf version is less than $1.
 dnl AC_PREREQ(VERSION)
 define(AC_PREREQ,
-[AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
+[AC_PROVIDE([$0])dnl
+AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
 AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])),[$1])])dnl
 dnl
 dnl Run configure in subdirectories $1.
 dnl Not actually done until AC_OUTPUT_SUBDIRS.
 dnl AC_CONFIG_SUBDIRS(DIR ...)
 define(AC_CONFIG_SUBDIRS,
-[AC_REQUIRE([AC_CONFIG_AUXDIR_DEFAULT])dnl
+[AC_PROVIDE([$0])dnl
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 define([AC_LIST_SUBDIRS],[$1])])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,
+dnl set `prefix' to /usr/local/gnu.
+dnl AC_PREFIX_PROGRAM(PROGRAM)
+define(AC_PREFIX_PROGRAM, [define([AC_LIST_PREFIX_PROGRAM],[$1])])dnl
+define(AC_PREFIX_INTERNAL,
+[if test "x$prefix" = xNONE; then
+changequote(<<,>>)dnl
+define(<<AC_VAR_NAME>>, translit($1, [a-z], [A-Z]))dnl
+changequote([,])dnl
+AC_PROGRAM_PATH(AC_VAR_NAME, $1)
+changequote(<<,>>)dnl
+  if test -n "$ac_cv_path_<<>>AC_VAR_NAME"; then
+    prefix=`echo $ac_cv_path_<<>>AC_VAR_NAME|sed 's%/[^/][^/]*/[^/][^/]*$%%'`
+changequote([,])dnl
+dnl    test -z "$prefix" && prefix=/
+    AC_VERBOSE(setting installation directory prefix to ${prefix})
+  fi
+fi
+undefine(AC_VAR_NAME)dnl
+])dnl
+define(AC_PREFIX,
+[AC_OBSOLETE([$0], [; instead use AC_PREFIX_PROGRAM before AC_INIT])dnl
+AC_PREFIX_INTERNAL([$1])])dnl
+dnl
 dnl
 dnl ### Canonicalizing the system type
 dnl
@@ -560,21 +584,21 @@ dnl
 dnl Find install.sh, config.sub, config.guess, and Cygnus configure
 dnl in directory $1.  These are auxiliary files used in configuration.
 dnl $1 can be either absolute or relative to ${srcdir}.
-dnl AC_CONFIG_AUXDIR(DIR)
-define(AC_CONFIG_AUXDIR,
-[AC_CONFIG_AUXDIR_DIRS($1 ${srcdir}/$1)])dnl
+dnl AC_CONFIG_AUX_DIR(DIR)
+define(AC_CONFIG_AUX_DIR,
+[AC_CONFIG_AUX_DIRS($1 ${srcdir}/$1)])dnl
 dnl
 dnl The default is `${srcdir}' or `${srcdir}/..' or `${srcdir}/../..'.
 dnl There's no need to call this macro explicitly; just AC_REQUIRE it.
-define(AC_CONFIG_AUXDIR_DEFAULT,
-[AC_CONFIG_AUXDIR_DIRS(${srcdir} ${srcdir}/.. ${srcdir}/../..)])dnl
+define(AC_CONFIG_AUX_DIR_DEFAULT,
+[AC_CONFIG_AUX_DIRS(${srcdir} ${srcdir}/.. ${srcdir}/../..)])dnl
 dnl
 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
 dnl do not automatically need to distribute the other auxiliary files.
-dnl AC_CONFIG_AUXDIR_DIRS(DIR ...)
-define(AC_CONFIG_AUXDIR_DIRS,
+dnl AC_CONFIG_AUX_DIRS(DIR ...)
+define(AC_CONFIG_AUX_DIRS,
 [ac_aux_dir=
 for ac_dir in $1; do
   if test -f $ac_dir/install.sh; then
@@ -588,12 +612,12 @@ ac_config_guess=${ac_aux_dir}/config.guess
 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_AUXDIR_DEFAULT])dnl
+AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 ])dnl
 dnl
 dnl Canonicalize the host, target, and build system types.
-define(AC_CANON_SYSTEM,
-[AC_REQUIRE([AC_CONFIG_AUXDIR_DEFAULT])dnl
+define(AC_CANONICAL_SYSTEM,
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 # Do some error checking and defaulting for the host and target type.
 # The inputs are:
 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
@@ -623,14 +647,14 @@ if ${ac_config_sub} sun4 >/dev/null 2>&1; then :
 else AC_ERROR(can not run ${ac_config_sub})
 fi
 
-AC_CANON_HOST
-AC_CANON_TARGET
-AC_CANON_BUILD
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+AC_CANONICAL_BUILD
 ])dnl
 dnl
-dnl Subroutines of AC_CANON_SYSTEM.
+dnl Subroutines of AC_CANONICAL_SYSTEM.
 dnl
-define(AC_CANON_HOST,
+define(AC_CANONICAL_HOST,
 [AC_CHECKING(host type)
 
 case "${host_alias}" in
@@ -653,7 +677,7 @@ AC_SUBST(host)dnl
 AC_SUBST(host_alias)dnl
 ])dnl
 dnl
-define(AC_CANON_TARGET,
+define(AC_CANONICAL_TARGET,
 [AC_CHECKING(target type)
 
 case "${target_alias}" in
@@ -673,7 +697,7 @@ AC_SUBST(target)dnl
 AC_SUBST(target_alias)dnl
 ])dnl
 dnl
-define(AC_CANON_BUILD,
+define(AC_CANONICAL_BUILD,
 [AC_CHECKING(build type)
 
 case "${build_alias}" in
@@ -690,30 +714,38 @@ AC_SUBST(build)dnl
 AC_SUBST(build_alias)dnl
 ])dnl
 dnl
-dnl Put the contents of file $2 into Makefile variable $1.
-dnl Useful for inserting Makefile fragments into Makefiles.
-dnl AC_SUBST_FILE(VARIABLE, FILE)
-define(AC_SUBST_FILE,
-[AC_SUBST($1)dnl
-if test -f ${srcdir}/$2; then
-  AC_VERBOSE(using $2 for $1)
-  $1=`cat ${srcdir}/$2`
-fi
-])dnl
-dnl
 dnl Link each of the existing files in $2 to the corresponding
 dnl link name in $1.
 dnl Not actually done until AC_OUTPUT_LINKS.
-dnl AC_MAKE_LINKS(LINK ..., FILE ...)
-define(AC_MAKE_LINKS,
+dnl AC_LINK_FILES(LINK ..., FILE ...)
+define(AC_LINK_FILES,
 [define([AC_LIST_LINKS],[$1])define([AC_LIST_FILES],[$2])])dnl
 dnl
 dnl
 dnl ### Caching test results
 dnl
 dnl
+dnl Look for site or system specific initialization scripts.
+define(AC_SITE_LOAD,
+[ac_site_dirs=/usr/local
+if test "x$prefix" != xNONE; then
+  ac_site_dirs=$prefix
+fi
+# System dependent files override system independent ones in case of conflict.
+if test "x$exec_prefix" != xNONE && test "x$exec_prefix" != "x$prefix"; then
+  ac_site_dirs="$ac_site_dirs $exec_prefix"
+fi
+for ac_site_dir in $ac_site_dirs; do
+  ac_site_file=$ac_site_dir/lib/config.site
+  if test -r "$ac_site_file"; then
+    AC_VERBOSE(loading site initialization script $ac_site_file)
+    . $ac_site_file
+  fi
+done
+])dnl
+dnl
 define(AC_CACHE_LOAD,
-[if test -r $cache_file; then
+[if test -r "$cache_file"; then
   AC_VERBOSE(loading test results from cache file $cache_file)
   . $cache_file
 else
@@ -728,7 +760,7 @@ cat > $cache_file <<\CEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
 # scripts and configure runs.  It is not useful on other systems.
-# If its contents are invalid for some reason, you may edit or delete it.
+# If its contents are invalid for some reason, you may delete or edit it.
 #
 # By default, configure uses ./config.cache as the cache file,
 # creating it if it does not exist already.  You can give configure
@@ -739,7 +771,8 @@ cat > $cache_file <<\CEOF
 # --recheck option to rerun configure.
 CEOF
 changequote(,)dnl
-set | sed -n "/^[a-zA-Z0-9_]*_cv_/s/=\(.*\)/='\1'/p" >> $cache_file
+dnl Allow a site initialization script to override cache values.
+set | sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1-'\2'}/p" >> $cache_file
 changequote([,])dnl
 fi])dnl
 dnl
@@ -888,7 +921,7 @@ AC_PROVIDE([$0])dnl
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='${CPP}'
-ac_compile='${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS >/dev/null 2>&1'
+ac_compile='${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1>&6 2>&6'
 ])dnl
 dnl
 define(AC_LANG_CPLUSPLUS,
@@ -897,7 +930,7 @@ AC_PROVIDE([$0])dnl
 ac_ext=C
 # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
 ac_cpp='${CXXCPP}'
-ac_compile='${CXX-gcc} $CXXFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS >/dev/null 2>&1'
+ac_compile='${CXX-gcc} $CXXFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1>&6 2>&6'
 ])dnl
 dnl
 dnl Push the current language on a stack.
@@ -940,25 +973,25 @@ define(AC_PROGRAM_CHECK,
 [# Extract the first word of "$2", so it can be a program name with args.
 set dummy $2; ac_word=[$]2
 AC_CHECKING([for $ac_word])
-AC_CACHE_VAL(ac_cv_program_$1,
+AC_CACHE_VAL(ac_cv_prog_$1,
 [if test -n "[$]$1"; then
-  ac_cv_program_$1="[$]$1" # Let the user override the test.
+  ac_cv_prog_$1="[$]$1" # Let the user override the test.
 else
   IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
   for ac_dir in $PATH; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_program_$1="$3"
+      ac_cv_prog_$1="$3"
       break
     fi
   done
   IFS="$ac_save_ifs"
 dnl If no 4th arg is given, leave the cache variable unset,
 dnl so AC_PROGRAMS_CHECK will keep looking.
-ifelse([$4],,, [  test -z "[$]ac_cv_program_$1" && ac_cv_program_$1="$4"
+ifelse([$4],,, [  test -z "[$]ac_cv_prog_$1" && ac_cv_prog_$1="$4"
 ])dnl
 fi])dnl
-$1="$ac_cv_program_$1"
+$1="$ac_cv_prog_$1"
 test -n "[$]$1" && AC_VERBOSE(setting $1 to [$]$1)
 AC_SUBST($1)dnl
 ])dnl
@@ -1018,28 +1051,6 @@ done
 ifelse([$3],,, [test -n "[$]$1" || $1="$3"
 ])])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,
-dnl set `prefix' to /usr/local/gnu.
-dnl AC_PREFIX(PROGRAM)
-define(AC_PREFIX,
-[if test -z "$prefix"; then
-changequote(<<,>>)dnl
-define(<<AC_VAR_NAME>>, translit($1, [a-z], [A-Z]))dnl
-changequote([,])dnl
-AC_PROGRAM_PATH(AC_VAR_NAME, $1)
-changequote(<<,>>)dnl
-  if test -n "$ac_cv_path_<<>>AC_VAR_NAME"; then
-    prefix=`echo $ac_cv_path_<<>>AC_VAR_NAME|sed 's%/[^/][^/]*/[^/][^/]*$%%'`
-changequote([,])dnl
-    test -z "$prefix" && prefix=/
-    AC_VERBOSE(setting installation directory prefix to ${prefix})
-  fi
-fi
-undefine(AC_VAR_NAME)dnl
-])dnl
-dnl
 dnl AC_HAVE_LIBRARY(LIBRARY [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
 define(AC_HAVE_LIBRARY, [dnl
 changequote(/,/)dnl
@@ -1106,7 +1117,8 @@ dnl AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY,
 dnl                  ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
 define(AC_COMPILE_CHECK,
 [AC_PROVIDE([$0])dnl
-AC_OBSOLETE([$0], [; instead use AC_TEST_LINK])dnl
+dnl It's actually ok to use this, if you don't care about caching.
+dnl AC_OBSOLETE([$0], [; instead use AC_TEST_LINK])dnl
 ifelse([$1], , , [AC_CHECKING([for $1])
 ])dnl
 AC_TEST_LINK([$2], [$3], [$4], [$5])dnl
@@ -1134,14 +1146,15 @@ fi
 rm -f conftest*]
 )dnl
 dnl
-dnl AC_TEST_PROGRAM(PROGRAM, ACTION-IF-TRUE [, ACTION-IF-FALSE
-dnl                 [, ACTION-IF-CROSS-COMPILING]])
-define(AC_TEST_PROGRAM,
+dnl AC_TEST_RUN(PROGRAM, ACTION-IF-TRUE [, ACTION-IF-FALSE
+dnl             [, ACTION-IF-CROSS-COMPILING]])
+define(AC_TEST_RUN,
 [AC_PROVIDE([$0])dnl
 AC_REQUIRE([AC_CROSS_CHECK])dnl
 if test -n "$cross_compiling"; then
   ifelse([$4], , AC_ERROR(can not run test program while cross compiling),
-  [$4
+  [AC_VERBOSE(using default for cross-compiling)
+$4
 ])
 else
 cat > conftest.${ac_ext} <<EOF
@@ -1157,6 +1170,9 @@ ifelse([$3], , , [else
 fi
 fi
 rm -fr conftest*])dnl
+dnl Obsolete name, which is less clear about what the macro does,
+dnl but is otherwise ok to use.
+define(AC_TEST_PROGRAM, [AC_TEST_RUN([$1], [$2], [$3], [$4])])dnl
 dnl
 dnl AC_TEST_CPP(INCLUDES, ACTION-IF-TRUE [, ACTION-IF-FALSE])
 define(AC_TEST_CPP,
@@ -1202,7 +1218,8 @@ dnl AC_FUNC_CHECK(FUNCTION, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
 define(AC_FUNC_CHECK,
 [AC_CHECKING([for $1])
 AC_CACHE_VAL(ac_cv_func_$1,
-[AC_TEST_LINK([#include <ctype.h>], [
+[AC_TEST_LINK(
+[#include <ctype.h> /* Arbitrary system header to define __stub macros. */], [
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
@@ -1266,15 +1283,14 @@ define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
 changequote([,])dnl
 AC_CHECKING(size of $1)
 AC_CACHE_VAL(AC_CV_NAME,
-[dnl If cross-compiling, the caller has to decide what to do; we can't.
-AC_TEST_PROGRAM([#include <stdio.h>
+[AC_TEST_RUN([#include <stdio.h>
 main()
 {
   FILE *f=fopen("conftestval", "w");
   if (!f) exit(1);
   fprintf(f, "%d\n", sizeof($1));
   exit(0);
-}], AC_CV_NAME=`cat conftestval`, AC_ERROR(can not determine size of $1))])dnl
+}], AC_CV_NAME=`cat conftestval`)])dnl
 AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
 undefine(AC_TYPE_NAME)dnl
 undefine(AC_CV_NAME)dnl
@@ -1288,9 +1304,9 @@ dnl AC_OUTPUT([FILE...] [,EXTRA-CMDS])
 define(AC_OUTPUT,
 [AC_CACHE_SAVE
 
-test -z "$prefix" && prefix=/usr/local
+test "x$prefix" = xNONE && prefix=/usr/local
 # Let make expand exec_prefix.
-test -z "$exec_prefix" && exec_prefix='${prefix}'
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
 # Any assignment to VPATH causes Sun make to only execute
 # the first set of double-colon rules, so remove it if not needed.
index c07b6c6d2b961108d73b4d43b4e8a058a0cb56e8..3024af70850af674f5fa7ad2bb15b634bac85ab3 100644 (file)
@@ -28,58 +28,60 @@ define(AC_PROG_CC,
 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
 AC_PROVIDE([$0])dnl
 AC_PROGRAM_CHECK(CC, gcc, gcc, cc)
+
 # Find out if we are using GNU C, under whatever name.
-cat > conftest.c <<EOF
+AC_CACHE_VAL(ac_cv_prog_gcc,
+[cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes
 #endif
 EOF
-${CC-cc} -E conftest.c > conftest.out 2>&1
-if egrep yes conftest.out >/dev/null 2>&1; then
-  GCC=yes
+if ${CC-cc} -E conftest.c 2>&6 | egrep yes >/dev/null 2>&1; then
+  ac_cv_prog_gcc=yes
 else
-  GCC=
-fi
-rm -f conftest*
+  ac_cv_prog_gcc=no
+fi])dnl
+if test "$ac_cv_prog_gcc" = yes; then GCC=yes; else GCC= ; fi
 ])dnl
 dnl
 define(AC_PROG_CXX,
 [AC_BEFORE([$0],[AC_PROG_CXXCPP])dnl
 AC_PROVIDE([$0])dnl
 AC_PROGRAMS_CHECK(CXX, $CCC c++ g++ gcc CC cxx, gcc)
+
 # Find out if we are using GNU C++, under whatever name.
-cat > conftest.C <<EOF
+AC_CACHE_VAL(ac_cv_prog_gxx,
+[cat > conftest.C <<EOF
 #ifdef __GNUC__
   yes
 #endif
 EOF
-${CXX-gcc} -E conftest.C > conftest.out 2>&1
-if egrep yes conftest.out >/dev/null 2>&1; then
-  GXX=yes
+if ${CXX-gcc} -E conftest.C 2>&6 | egrep yes >/dev/null 2>&1; then
+  ac_cv_prog_gxx=yes
 else
-  GXX=
-fi
-rm -f conftest*
+  ac_cv_prog_gxx=no
+fi])dnl
+if test "$ac_cv_prog_gxx" = yes; then GXX=yes; else GXX= ; fi
 ])dnl
 dnl
 define(AC_GCC_TRADITIONAL,
 [AC_REQUIRE([AC_PROG_CC])dnl
 AC_REQUIRE([AC_PROG_CPP])dnl
-if test "$GCC" = yes; then
+if test "$ac_cv_prog_gcc" = yes; then
   AC_CHECKING(whether -traditional is needed)
-changequote(,)dnl
-  ac_pattern="Autoconf.*'x'"
-changequote([,])dnl
+AC_CACHE_VAL(ac_cv_prog_gcc_traditional,
+[  ac_pattern="Autoconf.*'x'"
   ac_prog='#include <sgtty.h>
 Autoconf TIOCGETP'
-  AC_PROGRAM_EGREP($ac_pattern, $ac_prog, ac_need_trad=yes, ac_need_trad=no)
+  AC_PROGRAM_EGREP($ac_pattern, $ac_prog,
+  ac_cv_prog_gcc_traditional=yes, ac_cv_prog_gcc_traditional=no)
 
-  if test "$ac_need_trad" = no; then
+  if test "$ac_cv_prog_gcc_traditional" = no; then
     ac_prog='#include <termio.h>
 Autoconf TCGETA'
-    AC_PROGRAM_EGREP($ac_pattern, $ac_prog, ac_need_trad=yes)
-  fi
-  if test "$ac_need_trad" = yes; then
+    AC_PROGRAM_EGREP($ac_pattern, $ac_prog, ac_cv_prog_gcc_traditional=yes)
+  fi])dnl
+  if test "$ac_cv_prog_gcc_traditional" = yes; then
     CC="$CC -traditional"
     AC_VERBOSE(setting CC to $CC)
   fi
@@ -96,15 +98,15 @@ echo 'foo(){}' > conftest.c
 # Make sure it works both with $CC and with simple cc.
 # We do the test twice because some compilers refuse to overwrite an
 # existing .o file with -o, though they will create one.
-if ${CC-cc} -c conftest.c -o conftest.o >/dev/null 2>&1 \
- && test -f conftest.o && ${CC-cc} -c conftest.c -o conftest.o >/dev/null 2>&1
+if ${CC-cc} -c conftest.c -o conftest.o 1>&6 2>&6 &&
+  test -f conftest.o && ${CC-cc} -c conftest.c -o conftest.o 1>&6 2>&6
 then
   if test "x$CC" != xcc; then
     # Test first that cc exists at all.
-    if cc -c conftest.c >/dev/null 2>&1
+    if cc -c conftest.c 1>&6 2>&6
     then
-      if cc -c conftest.c -o conftest2.o >/dev/null 2>&1 && \
-         test -f conftest2.o && cc -c conftest.c -o conftest2.o >/dev/null 2>&1
+      if cc -c conftest.c -o conftest2.o 1>&6 2>&6 &&
+        test -f conftest2.o && cc -c conftest.c -o conftest2.o 1>&6 2>&6
       then
         :
       else
@@ -230,7 +232,7 @@ AC_SUBST(LEX_OUTPUT_ROOT)dnl
 ])dnl
 dnl
 define(AC_PROG_INSTALL,
-[AC_REQUIRE([AC_CONFIG_AUX_DEFAULT])dnl
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 # Make sure to not get the incompatible SysV /etc/install and
 # /usr/sbin/install, which might be in PATH before a BSD-like install,
 # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
@@ -249,7 +251,7 @@ define(AC_PROG_INSTALL,
 # by make from ./install.sh.
 AC_CHECKING(for a BSD compatible install)
 if test -z "${INSTALL}"; then
-AC_CACHE_VAL(ac_cv_path_INSTALL,
+AC_CACHE_VAL(ac_cv_path_install,
 [  IFS="${IFS=         }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
   for ac_dir in $PATH; do
     case "$ac_dir" in
@@ -264,7 +266,7 @@ AC_CACHE_VAL(ac_cv_path_INSTALL,
            # OSF/1 installbsd also uses dspmsg, but is usable.
            :
          else
-           ac_cv_path_INSTALL="$ac_dir/$ac_prog -c"
+           ac_cv_path_install="$ac_dir/$ac_prog -c"
            break 2
          fi
        fi
@@ -274,8 +276,8 @@ AC_CACHE_VAL(ac_cv_path_INSTALL,
   done
   IFS="$ac_save_ifs"
   # As a last resort, use the slow shell script.
-  test -z "$ac_cv_path_INSTALL" && ac_cv_path_INSTALL="$ac_install_sh"])dnl
-  INSTALL="$ac_cv_path_INSTALL"
+  test -z "$ac_cv_path_install" && ac_cv_path_install="$ac_install_sh"])dnl
+  INSTALL="$ac_cv_path_install"
 fi
 AC_SUBST(INSTALL)dnl
 AC_VERBOSE(setting INSTALL to $INSTALL)
@@ -348,7 +350,7 @@ fi
 
 if test "$ac_stdc_hdrs" = yes; then
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-AC_TEST_PROGRAM([#include <ctype.h>
+AC_TEST_RUN([#include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
 #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
@@ -402,14 +404,12 @@ AC_DIR_HEADER_CHECK(sys/dir.h, SYSDIR)
 AC_DIR_HEADER_CHECK(ndir.h, NDIR)
 
 AC_CHECKING(for closedir return value)
-AC_TEST_PROGRAM([#include <sys/types.h>
+AC_TEST_RUN([#include <sys/types.h>
 #include <$ac_dir_header>
 int closedir(); main() { exit(closedir(opendir(".")) != 0); }], ,
 AC_DEFINE(VOID_CLOSEDIR))
 ])dnl
 dnl Subroutine of AC_DIR_HEADER.
-dnl ??? I tried to put this define inside AC_DIR_HEADER, but when I did
-dnl that, $1 and $2 did not get expanded. --roland
 dnl Check if $1 is the winning directory library header file.
 dnl It must not only exist, but also correctly define the `DIR' type.
 dnl If it is really winning, define $2 and set shell var `ac_dir_header' to $1.
@@ -486,7 +486,7 @@ main()
   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
 }'
 changequote([,])dnl
-AC_TEST_PROGRAM([$ac_prog],
+AC_TEST_RUN([$ac_prog],
                AC_DEFINE(GETGROUPS_T, gid_t), AC_DEFINE(GETGROUPS_T, int))
 ])dnl
 dnl
@@ -535,7 +535,7 @@ dnl
 dnl
 define(AC_MMAP, [
 AC_CHECKING(for working mmap)
-AC_TEST_PROGRAM([/* Thanks to Mike Haertel and Jim Avera for this test. */
+AC_TEST_RUN([/* Thanks to Mike Haertel and Jim Avera for this test. */
 #include <sys/types.h>
 #include <fcntl.h>
 #include <sys/mman.h>
@@ -605,12 +605,9 @@ main()
 ])dnl
 dnl
 define(AC_VPRINTF,
-[AC_CHECKING([for vprintf])
-AC_TEST_LINK( , [vprintf();],
-  [ac_have_vprintf=yes AC_DEFINE(HAVE_VPRINTF)], ac_have_vprintf=no)
-if test "$ac_have_vprintf" = no; then
-AC_CHECKING([for _doprnt])
-AC_TEST_LINK( , [_doprnt();], AC_DEFINE(HAVE_DOPRNT))
+[AC_FUNC_CHECK(vprintf, AC_DEFINE(HAVE_VPRINTF))
+if test "$ac_cv_func_vprintf" != yes; then
+AC_FUNC_CHECK(_doprnt, AC_DEFINE(HAVE_DOPRNT))
 fi
 ])dnl
 dnl
@@ -619,7 +616,7 @@ define(AC_VFORK,
 AC_HEADER_CHECK(vfork.h, AC_DEFINE(HAVE_VFORK_H))
 AC_CHECKING(for working vfork)
 AC_REQUIRE([AC_RETSIGTYPE])
-AC_TEST_PROGRAM([/* Thanks to Paul Eggert for this test.  */
+AC_TEST_RUN([/* Thanks to Paul Eggert for this test.  */
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -704,7 +701,7 @@ main() {
 dnl
 define(AC_WAIT3,
 [AC_CHECKING(for wait3 that fills in rusage)
-AC_TEST_PROGRAM([#include <sys/types.h>
+AC_TEST_RUN([#include <sys/types.h>
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <stdio.h>
@@ -749,10 +746,12 @@ ac_decl="#ifdef __GNUC__
 #ifdef _AIX
  #pragma alloca
 #else
+#ifndef alloca /* predefined by HP cc +Olibcalls */
 char *alloca ();
 #endif
 #endif
 #endif
+#endif
 "
 AC_CHECKING([for alloca])
 AC_TEST_LINK($ac_decl,
@@ -780,7 +779,7 @@ AC_FUNC_CHECK([GETB67],AC_DEFINE([CRAY_STACKSEG_END],[GETB67]),
 AC_FUNC_CHECK([getb67],AC_DEFINE([CRAY_STACKSEG_END],[getb67])))))
 
 AC_CHECKING(stack direction for C alloca)
-AC_TEST_PROGRAM([find_stack_direction ()
+AC_TEST_RUN([find_stack_direction ()
 {
   static char *addr = 0;
   auto char dummy;
@@ -889,7 +888,7 @@ define(AC_UTIME_NULL,
 [AC_CHECKING(utime with null argument)
 rm -f conftestdata; > conftestdata
 # Sequent interprets utime(file, 0) to mean use start of epoch.  Wrong.
-AC_TEST_PROGRAM([#include <sys/types.h>
+AC_TEST_RUN([#include <sys/types.h>
 #include <sys/stat.h>
 main() {
 struct stat s, t;
@@ -901,7 +900,7 @@ rm -f core
 ])dnl
 dnl
 define(AC_STRCOLL, [AC_CHECKING(for strcoll)
-AC_TEST_PROGRAM([#include <string.h>
+AC_TEST_RUN([#include <string.h>
 main ()
 {
   exit (strcoll ("abc", "def") >= 0 ||
@@ -911,7 +910,7 @@ main ()
 dnl
 define(AC_SETVBUF_REVERSED,
 [AC_CHECKING(whether setvbuf arguments are reversed)
-AC_TEST_PROGRAM([#include <stdio.h>
+AC_TEST_RUN([#include <stdio.h>
 /* If setvbuf has the reversed format, exit 0. */
 main () {
   /* This call has the arguments reversed.
@@ -999,14 +998,14 @@ define(AC_CROSS_CHECK,
 [AC_PROVIDE([$0])dnl
 AC_CHECKING(whether cross-compiling)
 # If we cannot run a trivial program, we must be cross compiling.
-AC_TEST_PROGRAM([main(){exit(0);}], cross_compiling=, cross_compiling=yes)
+AC_TEST_RUN([main(){exit(0);}], cross_compiling=, cross_compiling=yes)
 if test "$cross_compiling" = yes; then
   AC_VERBOSE(we are cross-compiling)
 fi])dnl
 dnl
 define(AC_CHAR_UNSIGNED,
 [AC_CHECKING(for unsigned characters)
-AC_TEST_PROGRAM(
+AC_TEST_RUN(
 [/* volatile prevents gcc2 from optimizing the test away on sparcs.  */
 #if !__STDC__
 #define volatile
@@ -1023,10 +1022,10 @@ dnl
 define(AC_LONG_DOUBLE,
 [AC_REQUIRE([AC_PROG_CC])dnl
 AC_CHECKING(for long double)
-if test -n "$GCC"; then
+if test "$GCC" = yes; then
 AC_DEFINE(HAVE_LONG_DOUBLE)
 else
-AC_TEST_PROGRAM([int main() {
+AC_TEST_RUN([int main() {
 /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
 long double foo = 0.0;
 /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
@@ -1038,20 +1037,20 @@ dnl
 define(AC_INT_16_BITS,
 [AC_OBSOLETE([$0], [; instead use AC_SIZEOF_TYPE(int)])
 AC_CHECKING(integer size)
-AC_TEST_PROGRAM([main() { exit(sizeof(int) != 2); }],
+AC_TEST_RUN([main() { exit(sizeof(int) != 2); }],
  AC_DEFINE(INT_16_BITS))
 ])dnl
 dnl
 define(AC_LONG_64_BITS,
 [AC_OBSOLETE([$0], [; instead use AC_SIZEOF_TYPE(long)])
 AC_CHECKING(for 64-bit long ints)
-AC_TEST_PROGRAM([main() { exit(sizeof(long int) != 8); }],
+AC_TEST_RUN([main() { exit(sizeof(long int) != 8); }],
  AC_DEFINE(LONG_64_BITS))
 ])dnl
 dnl
 define(AC_WORDS_BIGENDIAN,
 [AC_CHECKING(byte ordering)
-AC_TEST_PROGRAM([main () {
+AC_TEST_RUN([main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
   union
   {
@@ -1065,7 +1064,7 @@ AC_TEST_PROGRAM([main () {
 dnl
 define(AC_ARG_ARRAY,
 [AC_CHECKING(whether the address of an argument can be used as an array)
-AC_TEST_PROGRAM([main() {
+AC_TEST_RUN([main() {
 /* Return 0 iff arg arrays are ok.  */
 exit(!x(1, 2, 3, 4));
 }
@@ -1186,7 +1185,7 @@ test "$ac_some_dir_failed" = yes || AC_DEFINE(HAVE_LONG_FILE_NAMES)
 dnl
 define(AC_RESTARTABLE_SYSCALLS,
 [AC_CHECKING(for restartable system calls)
-AC_TEST_PROGRAM(
+AC_TEST_RUN(
 [/* Exit 0 (true) if wait returns something other than -1,
    i.e. the pid of the child, which means that wait was restarted
    after getting the signal.  */
@@ -1373,8 +1372,8 @@ fi
 # It would also be nice to do this for all -L options, not just this one.
 if test -n "$x_libraries"; then
   X_LIBS="$X_LIBS -L$x_libraries"
-  if test "`(uname) 2>/dev/null`" = SunOS \
-     && uname -r | grep '^5' >/dev/null; then
+  if test "`(uname) 2>/dev/null`" = SunOS &&
+    uname -r | grep '^5' >/dev/null; then
     X_LIBS="$X_LIBS -R$x_libraries"
   fi
 fi
@@ -1410,13 +1409,13 @@ AC_SUBST(X_EXTRA_LIBS)dnl
 dnl
 dnl
 dnl ### Checks for UNIX variants
-dnl These are kludges; we need a better approach.
+dnl These are kludges; we need a more systematic approach.
 dnl
 dnl
 define(AC_AIX,
 [AC_CHECKING(for AIX)
 AC_BEFORE([$0], [AC_TEST_LINK])dnl
-AC_BEFORE([$0], [AC_TEST_PROGRAM])dnl
+AC_BEFORE([$0], [AC_TEST_RUN])dnl
 AC_BEFORE([$0], [AC_TEST_CPP])dnl
 AC_PROGRAM_EGREP(yes,
 [#ifdef _AIX
@@ -1427,7 +1426,7 @@ AC_PROGRAM_EGREP(yes,
 dnl
 define(AC_MINIX,
 [AC_BEFORE([$0], [AC_TEST_LINK])dnl
-AC_BEFORE([$0], [AC_TEST_PROGRAM])dnl
+AC_BEFORE([$0], [AC_TEST_RUN])dnl
 AC_BEFORE([$0], [AC_TEST_CPP])dnl
 AC_HEADER_CHECK(minix/config.h, MINIX=yes, MINIX=)
 # The Minix shell ca not assign to the same variable on the same line!
@@ -1441,7 +1440,7 @@ dnl
 define(AC_ISC_POSIX,
 [AC_PROVIDE([$0])dnl
 AC_BEFORE([$0], [AC_TEST_LINK])dnl
-AC_BEFORE([$0], [AC_TEST_PROGRAM])dnl
+AC_BEFORE([$0], [AC_TEST_RUN])dnl
 AC_BEFORE([$0], [AC_TEST_CPP])dnl
 AC_CHECKING(for POSIXized ISC)
 if test -d /etc/conf/kconfig.d &&
@@ -1449,7 +1448,7 @@ if test -d /etc/conf/kconfig.d &&
 then
   ISC=yes # If later tests want to check for ISC.
   AC_DEFINE(_POSIX_SOURCE)
-  if test -n "$GCC"; then
+  if test "$GCC" = yes; then
     CC="$CC -posix"
   else
     CC="$CC -Xp"