]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
diversions revision, 1.109
authorDavid MacKenzie <djm@djmnet.org>
Tue, 30 Aug 1994 18:42:54 +0000 (18:42 +0000)
committerDavid MacKenzie <djm@djmnet.org>
Tue, 30 Aug 1994 18:42:54 +0000 (18:42 +0000)
13 files changed:
Makefile.in
NEWS
README
acgeneral.m4
autoconf.in
autoconf.m4
autoconf.sh
autoconf.texi
bin/autoconf.in
doc/Makefile.in
doc/autoconf.texi
lib/autoconf/autoconf.m4
lib/autoconf/general.m4

index 6a4dd53aa50a2f707399cec13665f11fd4c06d1a..62542d840b1f262133d7ee7495f2ee2e815f1982 100644 (file)
@@ -27,7 +27,9 @@ MAKEINFO = makeinfo
 TEXI2DVI = texi2dvi
 M4 = @M4@
 
-PROGS = autoconf autoheader autoreconf autoupdate ifnames @PROGS@
+# Programs that are always installed.
+APROGS = autoconf autoheader autoreconf autoupdate ifnames 
+PROGS = $(APROGS) @PROGS@
 # Path of the perl interpreter.
 PERL = @PERL@
 
@@ -49,14 +51,17 @@ infodir = $(prefix)/info
 SHELL = /bin/sh
 
 SUBDIRS = testsuite
+
+M4FILES = autoconf.m4 acgeneral.m4 acoldnames.m4 acspecific.m4
+
 # Files that can be generated, but should be up to date for a distribution.
 DISTDEP = info Makefile
 # Files to distribute.
 DISTFILES = COPYING ChangeLog ChangeLog.1 INSTALL \
-       Makefile.in NEWS README TODO \
-       acconfig.h acfunctions acgeneral.m4 acheaders acidentifiers \
-       acmakevars acoldnames.m4 acprograms acspecific.m4 autoconf.info* \
-       autoconf.m4 autoconf.sh autoconf.texi install.texi \
+       Makefile.in NEWS README TODO $(M4FILES) \
+       acconfig.h acfunctions acheaders acidentifiers \
+       acmakevars acprograms autoconf.info* \
+       autoconf.sh autoconf.texi install.texi \
        autoheader.sh autoreconf.sh autoscan.pl autoupdate.sh ifnames.sh \
        config.guess config.sub configure configure.in \
        install.sh mkinstalldirs texinfo.tex \
@@ -122,14 +127,16 @@ installcheck: all install
 installdirs:
        $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(acdatadir)
 
-# References to install-info have been removed until it's released.
-install: all autoconf.m4 acgeneral.m4 acoldnames.m4 acspecific.m4 acconfig.h \
-       installdirs install-info
+install: all $(M4FILES) acconfig.h installdirs install-info
+       @case `$(M4) --help < /dev/null 2>&1` in \
+       *reload-state*) $(M4) -F $(acdatadir)/autoconf.m4f autoconf.m4 ;; \
+       *traditional*) ;; \
+       *) echo Error: Autoconf requires GNU m4 1.1 or later; exit 1 ;; \
+       esac
        for i in autoconf autoheader autoreconf autoupdate ifnames; do \
          $(INSTALL_PROGRAM) $$i $(bindir)/$$i; \
        done
-       for i in autoconf.m4 acgeneral.m4 acoldnames.m4 \
-         acspecific.m4 acconfig.h; do \
+       for i in $(M4FILES) acconfig.h; do \
        $(INSTALL_DATA) $(srcdir)/$$i $(acdatadir)/$$i; \
        done
        -if test -f autoscan; then \
@@ -158,7 +165,7 @@ uninstall:
        if test -f standards.info || test -f $(srcdir)/standards.info; \
        then cd $(infodir); rm -f standards.info*; fi
 
-configure: configure.in autoconf.m4 acgeneral.m4 acspecific.m4 acoldnames.m4
+configure: configure.in $(M4FILES)
        cd $(srcdir); \
        rm -f $@ $@.tmp; \
        $(M4) autoconf.m4 configure.in > $@.tmp && \
diff --git a/NEWS b/NEWS
index db033c614de87512b058f22d73b9b2b80b75bd6d..4d7547bc07ae0ab7dba5cd214142aa74cee3f1e8 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -17,7 +17,8 @@ Major changes in release 2.0:
 
 ** New macros:
 * AC_CACHE_VAL to share results of tests between configure runs.
-* AC_DEFUN to define macros and automatically AC_PROVIDE them.
+* AC_DEFUN to define macros, automatically AC_PROVIDE them, and ensure
+  that macros invoked with AC_REQUIRE don't interrupt other macros.
 * 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.
diff --git a/README b/README
index fab94f1106ae07efb1364d6f5adde5923650cdfb..959b195e046494301fb3eadc819b4feb8fd7b57d 100644 (file)
--- a/README
+++ b/README
@@ -9,10 +9,11 @@ operating system features that the package can use, in the form of m4
 macro calls.
 
 Producing configuration scripts using Autoconf requires GNU m4.  You
-should install GNU m4 (version 1.1 or later) before configuring
-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).
+must install GNU m4 (version 1.1 or later, preferably 1.3 or later
+for better performance) before configuring 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, TCL,
 and the TCL packages Expect and DejaGNU.  However, none of those
