]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
1999-10-31 Akim Demaille <akim@epita.fr>
authorAkim Demaille <akim@epita.fr>
Tue, 21 Dec 1999 11:11:54 +0000 (11:11 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 21 Dec 1999 11:11:54 +0000 (11:11 +0000)
Provide a means to specify commands to run before config.status is
created (and, for symmetry, after it is created).

This is typically needed by Automake so that AC_REPLACEd functions
go through deansification via

LIBOBJS=`echo $LIBOBJS | sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`

and/or by Libtool which needs to define LTLIBOBJS and others:

LTLIBOBJS=`echo $LIBOBJS | sed 's/\.o/\.lo/g'`
AC_SUBST(LTLIBOBJS)

* acgeneral.m4 (AC_OUTPUT_PRE_COMMANDS): New growing string.
Initialize.
(AC_OUTPUT_POST_COMMANDS): Likewise.
(AC_CONFIG_PRE_COMMANDS): New macro, grows AC_OUTPUT_PRE_COMMANDS.
(AC_CONFIG_PRE_COMMANDS): Likewise.
(AC_OUTPUT): Run AC_OUTPUT_PRE_COMMANDS before
AC_OUTPUT_CONFIG_STATUS, and AC_OUTPUT_POST_COMMANDS after.

ChangeLog
TODO
acgeneral.m4
lib/autoconf/general.m4

index e137c375aa1782ccc8a917ce52de9ed444e1a147..cfef1fa8485afc36988fd5e14059d559b9dfe115 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+1999-10-31  Akim Demaille  <akim@epita.fr>
+
+       Provide a means to specify commands to run before config.status is
+       created (and, for symmetry, after it is created).
+
+       This is typically needed by Automake so that AC_REPLACEd functions
+       go through deansification via
+
+       LIBOBJS=`echo $LIBOBJS | sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'`
+
+       and/or by Libtool which needs to define LTLIBOBJS and others:
+
+       LTLIBOBJS=`echo $LIBOBJS | sed 's/\.o/\.lo/g'`
+       AC_SUBST(LTLIBOBJS)
+
+       * acgeneral.m4 (AC_OUTPUT_PRE_COMMANDS): New growing string.
+       Initialize.
+       (AC_OUTPUT_POST_COMMANDS): Likewise.
+       (AC_CONFIG_PRE_COMMANDS): New macro, grows AC_OUTPUT_PRE_COMMANDS.
+       (AC_CONFIG_PRE_COMMANDS): Likewise.
+       (AC_OUTPUT): Run AC_OUTPUT_PRE_COMMANDS before
+       AC_OUTPUT_CONFIG_STATUS, and AC_OUTPUT_POST_COMMANDS after.
+
 1999-10-31  Akim Demaille  <akim@epita.fr>
 
        Remove spurious empty lines appearing in configures.
diff --git a/TODO b/TODO
index 0ee39e89625e1e054bbd21f7b1d448f99cf08a35..1ce90c09b6a375144db883e2e7911edc4fbba533 100644 (file)
--- a/TODO
+++ b/TODO
@@ -19,15 +19,18 @@ reader catches that properly, we should not care.  If no info reader
 can handle this, we should change the affected node names.  Bug
 triggered by looking for `CONFIG_FILES' in the index.
 
-** autoconf.texi: Document AC_CONFIG_FILES and AC_CONFIG_COMMANDS.
+** AC_CONFIG_FILES, AC_CONFIG_COMMANDS.
+Will we need both ICMD and CMD as is the case for AC_OUTPUT_COMMANDS?
+If so, they have to be adapted.
+
+** autoconf.texi: Document AC_CONFIG_FILES, AC_CONFIG_COMMANDS.
 I didn't do it, because I don't know where to do that.  I would like
 to have all the AC_CONFIG_ together, but it is not currently the
 case.  An architecture for the docs needs to be decided.
 
-** autoconf.texi, near fubar=27.
-This example is *wrong*.  fubar is set in configure, not
-config.status, therefore the extra commands will not know $fubar, as
-the example let us believe.
+** AC_CONFIG_PRE_COMMANDS, AC_CONFIG_POST_COMMANDS.
+We still have to discuss a few issues: should the pre-commands be run
+before the cache is created?  Are the names OK?  Document, see above.
 
 ** AC_C_STRUCT_MEMBER needs a full rewrite.
 And once done, the former specialized macros should be adapted.
index 3b188cc844511b202c2ef4e0ac3fba8cc04137b5..8e88cfc7fc042a8a98ad4816eace99f5d6973574 100644 (file)
@@ -3082,6 +3082,7 @@ dnl -----------------------------------------
 dnl Add additional commands for AC_OUTPUT to put into config.status.
 dnl Use diversions instead of macros so we can be robust in the
 dnl presence of commas in $1 and/or $2.
+dnl FIXME: Obsolete it?
 AC_DEFUN(AC_OUTPUT_COMMANDS,
 [AC_DIVERT_PUSH(AC_DIVERSION_CMDS)dnl
 [$1]
@@ -3091,6 +3092,28 @@ AC_DIVERT_PUSH(AC_DIVERSION_ICMDS)dnl
 AC_DIVERT_POP()])
 
 
+dnl AC_CONFIG_PRE_COMMANDS(CMDS)
+dnl ----------------------------
+dnl Commands to run right before config.status is created. Accumulates.
+AC_DEFUN([AC_CONFIG_PRE_COMMANDS],
+[m4_append([AC_OUTPUT_PRE_COMMANDS], [$1
+])])
+
+dnl Initialize.
+define([AC_OUTPUT_PRE_COMMANDS])
+
+
+dnl AC_CONFIG_POST_COMMANDS(CMDS)
+dnl -----------------------------
+dnl Commands to run after config.status was created.  Accumulates.
+AC_DEFUN([AC_CONFIG_POST_COMMANDS],
+[m4_append([AC_OUTPUT_POST_COMMANDS], [$1
+])])
+
+dnl Initialize.
+define([AC_OUTPUT_POST_COMMANDS])
+
+
 dnl AC_CONFIG_SUBDIRS(DIR ...)
 dnl --------------------------
 dnl FIXME: `subdirs=' should not be here.
@@ -3138,13 +3161,18 @@ trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
 
 ifset([AC_LIST_HEADERS], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
 
+dnl Commands to run before creating config.status.
+AC_OUTPUT_PRE_COMMANDS()dnl
+
 # Without the "./", some shells look in PATH for config.status.
 : ${CONFIG_STATUS=./config.status}
-
 AC_OUTPUT_CONFIG_STATUS()dnl
-
 rm -fr confdefs* $ac_clean_files
 trap 'exit 1' 1 2 15
+
+dnl Commands to run after config.status was created
+AC_OUTPUT_POST_COMMANDS()dnl
+
 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
 dnl config.status should not do recursion.
 ifset([AC_LIST_SUBDIRS], [AC_OUTPUT_SUBDIRS(AC_LIST_SUBDIRS)])dnl
index 3b188cc844511b202c2ef4e0ac3fba8cc04137b5..8e88cfc7fc042a8a98ad4816eace99f5d6973574 100644 (file)
@@ -3082,6 +3082,7 @@ dnl -----------------------------------------
 dnl Add additional commands for AC_OUTPUT to put into config.status.
 dnl Use diversions instead of macros so we can be robust in the
 dnl presence of commas in $1 and/or $2.
+dnl FIXME: Obsolete it?
 AC_DEFUN(AC_OUTPUT_COMMANDS,
 [AC_DIVERT_PUSH(AC_DIVERSION_CMDS)dnl
 [$1]
@@ -3091,6 +3092,28 @@ AC_DIVERT_PUSH(AC_DIVERSION_ICMDS)dnl
 AC_DIVERT_POP()])
 
 
+dnl AC_CONFIG_PRE_COMMANDS(CMDS)
+dnl ----------------------------
+dnl Commands to run right before config.status is created. Accumulates.
+AC_DEFUN([AC_CONFIG_PRE_COMMANDS],
+[m4_append([AC_OUTPUT_PRE_COMMANDS], [$1
+])])
+
+dnl Initialize.
+define([AC_OUTPUT_PRE_COMMANDS])
+
+
+dnl AC_CONFIG_POST_COMMANDS(CMDS)
+dnl -----------------------------
+dnl Commands to run after config.status was created.  Accumulates.
+AC_DEFUN([AC_CONFIG_POST_COMMANDS],
+[m4_append([AC_OUTPUT_POST_COMMANDS], [$1
+])])
+
+dnl Initialize.
+define([AC_OUTPUT_POST_COMMANDS])
+
+
 dnl AC_CONFIG_SUBDIRS(DIR ...)
 dnl --------------------------
 dnl FIXME: `subdirs=' should not be here.
@@ -3138,13 +3161,18 @@ trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
 
 ifset([AC_LIST_HEADERS], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
 
+dnl Commands to run before creating config.status.
+AC_OUTPUT_PRE_COMMANDS()dnl
+
 # Without the "./", some shells look in PATH for config.status.
 : ${CONFIG_STATUS=./config.status}
-
 AC_OUTPUT_CONFIG_STATUS()dnl
-
 rm -fr confdefs* $ac_clean_files
 trap 'exit 1' 1 2 15
+
+dnl Commands to run after config.status was created
+AC_OUTPUT_POST_COMMANDS()dnl
+
 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
 dnl config.status should not do recursion.
 ifset([AC_LIST_SUBDIRS], [AC_OUTPUT_SUBDIRS(AC_LIST_SUBDIRS)])dnl