]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
rework diversions and substitutions
authorDavid MacKenzie <djm@djmnet.org>
Thu, 25 Aug 1994 18:05:45 +0000 (18:05 +0000)
committerDavid MacKenzie <djm@djmnet.org>
Thu, 25 Aug 1994 18:05:45 +0000 (18:05 +0000)
Makefile.in
NEWS
TODO
acgeneral.m4
autoconf.texi
doc/Makefile.in
doc/autoconf.texi
lib/autoconf/general.m4

index 8c04f3dd44d706232d429ebe26a695f1903437bd..ad4de2b7987f89caa06274cfe7424caa74563ffa 100644 (file)
@@ -124,24 +124,20 @@ installdirs:
 
 # 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_PROGRAM) autoconf $(bindir)/autoconf
-       $(INSTALL_PROGRAM) autoheader $(bindir)/autoheader
-       $(INSTALL_PROGRAM) autoreconf $(bindir)/autoreconf
-       $(INSTALL_PROGRAM) autoupdate $(bindir)/autoupdate
-       $(INSTALL_PROGRAM) ifnames $(bindir)/ifnames
-       $(INSTALL_DATA) $(srcdir)/autoconf.m4 $(acdatadir)/autoconf.m4
-       $(INSTALL_DATA) $(srcdir)/acgeneral.m4 $(acdatadir)/acgeneral.m4
-       $(INSTALL_DATA) $(srcdir)/acoldnames.m4 $(acdatadir)/acoldnames.m4
-       $(INSTALL_DATA) $(srcdir)/acspecific.m4 $(acdatadir)/acspecific.m4
-       $(INSTALL_DATA) $(srcdir)/acconfig.h $(acdatadir)/acconfig.h
+       installdirs install-info
+       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 \
+       $(INSTALL_DATA) $(srcdir)/$$i $(acdatadir)/$$i; \
+       done
        -if test -f autoscan; then \
        $(INSTALL_PROGRAM) autoscan $(bindir)/autoscan; \
-       $(INSTALL_DATA) $(srcdir)/acfunctions $(acdatadir)/acfunctions; \
-       $(INSTALL_DATA) $(srcdir)/acheaders $(acdatadir)/acheaders; \
-       $(INSTALL_DATA) $(srcdir)/acidentifiers $(acdatadir)/acidentifiers; \
-       $(INSTALL_DATA) $(srcdir)/acprograms $(acdatadir)/acprograms; \
-       $(INSTALL_DATA) $(srcdir)/acmakevars $(acdatadir)/acmakevars; \
+       for i in acfunctions acheaders acidentifiers acprograms \
+         acmakevars; do \
+       $(INSTALL_DATA) $(srcdir)/$$i $(acdatadir)/$$i; \
+       done; \
        else :; fi
 
 install-info: info installdirs
diff --git a/NEWS b/NEWS
index ed02b191c6bb3e8068fe0026ac03229e924bafd4..0f9c858967ee7f36bb843e8adb59d48a3d27fd57 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -41,7 +41,7 @@ Major changes in release 2.0:
   LDFLAGS from the environment, with default values.
 * 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, AC_DEFINE_UNQUOTED, and AC_SUBST 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.
diff --git a/TODO b/TODO
index e3abf95ca06c700ea6a07f9e4a727c3c8b4537c2..6b899d149258e4e5ec478f7fe0613fed2c56656b 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,29 +1,37 @@
 -*- outline -*-
 
-Autoconf work:
-
 Required for 2.0:
 
 ------------------------------------------------------------------------------
 
+* Doc: chapter addressing misconceptions and migration from v1.
+
+------------------------------------------------------------------------------
+
 * Try it on Emacs configure.in, and adapt that to use the new features.
+Add equivalents of CFLAGS and LDFLAGS for the system to set,
+and which CPP will also use?
 
 ------------------------------------------------------------------------------
 
-* Split up AC_SUBST substitutions using a loop to accomodate old seds.
+\f
+Other things:
 
 ------------------------------------------------------------------------------
 
-* Doc: chapter addressing misconceptions and migration from v1.
+* Fix AC_REQUIRE interrupting messages.
 
 ------------------------------------------------------------------------------
 
-* Fix AC_ARG_{ENABLE,WITH}, and AC_REQUIRE interrupting messages.
+* Split up AC_SUBST substitutions using a loop to accomodate shells
+  with severely limited here document sizes, if it turns out to be a problem.
+  I'm not sure whether the limit is on lines or bytes; if bytes, it
+  will be less of a problem than it was with the long lines used for
+  creating a header file.
 
 ------------------------------------------------------------------------------
 
-\f
-Other things:
+* Look at Jim Avera's code to allow [ and ] in patterns and AC_DEFINE args.
 
 ------------------------------------------------------------------------------
 
index 462383f80851761cff2d1c374dd428a4777f58b4..dbe4a8f75e8a8af2a3b2932ab6be30d3e450b7f2 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.102)dnl
+define(AC_ACVERSION, 1.103)dnl
 dnl This is defined by the --version option of the autoconf script.
 ifdef([AC_PRINT_VERSION], [Autoconf version AC_ACVERSION
 m4exit(0)])dnl
