Hello,

On Wed, Apr 05, 2006 at 07:20:47AM -0700, Noah Misch wrote:
> On Tue, Apr 04, 2006 at 12:14:10PM -0700, Paul Eggert wrote:
> > Likewise.  Given that the patch fixes real problems, I suggest
> > installing it and waiting for the nicer fix later.
> 
> I installed it.  Thanks for the reviews.

OK, so I followed up:
1) moved the assignments back to _AC_CONFIG_FOOS, with an m4_if
   (the ``nicer fix'')
2) re-inserted a newline after that assignment; this fixes a subtle
   regression introduced by the Noah's patch; see below for details
3) added double quotes around the tag names, as descussed before; this fixes
   a regression introduced by my rewrite of status.m4 from last summer.

ad 2):
The expansion of AS_CONFIG_FILES always ended with a newline.
Of course the AS_CONFIG_FILES call is in most cases on a line by itself;
but we should prevent regressions in cases when it is not.

Since most of this was discussed earlier in this thread, I took the liberty
to commit these changes.

And since I think that Noah's patch didn't go to autoconf-patches, I'm
cc'ing this mail there and attaching a combined version of both patches.

Have a nice day,
        Stepan
2006-04-06  Stepan Kasal  <[EMAIL PROTECTED]>

        * lib/autoconf/status.m4 (_AC_CONFIG_FOOS): Append TAGS to
          ac_config_<foo>s again, sometimes normalized, sometimes not.
        (AC_CONFIG_FILES, AC_CONFIG_HEADERS, AC_CONFIG_LINKS, 
AC_CONFIG_COMMANDS):
          Do not do so here.
        (_AC_CONFIG_REGISTER_DEST): Double quote the tags in macros 
_AC_LIST_TAGS
          and_AC_LIST_TAG_COMMANDS; fixes another regression introduced by the
          2005-07-25 rewrite.  Noticed by Noah Misch.

2006-04-05  Noah Misch  <[EMAIL PROTECTED]>

        * lib/autoconf/status.m4 (_AC_CONFIG_FOOS): Do not append normalized
        TAGS to ac_config_<foo>s.
        (AC_CONFIG_FILES, AC_CONFIG_HEADERS, AC_CONFIG_LINKS): Do so here.
        (AC_CONFIG_COMMANDS): Append NAME to ac_config_commands without
        normalizing it, consistent it with previous releases.
        * tests/torture.at (Macro calls in AC_CONFIG_COMMANDS tags): New test.

Index: lib/autoconf/status.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/status.m4,v
retrieving revision 1.89
diff -u -r1.89 status.m4
--- lib/autoconf/status.m4      4 Apr 2006 16:13:47 -0000       1.89
+++ lib/autoconf/status.m4      6 Apr 2006 14:57:02 -0000
@@ -227,13 +227,17 @@
 # Associate the COMMANDS to each TAG, i.e., when config.status creates TAG,
 # run COMMANDS afterwards.  (This is done in _AC_CONFIG_REGISTER_DEST.)
 #
+# For COMMANDS, do not m4_normalize TAGS before adding it to 
ac_config_commands.
+# This historical difference allows macro calls in TAGS.
+#
 m4_define([_AC_CONFIG_FOOS],
 [m4_foreach_w([AC_File], [$2],
              [_AC_CONFIG_REGISTER([$1], m4_defn([AC_File]), [$3])])dnl
 m4_define([_AC_SEEN_CONFIG(ANY)])dnl
 m4_define([_AC_SEEN_CONFIG($1)])dnl
 _AC_CONFIG_COMMANDS_INIT([$4])dnl
-ac_config_[]m4_tolower([$1])="$ac_config_[]m4_tolower([$1]) m4_normalize([$2])"
+ac_config_[]m4_tolower([$1])="$ac_config_[]m4_tolower([$1]) dnl
+m4_if([$1], [COMMANDS], [$2], [m4_normalize([$2])])"
 ])
 
 
@@ -270,14 +274,14 @@
 dnl Recognize TAG as an argument to config.status:
 dnl
 m4_append([_AC_LIST_TAGS],
-[    $3) CONFIG_$1="$CONFIG_$1 $2" ;;
+[    "$3") CONFIG_$1="$CONFIG_$1 $2" ;;
 ])dnl
 dnl
 dnl Register the associated commands, if any:
 dnl
 m4_ifval([$4],
 [m4_append([_AC_LIST_TAG_COMMANDS],
-[    $3:]m4_bpatsubst([$1], [^\(.\).*$], [\1])[) $4 ;;
+[    "$3":]m4_bpatsubst([$1], [^\(.\).*$], [\1])[) $4 ;;
 ])])dnl
 ])# _AC_CONFIG_REGISTER_DEST
 

Index: tests/torture.at
===================================================================
RCS file: /cvsroot/autoconf/autoconf/tests/torture.at,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- tests/torture.at    6 Mar 2006 22:34:34 -0000       1.55
+++ tests/torture.at    5 Apr 2006 14:20:38 -0000       1.56
@@ -204,6 +204,25 @@
 
 
 
+## ---------------------------------------- ##
+## Macro calls in AC_CONFIG_COMMANDS tags.  ##
+## ---------------------------------------- ##
+
+AT_SETUP([Macro calls in AC_CONFIG_COMMANDS tags])
+
+AT_DATA_M4SUGAR([configure.ac],
+[[AC_INIT
+AC_CONFIG_COMMANDS([m4_if(1,1,mytag)])
+AC_OUTPUT
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE
+
+AT_CLEANUP
+
+
+
 ## ------------------- ##
 ## Missing templates.  ##
 ## ------------------- ##

Reply via email to