]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
rewrite AC_DEFINE
authorDavid MacKenzie <djm@djmnet.org>
Wed, 24 Aug 1994 06:41:01 +0000 (06:41 +0000)
committerDavid MacKenzie <djm@djmnet.org>
Wed, 24 Aug 1994 06:41:01 +0000 (06:41 +0000)
18 files changed:
Makefile.in
NEWS
README
TODO
acgeneral.m4
acspecific.m4
autoconf.texi
autoheader.in
autoheader.sh
autoreconf.in
autoreconf.sh
bin/autoheader.in
bin/autoreconf.in
configure.in
doc/Makefile.in
doc/autoconf.texi
lib/autoconf/general.m4
lib/autoconf/specific.m4

index 76b5b9a955b11ebab31b3d4248d71050baf1d1e5..fbbb39b0f8d4cc791514fa32664d98a4c1df60c2 100644 (file)
@@ -57,8 +57,7 @@ DISTFILES = COPYING ChangeLog ChangeLog.1 ChangeLog.0 INSTALL \
        acconfig.h acfunctions acgeneral.m4 acheaders acidentifiers \
        acmakevars acoldnames.m4 acprograms acspecific.m4 autoconf.info* \
        autoconf.m4 autoconf.sh autoconf.texi install.texi \
-       autoheader.sh autoreconf.sh autoscan.pl autoupdate.sh \
-       shindent.sh ifnames.sh \
+       autoheader.sh autoreconf.sh autoscan.pl autoupdate.sh ifnames.sh \
        config.guess config.sub configure configure.in \
        install.sh mkinstalldirs texinfo.tex \
        testsuite/Makefile.in testsuite/config/*.exp \
@@ -86,10 +85,6 @@ autoupdate: autoupdate.sh
        rm -f $@ $@.tmp
        $(editsh) $(srcdir)/autoupdate.sh > $@.tmp && mv $@.tmp $@ && chmod +x $@
 
-shindent: shindent.sh
-       rm -f $@ $@.tmp
-       $(editsh) $(srcdir)/shindent.sh > $@.tmp && mv $@.tmp $@ && chmod +x $@
-
 ifnames: ifnames.sh
        rm -f $@ $@.tmp
        $(editsh) $(srcdir)/ifnames.sh > $@.tmp && mv $@.tmp $@ && chmod +x $@
@@ -141,9 +136,6 @@ install: all acgeneral.m4 acoldnames.m4 acspecific.m4 acconfig.h \
        $(INSTALL_DATA) $(srcdir)/acconfig.h $(acdatadir)/acconfig.h
        -if test -f autoscan; then \
        $(INSTALL_PROGRAM) autoscan $(bindir)/autoscan; \
-       else :; fi
-       -if test -f shindent; then \
-       $(INSTALL_PROGRAM) shindent $(bindir)/shindent; \
        $(INSTALL_DATA) $(srcdir)/acfunctions $(acdatadir)/acfunctions; \
        $(INSTALL_DATA) $(srcdir)/acheaders $(acdatadir)/acheaders; \
        $(INSTALL_DATA) $(srcdir)/acidentifiers $(acdatadir)/acidentifiers; \
@@ -163,8 +155,7 @@ install-info: info installdirs
 
 uninstall:
        rm -f $(bindir)/autoconf $(bindir)/autoheader $(bindir)/autoscan 
-       rm -f $(bindir)/autoreconf $(bindir)/autoupdate
-       rm -f $(bindir)/shindent $(bindir)/ifnames 
+       rm -f $(bindir)/autoreconf $(bindir)/autoupdate $(bindir)/ifnames 
        rm -fr $(acdatadir)
        cd $(infodir); rm -f autoconf.info*
        if test -f standards.info || test -f $(srcdir)/standards.info; \
@@ -188,8 +179,7 @@ clean mostlyclean distclean realclean::
        done
 
 clean mostlyclean distclean realclean::
-       rm -f autoconf autoheader autoscan autoreconf autoupdate
-       rm -f shindent ifnames *.tmp 
+       rm -f autoconf autoheader autoscan autoreconf autoupdate ifnames *.tmp 
        rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log
        rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs *.ma *.mas
 
diff --git a/NEWS b/NEWS
index e33d812cc14efa911e919f4ece9cc49cfbe40962..0e710881048e6303b6c64f9dc0c6a984d4694ba4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -37,6 +37,7 @@ Major changes in release 2.0:
 * AC_OUTPUT and AC_CONFIG_HEADER allow you to override the input-file names.
 * AC_PROG_INSTALL looks for install.sh in the directory specified by
   AC_CONFIG_AUXDIR, or srcdir or srcdir/.. or srcdir/../.. by default.
+* AC_DEFINE and AC_DEFINE_UNQUOTED are more robust and smaller.
 * AC_DEFINE no longer prints anything, because of the new result reporting
   mechanism (AC_MSG_CHECKING and AC_MSG_RESULT).
 * AC_VERBOSE pays attention to --quiet/--silent, not --verbose.
@@ -51,8 +52,6 @@ Major changes in release 2.0:
 * autoreconf to recursively remake configure and configuration header
   files in a source tree.
 * autoupdate to update a configure.in to use the new macro names.
-* shindent to produce consistent indentation in shell scripts, such as
-  configure. 
 * ifnames to list the symbols used in #if and #ifdef directives in a
   source tree.
 
diff --git a/README b/README
index 7a4456fab9aa334af8a28b01bbf7148e7e6d9efd..fab94f1106ae07efb1364d6f5adde5923650cdfb 100644 (file)
--- a/README
+++ b/README
@@ -14,8 +14,8 @@ Autoconf, so that Autoconf's configure script can find it.  The
 configuration scripts produced by Autoconf are self-contained, so
 their users do not need to have Autoconf (or GNU m4).
 
-Also, some optional utilities that come with Autoconf use Perl, Bash,
-TCL, and the TCL packages Expect and DejaGNU.  However, none of those
+Also, some optional utilities that come with Autoconf use Perl, TCL,
+and the TCL packages Expect and DejaGNU.  However, none of those
 are required in order to use the main Autoconf program.  If they are
 not present, the affected Autoconf utilities will not be installed.
 
diff --git a/TODO b/TODO
index 63a9b5f5d22f8c020dd26fd6071762526eecbf98..a4d1b2ec21328426bc2830350c8896a371df8fd8 100644 (file)
--- a/TODO
+++ b/TODO
@@ -10,7 +10,7 @@ Required for 2.0:
 
 ------------------------------------------------------------------------------
 
-* Fix up quoting for AC_DEFINE; understand and integrate Jim Avera's patches.
+* Split up AC_SUBST substitutions using a loop to accomodate old seds.
 
 ------------------------------------------------------------------------------
 
@@ -21,6 +21,7 @@ Required for 2.0:
 * Fix AC_ARG_{ENABLE,WITH}, and AC_REQUIRE interrupting messages.
 
 ------------------------------------------------------------------------------
+
 \f
 Other things:
 
@@ -38,10 +39,6 @@ functions (POSIX, NIS) that do everything necessary, instead.
 
 ------------------------------------------------------------------------------
 
-* Add a --indent option to autoconf to call shindent.
-
-------------------------------------------------------------------------------
-
 * Doc: Add indexes of concepts, env vars.
 
 ------------------------------------------------------------------------------
index 0866d98fc62156265e21cefeaa619691f8c6291b..8f8ca60998e6835b6bde81856a4490b7efa6e7b6 100644 (file)
@@ -35,7 +35,7 @@ Install it before installing Autoconf or set the
 M4 environment variable to its path name.
 )m4exit(2)])dnl
 dnl
-define(AC_ACVERSION, 1.100)dnl
+define(AC_ACVERSION, 1.101)dnl
 dnl This is defined by the --version option of the autoconf script.
 ifdef([AC_PRINT_VERSION], [Autoconf version AC_ACVERSION
 m4exit(0)])dnl
@@ -53,12 +53,12 @@ divert(AC_DIVERSION_NORMAL)dnl
 dnl
 dnl Define a macro which automatically provides itself.
 dnl Use instead of define for macros to be used as functions.
-dnl
 dnl AC_DEFUN(NAME, EXPANSION)
 define([AC_DEFUN],
 [define($1,
 [define([AC_PROVIDE_$1], )][$2])])dnl
 dnl
+dnl AC_INIT_NOTICE()
 AC_DEFUN(AC_INIT_NOTICE,
 [# Guess values for system-dependent variables and create Makefiles.
 # Generated automatically using autoconf version] AC_ACVERSION [
@@ -79,6 +79,7 @@ AC_DEFUN(AC_INIT_NOTICE,
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 ])dnl
 dnl
+dnl AC_INIT_PARSE_ARGS()
 AC_DEFUN(AC_INIT_PARSE_ARGS,
 [AC_BEFORE([$0], [AC_ARG_ENABLE])dnl
 AC_BEFORE([$0], [AC_ARG_WITH])dnl
@@ -361,12 +362,13 @@ if test -n "$ac_prev"; then
 fi
 ])dnl
 dnl
-dnl Try to have only one #! line, just so it doesn't look funny.
-dnl
+dnl Try to have only one #! line, so the script doesn't look funny.
+dnl AC_BINSH()
 AC_DEFUN(AC_BINSH,
 [#!/bin/sh
 ])dnl
 dnl
+dnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR)
 AC_DEFUN(AC_INIT,
 [AC_REQUIRE([AC_BINSH])dnl
 AC_INIT_NOTICE
@@ -472,6 +474,11 @@ AC_CACHE_LOAD
 
 AC_LANG_C
 undivert(AC_DIVERSION_ARG)dnl
+dnl Substitute for predefined variables.
+AC_SUBST(LIBS)dnl
+AC_SUBST(prefix)dnl
+AC_SUBST(exec_prefix)dnl
+AC_SUBST(DEFS)dnl
 ])dnl
 dnl
 dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
@@ -537,30 +544,33 @@ AC_DEFUN(AC_REVISION,
 dnl
 dnl Subroutines of AC_PREREQ.
 dnl
-dnl Change the dots in version number $1 into commas.
+dnl Change the dots in NUMBER into commas.
+dnl AC_PREREQ_SPLIT(NUMBER)
 AC_DEFUN(AC_PREREQ_SPLIT,
 [translit($1, ., [, ])])dnl
 dnl
 dnl Default the ternary version number to 0 (e.g., 1, 7 -> 1, 7, 0).
+dnl AC_PREREQ_CANON(MAJOR, MINOR [,TERNARY])
 AC_DEFUN(AC_PREREQ_CANON,
 [$1, $2, ifelse([$3], , 0, [$3])])dnl
 dnl
-dnl Complain and exit if the version number in $1 through $3 is less than
-dnl the version number in $4 through $6.
-dnl $7 is the printable version of the second version number.
+dnl Complain and exit if version number 1 is less than version number 2.
+dnl PRINTABLE2 is the printable version of version number 2.
+dnl AC_PREREQ_COMPARE(MAJOR1, MINOR1, TERNARY1, MAJOR2, MINOR2, TERNARY2,
+dnl                   PRINTABLE2)
 AC_DEFUN(AC_PREREQ_COMPARE,
 [ifelse(builtin([eval],
 [$3 + $2 * 100 + $1 * 10000 < $6 + $5 * 100 + $4 * 10000]), 1,
 [errprint(Autoconf version $7 or higher is required
 )m4exit(3)])])dnl
 dnl
-dnl Complain and exit if the Autoconf version is less than $1.
+dnl Complain and exit if the Autoconf version is less than VERSION.
 dnl AC_PREREQ(VERSION)
 AC_DEFUN(AC_PREREQ,
 [AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
 AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1])])dnl
 dnl
-dnl Run configure in subdirectories $1.
+dnl Run configure in subdirectories DIR...
 dnl Not actually done until AC_OUTPUT_SUBDIRS.
 dnl AC_CONFIG_SUBDIRS(DIR ...)
 AC_DEFUN(AC_CONFIG_SUBDIRS,
@@ -586,7 +596,7 @@ changequote(<<, >>)dnl
 changequote([, ])dnl
   fi
 fi
-undefine(AC_VAR_NAME)dnl
+undefine([AC_VAR_NAME])dnl
 ])dnl
 AC_DEFUN(AC_PREFIX,
 [AC_OBSOLETE([$0], [; instead use AC_PREFIX_PROGRAM before AC_INIT])dnl
@@ -597,8 +607,8 @@ dnl ### Canonicalizing the system type
 dnl
 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 in directory DIR.  These are auxiliary files used in configuration.
+dnl DIR can be either absolute or relative to ${srcdir}.
 dnl AC_CONFIG_AUX_DIR(DIR)
 AC_DEFUN(AC_CONFIG_AUX_DIR,
 [AC_CONFIG_AUX_DIRS($1 ${srcdir}/$1)])dnl
@@ -738,8 +748,8 @@ AC_SUBST(build_vendor)dnl
 AC_SUBST(build_os)dnl
 ])dnl
 dnl
-dnl Link each of the existing files in $2 to the corresponding
-dnl link name in $1.
+dnl Link each of the existing files FILE... to the corresponding
+dnl link name in LINK...
 dnl Not actually done until AC_OUTPUT_LINKS.
 dnl AC_LINK_FILES(LINK ..., FILE ...)
 AC_DEFUN(AC_LINK_FILES,
@@ -750,6 +760,7 @@ dnl ### Caching test results
 dnl
 dnl
 dnl Look for site or system specific initialization scripts.
+dnl AC_SITE_LOAD()
 AC_DEFUN(AC_SITE_LOAD,
 [# Prefer explicitly selected file to automatically selected ones.
 if test ! -r "$CONFIG_SITE"; then
@@ -771,6 +782,7 @@ for ac_site_file in $CONFIG_SITE; do
 done
 ])dnl
 dnl
+dnl AC_CACHE_LOAD()
 AC_DEFUN(AC_CACHE_LOAD,
 [if test -r "$cache_file"; then
   echo "loading cache $cache_file"
@@ -781,10 +793,11 @@ else
 fi
 ])dnl
 dnl
+dnl AC_CACHE_SAVE()
 AC_DEFUN(AC_CACHE_SAVE,
 [if test -w $cache_file; then
 echo "updating cache $cache_file"
-cat > $cache_file <<\CEOF
+cat > $cache_file <<\EOF
 # 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.
@@ -798,7 +811,7 @@ cat > $cache_file <<\CEOF
 # Giving --cache-file=/dev/null disables caching, for debugging configure.
 # config.status only pays attention to the cache file if you give it the
 # --recheck option to rerun configure.
-CEOF
+EOF
 changequote(, )dnl
 dnl Allow a site initialization script to override cache values.
 # Ultrix sh set writes to stderr and can't be redirected directly.
@@ -809,8 +822,8 @@ echo "not updating unwritable cache $cache_file"
 fi
 ])dnl
 dnl
-dnl AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT)
 dnl The name of shell var CACHE-ID must contain `_cv_' in order to get saved.
+dnl AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT)
 AC_DEFUN(AC_CACHE_VAL,
 [AC_REQUIRE([AC_PROG_ECHO_N])dnl
 dnl We used to use the below line, but it fails if the 1st arg is a
@@ -827,95 +840,22 @@ dnl
 dnl ### Setting variables
 dnl
 dnl
-dnl Several simple subroutines to do various flavors of quoting.
-dnl
-dnl Quote $1 against shell "s.
-AC_DEFUN(AC_QUOTE_DQUOTE,
-[dnl We use \1 instead of \& to avoid an m4 1.0.3 bug.
-patsubst($1, changequote(, )\([$"`\\]\)changequote([, ]), \\\1)])dnl
-dnl
-dnl Quote $1 against shell 's.
-AC_DEFUN(AC_QUOTE_SQUOTE,
-[patsubst($1, ', '\\'')])dnl
-dnl
-dnl Quote $1 against shell here documents (<<EOF).
-AC_DEFUN(AC_QUOTE_HERE,
-[changequote({, })dnl
-dnl We use \1 instead of \& to avoid an m4 1.0.3 bug.
-patsubst(patsubst($1, \(\\[$`\\]\), \\\1), \([$`]\), \\\1){}dnl
-changequote([, ])])dnl
-dnl
-dnl Quote $1 against the right hand side of a sed substitution.
-AC_DEFUN(AC_QUOTE_SED,
-[changequote({, })dnl
-dnl We use \1 instead of \& to avoid an m4 1.0.3 bug.
-dnl % and @ and ! are commonly used as the sed s separator character.
-patsubst($1, \([&\\%@!]\), \\\1){}dnl
-changequote([, ])])dnl
-dnl
-dnl Quote $1 against tokenization.
-AC_DEFUN(AC_QUOTE_TOKEN,
-[changequote({, })dnl
-patsubst($1, \([        ]\), \\\1){}dnl
-changequote([, ])])dnl
-dnl
-dnl Subroutines of AC_DEFINE.  Does more quoting magic than any sane person
-dnl should be able to understand.  The point of it all is that what goes into
-dnl Makefile et al should be verbatim what was written in configure.in.
-AC_DEFUN(AC_DEFINE_QUOTE,
-[AC_QUOTE_TOKEN(AC_QUOTE_SQUOTE(AC_QUOTE_DQUOTE($1)))])dnl
-dnl
-AC_DEFUN(AC_DEFINE_SEDQUOTE,
-[AC_QUOTE_DQUOTE(AC_QUOTE_HERE(AC_QUOTE_HERE(AC_QUOTE_SED($1))))])dnl
-dnl
-dnl Don't compare $2 to a blank, so we can support "-Dfoo=".
-dnl If creating a configuration header file, we add
-dnl commands to ac_sed_defs to define the variable.  ac_[due][ABCD]
-dnl get defined in config.status.  Here we just insert the
-dnl variable parts of the string: the variable name to define
-dnl and the value to give it.
-dnl The newlines around the curly braces prevent sh syntax errors.
+dnl Set VARIABLE to VALUE, verbatim, or 1.
 dnl AC_DEFINE(VARIABLE [, VALUE])
 AC_DEFUN(AC_DEFINE,
-[
-{
-dnl Uniformly use AC_DEFINE_[SED]QUOTE, so callers of AC_DEFINE_UNQUOTED
-dnl can use AC_QUOTE_* manually if they want to.
-ifelse($#, 2,
-[define([AC_VAL], $2)dnl],
-[define([AC_VAL], 1)dnl])
-dnl
-echo "[#][define]" $1 "AC_QUOTE_SQUOTE(AC_VAL)" >> confdefs.h
-dnl Define DEFS even if AC_LIST_HEADERS for use in user case statements.
-DEFS="$DEFS -D$1=AC_QUOTE_SQUOTE(AC_VAL)"
-ifdef([AC_LIST_HEADERS],
-ac_sed_defs="dnl
-${ac_sed_defs}\${ac_dA}$1\${ac_dB}$1\${ac_dC}AC_DEFINE_SEDQUOTE(AC_VAL)\${ac_dD}
-\${ac_uA}$1\${ac_uB}$1\${ac_uC}AC_DEFINE_SEDQUOTE(AC_VAL)\${ac_uD}
-\${ac_eA}$1\${ac_eB}$1\${ac_eC}AC_DEFINE_SEDQUOTE(AC_VAL)\${ac_eD}
-"
-)dnl
-}
+[cat >> confdefs.h <<\EOF
+[#define] $1 ifelse($#, 2, [$2], 1)
+EOF
 ])dnl
 dnl
-dnl Unsafe version of AC_DEFINE.
-dnl Users are responsible for the quoting nightmare.
-dnl Well, not all of it.  We need to pull the identity function out to
-dnl the top level, because m4 doesn't really support nested functions;
-dnl it doesn't distinguish between the arguments to the outer
-dnl function, which should be expanded, and the arguments to the inner
-dnl function, which shouldn't yet.
-AC_DEFUN(AC_QUOTE_IDENTITY,
-$1)dnl
+dnl Similar, but perform shell substitutions $ ` \ once on VALUE.
 AC_DEFUN(AC_DEFINE_UNQUOTED,
-[pushdef([AC_QUOTE_SQUOTE], defn([AC_QUOTE_IDENTITY]))dnl
-pushdef([AC_DEFINE_SEDQUOTE], defn([AC_QUOTE_IDENTITY]))dnl
-AC_DEFINE($1, $2)dnl
-popdef([AC_DEFINE_SEDQUOTE])dnl
-popdef([AC_QUOTE_SQUOTE])dnl
+[cat >> confdefs.h <<EOF
+[#define] $1 ifelse($#, 2, [$2], 1)
+EOF
 ])dnl
 dnl
-dnl This macro protects the argument from being diverted twice
+dnl This macro protects VARIABLE from being diverted twice
 dnl if this macro is called twice for it.
 dnl AC_SUBST(VARIABLE)
 AC_DEFUN(AC_SUBST,
@@ -936,6 +876,7 @@ elif test -f ${srcdir}/$2; then
   AC_INSERT_FILE($1, ${srcdir}/$2)
 fi
 ])dnl
+dnl Internal subroutine of AC_SUBST_FILE.
 AC_DEFUN(AC_INSERT_FILE,
 [ifdef([AC_SUBST_$1], ,
 [define([AC_SUBST_$1], )dnl
@@ -954,6 +895,7 @@ AC_DEFUN(AC_MSG_CHECKING,
 [AC_REQUIRE([AC_PROG_ECHO_N])dnl
 echo $ac_n "checking $1""... $ac_c" 1>&AC_FD_MSG])dnl
 dnl
+dnl AC_CHECKING(FEATURE-DESCRIPTION)
 AC_DEFUN(AC_CHECKING,
 [echo "checking $1" 1>&AC_FD_MSG])dnl
 dnl
@@ -962,6 +904,7 @@ AC_DEFUN(AC_MSG_RESULT,
 [AC_REQUIRE([AC_PROG_ECHO_N])dnl
 echo "$ac_t""$1" 1>&AC_FD_MSG])dnl
 dnl
+dnl AC_VERBOSE(RESULT-DESCRIPTION)
 AC_DEFUN(AC_VERBOSE,
 [AC_OBSOLETE([$0], [; instead use AC_MSG_RESULT])dnl
 echo " $1" 1>&AC_FD_MSG])dnl
@@ -978,6 +921,7 @@ dnl
 dnl ### Selecting which language to use for testing
 dnl
 dnl
+dnl AC_LANG_C()
 AC_DEFUN(AC_LANG_C,
 [define([AC_LANG], [C])dnl
 ac_ext=c
@@ -986,6 +930,7 @@ ac_cpp='${CPP}'
 ac_compile='${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC'
 ])dnl
 dnl
+dnl AC_LANG_CPLUSPLUS()
 AC_DEFUN(AC_LANG_CPLUSPLUS,
 [define([AC_LANG], [CPLUSPLUS])dnl
 ac_ext=C
@@ -995,10 +940,13 @@ ac_compile='${CXX-gcc} $CXXFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1
 ])dnl
 dnl
 dnl Push the current language on a stack.
+dnl 
+dnl AC_LANG_SAVE()
 AC_DEFUN(AC_LANG_SAVE,
 [pushdef([AC_LANG_STACK], AC_LANG)])dnl
 dnl
 dnl Restore the current language from the stack.
+dnl AC_LANG_RESTORE()
 AC_DEFUN(AC_LANG_RESTORE,
 [ifelse(AC_LANG_STACK, C, [ifelse(AC_LANG, C, , [AC_LANG_C])], [ifelse(AC_LANG, CPLUSPLUS, , [AC_LANG_CPLUSPLUS])])[]popdef([AC_LANG_STACK])])dnl
 dnl
@@ -1029,7 +977,7 @@ dnl ### Checking for files - fundamental (caching)
 dnl
 dnl
 dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND
-dnl                  [, VALUE-IF-NOT-FOUND])
+dnl               [, VALUE-IF-NOT-FOUND])
 AC_DEFUN(AC_CHECK_PROG,
 [# Extract the first word of "$2", so it can be a program name with args.
 set dummy $2; ac_word=[$]2
@@ -1121,12 +1069,12 @@ ifelse([$3], , , [test -n "[$]$1" || $1="$3"
 ])])dnl
 dnl
 dnl AC_CHECK_LIB(LIBRARY, FUNCTION, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
-dnl                 [, OTHER-LIBRARIES]]])
+dnl              [, OTHER-LIBRARIES]]])
 AC_DEFUN(AC_CHECK_LIB,
-[changequote(/, /)dnl
-define(/AC_LIB_NAME/, dnl
-patsubst(patsubst($1, /lib\([^\.]*\)\.a/, /\1/), /-l/, //))dnl
-define(/AC_CV_NAME/, ac_cv_lib_//AC_LIB_NAME)dnl
+[changequote(<<, >>)dnl
+define(<<AC_LIB_NAME>>, dnl
+patsubst(patsubst($1, <<lib\([^\.]*\)\.a>>, <<\1>>), <<-l>>, <<>>))dnl
+define(<<AC_CV_NAME>>, ac_cv_lib_<<>>AC_LIB_NAME)dnl
 changequote([, ])dnl
 AC_MSG_CHECKING([for -l[]AC_LIB_NAME])
 AC_CACHE_VAL(AC_CV_NAME,
@@ -1145,8 +1093,8 @@ ifelse([$4], , , [else
   $4
 ])dnl
 fi
-undefine(AC_LIB_NAME)dnl
-undefine(AC_CV_NAME)dnl
+undefine([AC_LIB_NAME])dnl
+undefine([AC_CV_NAME])dnl
 ])dnl
 dnl
 dnl AC_HAVE_LIBRARY(LIBRARY, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
@@ -1168,7 +1116,7 @@ dnl
 dnl Because this macro is used by AC_PROG_GCC_TRADITIONAL, which must
 dnl come early, it is not included in AC_BEFORE checks.
 dnl AC_EGREP_CPP(PATTERN, PROGRAM, ACTION-IF-FOUND [,
-dnl                  ACTION-IF-NOT-FOUND])
+dnl              ACTION-IF-NOT-FOUND])
 AC_DEFUN(AC_EGREP_CPP,
 [AC_REQUIRE_CPP()dnl
 cat > conftest.${ac_ext} <<EOF
@@ -1198,7 +1146,7 @@ AC_TRY_LINK([$2], [$3], [$4], [$5])dnl
 ])dnl
 dnl
 dnl AC_TRY_LINK(INCLUDES, FUNCTION-BODY,
-dnl              ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
+dnl             ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
 AC_DEFUN(AC_TRY_LINK,
 [dnl We use return because because C++ requires a prototype for exit.
 cat > conftest.${ac_ext} <<EOF
@@ -1221,7 +1169,7 @@ rm -f conftest*]
 )dnl
 dnl
 dnl AC_TRY_RUN(PROGRAM, ACTION-IF-TRUE [, ACTION-IF-FALSE
-dnl             [, ACTION-IF-CROSS-COMPILING]])
+dnl            [, ACTION-IF-CROSS-COMPILING]])
 AC_DEFUN(AC_TRY_RUN,
 [AC_REQUIRE([AC_C_CROSS])dnl
 if test "$cross_compiling" = yes; then
@@ -1320,7 +1268,7 @@ AC_CHECK_FUNC(${ac_func},
 [changequote(, )dnl
   ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
 changequote([, ])dnl
-  AC_DEFINE(${ac_tr_func}) $2])dnl
+  AC_DEFINE_UNQUOTED(${ac_tr_func}) $2])dnl
 done
 ])dnl
 dnl
@@ -1333,7 +1281,7 @@ AC_CHECK_HEADER(${ac_hdr},
 [changequote(, )dnl
   ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./' '[A-Z]__'`
 changequote([, ])dnl
-  AC_DEFINE(${ac_tr_hdr}) $2])dnl
+  AC_DEFINE_UNQUOTED(${ac_tr_hdr}) $2])dnl
 done
 ])dnl
 dnl
@@ -1366,8 +1314,8 @@ main()
 }], AC_CV_NAME=`cat conftestval`)])dnl
 AC_MSG_RESULT($AC_CV_NAME)
 AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
-undefine(AC_TYPE_NAME)dnl
-undefine(AC_CV_NAME)dnl
+undefine([AC_TYPE_NAME])dnl
+undefine([AC_CV_NAME])dnl
 ])dnl
 dnl
 dnl AC_CHECK_TYPE(TYPE, DEFAULT)
@@ -1397,36 +1345,19 @@ 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.
 # If there is a colon in the path, we need to keep it.
-changequote(, )dnl
 if test "x$srcdir" = x.; then
+changequote(, )dnl
   ac_vpsub='/^[        ]*VPATH[        ]*=[^:]*$/d'
+changequote([, ])dnl
 fi
 
-# Quote sed substitution magic chars in DEFS.
-cat >conftest.def <<EOF
-$DEFS
-EOF
-ac_escape_ampersand_and_backslash='s%[&\\]%\\&%g'
-DEFS=`sed "$ac_escape_ampersand_and_backslash" <conftest.def`
-rm -f conftest.def
-# Substitute for predefined variables.
-changequote([, ])dnl
-AC_SUBST(LIBS)dnl
-AC_SUBST(prefix)dnl
-AC_SUBST(exec_prefix)dnl
-dnl Substituting for DEFS would confuse sed if it contains multiple lines.
-ifdef([AC_LIST_HEADERS],
-[divert(AC_DIVERSION_SED)dnl
-s%@DEFS@%-DHAVE_CONFIG_H%],
-[divert(AC_DIVERSION_SED)dnl
-s%@DEFS@%$DEFS%
-])dnl
-divert(AC_DIVERSION_NORMAL)dnl
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+ifdef([AC_LIST_HEADERS], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
 
 # Without the "./", some shells look in PATH for config.status.
 : ${CONFIG_STATUS=./config.status}
 
-trap "rm -f ${CONFIG_STATUS}; exit 1" 1 2 15
 echo creating ${CONFIG_STATUS}
 rm -f ${CONFIG_STATUS}
 cat > ${CONFIG_STATUS} <<EOF
@@ -1461,14 +1392,12 @@ do
   esac
 done
 
+ac_given_srcdir=$srcdir
+
 ifdef([AC_LIST_HEADERS],
 [trap 'rm -fr $1 AC_LIST_HEADERS conftest*; exit 1' 1 2 15],
 [trap 'rm -f $1; exit 1' 1 2 15])
 
-ac_given_srcdir=$srcdir
-
-EOF
-cat >> ${CONFIG_STATUS} <<\EOF
 AC_OUTPUT_FILES($1)
 ifdef([AC_LIST_HEADERS], [AC_OUTPUT_HEADER(AC_LIST_HEADERS)])dnl
 ifdef([AC_LIST_LINKS], [AC_OUTPUT_LINKS(AC_LIST_LINKS, AC_LIST_FILES)])dnl
@@ -1477,14 +1406,49 @@ exit 0
 EOF
 chmod +x ${CONFIG_STATUS}
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} ${CONFIG_STATUS}
-dnl config.status should never do recursion.
+dnl config.status should not do recursion.
 ifdef([AC_LIST_SUBDIRS], [AC_OUTPUT_SUBDIRS(AC_LIST_SUBDIRS)])dnl
 ])dnl
 dnl
-dnl This is a subroutine of AC_OUTPUT.  It is called inside a quoted
+dnl This is a subroutine of AC_OUTPUT.
+dnl AC_OUTPUT_MAKE_DEFS()
+AC_DEFUN(AC_OUTPUT_MAKE_DEFS,
+[# Transform confdefs.h into DEFS.
+dnl Using a here document instead of a string reduces the quoting nightmare.
+cat > conftest.defs <<\EOF
+changequote(<<, >>)dnl
+s%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g
+# Protect against shell expansion while executing Makefile rules.
+s%[ `~<<#>>$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+# Protect against Makefile macro expansion.
+s%\$%$$%g
+# Protect against being on the right side of a sed subst in config.status. 
+s/[\\&%]/\\&/g
+changequote([, ])dnl
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+])dnl
+dnl
+dnl This is a subroutine of AC_OUTPUT.  It is called inside an unquoted
 dnl here document whose contents are going into config.status.
+dnl AC_OUTPUT_FILES(FILE...)
 AC_DEFUN(AC_OUTPUT_FILES,
-[CONFIG_FILES=${CONFIG_FILES-"$1"}
+[cat > conftest.subs <<\CEOF
+dnl These here document variables are unquoted when configure runs
+dnl but quoted when config.status runs, so variables are expanded once.
+$ac_vpsub
+dnl Shell code in configure.in might set extrasub.
+$extrasub
+dnl Insert the sed substitutions of variables.
+undivert(AC_DIVERSION_SED)
+CEOF
+EOF
+cat >> ${CONFIG_STATUS} <<\EOF
+
+CONFIG_FILES=${CONFIG_FILES-"$1"}
 for ac_file in .. ${CONFIG_FILES}; do if test "x$ac_file" != x..; then
   # Support "outfile[:infile]", defaulting infile="outfile.in".
   case "$ac_file" in
@@ -1551,131 +1515,114 @@ a\\
 }
 " ;;
   esac
-  sed -e "
-$ac_comsub
-EOF
-cat >> ${CONFIG_STATUS} <<EOF
-$ac_vpsub
-dnl Shell code in configure.in might set extrasub.
-$extrasub
-dnl Insert the sed substitutions of variables.
-undivert(AC_DIVERSION_SED)
-s%@srcdir@%\$srcdir%g
-s%@top_srcdir@%\$top_srcdir%g
-ifdef([AC_PROVIDE_AC_PROG_INSTALL], [s%@INSTALL@%\$INSTALL%g
+  sed -e "$ac_comsub
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+ifdef([AC_PROVIDE_AC_PROG_INSTALL], [s%@INSTALL@%$INSTALL%g
 ])dnl
-EOF
-cat >> ${CONFIG_STATUS} <<\EOF
-" $ac_given_srcdir/$ac_file_in > $ac_file
+" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
 fi; done
+rm -f conftest.subs
 ])dnl
 dnl
-dnl Create the header files listed in $1.
 dnl This is a subroutine of AC_OUTPUT.  It is called inside a quoted
 dnl here document whose contents are going into config.status.
+dnl AC_OUTPUT_HEADER(HEADER-FILE...)
 AC_DEFUN(AC_OUTPUT_HEADER,
 [changequote(<<, >>)dnl
-# These sed commands are put into ac_sed_defs when defining a macro.
-# They are broken into pieces to make the sed script easier to manage.
-# They are passed to sed as "A NAME B NAME C VALUE D", where NAME
-# is the cpp macro being defined and VALUE is the value it is being given.
-# Each defining turns into a single global substitution command.
-# Hopefully no one uses "!" as a variable value.
-# Other candidates for the sed separators, like , and @, do get used.
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
 #
 # ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s!^\([  ]*\)#\([        ]*define[       ][      ]*\)'
-ac_dB='\([     ][      ]*\)[^  ]*!\1#\2'
+ac_dA='s%^\([  ]*\)#\([        ]*define[       ][      ]*\)'
+ac_dB='\([     ][      ]*\)[^  ]*%\1#\2'
 ac_dC='\3'
-ac_dD='!g'
+ac_dD='%g'
 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
-ac_uA='s!^\([  ]*\)#\([        ]*\)undef\([    ][      ]*\)'
-ac_uB='\([     ]\)!\1#\2define\3'
+ac_uA='s%^\([  ]*\)#\([        ]*\)undef\([    ][      ]*\)'
+ac_uB='\([     ]\)%\1#\2define\3'
 ac_uC=' '
-ac_uD='\4!g'
+ac_uD='\4%g'
 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_eA='s!^\([  ]*\)#\([        ]*\)undef\([    ][      ]*\)'
-ac_eB='<<$>>!\1#\2define\3'
+ac_eA='s%^\([  ]*\)#\([        ]*\)undef\([    ][      ]*\)'
+ac_eB='<<$>>%\1#\2define\3'
 ac_eC=' '
-ac_eD='!g'
+ac_eD='%g'
 changequote([, ])dnl
-rm -f conftest.sed
+
+CONFIG_HEADERS=${CONFIG_HEADERS-"$1"}
+for ac_file in .. ${CONFIG_HEADERS}; do if test "x$ac_file" != x..; then
+  # Support "outfile[:infile]", defaulting infile="outfile.in".
+  case "$ac_file" in
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
+       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+  *) ac_file_in="${ac_file}.in" ;;
+  esac
+
+  echo creating $ac_file
+
+  rm -f conftest.frag conftest.in conftest.out
+  cp $ac_given_srcdir/$ac_file_in conftest.in
+
 EOF
-# Turn off quoting long enough to insert the sed commands.
-rm -f conftest.sh
-cat > conftest.sh <<EOF
-$ac_sed_defs
+
+# Transform confdefs.h into a sed script conftest.vals that substitutes
+# the proper values into config.h.in to produce config.h.
+rm -f conftest.vals
+dnl Using a here document instead of a string reduces the quoting nightmare.
+cat > conftest.hdr <<\EOF
+changequote(<<, >>)dnl
+# Protect against being on the right side of a sed subst in config.status. 
+s/[\\&%]/\\&/g
+# Protect against being in an unquoted here document in config.status.
+s%[\\$`]%\\&%g
+s%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%ac_d%ac_u%gp
+s%ac_u%ac_e%gp
+changequote([, ])dnl
 EOF
+sed -n -f conftest.hdr confdefs.h > conftest.vals
+rm -f conftest.hdr
 
-# Break up $ac_sed_defs (now in conftest.sh) because some shells have a limit
-# on the size of here documents.
+# This sed command replaces #undef with comments.  This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >> conftest.vals <<\EOF
+changequote(, )dnl
+s%^[   ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+changequote([, ])dnl
+EOF
 
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
 # Maximum number of lines to put in a single here document.
-ac_max_sh_lines=9
+ac_max_here_lines=12
 
+rm -f conftest.tail
 while :
 do
-  # wc gives bogus results for an empty file on some AIX systems.
-  ac_lines=`grep -c . conftest.sh`
+  ac_lines=`grep -c . conftest.vals`
+  # grep -c gives empty output for an empty file on some AIX systems.
   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
-  rm -f conftest.s1 conftest.s2
-  sed ${ac_max_sh_lines}q conftest.sh > conftest.s1 # Like head -9.
-  sed 1,${ac_max_sh_lines}d conftest.sh > conftest.s2 # Like tail +10.
-  # Write a limited-size here document to append to conftest.sed.
-  echo 'cat >> conftest.sed <<CONFEOF' >> ${CONFIG_STATUS}
-  cat conftest.s1 >> ${CONFIG_STATUS}
-  echo 'CONFEOF' >> ${CONFIG_STATUS}
-  rm -f conftest.s1 conftest.sh
-  mv conftest.s2 conftest.sh
+  # Write a limited-size here document to conftest.frag.
+  echo '  cat > conftest.frag <<CEOF' >> ${CONFIG_STATUS}
+  sed ${ac_max_here_lines}q conftest.vals >> ${CONFIG_STATUS}
+  echo 'CEOF
+  sed -f conftest.frag conftest.in > conftest.out
+  mv conftest.out conftest.in
+' >> ${CONFIG_STATUS}
+  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+  mv conftest.tail conftest.vals
 done
-rm -f conftest.sh
+rm -f conftest.vals
 
 # Now back to your regularly scheduled config.status.
 cat >> ${CONFIG_STATUS} <<\EOF
-# This sed command replaces #undef with comments.  This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it in
-[#] $1.
-cat >> conftest.sed <<\CONFEOF
-changequote(, )dnl
-s,^[   ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
-changequote([, ])dnl
-CONFEOF
-rm -f conftest.h
-# Break up the sed commands because old seds have small limits.
-ac_max_sed_lines=20
-
-CONFIG_HEADERS=${CONFIG_HEADERS-"$1"}
-for ac_file in .. ${CONFIG_HEADERS}; do if test "x$ac_file" != x..; then
-  # Support "outfile[:infile]", defaulting infile="outfile.in".
-  case "$ac_file" in
-  *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
-       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
-  *) ac_file_in="${ac_file}.in" ;;
-  esac
-
-  echo creating $ac_file
-
-  cp $ac_given_srcdir/$ac_file_in conftest.h1
-  cp conftest.sed conftest.stm
-  while :
-  do
-    ac_lines=`grep -c . conftest.stm`
-    if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
-    rm -f conftest.s1 conftest.s2 conftest.h2
-    sed ${ac_max_sed_lines}q conftest.stm > conftest.s1 # Like head -20.
-    sed 1,${ac_max_sed_lines}d conftest.stm > conftest.s2 # Like tail +21.
-    sed -f conftest.s1 < conftest.h1 > conftest.h2
-    rm -f conftest.s1 conftest.h1 conftest.stm
-    mv conftest.h2 conftest.h1
-    mv conftest.s2 conftest.stm
-  done
-  rm -f conftest.stm conftest.h
+  rm -f conftest.frag conftest.h
   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
-  cat conftest.h1 >> conftest.h
-  rm -f conftest.h1
+  cat conftest.in >> conftest.h
+  rm -f conftest.in
   if cmp -s $ac_file conftest.h 2>/dev/null; then
-    # The file exists and we would not be changing it.
     echo "$ac_file is unchanged"
     rm -f conftest.h
   else
@@ -1683,10 +1630,10 @@ for ac_file in .. ${CONFIG_HEADERS}; do if test "x$ac_file" != x..; then
     mv conftest.h $ac_file
   fi
 fi; done
-rm -f conftest.sed
 
 ])dnl
 dnl
+dnl AC_OUTPUT_LINKS(DEST..., SOURCE...)
 AC_DEFUN(AC_OUTPUT_LINKS,
 [ac_links="$1"
 ac_files="$2"
@@ -1709,6 +1656,7 @@ while test -n "${ac_files}"; do
 done
 ])dnl
 dnl
+dnl AC_OUTPUT_SUBDIRS(DIRECTORY...)
 AC_DEFUN(AC_OUTPUT_SUBDIRS,
 [if test -z "${norecursion}"; then
 
index 214a2c56b34443e8de84d082301ccf08a1cb8f1a..85e932c2f2a6bb2e46af889d8128dda1f10c3cd1 100644 (file)
@@ -30,7 +30,8 @@ dnl Idea borrowed from dist 3.0.
 dnl Internal use only.
 AC_DEFUN(AC_PROG_ECHO_N,
 [if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
-  if (echo -n testing; echo 1,2,3) | grep -e -n > /dev/null; then
+  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn > /dev/null; then
     ac_n= ac_c='
 ' ac_t='       '
   else
@@ -87,15 +88,14 @@ if test $ac_cv_prog_gcc = yes; then
   AC_MSG_CHECKING(whether -traditional is needed)
 AC_CACHE_VAL(ac_cv_prog_gcc_traditional,
 [  ac_pattern="Autoconf.*'x'"
-  ac_prog='#include <sgtty.h>
-Autoconf TIOCGETP'
-  AC_EGREP_CPP($ac_pattern, $ac_prog,
+  AC_EGREP_CPP($ac_pattern, [#include <sgtty.h>
+Autoconf TIOCGETP],
   ac_cv_prog_gcc_traditional=yes, ac_cv_prog_gcc_traditional=no)
 
   if test $ac_cv_prog_gcc_traditional = no; then
-    ac_prog='#include <termio.h>
-Autoconf TCGETA'
-    AC_EGREP_CPP($ac_pattern, $ac_prog, ac_cv_prog_gcc_traditional=yes)
+    AC_EGREP_CPP($ac_pattern, [#include <termio.h>
+Autoconf TCGETA],
+    ac_cv_prog_gcc_traditional=yes)
   fi])dnl
   AC_MSG_RESULT($ac_cv_prog_gcc_traditional)
   if test $ac_cv_prog_gcc_traditional = yes; then
@@ -547,9 +547,10 @@ AC_DEFUN(AC_TYPE_GETGROUPS,
 [AC_REQUIRE([AC_TYPE_UID_T])dnl
 AC_MSG_CHECKING(type of array argument to getgroups)
 AC_CACHE_VAL(ac_cv_type_getgroups,
-[changequote(, )dnl
-dnl Do not put single quotes in the C program text!
-ac_prog='/* Thanks to Mike Rendell for this test.  */
+[AC_TRY_RUN(
+changequote(<<, >>)dnl
+<<
+/* Thanks to Mike Rendell for this test.  */
 #include <sys/types.h>
 #define NGID 256
 #undef MAX
@@ -568,9 +569,9 @@ main()
   /* Exit non-zero if getgroups seems to require an array of ints.  This
      happens when gid_t is short but getgroups modifies an array of ints.  */
   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
-}'
+}
+>>,
 changequote([, ])dnl