@@ -44,12 +44,14 @@ dnl
 dnl ### Controlling Autoconf operation
 dnl
 dnl
-dnl m4 diversions:
-define(AC_DIVERSION_NORMAL, 0)dnl      normal output
-define(AC_DIVERSION_SED, 1)dnl         sed substitutions for config.status
-define(AC_DIVERSION_HELP, 3)dnl                --enable/--with help strings
-define(AC_DIVERSION_ARG, 4)dnl         --enable/--with actions
-divert(AC_DIVERSION_NORMAL)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.
+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
 dnl
 dnl Define a macro which automatically provides itself.
 dnl Use instead of define for macros to be used as functions.
@@ -77,7 +79,8 @@ AC_DEFUN(AC_INIT_NOTICE,
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-])dnl
+
+ac_help=])dnl
 dnl
 dnl AC_INIT_PARSE_ARGS()
 AC_DEFUN(AC_INIT_PARSE_ARGS,
@@ -112,9 +115,7 @@ Features and packages:
 --without-PACKAGE      do not use PACKAGE (same as --with-PACKAGE=no)
 --x-includes=DIR       X include files are in DIR
 --x-libraries=DIR      X library files are in DIR
-
---enable/--with options recognized:
-undivert(AC_DIVERSION_HELP)"dnl
+--enable/--with options recognized:$ac_help"
 changequote([, ])dnl
 
 # Initialize some variables set by options.
@@ -372,8 +373,11 @@ dnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR)
 AC_DEFUN(AC_INIT,
 [AC_REQUIRE([AC_INIT_BINSH])dnl
 AC_INIT_NOTICE
+divert(AC_DIVERSION_INIT)dnl
 AC_INIT_PARSE_ARGS
-AC_INIT_PREPARE($1)])dnl
+AC_INIT_PREPARE($1)dnl
+divert(AC_DIVERSION_NORMAL)dnl
+])dnl
 dnl
 dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR)
 AC_DEFUN(AC_INIT_PREPARE,
@@ -465,15 +469,10 @@ if test ! -r $srcdir/$ac_unique_file; then
   fi
 fi
 
-ifdef([AC_LIST_SUBDIRS], [subdirs="AC_LIST_SUBDIRS"
-AC_SUBST(subdirs)])dnl
-ifdef([AC_LIST_PREFIX_PROGRAM], [AC_PREFIX(AC_LIST_PREFIX_PROGRAM)])dnl
 dnl Let the site file select an alternate cache file if it wants to.
 AC_SITE_LOAD
 AC_CACHE_LOAD
-
 AC_LANG_C
-undivert(AC_DIVERSION_ARG)dnl
 dnl Substitute for predefined variables.
 AC_SUBST(LIBS)dnl
 AC_SUBST(prefix)dnl
@@ -486,59 +485,49 @@ AC_SUBST_DEFAULT(LDFLAGS, )dnl
 dnl
 dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
 AC_DEFUN(AC_ARG_ENABLE,
-[divert(AC_DIVERSION_HELP)dnl
-$2
-divert(AC_DIVERSION_ARG)dnl
-AC_ENABLE_INTERNAL([$1], [$3], [$4])dnl
+[divert(AC_DIVERSION_NOTICE)dnl
+ac_help="${ac_help}
+[$2]"
 divert(AC_DIVERSION_NORMAL)dnl
-])dnl
-dnl
-AC_DEFUN(AC_ENABLE,
-[AC_OBSOLETE([$0], [; instead use AC_ARG_ENABLE before AC_INIT])dnl
-AC_ENABLE_INTERNAL([$1], [$2], [$3])dnl
-])dnl
-dnl
-dnl AC_ENABLE_INTERNAL(FEATURE, ACTION-IF-TRUE [, ACTION-IF-FALSE])
-AC_DEFUN(AC_ENABLE_INTERNAL,
-[[#] Check whether --enable-$1 or --disable-$1 was given.
+[#] Check whether --enable-$1 or --disable-$1 was given.
 enableval="[$enable_]patsubst($1, -, _)"
 if test -n "$enableval"; then
-  ifelse([$2], , :, [$2])
-ifelse([$3], , , [else
-  $3
+  ifelse([$3], , :, [$3])
+ifelse([$4], , , [else
+  $4
 ])dnl
 fi
 ])dnl
 dnl
+AC_DEFUN(AC_ENABLE,
+[AC_OBSOLETE([$0], [; instead use AC_ARG_ENABLE])dnl
+AC_ARG_ENABLE([$1], [--enable-$1], [$2], [$3])dnl
+])dnl
+dnl
 dnl AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
 AC_DEFUN(AC_ARG_WITH,
-[divert(AC_DIVERSION_HELP)dnl
-$2
-divert(AC_DIVERSION_ARG)dnl
-AC_WITH_INTERNAL([$1], [$3], [$4])dnl
+[divert(AC_DIVERSION_NOTICE)dnl
+ac_help="${ac_help}
+[$2]"
 divert(AC_DIVERSION_NORMAL)dnl
-])dnl
-dnl
-AC_DEFUN(AC_WITH,
-[AC_OBSOLETE([$0], [; instead use AC_ARG_WITH before AC_INIT])dnl
-AC_WITH_INTERNAL([$1], [$2], [$3])dnl
-])dnl
-dnl
-dnl AC_WITH_INTERNAL(PACKAGE, ACTION-IF-TRUE [, ACTION-IF-FALSE])
-AC_DEFUN(AC_WITH_INTERNAL,
-[[#] Check whether --with-$1 or --without-$1 was given.
+[#] Check whether --with-$1 or --without-$1 was given.
 withval="[$with_]patsubst($1, -, _)"
 if test -n "$withval"; then
-  ifelse([$2], , :, [$2])
-ifelse([$3], , , [else
-  $3
+  ifelse([$3], , :, [$3])
+ifelse([$4], , , [else
+  $4
 ])dnl
 fi
 ])dnl
 dnl
+AC_DEFUN(AC_WITH,
+[AC_OBSOLETE([$0], [; instead use AC_ARG_WITH])dnl
+AC_ARG_WITH([$1], [--with-$1], [$2], [$3])dnl
+])dnl
+dnl
 dnl AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
 AC_DEFUN(AC_CONFIG_HEADER,
-[define(AC_LIST_HEADERS, $1)])dnl
+[define(AC_LIST_HEADER, $1)])dnl
 dnl
 dnl AC_REVISION(REVISION-INFO)
 AC_DEFUN(AC_REVISION,
@@ -578,16 +567,20 @@ dnl Not actually done until AC_OUTPUT_SUBDIRS.
 dnl AC_CONFIG_SUBDIRS(DIR ...)
 AC_DEFUN(AC_CONFIG_SUBDIRS,
 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-define([AC_LIST_SUBDIRS], [$1])])dnl
+define([AC_LIST_SUBDIRS], [$1])dnl
+subdirs="AC_LIST_SUBDIRS"
+AC_SUBST(subdirs)dnl
+])dnl
 dnl
 dnl Guess the value for the `prefix' variable by looking for
 dnl the argument program along PATH and taking its parent.
 dnl Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc,
 dnl set `prefix' to /usr/local/gnu.
+dnl This comes too late to find a site file based on the prefix,
+dnl and it might use a cached value for the path.
+dnl No big loss, I think, since most configures don't use this macro anyway.
 dnl AC_PREFIX_PROGRAM(PROGRAM)
 AC_DEFUN(AC_PREFIX_PROGRAM,
-[define([AC_LIST_PREFIX_PROGRAM], [$1])])dnl
-AC_DEFUN(AC_PREFIX_INTERNAL,
 [if test "x$prefix" = xNONE; then
 changequote(<<, >>)dnl
 define(<<AC_VAR_NAME>>, translit($1, [a-z], [A-Z]))dnl
@@ -601,9 +594,6 @@ changequote([, ])dnl
 fi
 undefine([AC_VAR_NAME])dnl
 ])dnl
-AC_DEFUN(AC_PREFIX,
-[AC_OBSOLETE([$0], [; instead use AC_PREFIX_PROGRAM before AC_INIT])dnl
-AC_PREFIX_INTERNAL([$1])])dnl
 dnl
 dnl
 dnl ### Canonicalizing the system type
@@ -1150,6 +1140,8 @@ 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
+dnl This sometimes fails to find confdefs.h, for some reason.
+dnl [#]line __LINE__ "[$]0"
 #line __LINE__ "configure"
 #include "confdefs.h"
 [$1]
@@ -1356,7 +1348,7 @@ fi
 
 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
 
-ifdef([AC_LIST_HEADERS], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
+ifdef([AC_LIST_HEADER], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
 
 # Without the "./", some shells look in PATH for config.status.
 : ${CONFIG_STATUS=./config.status}
@@ -1396,14 +1388,15 @@ do
 done
 
 ac_given_srcdir=$srcdir
-ac_given_INSTALL="$INSTALL"
+ifdef([AC_PROVIDE_AC_PROG_INSTALL], [ac_given_INSTALL="$INSTALL"
+])dnl
 
-ifdef([AC_LIST_HEADERS],
-[trap 'rm -fr $1 AC_LIST_HEADERS conftest*; exit 1' 1 2 15],
+ifdef([AC_LIST_HEADER],
+[trap 'rm -fr $1 AC_LIST_HEADER conftest*; exit 1' 1 2 15],
 [trap 'rm -f $1; exit 1' 1 2 15])
 
 AC_OUTPUT_FILES($1)
-ifdef([AC_LIST_HEADERS], [AC_OUTPUT_HEADER(AC_LIST_HEADERS)])dnl
+ifdef([AC_LIST_HEADER], [AC_OUTPUT_HEADER(AC_LIST_HEADER)])dnl
 ifdef([AC_LIST_LINKS], [AC_OUTPUT_LINKS(AC_LIST_LINKS, AC_LIST_FILES)])dnl
 $2
 exit 0
@@ -1428,8 +1421,6 @@ 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' ' '`
@@ -1440,7 +1431,11 @@ 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,
-[cat > conftest.subs <<\CEOF
+[# Protect against being on the right side of a sed subst in config.status. 
+changequote(, )dnl
+sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g; 
+ s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF
+changequote([, ])dnl
 dnl These here document variables are unquoted when configure runs
 dnl but quoted when config.status runs, so variables are expanded once.
 $ac_vpsub
@@ -1662,7 +1657,8 @@ done
 dnl
 dnl AC_OUTPUT_SUBDIRS(DIRECTORY...)
 AC_DEFUN(AC_OUTPUT_SUBDIRS,
-[if test -z "${norecursion}"; then
+[
+if test "${norecursion}" != yes; then
 
   # Remove --cache-file and --srcdir arguments so they do not pile up.
   ac_sub_configure_args=
@@ -1698,7 +1694,7 @@ changequote([, ])dnl
       continue
     fi
 
-    echo configuring ${ac_config_dir}
+    echo configuring in ${ac_config_dir}
 
     case "${srcdir}" in
     .) ;;
index e44e7db1eacddc652f045c92f4fd6a94b315fcf0..1e486addcf17dc125b9a21196d043e91a9bb09dc 100644 (file)
@@ -6,8 +6,8 @@
 @c @setchapternewpage odd
 @c %**end of header
 
-@set EDITION 1.102
-@set VERSION 1.102
+@set EDITION 1.103
+@set VERSION 1.103
 @set UPDATED August 1994
 
 @iftex
@@ -429,7 +429,6 @@ name and the open parentheses.
 
 @display
 @group
-macros that control Autoconf operation
 @code{AC_INIT(@var{file})}
 checks for alternative programs
 checks for UNIX variants that set C preprocessor variables
@@ -1684,10 +1683,6 @@ These macros are defined in the file @file{acgeneral.m4}.
 @section Controlling Autoconf Setup
 
 The following macros control the kind of output that Autoconf produces.
-@file{configure.in} should call them before @code{AC_INIT} or
-@code{AC_INIT_PREPARE}.  Remember to put a @code{dnl} comment at the ends of
-the lines containing their calls, to avoid inserting blank lines at the
-beginning of @file{configure}.
 
 @defmac AC_CONFIG_AUX_DIR(@var{dir})
 @maindex CONFIG_AUX_DIR
@@ -1761,18 +1756,6 @@ make sure that the directory that it is told contains the source code in
 fact does (@pxref{Invoking configure}, for more information).
 @end defmac
 
-@defmac AC_INIT_PREPARE (@var{unique-file-in-source-dir})
-@maindex INIT_PREPARE
-Find the source code directory and set up shell variables necessary for
-other Autoconf macros to work.  @var{unique-file-in-source-dir} is some
-file that is in the package's source directory; @code{configure} checks
-for this file's existence to make sure that the directory that it is
-told contains the source code in fact does (@pxref{Invoking configure},
-for more information).  @code{AC_INIT_PREPARE} is the last thing done by
-@code{AC_INIT}.  Use @code{AC_INIT_PREPARE} instead of @code{AC_INIT} if you
-want to do argument parsing yourself; never use both.
-@end defmac
-
 @defmac AC_OUTPUT (@r{[}@var{file}@dots{}@r{] [,}@var{extra-cmds}@r{]})
 @maindex OUTPUT
 Create output files (typically one or more @file{Makefile}s) and
@@ -1797,12 +1780,6 @@ If you pass @var{extra-cmds}, those commands will be inserted into
 @file{config.status} to be run after all its other processing.
 @end defmac
 
-@defmac AC_PREFIX (@var{program})
-@maindex PREFIX
-This macro is like @code{AC_PREFIX_PROGRAM}, except that it does not
-find the site-wide defaults file correctly, so it is obsolete.
-@end defmac
-
 @defmac AC_PREFIX_PROGRAM (@var{program})
 @maindex PREFIX_PROGRAM
 If the user did not specify an installation prefix (using the
@@ -2301,7 +2278,8 @@ AC_DEFINE_UNQUOTED(config_machfile, "$@{machfile@}")
 Substitute the variable @var{variable} when creating the output files
 (typically one or more @file{Makefile}s).  This means replace instances
 of @samp{@@@var{variable}@@}, e.g. in @file{Makefile.in}, with the
-current value of the shell variable @var{variable}.  If this macro were
+current value of the shell variable @var{variable}.  The value of
+@var{variable} should not contain literal newlines.  If this macro were
 not called, the value of @var{variable} would not be set in the output
 files, even though @code{configure} had figured out a value for it.
 
@@ -3645,9 +3623,9 @@ for backward compatibility, the old names are considered obsolete.
 @item AC_PID_T
 @maindex PID_T
 @code{AC_TYPE_PID_T}
-@item AC_PREPARE
-@maindex PREPARE
-@code{AC_INIT_PREPARE}
+@item AC_PREFIX
+@maindex PREFIX
+@code{AC_PREFIX_PROGRAM}
 @item AC_PROGRAMS_CHECK
 @maindex PROGRAMS_CHECK
 @code{AC_CHECK_PROGS}
@@ -3916,12 +3894,13 @@ A long wish list for major features had accumulated, and the effect of
 several years of patching by various people had left some residual
 cruft.  In April 1994, while working for Cygnus Support, I began a major
 revision of Autoconf.  I added most of the features of the Cygnus
-@code{configure} that Autoconf had lacked; for example, support for
-using @file{config.sub} and options like @samp{--host}, derived from
-work that david zuhn and Ken Raeburn contributed while converting GNU
-@code{as} to use Autoconf.  Rob Savoye required the ability to run
-@code{configure} scripts in subdirectories when he made DejaGNU use
-Autoconf.
+@code{configure} that Autoconf had lacked, largely by adapting the
+relevant parts of Cygnus @code{configure} with the help of david zuhn
+and Ken Raeburn.  These features include support for using
+@file{config.sub}, @file{config.guess}, @samp{--host}, and
+@samp{--target}; making links to files; and running @code{configure}
+scripts in subdirectories.  Adding these features enabled Ken to convert
+GNU @code{as}, and Rob Savoye to convert DejaGNU, to using Autoconf.
 
 I added more features in response to other peoples' requests.  Many
 people had asked for @code{configure} scripts to share the results of
index 8c04f3dd44d706232d429ebe26a695f1903437bd..ad4de2b7987f89caa06274cfe7424caa74563ffa 100644 (file)
@@ -124,24 +124,20 @@ installdirs:
 
 # 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_PROGRAM) autoconf $(bindir)/autoconf
-       $(INSTALL_PROGRAM) autoheader $(bindir)/autoheader
-       $(INSTALL_PROGRAM) autoreconf $(bindir)/autoreconf
-       $(INSTALL_PROGRAM) autoupdate $(bindir)/autoupdate
-       $(INSTALL_PROGRAM) ifnames $(bindir)/ifnames
-       $(INSTALL_DATA) $(srcdir)/autoconf.m4 $(acdatadir)/autoconf.m4
-       $(INSTALL_DATA) $(srcdir)/acgeneral.m4 $(acdatadir)/acgeneral.m4
-       $(INSTALL_DATA) $(srcdir)/acoldnames.m4 $(acdatadir)/acoldnames.m4
-       $(INSTALL_DATA) $(srcdir)/acspecific.m4 $(acdatadir)/acspecific.m4
-       $(INSTALL_DATA) $(srcdir)/acconfig.h $(acdatadir)/acconfig.h
+       installdirs install-info
+       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 \
+       $(INSTALL_DATA) $(srcdir)/$$i $(acdatadir)/$$i; \
+       done
        -if test -f autoscan; then \
        $(INSTALL_PROGRAM) autoscan $(bindir)/autoscan; \
-       $(INSTALL_DATA) $(srcdir)/acfunctions $(acdatadir)/acfunctions; \
-       $(INSTALL_DATA) $(srcdir)/acheaders $(acdatadir)/acheaders; \
-       $(INSTALL_DATA) $(srcdir)/acidentifiers $(acdatadir)/acidentifiers; \
-       $(INSTALL_DATA) $(srcdir)/acprograms $(acdatadir)/acprograms; \
-       $(INSTALL_DATA) $(srcdir)/acmakevars $(acdatadir)/acmakevars; \
+       for i in acfunctions acheaders acidentifiers acprograms \
+         acmakevars; do \
+       $(INSTALL_DATA) $(srcdir)/$$i $(acdatadir)/$$i; \
+       done; \
        else :; fi
 
 install-info: info installdirs
index e44e7db1eacddc652f045c92f4fd6a94b315fcf0..1e486addcf17dc125b9a21196d043e91a9bb09dc 100644 (file)
@@ -6,8 +6,8 @@
 @c @setchapternewpage odd
 @c %**end of header
 
-@set EDITION 1.102
-@set VERSION 1.102
+@set EDITION 1.103
+@set VERSION 1.103
 @set UPDATED August 1994
 
 @iftex
@@ -429,7 +429,6 @@ name and the open parentheses.
 
 @display
 @group
-macros that control Autoconf operation
 @code{AC_INIT(@var{file})}
 checks for alternative programs
 checks for UNIX variants that set C preprocessor variables
@@ -1684,10 +1683,6 @@ These macros are defined in the file @file{acgeneral.m4}.
 @section Controlling Autoconf Setup
 
 The following macros control the kind of output that Autoconf produces.
-@file{configure.in} should call them before @code{AC_INIT} or
-@code{AC_INIT_PREPARE}.  Remember to put a @code{dnl} comment at the ends of
-the lines containing their calls, to avoid inserting blank lines at the
-beginning of @file{configure}.
 
 @defmac AC_CONFIG_AUX_DIR(@var{dir})
 @maindex CONFIG_AUX_DIR
@@ -1761,18 +1756,6 @@ make sure that the directory that it is told contains the source code in
 fact does (@pxref{Invoking configure}, for more information).
 @end defmac
 
-@defmac AC_INIT_PREPARE (@var{unique-file-in-source-dir})
-@maindex INIT_PREPARE
-Find the source code directory and set up shell variables necessary for
-other Autoconf macros to work.  @var{unique-file-in-source-dir} is some
-file that is in the package's source directory; @code{configure} checks
-for this file's existence to make sure that the directory that it is
-told contains the source code in fact does (@pxref{Invoking configure},
-for more information).  @code{AC_INIT_PREPARE} is the last thing done by
-@code{AC_INIT}.  Use @code{AC_INIT_PREPARE} instead of @code{AC_INIT} if you
-want to do argument parsing yourself; never use both.
-@end defmac
-
 @defmac AC_OUTPUT (@r{[}@var{file}@dots{}@r{] [,}@var{extra-cmds}@r{]})
 @maindex OUTPUT
 Create output files (typically one or more @file{Makefile}s) and
@@ -1797,12 +1780,6 @@ If you pass @var{extra-cmds}, those commands will be inserted into
 @file{config.status} to be run after all its other processing.
 @end defmac
 
-@defmac AC_PREFIX (@var{program})
-@maindex PREFIX
-This macro is like @code{AC_PREFIX_PROGRAM}, except that it does not
-find the site-wide defaults file correctly, so it is obsolete.
-@end defmac
-
 @defmac AC_PREFIX_PROGRAM (@var{program})
 @maindex PREFIX_PROGRAM
 If the user did not specify an installation prefix (using the
@@ -2301,7 +2278,8 @@ AC_DEFINE_UNQUOTED(config_machfile, "$@{machfile@}")
 Substitute the variable @var{variable} when creating the output files
 (typically one or more @file{Makefile}s).  This means replace instances
 of @samp{@@@var{variable}@@}, e.g. in @file{Makefile.in}, with the
-current value of the shell variable @var{variable}.  If this macro were
+current value of the shell variable @var{variable}.  The value of
+@var{variable} should not contain literal newlines.  If this macro were
 not called, the value of @var{variable} would not be set in the output
 files, even though @code{configure} had figured out a value for it.
 
@@ -3645,9 +3623,9 @@ for backward compatibility, the old names are considered obsolete.
 @item AC_PID_T
 @maindex PID_T
 @code{AC_TYPE_PID_T}
-@item AC_PREPARE
-@maindex PREPARE
-@code{AC_INIT_PREPARE}
+@item AC_PREFIX
+@maindex PREFIX
+@code{AC_PREFIX_PROGRAM}
 @item AC_PROGRAMS_CHECK
 @maindex PROGRAMS_CHECK
 @code{AC_CHECK_PROGS}
@@ -3916,12 +3894,13 @@ A long wish list for major features had accumulated, and the effect of
 several years of patching by various people had left some residual
 cruft.  In April 1994, while working for Cygnus Support, I began a major
 revision of Autoconf.  I added most of the features of the Cygnus
-@code{configure} that Autoconf had lacked; for example, support for
-using @file{config.sub} and options like @samp{--host}, derived from
-work that david zuhn and Ken Raeburn contributed while converting GNU
-@code{as} to use Autoconf.  Rob Savoye required the ability to run
-@code{configure} scripts in subdirectories when he made DejaGNU use
-Autoconf.
+@code{configure} that Autoconf had lacked, largely by adapting the
+relevant parts of Cygnus @code{configure} with the help of david zuhn
+and Ken Raeburn.  These features include support for using
+@file{config.sub}, @file{config.guess}, @samp{--host}, and
+@samp{--target}; making links to files; and running @code{configure}
+scripts in subdirectories.  Adding these features enabled Ken to convert
+GNU @code{as}, and Rob Savoye to convert DejaGNU, to using Autoconf.
 
 I added more features in response to other peoples' requests.  Many
 people had asked for @code{configure} scripts to share the results of
index 462383f80851761cff2d1c374dd428a4777f58b4..dbe4a8f75e8a8af2a3b2932ab6be30d3e450b7f2 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.102)dnl
+define(AC_ACVERSION, 1.103)dnl
 dnl This is defined by the --version option of the autoconf script.
 ifdef([AC_PRINT_VERSION], [Autoconf version AC_ACVERSION
 m4exit(0)])dnl
@@ -44,12 +44,14 @@ dnl
 dnl ### Controlling Autoconf operation
 dnl
 dnl
-dnl m4 diversions:
-define(AC_DIVERSION_NORMAL, 0)dnl      normal output
-define(AC_DIVERSION_SED, 1)dnl         sed substitutions for config.status
-define(AC_DIVERSION_HELP, 3)dnl                --enable/--with help strings
-define(AC_DIVERSION_ARG, 4)dnl         --enable/--with actions
-divert(AC_DIVERSION_NORMAL)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.
+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
 dnl
 dnl Define a macro which automatically provides itself.
 dnl Use instead of define for macros to be used as functions.
@@ -77,7 +79,8 @@ AC_DEFUN(AC_INIT_NOTICE,
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-])dnl
+
+ac_help=])dnl
 dnl
 dnl AC_INIT_PARSE_ARGS()
 AC_DEFUN(AC_INIT_PARSE_ARGS,
@@ -112,9 +115,7 @@ Features and packages:
 --without-PACKAGE      do not use PACKAGE (same as --with-PACKAGE=no)
 --x-includes=DIR       X include files are in DIR
 --x-libraries=DIR      X library files are in DIR
-
---enable/--with options recognized:
-undivert(AC_DIVERSION_HELP)"dnl
+--enable/--with options recognized:$ac_help"
 changequote([, ])dnl
 
 # Initialize some variables set by options.
@@ -372,8 +373,11 @@ dnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR)
 AC_DEFUN(AC_INIT,
 [AC_REQUIRE([AC_INIT_BINSH])dnl
 AC_INIT_NOTICE
+divert(AC_DIVERSION_INIT)dnl
 AC_INIT_PARSE_ARGS
-AC_INIT_PREPARE($1)])dnl
+AC_INIT_PREPARE($1)dnl
+divert(AC_DIVERSION_NORMAL)dnl
+])dnl
 dnl
 dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR)
 AC_DEFUN(AC_INIT_PREPARE,
@@ -465,15 +469,10 @@ if test ! -r $srcdir/$ac_unique_file; then
   fi
 fi
 
-ifdef([AC_LIST_SUBDIRS], [subdirs="AC_LIST_SUBDIRS"
-AC_SUBST(subdirs)])dnl
-ifdef([AC_LIST_PREFIX_PROGRAM], [AC_PREFIX(AC_LIST_PREFIX_PROGRAM)])dnl
 dnl Let the site file select an alternate cache file if it wants to.
 AC_SITE_LOAD
 AC_CACHE_LOAD
-
 AC_LANG_C
-undivert(AC_DIVERSION_ARG)dnl
 dnl Substitute for predefined variables.
 AC_SUBST(LIBS)dnl
 AC_SUBST(prefix)dnl
@@ -486,59 +485,49 @@ AC_SUBST_DEFAULT(LDFLAGS, )dnl
 dnl
 dnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
 AC_DEFUN(AC_ARG_ENABLE,
-[divert(AC_DIVERSION_HELP)dnl
-$2
-divert(AC_DIVERSION_ARG)dnl
-AC_ENABLE_INTERNAL([$1], [$3], [$4])dnl
+[divert(AC_DIVERSION_NOTICE)dnl
+ac_help="${ac_help}
+[$2]"
 divert(AC_DIVERSION_NORMAL)dnl
-])dnl
-dnl
-AC_DEFUN(AC_ENABLE,
-[AC_OBSOLETE([$0], [; instead use AC_ARG_ENABLE before AC_INIT])dnl
-AC_ENABLE_INTERNAL([$1], [$2], [$3])dnl
-])dnl
-dnl
-dnl AC_ENABLE_INTERNAL(FEATURE, ACTION-IF-TRUE [, ACTION-IF-FALSE])
-AC_DEFUN(AC_ENABLE_INTERNAL,
-[[#] Check whether --enable-$1 or --disable-$1 was given.
+[#] Check whether --enable-$1 or --disable-$1 was given.
 enableval="[$enable_]patsubst($1, -, _)"
 if test -n "$enableval"; then
-  ifelse([$2], , :, [$2])
-ifelse([$3], , , [else
-  $3
+  ifelse([$3], , :, [$3])
+ifelse([$4], , , [else
+  $4
 ])dnl
 fi
 ])dnl
 dnl
+AC_DEFUN(AC_ENABLE,
+[AC_OBSOLETE([$0], [; instead use AC_ARG_ENABLE])dnl
+AC_ARG_ENABLE([$1], [--enable-$1], [$2], [$3])dnl
+])dnl
+dnl
 dnl AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE])
 AC_DEFUN(AC_ARG_WITH,
-[divert(AC_DIVERSION_HELP)dnl
-$2
-divert(AC_DIVERSION_ARG)dnl
-AC_WITH_INTERNAL([$1], [$3], [$4])dnl
+[divert(AC_DIVERSION_NOTICE)dnl
+ac_help="${ac_help}
+[$2]"
 divert(AC_DIVERSION_NORMAL)dnl
-])dnl
-dnl
-AC_DEFUN(AC_WITH,
-[AC_OBSOLETE([$0], [; instead use AC_ARG_WITH before AC_INIT])dnl
-AC_WITH_INTERNAL([$1], [$2], [$3])dnl
-])dnl
-dnl
-dnl AC_WITH_INTERNAL(PACKAGE, ACTION-IF-TRUE [, ACTION-IF-FALSE])
-AC_DEFUN(AC_WITH_INTERNAL,
-[[#] Check whether --with-$1 or --without-$1 was given.
+[#] Check whether --with-$1 or --without-$1 was given.
 withval="[$with_]patsubst($1, -, _)"
 if test -n "$withval"; then
-  ifelse([$2], , :, [$2])
-ifelse([$3], , , [else
-  $3
+  ifelse([$3], , :, [$3])
+ifelse([$4], , , [else
+  $4
 ])dnl
 fi
 ])dnl
 dnl
+AC_DEFUN(AC_WITH,
+[AC_OBSOLETE([$0], [; instead use AC_ARG_WITH])dnl
+AC_ARG_WITH([$1], [--with-$1], [$2], [$3])dnl
+])dnl
+dnl
 dnl AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
 AC_DEFUN(AC_CONFIG_HEADER,
-[define(AC_LIST_HEADERS, $1)])dnl
+[define(AC_LIST_HEADER, $1)])dnl
 dnl
 dnl AC_REVISION(REVISION-INFO)
 AC_DEFUN(AC_REVISION,
@@ -578,16 +567,20 @@ dnl Not actually done until AC_OUTPUT_SUBDIRS.
 dnl AC_CONFIG_SUBDIRS(DIR ...)
 AC_DEFUN(AC_CONFIG_SUBDIRS,
 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-define([AC_LIST_SUBDIRS], [$1])])dnl
+define([AC_LIST_SUBDIRS], [$1])dnl
+subdirs="AC_LIST_SUBDIRS"
+AC_SUBST(subdirs)dnl
+])dnl
 dnl
 dnl Guess the value for the `prefix' variable by looking for
 dnl the argument program along PATH and taking its parent.
 dnl Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc,
 dnl set `prefix' to /usr/local/gnu.
+dnl This comes too late to find a site file based on the prefix,
+dnl and it might use a cached value for the path.
+dnl No big loss, I think, since most configures don't use this macro anyway.
 dnl AC_PREFIX_PROGRAM(PROGRAM)
 AC_DEFUN(AC_PREFIX_PROGRAM,
-[define([AC_LIST_PREFIX_PROGRAM], [$1])])dnl
-AC_DEFUN(AC_PREFIX_INTERNAL,
 [if test "x$prefix" = xNONE; then
 changequote(<<, >>)dnl
 define(<<AC_VAR_NAME>>, translit($1, [a-z], [A-Z]))dnl
@@ -601,9 +594,6 @@ changequote([, ])dnl
 fi
 undefine([AC_VAR_NAME])dnl
 ])dnl
-AC_DEFUN(AC_PREFIX,
-[AC_OBSOLETE([$0], [; instead use AC_PREFIX_PROGRAM before AC_INIT])dnl
-AC_PREFIX_INTERNAL([$1])])dnl
 dnl
 dnl
 dnl ### Canonicalizing the system type
@@ -1150,6 +1140,8 @@ 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
+dnl This sometimes fails to find confdefs.h, for some reason.
+dnl [#]line __LINE__ "[$]0"
 #line __LINE__ "configure"
 #include "confdefs.h"
 [$1]
@@ -1356,7 +1348,7 @@ fi
 
 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
 
-ifdef([AC_LIST_HEADERS], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
+ifdef([AC_LIST_HEADER], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
 
 # Without the "./", some shells look in PATH for config.status.
 : ${CONFIG_STATUS=./config.status}
@@ -1396,14 +1388,15 @@ do
 done
 
 ac_given_srcdir=$srcdir
-ac_given_INSTALL="$INSTALL"
+ifdef([AC_PROVIDE_AC_PROG_INSTALL], [ac_given_INSTALL="$INSTALL"
+])dnl
 
-ifdef([AC_LIST_HEADERS],
-[trap 'rm -fr $1 AC_LIST_HEADERS conftest*; exit 1' 1 2 15],
+ifdef([AC_LIST_HEADER],
+[trap 'rm -fr $1 AC_LIST_HEADER conftest*; exit 1' 1 2 15],
 [trap 'rm -f $1; exit 1' 1 2 15])
 
 AC_OUTPUT_FILES($1)
-ifdef([AC_LIST_HEADERS], [AC_OUTPUT_HEADER(AC_LIST_HEADERS)])dnl
+ifdef([AC_LIST_HEADER], [AC_OUTPUT_HEADER(AC_LIST_HEADER)])dnl
 ifdef([AC_LIST_LINKS], [AC_OUTPUT_LINKS(AC_LIST_LINKS, AC_LIST_FILES)])dnl
 $2
 exit 0
@@ -1428,8 +1421,6 @@ 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' ' '`
@@ -1440,7 +1431,11 @@ 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,
-[cat > conftest.subs <<\CEOF
+[# Protect against being on the right side of a sed subst in config.status. 
+changequote(, )dnl
+sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g; 
+ s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF
+changequote([, ])dnl
 dnl These here document variables are unquoted when configure runs
 dnl but quoted when config.status runs, so variables are expanded once.
 $ac_vpsub
@@ -1662,7 +1657,8 @@ done
 dnl
 dnl AC_OUTPUT_SUBDIRS(DIRECTORY...)
 AC_DEFUN(AC_OUTPUT_SUBDIRS,
-[if test -z "${norecursion}"; then
+[
+if test "${norecursion}" != yes; then
 
   # Remove --cache-file and --srcdir arguments so they do not pile up.
   ac_sub_configure_args=
@@ -1698,7 +1694,7 @@ changequote([, ])dnl
       continue
     fi
 
-    echo configuring ${ac_config_dir}
+    echo configuring in ${ac_config_dir}
 
     case "${srcdir}" in
     .) ;;