index 73a46bcd366347d364c41a34e59e1c1393e4484e..edf4abb9f56961861b69c2bf627b04cc3d68d6a6 100644 (file)
@@ -1,4 +1,4 @@
-dnl Parameterized macros that do not check for something specific.
+dnl Parameterized macros.
 dnl Requires GNU m4.
 dnl This file is part of Autoconf.
 dnl Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
@@ -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.108)dnl
+define(AC_ACVERSION, 1.109)dnl
 dnl This is defined by the --version option of the autoconf script.
 ifdef([AC_PRINT_VERSION], [Autoconf version AC_ACVERSION
 m4exit(0)])dnl
@@ -45,20 +45,66 @@ dnl ### Controlling Autoconf operation
 dnl
 dnl
 dnl m4 output diversions.  We let m4 output them all in order at the end,
-dnl except that we insert AC_DIVERSION_SED into AC_DIVERSION_NORMAL.
-dnl We don't use the default diversion (0) at all.
+dnl except that we explicitly undivert AC_DIVERSION_SED.
+dnl 
+dnl AC_DIVERSION_NOTICE - 1 (= 0)      AC_REQUIRE'd #!/bin/sh line
 define(AC_DIVERSION_NOTICE, 1)dnl      copyright notice & option help strings
 define(AC_DIVERSION_INIT, 2)dnl                initialization code
-define(AC_DIVERSION_NORMAL, 3)dnl      the tests and output code
-define(AC_DIVERSION_SED, 6)dnl         variable substitutions in config.status
-divert(AC_DIVERSION_NOTICE)dnl
+define(AC_DIVERSION_SED, 3)dnl         variable substitutions in config.status
+define(AC_DIVERSION_NORMAL_4, 4)dnl    AC_REQUIRE'd code, 4 level deep
+define(AC_DIVERSION_NORMAL_3, 5)dnl    AC_REQUIRE'd code, 3 level deep
+define(AC_DIVERSION_NORMAL_2, 6)dnl    AC_REQUIRE'd code, 2 level deep
+define(AC_DIVERSION_NORMAL_1, 7)dnl    AC_REQUIRE'd code, 1 level deep
+define(AC_DIVERSION_NORMAL, 8)dnl      the tests and output code
+dnl
+dnl Change the diversion stream to STREAM, while stacking old values.
+dnl AC_DIVERT_PUSH(STREAM)
+define(AC_DIVERT_PUSH,
+[pushdef([AC_DIVERSION_CURRENT], $1)dnl
+divert(AC_DIVERSION_CURRENT)dnl
+])dnl
+dnl
+dnl Change the diversion stream to its previous value, unstacking it.
+dnl AC_DIVERT_POP()
+define(AC_DIVERT_POP,
+[popdef([AC_DIVERSION_CURRENT])dnl
+divert(AC_DIVERSION_CURRENT)dnl
+])dnl
+dnl
+dnl Initialize the diversion setup.
+define(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL)dnl
+AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl will be later POPed by AC_INIT
+dnl
+dnl The prologue for Autoconf macros.
+dnl AC_PRO(MACRO-NAME)
+define(AC_PRO,
+[define([AC_PROVIDE_$1], )dnl
+ifelse(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL,
+[AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))],
+[pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_CURRENT)])dnl
+])dnl
+dnl
+dnl The Epilogue for Autoconf macros.
+dnl AC_EPI()
+define(AC_EPI,
+[AC_DIVERT_POP()dnl
+ifelse(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL,
+[undivert(AC_DIVERSION_NORMAL_4)dnl
+undivert(AC_DIVERSION_NORMAL_3)dnl
+undivert(AC_DIVERSION_NORMAL_2)dnl
+undivert(AC_DIVERSION_NORMAL_1)dnl
+])dnl
+])dnl
 dnl
-dnl Define a macro which automatically provides itself.
-dnl Use instead of define for macros to be used as functions.
+dnl Define a macro which automatically provides itself.  Add machinery
+dnl so the macro automatically switches expansion to the diversion
+dnl stack if it is not already using it.  In this case, once finished,
+dnl it will bring back all the code accumulated in the diversion stack.
+dnl This, combined with AC_REQUIRE, achieves the topological ordering of
+dnl macros.
 dnl AC_DEFUN(NAME, EXPANSION)
 define([AC_DEFUN],
-[define($1,
-[define([AC_PROVIDE_$1], )][$2])])dnl
+[define($1, [AC_PRO([$1])$2[]AC_EPI()])])dnl
 dnl
 dnl AC_INIT_NOTICE()
 AC_DEFUN(AC_INIT_NOTICE,
@@ -361,7 +407,8 @@ if test -n "$ac_prev"; then
 fi
 ])dnl
 dnl