-AC_TRY_RUN([$ac_prog],
   ac_cv_type_getgroups=gid_t, ac_cv_type_getgroups=int)])dnl
 AC_MSG_RESULT($ac_cv_type_getgroups)
 AC_DEFINE_UNQUOTED(GETGROUPS_T, $ac_cv_type_getgroups)
@@ -1310,9 +1311,10 @@ AC_DEFUN(AC_C_CONST,
 dnl and with the result message.
 AC_MSG_CHECKING([for working const])
 AC_CACHE_VAL(ac_cv_c_const,
-[changequote(, )dnl
-dnl Do not put single quotes in the C program text!
-ac_prog='/* Ultrix mips cc rejects this.  */
+[AC_TRY_LINK(,
+changequote(<<, >>)dnl
+<<
+/* Ultrix mips cc rejects this.  */
 typedef int charset[2]; const charset x;
 /* SunOS 4.1.1 cc rejects this.  */
 char const *const *ccp;
@@ -1349,9 +1351,10 @@ ccp = (char const *const *) p;
 }
 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
   const int foo = 10;
-}'
+}
+>>,
 changequote([, ])dnl
-AC_TRY_LINK(, [$ac_prog], ac_cv_c_const=yes, ac_cv_c_const=no)])dnl
+ac_cv_c_const=yes, ac_cv_c_const=no)])dnl
 AC_MSG_RESULT($ac_cv_c_const)
 if test $ac_cv_c_const = no; then
   AC_DEFINE(const, )
