]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Fix regression of AC_CONFIG_SUBDIRS with multiple arguments.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 6 Jul 2010 20:31:33 +0000 (22:31 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Thu, 8 Jul 2010 04:43:33 +0000 (06:43 +0200)
* lib/autoconf/status.m4 (AC_CONFIG_SUBDIRS): Do not assume the
argument is a single word.
* tests/torture.at (Deep Package): Extend test to cover this.
(Non-literal AC_CONFIG_SUBDIRS): New test.
* doc/autoconf.texi (Subdirectories): Add example marker.
* NEWS: Update.
Report by Bruno Haible.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
NEWS
doc/autoconf.texi
lib/autoconf/status.m4
tests/torture.at

index ab4d7b2f5d1a574b2095cad3ec0fcfc69edd652b..e9e465b6477f802bbc4427f31ed6e397cf93d523 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2010-07-08  Eric Blake  <eblake@redhat.com>
+       and Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Fix regression of AC_CONFIG_SUBDIRS with multiple arguments.
+       * lib/autoconf/status.m4 (AC_CONFIG_SUBDIRS): Do not assume the
+       argument is a single word.
+       * tests/torture.at (Deep Package): Extend test to cover this.
+       (Non-literal AC_CONFIG_SUBDIRS): New test.
+       * doc/autoconf.texi (Subdirectories): Add example marker.
+       * NEWS: Update.
+       Report by Bruno Haible.
+
 2010-07-04  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        Fix minor copy&paste leftover in m4sh tests.
diff --git a/NEWS b/NEWS
index 7282697572f02e4d05a5d58071f35e9a2b21545b..505355791728067273bbdf58cb361a9b3f9562b8 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,8 @@ GNU Autoconf NEWS - User visible changes.
 
 * Noteworthy changes in release ?.? (????-??-??) [?]
 
+** AC_CONFIG_SUBDIRS with more than one subdirectory at a time works again.
+   Regression introduced in 2.66.
 
 * Major changes in Autoconf 2.66 (2010-07-02) [stable]
   Released by Eric Blake, based on git versions 2.65.*.
index 0c106c71e82c8a5548960180d628199ece0dedb9..39c2ba608bf9c671ca3bedfba99e22fc3c45749d 100644 (file)
@@ -3617,6 +3617,7 @@ Make @code{AC_OUTPUT} run @command{configure} in each subdirectory
 be a literal, i.e., please do not use:
 
 @example
+@c If you change this example, adjust tests/torture.at:Non-literal AC_CONFIG_SUBDIRS.
 if test "x$package_foo_enabled" = xyes; then
   my_subdirs="$my_subdirs foo"
 fi
index 52b7a3d196ad3dfc197bf3e02df4deee9ada3ad7..b9e70264df36313f793163a8980f2beb80c6446f 100644 (file)
@@ -1102,7 +1102,7 @@ AC_DEFUN([AC_CONFIG_SUBDIRS],
   _AC_CONFIG_COMPUTE_DEST(], [))])]dnl
 [m4_append([_AC_LIST_SUBDIRS], [$1], [
 ])]dnl
-[AS_LITERAL_WORD_IF([$1], [],
+[AS_LITERAL_IF([$1], [],
               [AC_DIAGNOSE([syntax], [$0: you should use literals])])]dnl
 [AC_SUBST([subdirs], ["$subdirs m4_normalize([$1])"])])
 
index 5f138740ab9661148f8b2646d1eaad1ce026c905..e7f61ed119d5d46791101148d542ace0a5ffc01c 100644 (file)
@@ -1567,7 +1567,9 @@ AC_ARG_VAR([INNER2], [an inner2 variable])
 AC_OUTPUT
 ]])
 
-AT_CHECK([autoreconf -Wall -v], [0], [ignore], [ignore])
+AT_CHECK([autoreconf -Wall -v], [0], [ignore], [stderr])
+# We should not warn about nonliteral argument to AC_CONFIG_SUBDIRS here.
+AT_CHECK([grep 'AC_CONFIG_SUBDIRS:.*literals' stderr], [1])
 AT_CHECK([test -f inner/configure])
 AT_CHECK([test -f inner/innermost/configure])
 AT_CHECK([test -f inner/innermost/config.hin])
@@ -1693,6 +1695,56 @@ AT_CHECK([test -f inner/myfile], 0)
 AT_CLEANUP
 
 
+## ------------------------------- ##
+## Non-literal AC_CONFIG_SUBDIRS.  ##
+## ------------------------------- ##
+
+AT_SETUP([Non-literal AC_CONFIG_SUBDIRS])
+AT_KEYWORDS([autoreconf])
+
+# We use aclocal (via autoreconf).
+AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])
+
+AT_DATA([install-sh], [])
+AT_DATA([configure.in],
+[[AC_INIT(GNU Outer, 1.0)
+
+my_subdirs=
+# Taken from autoconf.texi:Subdirectories.
+if test "x$package_foo_enabled" = xyes; then
+  my_subdirs="$my_subdirs foo"
+fi
+AC_CONFIG_SUBDIRS([$my_subdirs])
+AC_OUTPUT
+]])
+
+AS_MKDIR_P([foo])
+
+AT_DATA([foo/configure],
+[[#! /bin/sh
+touch innerfile
+exit 0
+]])
+chmod +x foo/configure
+
+# autoreconf should warn without -Wno-syntax, but should not fail without -Werror.
+AT_CHECK([autoreconf -Werror -v], [1], [ignore], [stderr])
+AT_CHECK([grep 'AC_CONFIG_SUBDIRS:.*literals' stderr], [0], [ignore])
+AT_CHECK([autoreconf -v], [0], [ignore], [stderr])
+AT_CHECK([grep 'AC_CONFIG_SUBDIRS:.*literals' stderr], [0], [ignore])
+# We cannot assume aclocal won't warn (aclocal-1.9 does not understand -W*
+# options), so check autoconf only.
+AT_CHECK([autoconf --force -Wno-syntax], 0, [ignore], [stderr])
+AT_CHECK([grep 'AC_CONFIG_SUBDIRS:.*literals' stderr], [1])
+
+AT_CHECK([./configure $configure_options], [0], [ignore])
+AT_CHECK([test ! -f foo/innerfile])
+# Running the outer configure should trigger the inner.
+AT_CHECK([./configure $configure_options package_foo_enabled=yes], [0], [ignore])
+AT_CHECK([test -f foo/innerfile])
+
+AT_CLEANUP
+
 
 ## ----------------- ##
 ## Empty directory.  ##