-dnl Try to have only one #! line, so the script doesn't look funny.
+dnl Try to have only one #! line, so the script doesn't look funny
+dnl for users of AC_REVISION.
 dnl AC_INIT_BINSH()
 AC_DEFUN(AC_INIT_BINSH,
 [#!/bin/sh
@@ -369,12 +416,14 @@ AC_DEFUN(AC_INIT_BINSH,
 dnl
 dnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR)
 AC_DEFUN(AC_INIT,
-[AC_REQUIRE([AC_INIT_BINSH])dnl
+[sinclude(./aclocal.m4)dnl
+AC_REQUIRE([AC_INIT_BINSH])dnl
 AC_INIT_NOTICE
-divert(AC_DIVERSION_INIT)dnl
+AC_DIVERT_POP()dnl     to NORMAL
+AC_DIVERT_PUSH(AC_DIVERSION_INIT)dnl
 AC_INIT_PARSE_ARGS
 AC_INIT_PREPARE($1)dnl
-divert(AC_DIVERSION_NORMAL)dnl
+AC_DIVERT_POP()dnl     to NORMAL
 ])dnl
 dnl
 dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR)
@@ -478,10 +527,10 @@ AC_SUBST(LDFLAGS)dnl
 dnl
 dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
 AC_DEFUN(AC_ARG_ENABLE,
-[divert(AC_DIVERSION_NOTICE)dnl
+[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
 ac_help="${ac_help}
 [$2]"
-divert(AC_DIVERSION_NORMAL)dnl
+AC_DIVERT_POP()dnl
 [#] Check whether --enable-$1 or --disable-$1 was given.
 enableval="[$enable_]patsubst($1, -, _)"
 if test -n "$enableval"; then
@@ -499,10 +548,10 @@ AC_ARG_ENABLE([$1], [  --enable-$1], [$2], [$3])dnl
 dnl
 dnl AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
 AC_DEFUN(AC_ARG_WITH,
-[divert(AC_DIVERSION_NOTICE)dnl
+[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
 ac_help="${ac_help}
 [$2]"
-divert(AC_DIVERSION_NORMAL)dnl
+AC_DIVERT_POP()dnl
 [#] Check whether --with-$1 or --without-$1 was given.
 withval="[$with_]patsubst($1, -, _)"
 if test -n "$withval"; then
@@ -852,19 +901,19 @@ dnl AC_SUBST(VARIABLE)
 AC_DEFUN(AC_SUBST,
 [ifdef([AC_SUBST_$1], ,
 [define([AC_SUBST_$1], )dnl
-divert(AC_DIVERSION_SED)dnl
+AC_DIVERT_PUSH(AC_DIVERSION_SED)dnl
 s%@$1@%[$]$1%g
-divert(AC_DIVERSION_NORMAL)dnl
+AC_DIVERT_POP()dnl
 ])])dnl
 dnl
 dnl AC_SUBST_FILE(VARIABLE)
 AC_DEFUN(AC_SUBST_FILE,
 [ifdef([AC_SUBST_$1], ,
 [define([AC_SUBST_$1], )dnl
-divert(AC_DIVERSION_SED)dnl
+AC_DIVERT_PUSH(AC_DIVERSION_SED)dnl
 /@$1@/r [$]$1
 s%@$1@%%g
-divert(AC_DIVERSION_NORMAL)dnl
+AC_DIVERT_POP()dnl
 ])])dnl
 dnl
 dnl
@@ -942,7 +991,11 @@ AC_DEFUN(AC_BEFORE,
 dnl
 dnl AC_REQUIRE(MACRO-NAME)
 AC_DEFUN(AC_REQUIRE,
-[ifdef([AC_PROVIDE_$1], , [indir([$1])])])dnl
+[ifdef([AC_PROVIDE_$1], ,
+[AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))dnl
+indir([$1])
+AC_DIVERT_POP()dnl
+])])dnl
 dnl
 dnl AC_PROVIDE(MACRO-NAME)
 define(AC_PROVIDE,
@@ -954,7 +1007,7 @@ AC_DEFUN(AC_OBSOLETE,
 )])dnl
 dnl
 dnl
-dnl ### Checking for files - fundamental (caching)
+dnl ### Checking for files (caching)
 dnl
 dnl
 dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND
@@ -1025,10 +1078,6 @@ fi
 AC_SUBST($1)dnl
 ])dnl
 dnl
-dnl
-dnl ### Checking for files - derived (caching)
-dnl
-dnl
 dnl AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND])
 AC_DEFUN(AC_CHECK_PROGS,
 [for ac_prog in $2
@@ -1065,7 +1114,7 @@ if eval "test \"`echo '$ac_cv_lib_'$1`\" = yes"; then
 [changequote(, )dnl
   ac_tr_lib=HAVE_LIB`echo $1 | tr '[a-z]' '[A-Z]'`
 changequote([, ])dnl
-  AC_DEFINE(${ac_tr_lib})
+  AC_DEFINE_UNQUOTED(${ac_tr_lib})
   LIBS="${LIBS} -l$1"
 ], [$3])
 else
@@ -1106,7 +1155,7 @@ undefine([AC_CV_NAME])dnl
 ])dnl
 dnl
 dnl
-dnl ### Checking for C features - fundamental (no caching)
+dnl ### Checking for C features - primitive (no caching)
 dnl
 dnl
 dnl AC_EGREP_HEADER(PATTERN, HEADER-FILE, ACTION-IF-FOUND [,
index 5edf0b7b71e1cf33ec2fc31fa46a74d7787e7700..63b776e363015edc146b7f33ed08f6cff4a1fc54 100644 (file)
@@ -88,7 +88,16 @@ if test -z "$print_version"; then
   fi
 fi
 
-$M4 -I$AC_MACRODIR $print_version autoconf.m4 $infile > $tmpout || { rm -f $tmpin $tmpout; exit 2; }
+# Use the frozen version of Autoconf if available.
+r= f=
+# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
+case `$M4 --help < /dev/null 2>&1` in
+*reload-state*) test -r $AC_MACRODIR/autoconf.m4f && { r=--reload f=f; } ;;
+*traditional*) ;;
+*) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;;
+esac
+
+$M4 -I$AC_MACRODIR $print_version $r autoconf.m4$f $infile > $tmpout || { rm -f $tmpin $tmpout; exit 2; }
 
 if test -n "$print_version"; then
   cat $tmpout
index 2c2a7d48e5dc083277d4ec3905941ec4e70195dd..4517dbe53c2e81b3e8541c0e94779aafb614beaa 100644 (file)
@@ -23,4 +23,4 @@ include(acgeneral.m4)dnl
 builtin(include, acspecific.m4)dnl
 builtin(include, acoldnames.m4)dnl
 sinclude(acsite.m4)dnl
-sinclude(./aclocal.m4)dnl
+dnl Do not sinclude ./aclocal.m4 here, to prevent it from being frozen.
index 5edf0b7b71e1cf33ec2fc31fa46a74d7787e7700..63b776e363015edc146b7f33ed08f6cff4a1fc54 100644 (file)
@@ -88,7 +88,16 @@ if test -z "$print_version"; then
   fi
 fi
 
-$M4 -I$AC_MACRODIR $print_version autoconf.m4 $infile > $tmpout || { rm -f $tmpin $tmpout; exit 2; }
+# Use the frozen version of Autoconf if available.
+r= f=
+# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
+case `$M4 --help < /dev/null 2>&1` in
+*reload-state*) test -r $AC_MACRODIR/autoconf.m4f && { r=--reload f=f; } ;;
+*traditional*) ;;
+*) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;;
+esac
+
+$M4 -I$AC_MACRODIR $print_version $r autoconf.m4$f $infile > $tmpout || { rm -f $tmpin $tmpout; exit 2; }
 
 if test -n "$print_version"; then
   cat $tmpout