index 15b5442dff57249fb6d13b352234f0350621c960..e2511df52284c1772348acb96a22f1df37110229 100644 (file)
@@ -6,8 +6,8 @@
 @c @setchapternewpage odd
 @c %**end of header
 
-@set EDITION 1.100
-@set VERSION 1.100
+@set EDITION 1.101
+@set VERSION 1.101
 @set UPDATED August 1994
 
 @iftex
@@ -120,7 +120,6 @@ Making @code{configure} Scripts
 * Invoking ifnames::            Listing the conditionals in source code.
 * Invoking autoreconf::         Remaking multiple @code{configure} scripts.
 * Invoking autoupdate::         Replacing old macro names in @code{configure.in}.
-* Invoking shindent::           Making @code{configure} scripts more readable.
 
 Specific Tests
 
@@ -383,7 +382,6 @@ Makefile.in ---'                    `-> Makefile ---'
 * Invoking ifnames::            Listing the conditionals in source code.
 * Invoking autoreconf::         Remaking multiple @code{configure} scripts.
 * Invoking autoupdate::         Replacing old macro names in @code{configure.in}.
-* Invoking shindent::           Making @code{configure} scripts more readable.
 @end menu
 
 @node Writing configure.in, Invoking autoconf, , Making configure Scripts
@@ -636,7 +634,7 @@ Print the name of each directory where @code{autoreconf} runs
 Print the version number of @code{autoreconf} and exit.
 @end table
 
