+2005-06-29 Stepan Kasal <kasal@ucw.cz>
+
+ * lib/autoconf/general.m4 (AC_SUBST_TRACE): New macro, to be traced
+ instead of AC_SUBST; proposed by Alexandre Duret-Lutz.
+ (AC_SUBST): Call it.
+ * lib/autoconf/status.m4 (_AC_OUTPUT_FILES): Call AC_SUBST_TRACE for
+ the directory specific variables; but don't call it for configure_input.
+
2005-06-29 Stepan Kasal <kasal@ucw.cz>
* lib/autoconf/general.m4 (AC_ARG_VAR): Move next to _AC_ARG_PRECIOUS.
## -------------------------- ##
+# AC_SUBST_TRACE(VARIABLE)
+# ------------------------
+# This macro is used with --trace to collect the list of substituted variables.
+m4_define([AC_SUBST_TRACE])
+
+
# AC_SUBST(VARIABLE, [VALUE])
# ---------------------------
# Create an output variable from a shell VARIABLE. If VALUE is given
# Beware that if you change this macro, you also have to change the
# sed script at the top of _AC_OUTPUT_FILES.
m4_define([AC_SUBST],
-[m4_pattern_allow([^$1$])dnl
+[AC_SUBST_TRACE([$1])dnl
+m4_pattern_allow([^$1$])dnl
m4_ifvaln([$2], [$1=$2])[]dnl
m4_append_uniq([_AC_SUBST_VARS], [$1], [
])dnl
cat >>$CONFIG_STATUS <<\_ACEOF
:t
[/@[a-zA-Z_][a-zA-Z_0-9]*@/!b]
+dnl configure_input is a somewhat special, so we don't call AC_SUBST_TRACE.
s|@configure_input@|$configure_input|;t t
-s|@srcdir@|$ac_srcdir|;t t
-s|@abs_srcdir@|$ac_abs_srcdir|;t t
-s|@top_srcdir@|$ac_top_srcdir|;t t
-s|@abs_top_srcdir@|$ac_abs_top_srcdir|;t t
-s|@builddir@|$ac_builddir|;t t
-s|@abs_builddir@|$ac_abs_builddir|;t t
-s|@top_builddir@|$ac_top_builddir_sub|;t t
-s|@abs_top_builddir@|$ac_abs_top_builddir|;t t
-AC_PROVIDE_IFELSE([AC_PROG_INSTALL], [s,@INSTALL@,$ac_INSTALL,;t t
+dnl During the transition period, this is a special case:
+s|@top_builddir@|$ac_top_builddir_sub|;t t[]AC_SUBST_TRACE([top_builddir])
+m4_foreach([_AC_Var], [srcdir, abs_srcdir, top_srcdir, abs_top_srcdir,
+ builddir, abs_builddir,
+ abs_top_builddir]AC_PROVIDE_IFELSE([AC_PROG_INSTALL], [[, INSTALL]]),
+ [s|@_AC_Var@|$ac_[]_AC_Var|;t t[]AC_SUBST_TRACE(_AC_Var)
])dnl
" $ac_file_inputs m4_defn([_AC_SED_CMDS])>$tmp/out
m4_popdef([_AC_SED_CMDS])dnl