index 4127bbae1a15e1e7e98f99aebe7bd4cf484a5460..3ce904f6d0acf1601698663b15b235fcf3beb781 100644 (file)
@@ -6,8 +6,8 @@
 @c @setchapternewpage odd
 @c %**end of header
 
-@set EDITION 1.108
-@set VERSION 1.108
+@set EDITION 1.109
+@set VERSION 1.109
 @set UPDATED August 1994
 
 @iftex
@@ -306,7 +306,8 @@ Autoconf imposes some restrictions on the names of macros used with
 Autoconf requires GNU @code{m4} in order to generate the scripts.  It
 uses features that some UNIX versions of @code{m4} do not have.  It also
 overflows internal limits of some versions of @code{m4}, including GNU
-@code{m4} 1.0; you must use version 1.1 or later of GNU @code{m4}.
+@code{m4} 1.0.  You must use version 1.1 or later of GNU @code{m4}.
+Using version 1.3 or later will be much faster than 1.1 or 1.2.
 
 @xref{Concerns}, for answers to some common questions about Autoconf.
 @xref{Upgrading}, for information about upgrading from version 1.
@@ -2591,9 +2592,9 @@ number, which you can get by running @samp{autoconf --version}.
 @maindex DEFUN
 Autoconf macros are defined as arguments to the @code{AC_DEFUN} macro,
 which is similar to the @code{m4} builtin @code{define} macro.  In
-addition to defining the macro, @code{AC_DEFUN} causes the macro, when
-it is called, to set a flag which is used to constrain the order in
-which macros are called (@pxref{Prerequisite Macros}).
+addition to defining the macro, @code{AC_DEFUN} adds some code to the
+macro which is used to constrain the order in which macros are called
+(@pxref{Prerequisite Macros}).
 
 An Autoconf macro definition looks like this:
 
@@ -3762,14 +3763,23 @@ Why does Autoconf require GNU @code{m4}?
 @end display
 
 Many @code{m4} implementations have hard-coded limitations on the size
-and number of macros.  They also lack regular expression capabilities
-and other builtins that it would be difficult to get along without in a
-sophisticated application like Autoconf.  Since only software
-maintainers need to use Autoconf, and since GNU @code{m4} is simple to
-configure and install, it does not seem like an unreasonable burden to
-require GNU @code{m4} to be installed also.  Most maintainers of GNU and
-other free software already have most of the GNU utilities installed,
-since they prefer them.
+and number of macros, which Autoconf exceeds.  They also lack several
+builtin macros that it would be difficult to get along without in a
+sophisticated application like Autoconf, including:
+
+@example
+builtin
+indir
+patsubst
+__file__
+__line__
+@end example
+
+Since only software maintainers need to use Autoconf, and since GNU
+@code{m4} is simple to configure and install, it does not seem like an
+unreasonable burden to require GNU @code{m4} to be installed also.  Most
+maintainers of GNU and other free software already have most of the GNU
+utilities installed, since they prefer them.
 
 @node Bootstrapping, Policy Decisions, Why GNU m4, Concerns
 @section How Can I Bootstrap?
@@ -3817,9 +3827,12 @@ out some problems to watch for when upgrading.  Also, perhaps your
 @code{configure} scripts could benefit from some of the new features in
 version 2.
 
