]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Implement AH_HEADER
authorStepan Kasal <kasal@ucw.cz>
Tue, 23 Aug 2005 08:50:54 +0000 (08:50 +0000)
committerStepan Kasal <kasal@ucw.cz>
Tue, 23 Aug 2005 08:50:54 +0000 (08:50 +0000)
ChangeLog
NEWS
doc/autoconf.texi
lib/autoconf/status.m4

index f13c4d831e4233b837af68fe4d1c2ad205a1cfae..ac38f439b68881c067196e92d6bd81d8f6c53913 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2005-08-23  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>,
+           Stepan Kasal  <kasal@ucw.cz>
+
+       * lib/autoconf/status.m4 (_AC_CONFIG_REGISTER_DEST): When the
+       first header appears, define AH_HEADER.
+       * doc/autoconf.texi (Configuration Headers): Document AH_HEADER.
+       Update limitations about when to call AC_CONFIG_HEADERS.
+       (Configuration Commands): Document that AC_CONFIG_COMMANDS_PRE
+       parameter can call AC_SUBST, AC_DEFINE, or AC_CONFIG_FOOS; explain
+       that AC_CONFIG_COMMANDS_PRE and AC_CONFIG_COMMANDS_POST are not
+       ``Configuration Actions''; fix their index entries.
+
 2005-08-23  Stepan Kasal  <kasal@ucw.cz>
 
        * Makefile.maint: Revert the change from 2005-08-12.
diff --git a/NEWS b/NEWS
index 9531711541f7113d760dda2e21662ce70d582b62..63fcc8c8eaa08fd16853786eee04f991e84cd7cb 100644 (file)
--- a/NEWS
+++ b/NEWS
 ** AC_PROG_SED
   New macro that tests for a sed program that truncates as few characters
   as possible.
+
+** AH_HEADER
+  New macro which is defined to the name of the first declared config header
+  or undefined if no config headers have been declared yet.
 \f
 * Major changes in Autoconf 2.59
 
index ee12794dcbfcde27d682e2bd651747549ac19140..4a1a772fca3e55da779ca56ccd79a172b1d33dd4 100644 (file)
@@ -2648,8 +2648,9 @@ seriously, the command lines can exceed the length limits of some
 operating systems.  As an alternative to passing @option{-D} options to
 the compiler, @command{configure} scripts can create a C header file
 containing @samp{#define} directives.  The @code{AC_CONFIG_HEADERS}
-macro selects this kind of output.  It should be called right after
-@code{AC_INIT}.
+macro selects this kind of output.  Though it can be called anywhere
+between @code{AC_INIT} and @code{AC_OUTPUT}, it is customary to call
+it right after @code{AC_INIT}.
 
 The package should @samp{#include} the configuration header file before
 any other header files, to prevent inconsistencies in declarations (for
@@ -2697,6 +2698,19 @@ Doing this allows you to keep your file names acceptable to
 to prepend and/or append boilerplate to the file.
 @end defmac
 
+@defmac AH_HEADER
+This macro is defined as the name of the first declared config header
+and undefined if no config headers have been declared up to this point.
+A third-party macro may, for example, require use of a config header
+without invoking AC_CONFIG_HEADERS twice, like this:
+
+@example
+AC_CONFIG_COMMANDS_PRE(
+       [m4_ifndef([AH_HEADER], [AC_CONFIG_HEADERS([config.h])])])
+@end example
+
+@end defmac
+
 @xref{Configuration Actions}, for more details on @var{header}.
 
 @menu
@@ -2970,13 +2984,23 @@ AC_CONFIG_COMMANDS([time-stamp], [date >time-stamp])
 @end example
 @end defmac
 
+The following two macros look similar, but in fact they are not of the same
+breed: they are executed directly by @file{configure}, so you cannot use
+@file{config.status} to re-run them.
+
+@c Yet it is good to leave them here.  The user sees them together and
+@c decides which best fits their needs.
+
 @defmac AC_CONFIG_COMMANDS_PRE (@var{cmds})
-@acindex{OUTPUT_COMMANDS_PRE}
+@acindex{CONFIG_COMMANDS_PRE}
 Execute the @var{cmds} right before creating @file{config.status}.
+
+This macro presents the last opportunity to call @code{AC_SUBST},
+@code{AC_DEFINE}, or @code{AC_CONFIG_FOOS} macros. 
 @end defmac
 
 @defmac AC_CONFIG_COMMANDS_POST (@var{cmds})
-@acindex{OUTPUT_COMMANDS_POST}
+@acindex{CONFIG_COMMANDS_POST}
 Execute the @var{cmds} right after creating @file{config.status}.
 @end defmac
 
index 1570cd4132f4fd816905a72c781793d8b3eeb119..bf71570ccf95bc47f8b1b66856794e2c3920f0b2 100644 (file)
@@ -258,9 +258,14 @@ _AC_CONFIG_REGISTER_DEST([$1], [$2], m4_bpatsubst([[$2]], [:.*\(.\)$], [\1]), [$
 # With CONFIG_LINKS, reject DEST=., because it is makes it hard for ./config.status
 # to guess the links to establish (`./config.status .').
 #
+# Save the name of the first config header to AH_HEADER.
+#
 m4_define([_AC_CONFIG_REGISTER_DEST],
 [_AC_CONFIG_UNIQUE([$1], [$3])dnl
-m4_if([$1 $3], [LINKS .], [AC_FATAL([invalid destination of a config link: `.'])])dnl
+m4_if([$1 $3], [LINKS .],
+      [AC_FATAL([invalid destination of a config link: `.'])])dnl
+m4_if([$1], [HEADERS],
+      [m4_define_default([AH_HEADER], [$3])])dnl
 dnl
 dnl Recognize TAG as an argument to config.status:
 dnl