+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.
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.
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]
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.
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
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]
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.
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