From: Alexandre Duret-Lutz Date: Fri, 19 Apr 2002 10:13:24 +0000 (+0000) Subject: * m4/header.m4 (_AM_CONFIG_HEADER_INSINUATE): New function, X-Git-Tag: Release-1-6b~126 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=fc2f265fc40cbbcec74e18a7c081fe2c5cc0b3c8;p=automake.git * m4/header.m4 (_AM_CONFIG_HEADER_INSINUATE): New function, override AC_CONFIG_HEADERS with AM_CONFIG_HEADER. (_AM_CONFIG_HEADER): Use _AM_AC_CONFIG_HEADERS. * m4/init.m4: Call _AM_CONFIG_HEADER_INSINUATE. * tests/stamph2.test: Use AC_CONFIG_HEADERS for some of the config files. * tests/confh5.test: New file. * tests/Makefile.am (TESTS): Add confh5.test. * automake.texi (Optional, Public macros): Update descriptions of AC_CONFIG_HEADERS and AM_CONFIG_HEADER. --- diff --git a/ChangeLog b/ChangeLog index 8a4738db..8b62d498 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2002-04-19 Alexandre Duret-Lutz + + * m4/header.m4 (_AM_CONFIG_HEADER_INSINUATE): New function, + override AC_CONFIG_HEADERS with AM_CONFIG_HEADER. + (_AM_CONFIG_HEADER): Use _AM_AC_CONFIG_HEADERS. + * m4/init.m4: Call _AM_CONFIG_HEADER_INSINUATE. + * tests/stamph2.test: Use AC_CONFIG_HEADERS for some of the config + files. + * tests/confh5.test: New file. + * tests/Makefile.am (TESTS): Add confh5.test. + * automake.texi (Optional, Public macros): Update descriptions + of AC_CONFIG_HEADERS and AM_CONFIG_HEADER. + 2002-04-13 Alexandre Duret-Lutz * tests/man2.test: New file. diff --git a/NEWS b/NEWS index 550149e1..dac1f757 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ New in 1.6a: +* It is no longuer a requirement to use AM_CONFIG_HEADER instead of + AC_CONFIG_HEADERS. AM_CONFIG_HEADER is obsolete. * Use Autoconf's --trace interface to inspect configure.ac and get a more accurate view of it. * automake --output-dir is deprecated diff --git a/automake.texi b/automake.texi index d299aef8..555e2b66 100644 --- a/automake.texi +++ b/automake.texi @@ -1115,12 +1115,11 @@ generated @file{Makefile.in} appropriately. Currently recognized macros and their effects are: @table @code -@item AC_CONFIG_HEADER -Automake requires the use of @code{AM_CONFIG_HEADER} (@pxref{Macros}), -which is similar to @code{AC_CONFIG_HEADER} (@pxref{Configuration -Headers, , Configuration Header Files, autoconf, The Autoconf Manual}), -but does some useful Automake-specific work. -@cvindex AC_CONFIG_HEADER +@item AC_CONFIG_HEADERS +Automake will generate rules to rebuild these headers. Older versions +of Automake required the use of @code{AM_CONFIG_HEADER} +(@pxref{Macros}); this no longuer the case today. +@cvindex AC_CONFIG_HEADERS @item AC_CONFIG_AUX_DIR Automake will look for various helper scripts, such as @@ -1385,7 +1384,8 @@ Automake ships with several Autoconf macros that you can use from your @table @code @item AM_CONFIG_HEADER Automake will generate rules to automatically regenerate the config -header. +header. This obsolete macro is a synonym of @code{AC_CONFIG_HEADERS} +today (@pxref{Optional}). @cvindex AM_CONFIG_HEADER @item AM_ENABLE_MULTILIB @@ -2326,7 +2326,7 @@ instance, @samp{-I} and @samp{-D} options should be listed here. Automake already provides some @samp{-I} options automatically. In particular it generates @samp{-I$(srcdir)}, @samp{-I.}, and a @samp{-I} pointing to the directory holding @file{config.h} (if you've used -@code{AC_CONFIG_HEADER} or @code{AM_CONFIG_HEADER}). You can disable +@code{AC_CONFIG_HEADERS} or @code{AM_CONFIG_HEADER}). You can disable the default @samp{-I} options using the @samp{nostdinc} option. @item INCLUDES diff --git a/m4/header.m4 b/m4/header.m4 index 63b90e5a..dc602a54 100644 --- a/m4/header.m4 +++ b/m4/header.m4 @@ -62,7 +62,7 @@ AS_ESCAPE(_AM_DIRNAME(patsubst([$1], AC_DEFUN([_AM_CONFIG_HEADER], [# Add the stamp file to the list of files AC keeps track of, # along with our hook. -AC_CONFIG_HEADERS([$1], +_AM_AC_CONFIG_HEADERS([$1], [# update the timestamp echo 'timestamp for $1' >"_AM_STAMP([$1])" $2], @@ -75,3 +75,20 @@ $2], AC_DEFUN([AM_CONFIG_HEADER], [AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])]) ])# AM_CONFIG_HEADER + + +# _AM_CONFIG_HEADER_INSINUATE +# --------------------------- +# Replace AC_CONFIG_HEADERS with our AM_CONFIG_HEADER. +# We don't care about AC_CONFIG_HEADER (without S): it's an obsolete +# Autoconf macro which will simply call AC_CONFIG_HEADERS (with S). +AC_DEFUN([_AM_CONFIG_HEADER_INSINUATE], [ +dnl Since the substitution is only effective after AM_INIT_AUTOMAKE, +dnl make sure AC_CONFIG_HEADERS is not called before. +AC_BEFORE([AM_INIT_AUTOMAKE], [AC_CONFIG_HEADERS])dnl +dnl Save the previous AC_CONFIG_HEADERS definition +m4_rename([AC_CONFIG_HEADERS], [_AM_AC_CONFIG_HEADERS])dnl +dnl Setup ours. +dnl (Don't use m4_copy because we are tracing AM_CONFIG_HEADER.) +AC_DEFUN([AC_CONFIG_HEADERS], [AM_CONFIG_HEADER($][@)])dnl +]) diff --git a/m4/init.m4 b/m4/init.m4 index c435f4e6..65e6e431 100644 --- a/m4/init.m4 +++ b/m4/init.m4 @@ -87,13 +87,14 @@ AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl _AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_][CC], +[AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_][CC], - defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_][CXX], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_][CXX], - defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) +_AM_CONFIG_HEADER_INSINUATE ]) diff --git a/stamp-vti b/stamp-vti index 90fbfc78..ed5cae0a 100644 --- a/stamp-vti +++ b/stamp-vti @@ -1,4 +1,4 @@ -@set UPDATED 12 April 2002 +@set UPDATED 19 April 2002 @set UPDATED-MONTH April 2002 @set EDITION 1.6a @set VERSION 1.6a diff --git a/tests/Makefile.am b/tests/Makefile.am index cec29a44..411bb3a8 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -92,6 +92,7 @@ confdeps.test \ confdist.test \ confh.test \ confh4.test \ +confh5.test \ config.test \ confincl.test \ confsub.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 717ac2a9..2cb29ef3 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -176,6 +176,7 @@ confdeps.test \ confdist.test \ confh.test \ confh4.test \ +confh5.test \ config.test \ confincl.test \ confsub.test \ diff --git a/tests/confh5.test b/tests/confh5.test new file mode 100755 index 00000000..a91b0ee5 --- /dev/null +++ b/tests/confh5.test @@ -0,0 +1,19 @@ +#! /bin/sh + +# Make sure Autoconf complains if AC_CONFIG_HEADERS appears +# before AM_INIT_AUTOMAKE. + +. $srcdir/defs || exit 1 + +cat > configure.in << 'END' +AC_INIT +AC_CONFIG_HEADERS(config.h) +AM_INIT_AUTOMAKE(nonesuch, nonesuch) +AC_OUTPUT +END + +: > config.h.in + +$ACLOCAL || exit 1 +$AUTOCONF 2>&1 | grep AC_CONFIG_HEADERS || exit 1 +: diff --git a/tests/stamph2.test b/tests/stamph2.test index f25e6831..a7bf9482 100755 --- a/tests/stamph2.test +++ b/tests/stamph2.test @@ -3,18 +3,16 @@ # Make sure stamp-h* files are created where we expect . $srcdir/defs || exit 1 -cat > configure.in << END -AC_INIT(Makefile.am) -AM_INIT_AUTOMAKE($me, 1.0) +cat >> configure.in << END AM_CONFIG_HEADER(1.h 2.h:config.hin - 3.h:sdir1/config1.hin - - sdir1/4.h - sdir1/5.h:config.hin - sdir1/6.h:sdir1/config1.hin - sdir1/7.h:sdir2/config2.hin) -AC_OUTPUT(Makefile) + 3.h:sdir1/config1.hin) +# AM_CONFIG_HEADER and AC_CONFIG_HEADERS should be synonyms. +AC_CONFIG_HEADERS(sdir1/4.h + sdir1/5.h:config.hin + sdir1/6.h:sdir1/config1.hin + sdir1/7.h:sdir2/config2.hin) +AC_OUTPUT END : > Makefile.am diff --git a/version.texi b/version.texi index 90fbfc78..ed5cae0a 100644 --- a/version.texi +++ b/version.texi @@ -1,4 +1,4 @@ -@set UPDATED 12 April 2002 +@set UPDATED 19 April 2002 @set UPDATED-MONTH April 2002 @set EDITION 1.6a @set VERSION 1.6a