-First, make sure you have GNU @code{m4} version 1.1 or higher installed.
-Earlier versions have bugs that prevent them from working with Autoconf
-version 2.
+First, make sure you have GNU @code{m4} version 1.1 or higher installed,
+preferably 1.3 or higher.  Versions before 1.1 have bugs that prevent
+them from working with Autoconf version 2.  Versions 1.3 and later are
+much faster than earlier versions, because as of version 1.3, GNU
+@code{m4} has a more efficient implementation of diversions and can
+freeze its internal state in a file that it can read back quickly.
 
 @menu
 * Changed File Names::          Files you might rename.
@@ -3944,10 +3957,13 @@ predictably, and does not treat quotes (except backquotes) specially.
 @node Changed Macro Writing, , Changed Results, Upgrading
 @section Changed Macro Writing
 
-When defining your own macros, you may now use @code{AC_DEFUN} instead of
-@code{define}, because @code{AC_DEFUN} automatically calls
-@code{AC_PROVIDE}.  There's no harm in continuing to use the older way;
-it's just less convenient.  @xref{Macro Format}.
+When defining your own macros, you should now use @code{AC_DEFUN}
+instead of @code{define}.  @code{AC_DEFUN} automatically calls
+@code{AC_PROVIDE} and ensures that macros called via @code{AC_REQUIRE}
+do not interrupt other macros, to prevent nested @samp{checking@dots{}}
+messages on the screen.  There's no actual harm in continuing to use the
+older way, but it's less convenient and attractive.  @xref{Macro
+Format}.
 
 You probably looked at the macros that came with Autoconf as a guide for
 how to do things.  It would be a good idea to take a look at the new
index 5edf0b7b71e1cf33ec2fc31fa46a74d7787e7700..63b776e363015edc146b7f33ed08f6cff4a1fc54 100644 (file)
@@ -88,7 +88,16 @@ if test -z "$print_version"; then
   fi
 fi
 
-$M4 -I$AC_MACRODIR $print_version autoconf.m4 $infile > $tmpout || { rm -f $tmpin $tmpout; exit 2; }
+# Use the frozen version of Autoconf if available.
+r= f=
+# Some non-GNU m4's don't reject the --help option, so give them /dev/null.
+case `$M4 --help < /dev/null 2>&1` in
+*reload-state*) test -r $AC_MACRODIR/autoconf.m4f && { r=--reload f=f; } ;;
+*traditional*) ;;
+*) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;;
+esac
+
+$M4 -I$AC_MACRODIR $print_version $r autoconf.m4$f $infile > $tmpout || { rm -f $tmpin $tmpout; exit 2; }
 
 if test -n "$print_version"; then
   cat $tmpout
index 6a4dd53aa50a2f707399cec13665f11fd4c06d1a..62542d840b1f262133d7ee7495f2ee2e815f1982 100644 (file)
@@ -27,7 +27,9 @@ MAKEINFO = makeinfo
 TEXI2DVI = texi2dvi
 M4 = @M4@
 
-PROGS = autoconf autoheader autoreconf autoupdate ifnames @PROGS@
+# Programs that are always installed.
+APROGS = autoconf autoheader autoreconf autoupdate ifnames 
+PROGS = $(APROGS) @PROGS@
 # Path of the perl interpreter.
 PERL = @PERL@
 
@@ -49,14 +51,17 @@ infodir = $(prefix)/info
 SHELL = /bin/sh
 
 SUBDIRS = testsuite
+
+M4FILES = autoconf.m4 acgeneral.m4 acoldnames.m4 acspecific.m4
+
 # Files that can be generated, but should be up to date for a distribution.
 DISTDEP = info Makefile
 # Files to distribute.
 DISTFILES = COPYING ChangeLog ChangeLog.1 INSTALL \
-       Makefile.in NEWS README TODO \
-       acconfig.h acfunctions acgeneral.m4 acheaders acidentifiers \
-       acmakevars acoldnames.m4 acprograms acspecific.m4 autoconf.info* \
-       autoconf.m4 autoconf.sh autoconf.texi install.texi \
+       Makefile.in NEWS README TODO $(M4FILES) \
+       acconfig.h acfunctions acheaders acidentifiers \
+       acmakevars acprograms autoconf.info* \
+       autoconf.sh autoconf.texi install.texi \
        autoheader.sh autoreconf.sh autoscan.pl autoupdate.sh ifnames.sh \
        config.guess config.sub configure configure.in \
        install.sh mkinstalldirs texinfo.tex \
@@ -122,14 +127,16 @@ installcheck: all install
 installdirs:
        $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(acdatadir)
 
-# References to install-info have been removed until it's released.
-install: all autoconf.m4 acgeneral.m4 acoldnames.m4 acspecific.m4 acconfig.h \
-       installdirs install-info
+install: all $(M4FILES) acconfig.h installdirs install-info
+       @case `$(M4) --help < /dev/null 2>&1` in \
+       *reload-state*) $(M4) -F $(acdatadir)/autoconf.m4f autoconf.m4 ;; \
+       *traditional*) ;; \
+       *) echo Error: Autoconf requires GNU m4 1.1 or later; exit 1 ;; \
+       esac
        for i in autoconf autoheader autoreconf autoupdate ifnames; do \
          $(INSTALL_PROGRAM) $$i $(bindir)/$$i; \
        done
-       for i in autoconf.m4 acgeneral.m4 acoldnames.m4 \
-         acspecific.m4 acconfig.h; do \
+       for i in $(M4FILES) acconfig.h; do \
        $(INSTALL_DATA) $(srcdir)/$$i $(acdatadir)/$$i; \
        done
        -if test -f autoscan; then \