-@node Invoking autoupdate, Invoking shindent, Invoking autoreconf, Making configure Scripts
+@node Invoking autoupdate, , Invoking autoreconf, Making configure Scripts
 @section Invoking autoupdate
 
 The @code{autoupdate} program updates a @file{configure.in} file that
@@ -674,56 +672,6 @@ default installation directory.
 Print the version number of @code{autoupdate} and exit.
 @end table
 
-@node Invoking shindent, , Invoking autoupdate, Making configure Scripts
-@section Invoking shindent
-
-Autoconf-generated @code{configure} scripts can be somewhat hard to
-read, because they @emph{look} machine-generated---mainly because they
-do not use whitespace rationally.  Unfortunately, it is impossible to do
-proper indentation using a macro processor like @code{m4}.  However, if
-you have GNU @code{bash} installed, you can use the @code{shindent}
-program, which uses @code{bash} to give a Bourne shell script readable
-indentation. 
-
-@code{shindent} indents each script named on the command line, backing
-up the original version with the suffix @file{~} (or the value of the
-environment variable @code{SIMPLE_BACKUP_SUFFIX}, if that is set).
-@code{shindent} places some restrictions on its input, due to the way it
-uses @code{bash} to do the indentation:
-
-@itemize @bullet
-@item
-It removes comments and blank lines between cases case statements.
-
-@item
-Doing odd things in case statements might cause odd problems.
-
-@item
-The script must not define any shell functions.
-
-@item
-If any string literals or here-documents contain lines that start
-with four spaces, those spaces will be removed.
-
-@item
-The script must not be @code{shindent} itself.
-@end itemize
-
-@noindent
-@code{shindent} accepts the following options:
-
-@table @code
-@item --help
-Print a summary of the command line options and exit.
-
-@item --macrodir=@var{dir}
-Look for the Autoconf macro files in directory @var{dir} instead of the
-default installation directory.  Only used to get the version number.
-
-@item --version
-Print the version number of @code{shindent} and exit.
-@end table
-
 @node Specific Tests, General Purpose Macros, Making configure Scripts, Top
 @chapter Specific Tests
 
@@ -2259,18 +2207,26 @@ variables.
 @defmac AC_DEFINE (@var{variable} @r{[}, @var{value}@r{]})
 @maindex DEFINE
 Define C preprocessor variable @var{variable}.  If @var{value} is given,
