Hellom

* Eric Blake wrote on Sat, Jul 03, 2010 at 09:59:35PM CEST:
> ----- "Bruno Haible" wrote:
> > In the newest autoconf 2.66, AC_CONFIG_SUBDIRS warns when it is
> > invoked with more than one directory. But this way of invoking it is
> > supported, see the doc:
> 
> Thanks for the report, and sorry for the regression.  Does this
> (untested) patch fix things for you?

Proposed patch for this.  OK to commit?

Please note that I'm trying to merely fix the regression part here.  The
Subdirectories node of the manual also documents:

     If a given DIR is not found, an error is reported: if the
     subdirectory is optional, write:

          if test -d "$srcdir/foo"; then
            AC_CONFIG_SUBDIRS([foo])
          fi

which isn't true either: we don't warn or error if a subdirectory is not
present.  This is *not* a recent regression, and it's on purpose that I
don't want to change this behavior before the next release; I fear that
packages rely on the broken behavior but do not intend to test this
right now.

Thanks,
Ralf

2010-07-06  Eric Blake  <ebl...@redhat.com>
        and Ralf Wildenhues  <ralf.wildenh...@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.

diff --git a/NEWS b/NEWS
index 6c98c23..a2c173f 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,9 @@ GNU Autoconf NEWS - User visible changes.
 ** AC_CHECK_SIZEOF of a pointer type works again.  Regression introduced in
    2.66.
 
+** 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.*.
 
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index e9fcc70..76b01c9 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -3617,6 +3617,7 @@ Subdirectories
 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
diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4
index 52b7a3d..b9e7026 100644
--- a/lib/autoconf/status.m4
+++ b/lib/autoconf/status.m4
@@ -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])"])])
 
diff --git a/tests/torture.at b/tests/torture.at
index 5f13874..e7f61ed 100644
--- a/tests/torture.at
+++ b/tests/torture.at
@@ -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.  ##

Reply via email to