@@ -158,7 +165,7 @@ uninstall:
        if test -f standards.info || test -f $(srcdir)/standards.info; \
        then cd $(infodir); rm -f standards.info*; fi
 
-configure: configure.in autoconf.m4 acgeneral.m4 acspecific.m4 acoldnames.m4
+configure: configure.in $(M4FILES)
        cd $(srcdir); \
        rm -f $@ $@.tmp; \
        $(M4) autoconf.m4 configure.in > $@.tmp && \
index 4127bbae1a15e1e7e98f99aebe7bd4cf484a5460..3ce904f6d0acf1601698663b15b235fcf3beb781 100644 (file)
@@ -6,8 +6,8 @@
 @c @setchapternewpage odd
 @c %**end of header
 
-@set EDITION 1.108
-@set VERSION 1.108
+@set EDITION 1.109
+@set VERSION 1.109
 @set UPDATED August 1994
 
 @iftex
@@ -306,7 +306,8 @@ Autoconf imposes some restrictions on the names of macros used with
 Autoconf requires GNU @code{m4} in order to generate the scripts.  It
 uses features that some UNIX versions of @code{m4} do not have.  It also
 overflows internal limits of some versions of @code{m4}, including GNU
-@code{m4} 1.0; you must use version 1.1 or later of GNU @code{m4}.
+@code{m4} 1.0.  You must use version 1.1 or later of GNU @code{m4}.
+Using version 1.3 or later will be much faster than 1.1 or 1.2.
 
 @xref{Concerns}, for answers to some common questions about Autoconf.
 @xref{Upgrading}, for information about upgrading from version 1.
@@ -2591,9 +2592,9 @@ number, which you can get by running @samp{autoconf --version}.
 @maindex DEFUN
 Autoconf macros are defined as arguments to the @code{AC_DEFUN} macro,
 which is similar to the @code{m4} builtin @code{define} macro.  In
-addition to defining the macro, @code{AC_DEFUN} causes the macro, when
-it is called, to set a flag which is used to constrain the order in
-which macros are called (@pxref{Prerequisite Macros}).
+addition to defining the macro, @code{AC_DEFUN} adds some code to the
+macro which is used to constrain the order in which macros are called
+(@pxref{Prerequisite Macros}).
 
 An Autoconf macro definition looks like this:
 
@@ -3762,14 +3763,23 @@ Why does Autoconf require GNU @code{m4}?
 @end display
 
 Many @code{m4} implementations have hard-coded limitations on the size
-and number of macros.  They also lack regular expression capabilities
-and other builtins that it would be difficult to get along without in a
-sophisticated application like Autoconf.  Since only software
-maintainers need to use Autoconf, and since GNU @code{m4} is simple to
-configure and install, it does not seem like an unreasonable burden to
-require GNU @code{m4} to be installed also.  Most maintainers of GNU and
-other free software already have most of the GNU utilities installed,
-since they prefer them.
+and number of macros, which Autoconf exceeds.  They also lack several
+builtin macros that it would be difficult to get along without in a
+sophisticated application like Autoconf, including:
+
+@example
+builtin
+indir
+patsubst
+__file__
+__line__
+@end example
+
+Since only software maintainers need to use Autoconf, and since GNU
+@code{m4} is simple to configure and install, it does not seem like an
+unreasonable burden to require GNU @code{m4} to be installed also.  Most
+maintainers of GNU and other free software already have most of the GNU
+utilities installed, since they prefer them.
 
 @node Bootstrapping, Policy Decisions, Why GNU m4, Concerns
 @section How Can I Bootstrap?
@@ -3817,9 +3827,12 @@ out some problems to watch for when upgrading.  Also, perhaps your
 @code{configure} scripts could benefit from some of the new features in
 version 2.
 
-First, make sure you have GNU @code{m4} version 1.1 or higher installed.
-Earlier versions have bugs that prevent them from working with Autoconf
-version 2.
+First, make sure you have GNU @code{m4} version 1.1 or higher installed,
+preferably 1.3 or higher.  Versions before 1.1 have bugs that prevent
+them from working with Autoconf version 2.  Versions 1.3 and later are
+much faster than earlier versions, because as of version 1.3, GNU
+@code{m4} has a more efficient implementation of diversions and can
+freeze its internal state in a file that it can read back quickly.
 
 @menu
 * Changed File Names::          Files you might rename.
@@ -3944,10 +3957,13 @@ predictably, and does not treat quotes (except backquotes) specially.
 @node Changed Macro Writing, , Changed Results, Upgrading
 @section Changed Macro Writing
 
-When defining your own macros, you may now use @code{AC_DEFUN} instead of
-@code{define}, because @code{AC_DEFUN} automatically calls
-@code{AC_PROVIDE}.  There's no harm in continuing to use the older way;
-it's just less convenient.  @xref{Macro Format}.
+When defining your own macros, you should now use @code{AC_DEFUN}
+instead of @code{define}.  @code{AC_DEFUN} automatically calls
+@code{AC_PROVIDE} and ensures that macros called via @code{AC_REQUIRE}
+do not interrupt other macros, to prevent nested @samp{checking@dots{}}
+messages on the screen.  There's no actual harm in continuing to use the
+older way, but it's less convenient and attractive.  @xref{Macro
+Format}.
 
 You probably looked at the macros that came with Autoconf as a guide for
 how to do things.  It would be a good idea to take a look at the new