-set @var{variable} to that value, otherwise set it to 1.  To use a shell
-variable as the value, use @code{AC_DEFINE_UNQUOTED} instead and precede
-double quotes in the value with backslashes.
-
-This macro adds to the shell variable @code{DEFS}.  @code{AC_OUTPUT}
-later substitutes the values in @code{DEFS} into the file(s) that it
-generates (typically @file{Makefile}).  Alternately, if
-@code{AC_CONFIG_HEADER} has been called, @code{AC_OUTPUT} creates a
-header file by substituting the correct values into @code{#define}
-statements in a template file.
-
-For example, suppose your @file{configure.in} calls
+set @var{variable} to that value (verbatim), otherwise set it to 1.
+@var{value} should not contain literal newlines, and if you are not
+using @code{AC_CONFIG_HEADER} it should not contain any @samp{#}
+characters, as @code{make} tends to eat them.  To use a shell variable
+as the value, use @code{AC_DEFINE_UNQUOTED} instead.
+
+@code{AC_OUTPUT} substitutes the values defined by this macro as the
+variable @code{DEFS} in the file(s) that it generates (typically
+@file{Makefile}).  Unlike in Autoconf version 1, there is no variable
+@code{DEFS} defined while @code{configure} is running, so macros cannot
+check its value for the results of previous tests.  This difference is
+because properly quoting the contents of that variable turned out to be
+too cumbersome and inefficient to do every time @code{AC_DEFINE} is
+called.  Checking cache variable values is a cleaner way to get the
+effect of checking the value of @code{DEFS}.
+
+If @code{AC_CONFIG_HEADER} has been called, then instead of substituting
+@code{DEFS}, @code{AC_OUTPUT} creates a header file by substituting the
+correct values into @code{#define} statements in a template file.  For
+example, suppose your @file{configure.in} calls
 @code{AC_CONFIG_HEADER(conf.h)} and @code{AC_CHECK_HEADERS(unistd.h)}.
 You could have code like this in @file{conf.h.in}:
 
@@ -2326,15 +2282,14 @@ AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4); LIBS="$LIBS -lelf")
 
 @defmac AC_DEFINE_UNQUOTED (@var{variable} @r{[}, @var{value}@r{]})
 @maindex DEFINE_UNQUOTED
-Like @code{AC_DEFINE}, but it does nothing to quote @var{value} from
-various shell and @code{sed} expansions it will undergo.  @var{value}
-will be used in many different contexts requiring different quoting, and
-it is up to you to make sure it works right.  Use this macro instead of
-@code{AC_DEFINE} when @var{value} contains a shell variable.  For
+Like @code{AC_DEFINE}, but three shell expansions are performed once on
+@var{value}: variable expansion (@samp{$}), command substitution
+(@samp{`}), and backslash escaping (@samp{\}).  Use this macro instead
+of @code{AC_DEFINE} when @var{value} contains a shell variable.  For
 example:
 
 @example
-AC_DEFINE_UNQUOTED(config_machfile,  $@{machfile@})
+AC_DEFINE_UNQUOTED(config_machfile, "$@{machfile@}")
 @end example
 @end defmac
 
@@ -2977,12 +2932,6 @@ AC_CHECK_FUNC(_doprnt, AC_DEFINE(HAVE_DOPRNT))
 fi
 @end example
 
-@noindent
-Unlike in Autoconf version 1, there is no shell variable @code{DEFS} set
-while @code{configure} is running.  This difference is because properly
-quoting the contents of that variable turned out to be too cumbersome to
-do every time @code{AC_DEFINE} is called.
-
 @node Test Programs, Multiple Cases, Checking for Symbols, Writing Macros
 @section Test Programs
 
index 31c65a31d091679d002b96773be7726c29f41f24..dc0e6b461beba74bed3086a73ca74f6924a40b1b 100644 (file)
@@ -87,6 +87,9 @@ esac
 frob='define([AC_DEFINE],[#
 @@@syms="$syms $1"@@@
 ])dnl
+define([AC_DEFINE_UNQUOTED],[#
+@@@syms="$syms $1"@@@
+])dnl
 define([AC_SIZEOF_TYPE],[#
 @@@types="$types,$1"@@@
 ])dnl
index 31c65a31d091679d002b96773be7726c29f41f24..dc0e6b461beba74bed3086a73ca74f6924a40b1b 100644 (file)
@@ -87,6 +87,9 @@ esac
 frob='define([AC_DEFINE],[#
 @@@syms="$syms $1"@@@
 ])dnl
+define([AC_DEFINE_UNQUOTED],[#
+@@@syms="$syms $1"@@@
+])dnl
 define([AC_SIZEOF_TYPE],[#
 @@@types="$types,$1"@@@
 ])dnl
index 159e92966c0bac57ee8ee01294ffa5db9b897d9b..dd7dd883ebdfb0a81c262e4155d243e97097ac97 100644 (file)
@@ -66,7 +66,6 @@ while read confin; do
   cd $dir || exit 1
   test $verbose = yes && echo running autoconf in $dir
   autoconf
-  # FIXME maybe we should have an option to run shindent here.
   if grep AC_CONFIG_HEADER configure.in > /dev/null; then
     test $verbose = yes && echo running autoheader in $dir
     autoheader
index 159e92966c0bac57ee8ee01294ffa5db9b897d9b..dd7dd883ebdfb0a81c262e4155d243e97097ac97 100644 (file)
@@ -66,7 +66,6 @@ while read confin; do
   cd $dir || exit 1
   test $verbose = yes && echo running autoconf in $dir
   autoconf
-  # FIXME maybe we should have an option to run shindent here.
   if grep AC_CONFIG_HEADER configure.in > /dev/null; then
     test $verbose = yes && echo running autoheader in $dir
     autoheader
index 31c65a31d091679d002b96773be7726c29f41f24..dc0e6b461beba74bed3086a73ca74f6924a40b1b 100644 (file)
@@ -87,6 +87,9 @@ esac
 frob='define([AC_DEFINE],[#
 @@@syms="$syms $1"@@@
 ])dnl
+define([AC_DEFINE_UNQUOTED],[#
+@@@syms="$syms $1"@@@
+])dnl
 define([AC_SIZEOF_TYPE],[#
 @@@types="$types,$1"@@@
 ])dnl
index 159e92966c0bac57ee8ee01294ffa5db9b897d9b..dd7dd883ebdfb0a81c262e4155d243e97097ac97 100644 (file)
@@ -66,7 +66,6 @@ while read confin; do
   cd $dir || exit 1
   test $verbose = yes && echo running autoconf in $dir
   autoconf
-  # FIXME maybe we should have an option to run shindent here.
   if grep AC_CONFIG_HEADER configure.in > /dev/null; then
     test $verbose = yes && echo running autoheader in $dir
     autoheader
index d5bb7051c194a7fe7cd8f85b110d98500bdee419..e1cacb1d983c5277c3960749539a1e62614ee19b 100644 (file)
@@ -17,13 +17,6 @@ else
   AC_MSG_WARN(autoscan will not be built since perl is not found)
 fi
 
-AC_CHECK_PROG(BASH, bash, no-bash)
-if test "$BASH" != no-bash; then
-  PROGS="$PROGS shindent"
-else
-  AC_MSG_WARN(shindent will not be built since bash is not found)
-fi
-
 AC_PROG_INSTALL
 
 # Work with the GNU or Cygnus source tree layout.
index 76b5b9a955b11ebab31b3d4248d71050baf1d1e5..fbbb39b0f8d4cc791514fa32664d98a4c1df60c2 100644 (file)
@@ -57,8 +57,7 @@ DISTFILES = COPYING ChangeLog ChangeLog.1 ChangeLog.0 INSTALL \
        acconfig.h acfunctions acgeneral.m4 acheaders acidentifiers \
        acmakevars acoldnames.m4 acprograms acspecific.m4 autoconf.info* \
        autoconf.m4 autoconf.sh autoconf.texi install.texi \
-       autoheader.sh autoreconf.sh autoscan.pl autoupdate.sh \
-       shindent.sh ifnames.sh \
+       autoheader.sh autoreconf.sh autoscan.pl autoupdate.sh ifnames.sh \
        config.guess config.sub configure configure.in \
        install.sh mkinstalldirs texinfo.tex \
        testsuite/Makefile.in testsuite/config/*.exp \
@@ -86,10 +85,6 @@ autoupdate: autoupdate.sh
        rm -f $@ $@.tmp
        $(editsh) $(srcdir)/autoupdate.sh > $@.tmp && mv $@.tmp $@ && chmod +x $@
 
-shindent: shindent.sh
-       rm -f $@ $@.tmp
-       $(editsh) $(srcdir)/shindent.sh > $@.tmp && mv $@.tmp $@ && chmod +x $@
-
 ifnames: ifnames.sh
        rm -f $@ $@.tmp
        $(editsh) $(srcdir)/ifnames.sh > $@.tmp && mv $@.tmp $@ && chmod +x $@
@@ -141,9 +136,6 @@ install: all acgeneral.m4 acoldnames.m4 acspecific.m4 acconfig.h \
        $(INSTALL_DATA) $(srcdir)/acconfig.h $(acdatadir)/acconfig.h
        -if test -f autoscan; then \
        $(INSTALL_PROGRAM) autoscan $(bindir)/autoscan; \
-       else :; fi
-       -if test -f shindent; then \
-       $(INSTALL_PROGRAM) shindent $(bindir)/shindent; \
        $(INSTALL_DATA) $(srcdir)/acfunctions $(acdatadir)/acfunctions; \
        $(INSTALL_DATA) $(srcdir)/acheaders $(acdatadir)/acheaders; \
        $(INSTALL_DATA) $(srcdir)/acidentifiers $(acdatadir)/acidentifiers; \
@@ -163,8 +155,7 @@ install-info: info installdirs
 
 uninstall:
        rm -f $(bindir)/autoconf $(bindir)/autoheader $(bindir)/autoscan 
-       rm -f $(bindir)/autoreconf $(bindir)/autoupdate
-       rm -f $(bindir)/shindent $(bindir)/ifnames 
+       rm -f $(bindir)/autoreconf $(bindir)/autoupdate $(bindir)/ifnames 
        rm -fr $(acdatadir)
        cd $(infodir); rm -f autoconf.info*
        if test -f standards.info || test -f $(srcdir)/standards.info; \
@@ -188,8 +179,7 @@ clean mostlyclean distclean realclean::
        done
 
 clean mostlyclean distclean realclean::
-       rm -f autoconf autoheader autoscan autoreconf autoupdate
-       rm -f shindent ifnames *.tmp 
+       rm -f autoconf autoheader autoscan autoreconf autoupdate ifnames *.tmp 
        rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log
        rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs *.ma *.mas
 
index 15b5442dff57249fb6d13b352234f0350621c960..e2511df52284c1772348acb96a22f1df37110229 100644 (file)
@@ -6,8 +6,8 @@
 @c @setchapternewpage odd
 @c %**end of header
 
-@set EDITION 1.100
-@set VERSION 1.100
+@set EDITION 1.101
+@set VERSION 1.101
 @set UPDATED August 1994
 
 @iftex
@@ -120,7 +120,6 @@ Making @code{configure} Scripts
 * Invoking ifnames::            Listing the conditionals in source code.
 * Invoking autoreconf::         Remaking multiple @code{configure} scripts.
 * Invoking autoupdate::         Replacing old macro names in @code{configure.in}.
-* Invoking shindent::           Making @code{configure} scripts more readable.
 
 Specific Tests
 
@@ -383,7 +382,6 @@ Makefile.in ---'                    `-> Makefile ---'
 * Invoking ifnames::            Listing the conditionals in source code.
 * Invoking autoreconf::         Remaking multiple @code{configure} scripts.
 * Invoking autoupdate::         Replacing old macro names in @code{configure.in}.
-* Invoking shindent::           Making @code{configure} scripts more readable.
 @end menu
 
 @node Writing configure.in, Invoking autoconf, , Making configure Scripts
@@ -636,7 +634,7 @@ Print the name of each directory where @code{autoreconf} runs
 Print the version number of @code{autoreconf} and exit.
 @end table
 
-@node Invoking autoupdate, Invoking shindent, Invoking autoreconf, Making configure Scripts
+@node Invoking autoupdate, , Invoking autoreconf, Making configure Scripts
 @section Invoking autoupdate
 
 The @code{autoupdate} program updates a @file{configure.in} file that
@@ -674,56 +672,6 @@ default installation directory.
 Print the version number of @code{autoupdate} and exit.
 @end table
 
-@node Invoking shindent, , Invoking autoupdate, Making configure Scripts
-@section Invoking shindent
-
-Autoconf-generated @code{configure} scripts can be somewhat hard to
-read, because they @emph{look} machine-generated---mainly because they
-do not use whitespace rationally.  Unfortunately, it is impossible to do
-proper indentation using a macro processor like @code{m4}.  However, if
-you have GNU @code{bash} installed, you can use the @code{shindent}
-program, which uses @code{bash} to give a Bourne shell script readable
-indentation. 
-
-@code{shindent} indents each script named on the command line, backing
-up the original version with the suffix @file{~} (or the value of the
-environment variable @code{SIMPLE_BACKUP_SUFFIX}, if that is set).
-@code{shindent} places some restrictions on its input, due to the way it
-uses @code{bash} to do the indentation:
-
-@itemize @bullet
-@item
-It removes comments and blank lines between cases case statements.
-
-@item
-Doing odd things in case statements might cause odd problems.
-
-@item
-The script must not define any shell functions.
-
-@item
-If any string literals or here-documents contain lines that start
-with four spaces, those spaces will be removed.
-
-@item
-The script must not be @code{shindent} itself.
-@end itemize
-
-@noindent
-@code{shindent} accepts the following options:
-
-@table @code
-@item --help
-Print a summary of the command line options and exit.
-
-@item --macrodir=@var{dir}
-Look for the Autoconf macro files in directory @var{dir} instead of the
-default installation directory.  Only used to get the version number.
-
-@item --version
-Print the version number of @code{shindent} and exit.
-@end table
-
 @node Specific Tests, General Purpose Macros, Making configure Scripts, Top
 @chapter Specific Tests
 
@@ -2259,18 +2207,26 @@ variables.
 @defmac AC_DEFINE (@var{variable} @r{[}, @var{value}@r{]})
 @maindex DEFINE
 Define C preprocessor variable @var{variable}.  If @var{value} is given,
-set @var{variable} to that value, otherwise set it to 1.  To use a shell
-variable as the value, use @code{AC_DEFINE_UNQUOTED} instead and precede
-double quotes in the value with backslashes.
-
-This macro adds to the shell variable @code{DEFS}.  @code{AC_OUTPUT}
-later substitutes the values in @code{DEFS} into the file(s) that it
-generates (typically @file{Makefile}).  Alternately, if
-@code{AC_CONFIG_HEADER} has been called, @code{AC_OUTPUT} creates a
-header file by substituting the correct values into @code{#define}
-statements in a template file.
-
-For example, suppose your @file{configure.in} calls
+set @var{variable} to that value (verbatim), otherwise set it to 1.
+@var{value} should not contain literal newlines, and if you are not
+using @code{AC_CONFIG_HEADER} it should not contain any @samp{#}
+characters, as @code{make} tends to eat them.  To use a shell variable
+as the value, use @code{AC_DEFINE_UNQUOTED} instead.
+
+@code{AC_OUTPUT} substitutes the values defined by this macro as the
+variable @code{DEFS} in the file(s) that it generates (typically
+@file{Makefile}).  Unlike in Autoconf version 1, there is no variable
+@code{DEFS} defined while @code{configure} is running, so macros cannot
+check its value for the results of previous tests.  This difference is
+because properly quoting the contents of that variable turned out to be
+too cumbersome and inefficient to do every time @code{AC_DEFINE} is
+called.  Checking cache variable values is a cleaner way to get the
+effect of checking the value of @code{DEFS}.
+
+If @code{AC_CONFIG_HEADER} has been called, then instead of substituting
+@code{DEFS}, @code{AC_OUTPUT} creates a header file by substituting the
+correct values into @code{#define} statements in a template file.  For
+example, suppose your @file{configure.in} calls
 @code{AC_CONFIG_HEADER(conf.h)} and @code{AC_CHECK_HEADERS(unistd.h)}.
 You could have code like this in @file{conf.h.in}:
 
@@ -2326,15 +2282,14 @@ AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4); LIBS="$LIBS -lelf")
 
 @defmac AC_DEFINE_UNQUOTED (@var{variable} @r{[}, @var{value}@r{]})
 @maindex DEFINE_UNQUOTED
-Like @code{AC_DEFINE}, but it does nothing to quote @var{value} from
-various shell and @code{sed} expansions it will undergo.  @var{value}
-will be used in many different contexts requiring different quoting, and
-it is up to you to make sure it works right.  Use this macro instead of
-@code{AC_DEFINE} when @var{value} contains a shell variable.  For
+Like @code{AC_DEFINE}, but three shell expansions are performed once on
+@var{value}: variable expansion (@samp{$}), command substitution
+(@samp{`}), and backslash escaping (@samp{\}).  Use this macro instead
+of @code{AC_DEFINE} when @var{value} contains a shell variable.  For
 example:
 
 @example
-AC_DEFINE_UNQUOTED(config_machfile,  $@{machfile@})
+AC_DEFINE_UNQUOTED(config_machfile, "$@{machfile@}")
 @end example
 @end defmac
 
@@ -2977,12 +2932,6 @@ AC_CHECK_FUNC(_doprnt, AC_DEFINE(HAVE_DOPRNT))
 fi
 @end example
 
-@noindent
-Unlike in Autoconf version 1, there is no shell variable @code{DEFS} set
-while @code{configure} is running.  This difference is because properly
-quoting the contents of that variable turned out to be too cumbersome to
-do every time @code{AC_DEFINE} is called.
-
 @node Test Programs, Multiple Cases, Checking for Symbols, Writing Macros
 @section Test Programs
 
index 0866d98fc62156265e21cefeaa619691f8c6291b..8f8ca60998e6835b6bde81856a4490b7efa6e7b6 100644 (file)
@@ -35,7 +35,7 @@ Install it before installing Autoconf or set the
 M4 environment variable to its path name.
 )m4exit(2)])dnl
 dnl
-define(AC_ACVERSION, 1.100)dnl
+define(AC_ACVERSION, 1.101)dnl
 dnl This is defined by the --version option of the autoconf script.
 ifdef([AC_PRINT_VERSION], [Autoconf version AC_ACVERSION
 m4exit(0)])dnl
@@ -53,12 +53,12 @@ divert(AC_DIVERSION_NORMAL)dnl
 dnl
 dnl Define a macro which automatically provides itself.
 dnl Use instead of define for macros to be used as functions.
-dnl
 dnl AC_DEFUN(NAME, EXPANSION)
 define([AC_DEFUN],
 [define($1,
 [define([AC_PROVIDE_$1], )][$2])])dnl
 dnl
+dnl AC_INIT_NOTICE()
 AC_DEFUN(AC_INIT_NOTICE,
 [# Guess values for system-dependent variables and create Makefiles.
 # Generated automatically using autoconf version] AC_ACVERSION [
@@ -79,6 +79,7 @@ AC_DEFUN(AC_INIT_NOTICE,
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 ])dnl
 dnl
+dnl AC_INIT_PARSE_ARGS()
 AC_DEFUN(AC_INIT_PARSE_ARGS,
 [AC_BEFORE([$0], [AC_ARG_ENABLE])dnl
 AC_BEFORE([$0], [AC_ARG_WITH])dnl
@@ -361,12 +362,13 @@ if test -n "$ac_prev"; then
 fi
 ])dnl
 dnl
-dnl Try to have only one #! line, just so it doesn't look funny.
-dnl
+dnl Try to have only one #! line, so the script doesn't look funny.
+dnl AC_BINSH()
 AC_DEFUN(AC_BINSH,
 [#!/bin/sh
 ])dnl
 dnl
+dnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR)
 AC_DEFUN(AC_INIT,
 [AC_REQUIRE([AC_BINSH])dnl
 AC_INIT_NOTICE
@@ -472,6 +474,11 @@ AC_CACHE_LOAD
 
 AC_LANG_C
 undivert(AC_DIVERSION_ARG)dnl
+dnl Substitute for predefined variables.
+AC_SUBST(LIBS)dnl
+AC_SUBST(prefix)dnl
+AC_SUBST(exec_prefix)dnl
+AC_SUBST(DEFS)dnl
 ])dnl
 dnl
 dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
@@ -537,30 +544,33 @@ AC_DEFUN(AC_REVISION,
 dnl
 dnl Subroutines of AC_PREREQ.
 dnl
-dnl Change the dots in version number $1 into commas.
+dnl Change the dots in NUMBER into commas.
+dnl AC_PREREQ_SPLIT(NUMBER)
 AC_DEFUN(AC_PREREQ_SPLIT,
 [translit($1, ., [, ])])dnl
 dnl
 dnl Default the ternary version number to 0 (e.g., 1, 7 -> 1, 7, 0).
+dnl AC_PREREQ_CANON(MAJOR, MINOR [,TERNARY])
 AC_DEFUN(AC_PREREQ_CANON,
 [$1, $2, ifelse([$3], , 0, [$3])])dnl
 dnl
-dnl Complain and exit if the version number in $1 through $3 is less than
-dnl the version number in $4 through $6.
-dnl $7 is the printable version of the second version number.
+dnl Complain and exit if version number 1 is less than version number 2.
+dnl PRINTABLE2 is the printable version of version number 2.
+dnl AC_PREREQ_COMPARE(MAJOR1, MINOR1, TERNARY1, MAJOR2, MINOR2, TERNARY2,
+dnl                   PRINTABLE2)
 AC_DEFUN(AC_PREREQ_COMPARE,
 [ifelse(builtin([eval],
 [$3 + $2 * 100 + $1 * 10000 < $6 + $5 * 100 + $4 * 10000]), 1,
 [errprint(Autoconf version $7 or higher is required
 )m4exit(3)])])dnl
 dnl
-dnl Complain and exit if the Autoconf version is less than $1.
+dnl Complain and exit if the Autoconf version is less than VERSION.
 dnl AC_PREREQ(VERSION)
 AC_DEFUN(AC_PREREQ,
 [AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)),
 AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1])])dnl
 dnl
-dnl Run configure in subdirectories $1.
+dnl Run configure in subdirectories DIR...
 dnl Not actually done until AC_OUTPUT_SUBDIRS.
 dnl AC_CONFIG_SUBDIRS(DIR ...)
 AC_DEFUN(AC_CONFIG_SUBDIRS,
@@ -586,7 +596,7 @@ changequote(<<, >>)dnl
 changequote([, ])dnl
   fi
 fi
-undefine(AC_VAR_NAME)dnl
+undefine([AC_VAR_NAME])dnl
 ])dnl
 AC_DEFUN(AC_PREFIX,
 [AC_OBSOLETE([$0], [; instead use AC_PREFIX_PROGRAM before AC_INIT])dnl
@@ -597,8 +607,8 @@ dnl ### Canonicalizing the system type
 dnl
 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 in directory DIR.  These are auxiliary files used in configuration.
+dnl DIR can be either absolute or relative to ${srcdir}.
 dnl AC_CONFIG_AUX_DIR(DIR)
 AC_DEFUN(AC_CONFIG_AUX_DIR,
 [AC_CONFIG_AUX_DIRS($1 ${srcdir}/$1)])dnl
@@ -738,8 +748,8 @@ AC_SUBST(build_vendor)dnl
 AC_SUBST(build_os)dnl
 ])dnl
 dnl
-dnl Link each of the existing files in $2 to the corresponding
-dnl link name in $1.
+dnl Link each of the existing files FILE... to the corresponding
+dnl link name in LINK...
 dnl Not actually done until AC_OUTPUT_LINKS.
 dnl AC_LINK_FILES(LINK ..., FILE ...)
 AC_DEFUN(AC_LINK_FILES,
@@ -750,6 +760,7 @@ dnl ### Caching test results
 dnl
 dnl
 dnl Look for site or system specific initialization scripts.
+dnl AC_SITE_LOAD()
 AC_DEFUN(AC_SITE_LOAD,
 [# Prefer explicitly selected file to automatically selected ones.
 if test ! -r "$CONFIG_SITE"; then
@@ -771,6 +782,7 @@ for ac_site_file in $CONFIG_SITE; do
 done
 ])dnl
 dnl
+dnl AC_CACHE_LOAD()
 AC_DEFUN(AC_CACHE_LOAD,
 [if test -r "$cache_file"; then
   echo "loading cache $cache_file"
@@ -781,10 +793,11 @@ else
 fi
 ])dnl
 dnl
+dnl AC_CACHE_SAVE()
 AC_DEFUN(AC_CACHE_SAVE,
 [if test -w $cache_file; then
 echo "updating cache $cache_file"
-cat > $cache_file <<\CEOF
+cat > $cache_file <<\EOF
 # 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.
@@ -798,7 +811,7 @@ cat > $cache_file <<\CEOF
 # Giving --cache-file=/dev/null disables caching, for debugging configure.
 # config.status only pays attention to the cache file if you give it the
 # --recheck option to rerun configure.
-CEOF
+EOF
 changequote(, )dnl
 dnl Allow a site initialization script to override cache values.
 # Ultrix sh set writes to stderr and can't be redirected directly.
@@ -809,8 +822,8 @@ echo "not updating unwritable cache $cache_file"
 fi
 ])dnl
 dnl
-dnl AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT)
 dnl The name of shell var CACHE-ID must contain `_cv_' in order to get saved.
+dnl AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT)
 AC_DEFUN(AC_CACHE_VAL,
 [AC_REQUIRE([AC_PROG_ECHO_N])dnl
 dnl We used to use the below line, but it fails if the 1st arg is a
@@ -827,95 +840,22 @@ dnl
 dnl ### Setting variables
 dnl
 dnl
-dnl Several simple subroutines to do various flavors of quoting.
-dnl
-dnl Quote $1 against shell "s.
-AC_DEFUN(AC_QUOTE_DQUOTE,
-[dnl We use \1 instead of \& to avoid an m4 1.0.3 bug.
-patsubst($1, changequote(, )\([$"`\\]\)changequote([, ]), \\\1)])dnl
-dnl
-dnl Quote $1 against shell 's.
-AC_DEFUN(AC_QUOTE_SQUOTE,
-[patsubst($1, ', '\\'')])dnl
-dnl
-dnl Quote $1 against shell here documents (<<EOF).
-AC_DEFUN(AC_QUOTE_HERE,
-[changequote({, })dnl
-dnl We use \1 instead of \& to avoid an m4 1.0.3 bug.
-patsubst(patsubst($1, \(\\[$`\\]\), \\\1), \([$`]\), \\\1){}dnl
-changequote([, ])])dnl
-dnl
-dnl Quote $1 against the right hand side of a sed substitution.
-AC_DEFUN(AC_QUOTE_SED,
-[changequote({, })dnl
-dnl We use \1 instead of \& to avoid an m4 1.0.3 bug.
-dnl % and @ and ! are commonly used as the sed s separator character.
-patsubst($1, \([&\\%@!]\), \\\1){}dnl
-changequote([, ])])dnl
-dnl
-dnl Quote $1 against tokenization.
-AC_DEFUN(AC_QUOTE_TOKEN,
-[changequote({, })dnl
-patsubst($1, \([        ]\), \\\1){}dnl
-changequote([, ])])dnl
-dnl
-dnl Subroutines of AC_DEFINE.  Does more quoting magic than any sane person
-dnl should be able to understand.  The point of it all is that what goes into
-dnl Makefile et al should be verbatim what was written in configure.in.
-AC_DEFUN(AC_DEFINE_QUOTE,
-[AC_QUOTE_TOKEN(AC_QUOTE_SQUOTE(AC_QUOTE_DQUOTE($1)))])dnl
-dnl
-AC_DEFUN(AC_DEFINE_SEDQUOTE,
-[AC_QUOTE_DQUOTE(AC_QUOTE_HERE(AC_QUOTE_HERE(AC_QUOTE_SED($1))))])dnl
-dnl
-dnl Don't compare $2 to a blank, so we can support "-Dfoo=".
-dnl If creating a configuration header file, we add
-dnl commands to ac_sed_defs to define the variable.  ac_[due][ABCD]
-dnl get defined in config.status.  Here we just insert the
-dnl variable parts of the string: the variable name to define
-dnl and the value to give it.
-dnl The newlines around the curly braces prevent sh syntax errors.
+dnl Set VARIABLE to VALUE, verbatim, or 1.
 dnl AC_DEFINE(VARIABLE [, VALUE])
 AC_DEFUN(AC_DEFINE,
-[
-{
-dnl Uniformly use AC_DEFINE_[SED]QUOTE, so callers of AC_DEFINE_UNQUOTED
-dnl can use AC_QUOTE_* manually if they want to.
-ifelse($#, 2,
-[define([AC_VAL], $2)dnl],
-[define([AC_VAL], 1)dnl])
-dnl
-echo "[#][define]" $1 "AC_QUOTE_SQUOTE(AC_VAL)" >> confdefs.h
-dnl Define DEFS even if AC_LIST_HEADERS for use in user case statements.
-DEFS="$DEFS -D$1=AC_QUOTE_SQUOTE(AC_VAL)"
-ifdef([AC_LIST_HEADERS],
-ac_sed_defs="dnl
-${ac_sed_defs}\${ac_dA}$1\${ac_dB}$1\${ac_dC}AC_DEFINE_SEDQUOTE(AC_VAL)\${ac_dD}
-\${ac_uA}$1\${ac_uB}$1\${ac_uC}AC_DEFINE_SEDQUOTE(AC_VAL)\${ac_uD}
-\${ac_eA}$1\${ac_eB}$1\${ac_eC}AC_DEFINE_SEDQUOTE(AC_VAL)\${ac_eD}
-"
-)dnl
-}
+[cat >> confdefs.h <<\EOF
+[#define] $1 ifelse($#, 2, [$2], 1)
+EOF
 ])dnl
 dnl
-dnl Unsafe version of AC_DEFINE.
-dnl Users are responsible for the quoting nightmare.
-dnl Well, not all of it.  We need to pull the identity function out to
-dnl the top level, because m4 doesn't really support nested functions;
-dnl it doesn't distinguish between the arguments to the outer
-dnl function, which should be expanded, and the arguments to the inner
-dnl function, which shouldn't yet.
-AC_DEFUN(AC_QUOTE_IDENTITY,
-$1)dnl
+dnl Similar, but perform shell substitutions $ ` \ once on VALUE.
 AC_DEFUN(AC_DEFINE_UNQUOTED,
-[pushdef([AC_QUOTE_SQUOTE], defn([AC_QUOTE_IDENTITY]))dnl
-pushdef([AC_DEFINE_SEDQUOTE], defn([AC_QUOTE_IDENTITY]))dnl
-AC_DEFINE($1, $2)dnl
-popdef([AC_DEFINE_SEDQUOTE])dnl
-popdef([AC_QUOTE_SQUOTE])dnl
+[cat >> confdefs.h <<EOF
+[#define] $1 ifelse($#, 2, [$2], 1)
+EOF
 ])dnl
 dnl
-dnl This macro protects the argument from being diverted twice
+dnl This macro protects VARIABLE from being diverted twice
 dnl if this macro is called twice for it.
 dnl AC_SUBST(VARIABLE)
 AC_DEFUN(AC_SUBST,
@@ -936,6 +876,7 @@ elif test -f ${srcdir}/$2; then
   AC_INSERT_FILE($1, ${srcdir}/$2)
 fi
 ])dnl
+dnl Internal subroutine of AC_SUBST_FILE.
 AC_DEFUN(AC_INSERT_FILE,
 [ifdef([AC_SUBST_$1], ,
 [define([AC_SUBST_$1], )dnl
@@ -954,6 +895,7 @@ AC_DEFUN(AC_MSG_CHECKING,
 [AC_REQUIRE([AC_PROG_ECHO_N])dnl
 echo $ac_n "checking $1""... $ac_c" 1>&AC_FD_MSG])dnl
 dnl
+dnl AC_CHECKING(FEATURE-DESCRIPTION)
 AC_DEFUN(AC_CHECKING,
 [echo "checking $1" 1>&AC_FD_MSG])dnl
 dnl
@@ -962,6 +904,7 @@ AC_DEFUN(AC_MSG_RESULT,
 [AC_REQUIRE([AC_PROG_ECHO_N])dnl
 echo "$ac_t""$1" 1>&AC_FD_MSG])dnl
 dnl
+dnl AC_VERBOSE(RESULT-DESCRIPTION)
 AC_DEFUN(AC_VERBOSE,
 [AC_OBSOLETE([$0], [; instead use AC_MSG_RESULT])dnl
 echo " $1" 1>&AC_FD_MSG])dnl
@@ -978,6 +921,7 @@ dnl
 dnl ### Selecting which language to use for testing
 dnl
 dnl
+dnl AC_LANG_C()
 AC_DEFUN(AC_LANG_C,
 [define([AC_LANG], [C])dnl
 ac_ext=c
@@ -986,6 +930,7 @@ ac_cpp='${CPP}'
 ac_compile='${CC-cc} $CFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1>&AC_FD_CC 2>&AC_FD_CC'
 ])dnl
 dnl
+dnl AC_LANG_CPLUSPLUS()
 AC_DEFUN(AC_LANG_CPLUSPLUS,
 [define([AC_LANG], [CPLUSPLUS])dnl
 ac_ext=C
@@ -995,10 +940,13 @@ ac_compile='${CXX-gcc} $CXXFLAGS $LDFLAGS conftest.${ac_ext} -o conftest $LIBS 1
 ])dnl
 dnl
 dnl Push the current language on a stack.
+dnl 
+dnl AC_LANG_SAVE()
 AC_DEFUN(AC_LANG_SAVE,
 [pushdef([AC_LANG_STACK], AC_LANG)])dnl
 dnl
 dnl Restore the current language from the stack.
+dnl AC_LANG_RESTORE()
 AC_DEFUN(AC_LANG_RESTORE,
 [ifelse(AC_LANG_STACK, C, [ifelse(AC_LANG, C, , [AC_LANG_C])], [ifelse(AC_LANG, CPLUSPLUS, , [AC_LANG_CPLUSPLUS])])[]popdef([AC_LANG_STACK])])dnl
 dnl
@@ -1029,7 +977,7 @@ dnl ### Checking for files - fundamental (caching)
 dnl
 dnl
 dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND
-dnl                  [, VALUE-IF-NOT-FOUND])
+dnl               [, VALUE-IF-NOT-FOUND])
 AC_DEFUN(AC_CHECK_PROG,
 [# Extract the first word of "$2", so it can be a program name with args.
 set dummy $2; ac_word=[$]2
@@ -1121,12 +1069,12 @@ ifelse([$3], , , [test -n "[$]$1" || $1="$3"
 ])])dnl
 dnl
 dnl AC_CHECK_LIB(LIBRARY, FUNCTION, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
-dnl                 [, OTHER-LIBRARIES]]])
+dnl              [, OTHER-LIBRARIES]]])
 AC_DEFUN(AC_CHECK_LIB,
-[changequote(/, /)dnl
-define(/AC_LIB_NAME/, dnl
-patsubst(patsubst($1, /lib\([^\.]*\)\.a/, /\1/), /-l/, //))dnl
-define(/AC_CV_NAME/, ac_cv_lib_//AC_LIB_NAME)dnl
+[changequote(<<, >>)dnl
+define(<<AC_LIB_NAME>>, dnl
+patsubst(patsubst($1, <<lib\([^\.]*\)\.a>>, <<\1>>), <<-l>>, <<>>))dnl
+define(<<AC_CV_NAME>>, ac_cv_lib_<<>>AC_LIB_NAME)dnl
 changequote([, ])dnl
 AC_MSG_CHECKING([for -l[]AC_LIB_NAME])
 AC_CACHE_VAL(AC_CV_NAME,
@@ -1145,8 +1093,8 @@ ifelse([$4], , , [else
   $4
 ])dnl
 fi
-undefine(AC_LIB_NAME)dnl
-undefine(AC_CV_NAME)dnl
+undefine([AC_LIB_NAME])dnl
+undefine([AC_CV_NAME])dnl
 ])dnl
 dnl
 dnl AC_HAVE_LIBRARY(LIBRARY, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
@@ -1168,7 +1116,7 @@ dnl
 dnl Because this macro is used by AC_PROG_GCC_TRADITIONAL, which must
 dnl come early, it is not included in AC_BEFORE checks.
 dnl AC_EGREP_CPP(PATTERN, PROGRAM, ACTION-IF-FOUND [,
-dnl                  ACTION-IF-NOT-FOUND])
+dnl              ACTION-IF-NOT-FOUND])
 AC_DEFUN(AC_EGREP_CPP,
 [AC_REQUIRE_CPP()dnl
 cat > conftest.${ac_ext} <<EOF
@@ -1198,7 +1146,7 @@ AC_TRY_LINK([$2], [$3], [$4], [$5])dnl
 ])dnl
 dnl
 dnl AC_TRY_LINK(INCLUDES, FUNCTION-BODY,
-dnl              ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
+dnl             ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
 AC_DEFUN(AC_TRY_LINK,
 [dnl We use return because because C++ requires a prototype for exit.
 cat > conftest.${ac_ext} <<EOF
@@ -1221,7 +1169,7 @@ rm -f conftest*]
 )dnl
 dnl
 dnl AC_TRY_RUN(PROGRAM, ACTION-IF-TRUE [, ACTION-IF-FALSE
-dnl             [, ACTION-IF-CROSS-COMPILING]])
+dnl            [, ACTION-IF-CROSS-COMPILING]])
 AC_DEFUN(AC_TRY_RUN,
 [AC_REQUIRE([AC_C_CROSS])dnl
 if test "$cross_compiling" = yes; then
@@ -1320,7 +1268,7 @@ AC_CHECK_FUNC(${ac_func},
 [changequote(, )dnl
   ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
 changequote([, ])dnl
-  AC_DEFINE(${ac_tr_func}) $2])dnl
+  AC_DEFINE_UNQUOTED(${ac_tr_func}) $2])dnl
 done
 ])dnl
 dnl
@@ -1333,7 +1281,7 @@ AC_CHECK_HEADER(${ac_hdr},
 [changequote(, )dnl
   ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./' '[A-Z]__'`
 changequote([, ])dnl
-  AC_DEFINE(${ac_tr_hdr}) $2])dnl
+  AC_DEFINE_UNQUOTED(${ac_tr_hdr}) $2])dnl
 done
 ])dnl
 dnl
@@ -1366,8 +1314,8 @@ main()
 }], AC_CV_NAME=`cat conftestval`)])dnl
 AC_MSG_RESULT($AC_CV_NAME)
 AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
-undefine(AC_TYPE_NAME)dnl
-undefine(AC_CV_NAME)dnl
+undefine([AC_TYPE_NAME])dnl
+undefine([AC_CV_NAME])dnl
 ])dnl
 dnl
 dnl AC_CHECK_TYPE(TYPE, DEFAULT)
@@ -1397,36 +1345,19 @@ 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.
 # If there is a colon in the path, we need to keep it.
-changequote(, )dnl
 if test "x$srcdir" = x.; then
+changequote(, )dnl
   ac_vpsub='/^[        ]*VPATH[        ]*=[^:]*$/d'
+changequote([, ])dnl
 fi
 
-# Quote sed substitution magic chars in DEFS.
-cat >conftest.def <<EOF
-$DEFS
-EOF
-ac_escape_ampersand_and_backslash='s%[&\\]%\\&%g'
-DEFS=`sed "$ac_escape_ampersand_and_backslash" <conftest.def`
-rm -f conftest.def
-# Substitute for predefined variables.
-changequote([, ])dnl
-AC_SUBST(LIBS)dnl
-AC_SUBST(prefix)dnl
-AC_SUBST(exec_prefix)dnl
-dnl Substituting for DEFS would confuse sed if it contains multiple lines.
-ifdef([AC_LIST_HEADERS],
-[divert(AC_DIVERSION_SED)dnl
-s%@DEFS@%-DHAVE_CONFIG_H%],
-[divert(AC_DIVERSION_SED)dnl
-s%@DEFS@%$DEFS%
-])dnl
-divert(AC_DIVERSION_NORMAL)dnl
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+ifdef([AC_LIST_HEADERS], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
 
 # Without the "./", some shells look in PATH for config.status.
 : ${CONFIG_STATUS=./config.status}
 
-trap "rm -f ${CONFIG_STATUS}; exit 1" 1 2 15
 echo creating ${CONFIG_STATUS}
 rm -f ${CONFIG_STATUS}
 cat > ${CONFIG_STATUS} <<EOF
@@ -1461,14 +1392,12 @@ do
   esac
 done
 
+ac_given_srcdir=$srcdir
+
 ifdef([AC_LIST_HEADERS],
 [trap 'rm -fr $1 AC_LIST_HEADERS conftest*; exit 1' 1 2 15],
 [trap 'rm -f $1; exit 1' 1 2 15])
 
-ac_given_srcdir=$srcdir
-
-EOF
-cat >> ${CONFIG_STATUS} <<\EOF
 AC_OUTPUT_FILES($1)
 ifdef([AC_LIST_HEADERS], [AC_OUTPUT_HEADER(AC_LIST_HEADERS)])dnl
 ifdef([AC_LIST_LINKS], [AC_OUTPUT_LINKS(AC_LIST_LINKS, AC_LIST_FILES)])dnl
@@ -1477,14 +1406,49 @@ exit 0
 EOF
 chmod +x ${CONFIG_STATUS}
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} ${CONFIG_STATUS}
-dnl config.status should never do recursion.
+dnl config.status should not do recursion.
 ifdef([AC_LIST_SUBDIRS], [AC_OUTPUT_SUBDIRS(AC_LIST_SUBDIRS)])dnl
 ])dnl
 dnl
