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