index 2c2a7d48e5dc083277d4ec3905941ec4e70195dd..4517dbe53c2e81b3e8541c0e94779aafb614beaa 100644 (file)
@@ -23,4 +23,4 @@ include(acgeneral.m4)dnl
 builtin(include, acspecific.m4)dnl
 builtin(include, acoldnames.m4)dnl
 sinclude(acsite.m4)dnl
-sinclude(./aclocal.m4)dnl
+dnl Do not sinclude ./aclocal.m4 here, to prevent it from being frozen.
index 73a46bcd366347d364c41a34e59e1c1393e4484e..edf4abb9f56961861b69c2bf627b04cc3d68d6a6 100644 (file)
@@ -1,4 +1,4 @@
-dnl Parameterized macros that do not check for something specific.
+dnl Parameterized macros.
 dnl Requires GNU m4.
 dnl This file is part of Autoconf.
 dnl Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
@@ -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.108)dnl
+define(AC_ACVERSION, 1.109)dnl
 dnl This is defined by the --version option of the autoconf script.
 ifdef([AC_PRINT_VERSION], [Autoconf version AC_ACVERSION
 m4exit(0)])dnl
@@ -45,20 +45,66 @@ dnl ### Controlling Autoconf operation
 dnl
 dnl
 dnl m4 output diversions.  We let m4 output them all in order at the end,
-dnl except that we insert AC_DIVERSION_SED into AC_DIVERSION_NORMAL.
-dnl We don't use the default diversion (0) at all.
+dnl except that we explicitly undivert AC_DIVERSION_SED.
+dnl 
+dnl AC_DIVERSION_NOTICE - 1 (= 0)      AC_REQUIRE'd #!/bin/sh line
 define(AC_DIVERSION_NOTICE, 1)dnl      copyright notice & option help strings
 define(AC_DIVERSION_INIT, 2)dnl                initialization code
-define(AC_DIVERSION_NORMAL, 3)dnl      the tests and output code
-define(AC_DIVERSION_SED, 6)dnl         variable substitutions in config.status
-divert(AC_DIVERSION_NOTICE)dnl
+define(AC_DIVERSION_SED, 3)dnl         variable substitutions in config.status
+define(AC_DIVERSION_NORMAL_4, 4)dnl    AC_REQUIRE'd code, 4 level deep
+define(AC_DIVERSION_NORMAL_3, 5)dnl    AC_REQUIRE'd code, 3 level deep
+define(AC_DIVERSION_NORMAL_2, 6)dnl    AC_REQUIRE'd code, 2 level deep
+define(AC_DIVERSION_NORMAL_1, 7)dnl    AC_REQUIRE'd code, 1 level deep
+define(AC_DIVERSION_NORMAL, 8)dnl      the tests and output code
+dnl
+dnl Change the diversion stream to STREAM, while stacking old values.
+dnl AC_DIVERT_PUSH(STREAM)
+define(AC_DIVERT_PUSH,
+[pushdef([AC_DIVERSION_CURRENT], $1)dnl
+divert(AC_DIVERSION_CURRENT)dnl
+])dnl
+dnl
+dnl Change the diversion stream to its previous value, unstacking it.
+dnl AC_DIVERT_POP()
+define(AC_DIVERT_POP,
+[popdef([AC_DIVERSION_CURRENT])dnl
+divert(AC_DIVERSION_CURRENT)dnl
+])dnl
+dnl
+dnl Initialize the diversion setup.
+define(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL)dnl
+AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl will be later POPed by AC_INIT
+dnl
+dnl The prologue for Autoconf macros.
+dnl AC_PRO(MACRO-NAME)
+define(AC_PRO,
+[define([AC_PROVIDE_$1], )dnl
+ifelse(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL,
+[AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))],
+[pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_CURRENT)])dnl
+])dnl
+dnl
+dnl The Epilogue for Autoconf macros.
+dnl AC_EPI()
+define(AC_EPI,
+[AC_DIVERT_POP()dnl
+ifelse(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL,
+[undivert(AC_DIVERSION_NORMAL_4)dnl
+undivert(AC_DIVERSION_NORMAL_3)dnl
+undivert(AC_DIVERSION_NORMAL_2)dnl
+undivert(AC_DIVERSION_NORMAL_1)dnl
+])dnl
+])dnl
 dnl
-dnl Define a macro which automatically provides itself.
-dnl Use instead of define for macros to be used as functions.
+dnl Define a macro which automatically provides itself.  Add machinery
+dnl so the macro automatically switches expansion to the diversion
+dnl stack if it is not already using it.  In this case, once finished,
+dnl it will bring back all the code accumulated in the diversion stack.
+dnl This, combined with AC_REQUIRE, achieves the topological ordering of
+dnl macros.
 dnl AC_DEFUN(NAME, EXPANSION)
 define([AC_DEFUN],
-[define($1,
-[define([AC_PROVIDE_$1], )][$2])])dnl
+[define($1, [AC_PRO([$1])$2[]AC_EPI()])])dnl
 dnl
 dnl AC_INIT_NOTICE()
 AC_DEFUN(AC_INIT_NOTICE,
@@ -361,7 +407,8 @@ if test -n "$ac_prev"; then
 fi
 ])dnl
 dnl