-dnl This is a subroutine of AC_OUTPUT.  It is called inside a quoted
+dnl This is a subroutine of AC_OUTPUT.
+dnl AC_OUTPUT_MAKE_DEFS()
+AC_DEFUN(AC_OUTPUT_MAKE_DEFS,
+[# Transform confdefs.h into DEFS.
+dnl Using a here document instead of a string reduces the quoting nightmare.
+cat > conftest.defs <<\EOF
+changequote(<<, >>)dnl
+s%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g
+# Protect against shell expansion while executing Makefile rules.
+s%[ `~<<#>>$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+# Protect against Makefile macro expansion.
+s%\$%$$%g
+# Protect against being on the right side of a sed subst in config.status. 
+s/[\\&%]/\\&/g
+changequote([, ])dnl
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+])dnl
+dnl
+dnl This is a subroutine of AC_OUTPUT.  It is called inside an unquoted
 dnl here document whose contents are going into config.status.
+dnl AC_OUTPUT_FILES(FILE...)
 AC_DEFUN(AC_OUTPUT_FILES,
-[CONFIG_FILES=${CONFIG_FILES-"$1"}
+[cat > conftest.subs <<\CEOF
+dnl These here document variables are unquoted when configure runs
+dnl but quoted when config.status runs, so variables are expanded once.
+$ac_vpsub
+dnl Shell code in configure.in might set extrasub.
+$extrasub
+dnl Insert the sed substitutions of variables.
+undivert(AC_DIVERSION_SED)
+CEOF
+EOF
+cat >> ${CONFIG_STATUS} <<\EOF
+
+CONFIG_FILES=${CONFIG_FILES-"$1"}
 for ac_file in .. ${CONFIG_FILES}; do if test "x$ac_file" != x..; then
   # Support "outfile[:infile]", defaulting infile="outfile.in".
   case "$ac_file" in
@@ -1551,131 +1515,114 @@ a\\
 }
 " ;;
   esac
-  sed -e "
-$ac_comsub
-EOF
-cat >> ${CONFIG_STATUS} <<EOF
-$ac_vpsub
-dnl Shell code in configure.in might set extrasub.
-$extrasub
-dnl Insert the sed substitutions of variables.
-undivert(AC_DIVERSION_SED)
-s%@srcdir@%\$srcdir%g
-s%@top_srcdir@%\$top_srcdir%g
-ifdef([AC_PROVIDE_AC_PROG_INSTALL], [s%@INSTALL@%\$INSTALL%g
+  sed -e "$ac_comsub
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+ifdef([AC_PROVIDE_AC_PROG_INSTALL], [s%@INSTALL@%$INSTALL%g
 ])dnl
-EOF
-cat >> ${CONFIG_STATUS} <<\EOF
-" $ac_given_srcdir/$ac_file_in > $ac_file
+" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
 fi; done
+rm -f conftest.subs
 ])dnl
 dnl
-dnl Create the header files listed in $1.
 dnl This is a subroutine of AC_OUTPUT.  It is called inside a quoted
 dnl here document whose contents are going into config.status.
+dnl AC_OUTPUT_HEADER(HEADER-FILE...)
 AC_DEFUN(AC_OUTPUT_HEADER,
 [changequote(<<, >>)dnl
-# These sed commands are put into ac_sed_defs when defining a macro.
-# They are broken into pieces to make the sed script easier to manage.
-# They are passed to sed as "A NAME B NAME C VALUE D", where NAME
-# is the cpp macro being defined and VALUE is the value it is being given.
-# Each defining turns into a single global substitution command.
-# Hopefully no one uses "!" as a variable value.
-# Other candidates for the sed separators, like , and @, do get used.
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
 #
 # ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s!^\([  ]*\)#\([        ]*define[       ][      ]*\)'
-ac_dB='\([     ][      ]*\)[^  ]*!\1#\2'
+ac_dA='s%^\([  ]*\)#\([        ]*define[       ][      ]*\)'
+ac_dB='\([     ][      ]*\)[^  ]*%\1#\2'
 ac_dC='\3'
-ac_dD='!g'
+ac_dD='%g'
 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
-ac_uA='s!^\([  ]*\)#\([        ]*\)undef\([    ][      ]*\)'
-ac_uB='\([     ]\)!\1#\2define\3'
+ac_uA='s%^\([  ]*\)#\([        ]*\)undef\([    ][      ]*\)'
+ac_uB='\([     ]\)%\1#\2define\3'
 ac_uC=' '
-ac_uD='\4!g'
+ac_uD='\4%g'
 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_eA='s!^\([  ]*\)#\([        ]*\)undef\([    ][      ]*\)'
-ac_eB='<<$>>!\1#\2define\3'
+ac_eA='s%^\([  ]*\)#\([        ]*\)undef\([    ][      ]*\)'
+ac_eB='<<$>>%\1#\2define\3'
 ac_eC=' '
-ac_eD='!g'
+ac_eD='%g'
 changequote([, ])dnl
-rm -f conftest.sed
+
+CONFIG_HEADERS=${CONFIG_HEADERS-"$1"}
+for ac_file in .. ${CONFIG_HEADERS}; do if test "x$ac_file" != x..; then
+  # Support "outfile[:infile]", defaulting infile="outfile.in".
+  case "$ac_file" in
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
+       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+  *) ac_file_in="${ac_file}.in" ;;
+  esac
+
+  echo creating $ac_file
+
+  rm -f conftest.frag conftest.in conftest.out
+  cp $ac_given_srcdir/$ac_file_in conftest.in
+
 EOF
-# Turn off quoting long enough to insert the sed commands.
-rm -f conftest.sh
-cat > conftest.sh <<EOF
-$ac_sed_defs
+
+# Transform confdefs.h into a sed script conftest.vals that substitutes
+# the proper values into config.h.in to produce config.h.
+rm -f conftest.vals
+dnl Using a here document instead of a string reduces the quoting nightmare.
+cat > conftest.hdr <<\EOF
+changequote(<<, >>)dnl
+# Protect against being on the right side of a sed subst in config.status. 
+s/[\\&%]/\\&/g
+# Protect against being in an unquoted here document in config.status.
+s%[\\$`]%\\&%g
+s%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%ac_d%ac_u%gp
+s%ac_u%ac_e%gp
+changequote([, ])dnl
 EOF
+sed -n -f conftest.hdr confdefs.h > conftest.vals
+rm -f conftest.hdr
 
-# Break up $ac_sed_defs (now in conftest.sh) because some shells have a limit
-# on the size of here documents.
+# This sed command replaces #undef with comments.  This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >> conftest.vals <<\EOF
+changequote(, )dnl
+s%^[   ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+changequote([, ])dnl
+EOF
 
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
 # Maximum number of lines to put in a single here document.
-ac_max_sh_lines=9
+ac_max_here_lines=12
 
+rm -f conftest.tail
 while :
 do
-  # wc gives bogus results for an empty file on some AIX systems.
-  ac_lines=`grep -c . conftest.sh`
+  ac_lines=`grep -c . conftest.vals`
+  # grep -c gives empty output for an empty file on some AIX systems.
   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
-  rm -f conftest.s1 conftest.s2
-  sed ${ac_max_sh_lines}q conftest.sh > conftest.s1 # Like head -9.
-  sed 1,${ac_max_sh_lines}d conftest.sh > conftest.s2 # Like tail +10.
-  # Write a limited-size here document to append to conftest.sed.
-  echo 'cat >> conftest.sed <<CONFEOF' >> ${CONFIG_STATUS}
-  cat conftest.s1 >> ${CONFIG_STATUS}
-  echo 'CONFEOF' >> ${CONFIG_STATUS}
-  rm -f conftest.s1 conftest.sh
-  mv conftest.s2 conftest.sh
+  # Write a limited-size here document to conftest.frag.
+  echo '  cat > conftest.frag <<CEOF' >> ${CONFIG_STATUS}
+  sed ${ac_max_here_lines}q conftest.vals >> ${CONFIG_STATUS}
+  echo 'CEOF
+  sed -f conftest.frag conftest.in > conftest.out
+  mv conftest.out conftest.in
+' >> ${CONFIG_STATUS}
+  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+  mv conftest.tail conftest.vals
 done
-rm -f conftest.sh
+rm -f conftest.vals
 
 # Now back to your regularly scheduled config.status.
 cat >> ${CONFIG_STATUS} <<\EOF
-# This sed command replaces #undef with comments.  This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it in
-[#] $1.
-cat >> conftest.sed <<\CONFEOF
-changequote(, )dnl
-s,^[   ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
-changequote([, ])dnl
-CONFEOF
-rm -f conftest.h
-# Break up the sed commands because old seds have small limits.
-ac_max_sed_lines=20
-
-CONFIG_HEADERS=${CONFIG_HEADERS-"$1"}
-for ac_file in .. ${CONFIG_HEADERS}; do if test "x$ac_file" != x..; then
-  # Support "outfile[:infile]", defaulting infile="outfile.in".
-  case "$ac_file" in
-  *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
-       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
-  *) ac_file_in="${ac_file}.in" ;;
-  esac
-
-  echo creating $ac_file
-
-  cp $ac_given_srcdir/$ac_file_in conftest.h1
-  cp conftest.sed conftest.stm
-  while :
-  do
-    ac_lines=`grep -c . conftest.stm`
-    if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
-    rm -f conftest.s1 conftest.s2 conftest.h2
-    sed ${ac_max_sed_lines}q conftest.stm > conftest.s1 # Like head -20.
-    sed 1,${ac_max_sed_lines}d conftest.stm > conftest.s2 # Like tail +21.
-    sed -f conftest.s1 < conftest.h1 > conftest.h2
-    rm -f conftest.s1 conftest.h1 conftest.stm
-    mv conftest.h2 conftest.h1
-    mv conftest.s2 conftest.stm
-  done
-  rm -f conftest.stm conftest.h
+  rm -f conftest.frag conftest.h
   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
-  cat conftest.h1 >> conftest.h
-  rm -f conftest.h1
+  cat conftest.in >> conftest.h
+  rm -f conftest.in
   if cmp -s $ac_file conftest.h 2>/dev/null; then
-    # The file exists and we would not be changing it.
     echo "$ac_file is unchanged"
     rm -f conftest.h
   else
@@ -1683,10 +1630,10 @@ for ac_file in .. ${CONFIG_HEADERS}; do if test "x$ac_file" != x..; then
     mv conftest.h $ac_file
   fi
 fi; done
-rm -f conftest.sed
 
 ])dnl
 dnl
+dnl AC_OUTPUT_LINKS(DEST..., SOURCE...)
 AC_DEFUN(AC_OUTPUT_LINKS,
 [ac_links="$1"
 ac_files="$2"
@@ -1709,6 +1656,7 @@ while test -n "${ac_files}"; do
 done
 ])dnl
 dnl
+dnl AC_OUTPUT_SUBDIRS(DIRECTORY...)
 AC_DEFUN(AC_OUTPUT_SUBDIRS,
 [if test -z "${norecursion}"; then
 
index 214a2c56b34443e8de84d082301ccf08a1cb8f1a..85e932c2f2a6bb2e46af889d8128dda1f10c3cd1 100644 (file)
@@ -30,7 +30,8 @@ dnl Idea borrowed from dist 3.0.
 dnl Internal use only.
 AC_DEFUN(AC_PROG_ECHO_N,
 [if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
-  if (echo -n testing; echo 1,2,3) | grep -e -n > /dev/null; then
+  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn > /dev/null; then
     ac_n= ac_c='
 ' ac_t='       '
   else
@@ -87,15 +88,14 @@ if test $ac_cv_prog_gcc = yes; then
   AC_MSG_CHECKING(whether -traditional is needed)
 AC_CACHE_VAL(ac_cv_prog_gcc_traditional,
 [  ac_pattern="Autoconf.*'x'"
-  ac_prog='#include <sgtty.h>
-Autoconf TIOCGETP'
-  AC_EGREP_CPP($ac_pattern, $ac_prog,
+  AC_EGREP_CPP($ac_pattern, [#include <sgtty.h>
+Autoconf TIOCGETP],
   ac_cv_prog_gcc_traditional=yes, ac_cv_prog_gcc_traditional=no)
 
   if test $ac_cv_prog_gcc_traditional = no; then
-    ac_prog='#include <termio.h>
-Autoconf TCGETA'
-    AC_EGREP_CPP($ac_pattern, $ac_prog, ac_cv_prog_gcc_traditional=yes)
+    AC_EGREP_CPP($ac_pattern, [#include <termio.h>
+Autoconf TCGETA],
+    ac_cv_prog_gcc_traditional=yes)
   fi])dnl
   AC_MSG_RESULT($ac_cv_prog_gcc_traditional)
   if test $ac_cv_prog_gcc_traditional = yes; then
@@ -547,9 +547,10 @@ AC_DEFUN(AC_TYPE_GETGROUPS,
 [AC_REQUIRE([AC_TYPE_UID_T])dnl
 AC_MSG_CHECKING(type of array argument to getgroups)
 AC_CACHE_VAL(ac_cv_type_getgroups,
-[changequote(, )dnl
-dnl Do not put single quotes in the C program text!
-ac_prog='/* Thanks to Mike Rendell for this test.  */
+[AC_TRY_RUN(
+changequote(<<, >>)dnl
+<<
+/* Thanks to Mike Rendell for this test.  */
 #include <sys/types.h>
 #define NGID 256
 #undef MAX
@@ -568,9 +569,9 @@ main()
   /* Exit non-zero if getgroups seems to require an array of ints.  This
      happens when gid_t is short but getgroups modifies an array of ints.  */
   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
-}'
+}
+>>,
 changequote([, ])dnl
-AC_TRY_RUN([$ac_prog],
   ac_cv_type_getgroups=gid_t, ac_cv_type_getgroups=int)])dnl
 AC_MSG_RESULT($ac_cv_type_getgroups)
 AC_DEFINE_UNQUOTED(GETGROUPS_T, $ac_cv_type_getgroups)
@@ -1310,9 +1311,10 @@ AC_DEFUN(AC_C_CONST,
 dnl and with the result message.
 AC_MSG_CHECKING([for working const])
 AC_CACHE_VAL(ac_cv_c_const,
-[changequote(, )dnl
-dnl Do not put single quotes in the C program text!
-ac_prog='/* Ultrix mips cc rejects this.  */
+[AC_TRY_LINK(,
+changequote(<<, >>)dnl
+<<
+/* Ultrix mips cc rejects this.  */
 typedef int charset[2]; const charset x;
 /* SunOS 4.1.1 cc rejects this.  */
 char const *const *ccp;
@@ -1349,9 +1351,10 @@ ccp = (char const *const *) p;
 }
 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
   const int foo = 10;
-}'
+}
+>>,
 changequote([, ])dnl
-AC_TRY_LINK(, [$ac_prog], ac_cv_c_const=yes, ac_cv_c_const=no)])dnl
+ac_cv_c_const=yes, ac_cv_c_const=no)])dnl
 AC_MSG_RESULT($ac_cv_c_const)
 if test $ac_cv_c_const = no; then
   AC_DEFINE(const, )