-dnl Try to have only one #! line, so the script doesn't look funny.
+dnl Try to have only one #! line, so the script doesn't look funny
+dnl for users of AC_REVISION.
 dnl AC_INIT_BINSH()
 AC_DEFUN(AC_INIT_BINSH,
 [#!/bin/sh
@@ -369,12 +416,14 @@ AC_DEFUN(AC_INIT_BINSH,
 dnl
 dnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR)
 AC_DEFUN(AC_INIT,
-[AC_REQUIRE([AC_INIT_BINSH])dnl
+[sinclude(./aclocal.m4)dnl
+AC_REQUIRE([AC_INIT_BINSH])dnl
 AC_INIT_NOTICE
-divert(AC_DIVERSION_INIT)dnl
+AC_DIVERT_POP()dnl     to NORMAL
+AC_DIVERT_PUSH(AC_DIVERSION_INIT)dnl
 AC_INIT_PARSE_ARGS
 AC_INIT_PREPARE($1)dnl
-divert(AC_DIVERSION_NORMAL)dnl
+AC_DIVERT_POP()dnl     to NORMAL
 ])dnl
 dnl
 dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR)
@@ -478,10 +527,10 @@ AC_SUBST(LDFLAGS)dnl
 dnl
 dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
 AC_DEFUN(AC_ARG_ENABLE,
-[divert(AC_DIVERSION_NOTICE)dnl
+[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
 ac_help="${ac_help}
 [$2]"
-divert(AC_DIVERSION_NORMAL)dnl
+AC_DIVERT_POP()dnl
 [#] Check whether --enable-$1 or --disable-$1 was given.
 enableval="[$enable_]patsubst($1, -, _)"
 if test -n "$enableval"; then
@@ -499,10 +548,10 @@ AC_ARG_ENABLE([$1], [  --enable-$1], [$2], [$3])dnl
 dnl
 dnl AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
 AC_DEFUN(AC_ARG_WITH,
-[divert(AC_DIVERSION_NOTICE)dnl
+[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
 ac_help="${ac_help}
 [$2]"
-divert(AC_DIVERSION_NORMAL)dnl
+AC_DIVERT_POP()dnl
 [#] Check whether --with-$1 or --without-$1 was given.
 withval="[$with_]patsubst($1, -, _)"
 if test -n "$withval"; then
@@ -852,19 +901,19 @@ dnl AC_SUBST(VARIABLE)
 AC_DEFUN(AC_SUBST,
 [ifdef([AC_SUBST_$1], ,
 [define([AC_SUBST_$1], )dnl
-divert(AC_DIVERSION_SED)dnl
+AC_DIVERT_PUSH(AC_DIVERSION_SED)dnl
 s%@$1@%[$]$1%g
-divert(AC_DIVERSION_NORMAL)dnl
+AC_DIVERT_POP()dnl
 ])])dnl
 dnl
 dnl AC_SUBST_FILE(VARIABLE)
 AC_DEFUN(AC_SUBST_FILE,
 [ifdef([AC_SUBST_$1], ,
 [define([AC_SUBST_$1], )dnl
-divert(AC_DIVERSION_SED)dnl
+AC_DIVERT_PUSH(AC_DIVERSION_SED)dnl
 /@$1@/r [$]$1
 s%@$1@%%g
-divert(AC_DIVERSION_NORMAL)dnl
+AC_DIVERT_POP()dnl
 ])])dnl
 dnl
 dnl
@@ -942,7 +991,11 @@ AC_DEFUN(AC_BEFORE,
 dnl
 dnl AC_REQUIRE(MACRO-NAME)
 AC_DEFUN(AC_REQUIRE,
-[ifdef([AC_PROVIDE_$1], , [indir([$1])])])dnl
+[ifdef([AC_PROVIDE_$1], ,
+[AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))dnl
+indir([$1])
+AC_DIVERT_POP()dnl
+])])dnl
 dnl
 dnl AC_PROVIDE(MACRO-NAME)
 define(AC_PROVIDE,
@@ -954,7 +1007,7 @@ AC_DEFUN(AC_OBSOLETE,
 )])dnl
 dnl
 dnl
-dnl ### Checking for files - fundamental (caching)
+dnl ### Checking for files (caching)
 dnl
 dnl
 dnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND
@@ -1025,10 +1078,6 @@ fi
 AC_SUBST($1)dnl
 ])dnl
 dnl
-dnl
-dnl ### Checking for files - derived (caching)
-dnl
-dnl
 dnl AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND])
 AC_DEFUN(AC_CHECK_PROGS,
 [for ac_prog in $2
@@ -1065,7 +1114,7 @@ if eval "test \"`echo '$ac_cv_lib_'$1`\" = yes"; then
 [changequote(, )dnl
   ac_tr_lib=HAVE_LIB`echo $1 | tr '[a-z]' '[A-Z]'`
 changequote([, ])dnl
-  AC_DEFINE(${ac_tr_lib})
+  AC_DEFINE_UNQUOTED(${ac_tr_lib})
   LIBS="${LIBS} -l$1"
 ], [$3])
 else
@@ -1106,7 +1155,7 @@ undefine([AC_CV_NAME])dnl
 ])dnl
 dnl
 dnl
-dnl ### Checking for C features - fundamental (no caching)
+dnl ### Checking for C features - primitive (no caching)
 dnl
 dnl
 dnl AC_EGREP_HEADER(PATTERN, HEADER-FILE, ACTION-IF-FOUND [,