bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: autoreconf vs AC_CONFIG_SUBDIRS


From: Akim Demaille
Subject: Re: autoreconf vs AC_CONFIG_SUBDIRS
Date: 08 Nov 2001 17:11:21 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence)

>>>>> "Akim" == Akim Demaille <address@hidden> writes:

>>>>> "Ralf" == Ralf Corsepius <address@hidden> writes:
Ralf> IMHO, autoreconf's behavior doesn't match with autoconf's
Ralf> behavior, and therefore should be changed, i.e. I am in favor of
Ralf> letting autoreconf either ignore or just warn about
Ralf> AC_CONFIG_SUBDIRS which are not present in a source-tree, but
Ralf> not to abort.

Akim> You are right, thanks for the report.  I'll fix that.
Akim> configure.ac/dirs passed on the CL are mandatory, but not those
Akim> in SUBDIRS.

Here is the patch.  Thanks!

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * bin/autoreconf.in (&autoreconf): AC_CONFIG_SUBIDRS are to be
        processed only if present.
        * tests/torture.at (Configuring subdirectories): Use autoreconf
        instead of successive calls to autoconf.
        Add a nonexistent subdirectory to exercise the patch above.
        Reported by Ralf Corsepius.

Index: bin/autoreconf.in
===================================================================
RCS file: /cvs/autoconf/bin/autoreconf.in,v
retrieving revision 1.86
diff -u -u -r1.86 autoreconf.in
--- bin/autoreconf.in 2001/11/05 09:32:35 1.86
+++ bin/autoreconf.in 2001/11/08 16:14:18
@@ -240,9 +240,22 @@
       $uses_gettext = 1           if /AM_GNU_GETTEXT/;
       $uses_libtool = 1           if /AM_PROG_LIBTOOL/;
       $uses_autoheader = 1        if /AC_CONFIG_HEADERS/;
-      push @ARGV, split (' ', $1) if /AC_CONFIG_SUBDIRS:(.*)/;
+      push @subdir, split (' ', $1) if /AC_CONFIG_SUBDIRS:(.*)/;
     }
 
+  # The subdirs are *optional*, they may not exist.
+  foreach (@subdir)
+    {
+      if (-d)
+       {
+         verbose "$configure_ac: subdirectory $_ to autoreconf";
+         push @ARGV, $_;
+       }
+      else
+       {
+         verbose "$configure_ac: subdirectory $_ not present";
+       }
+    }
 
   # -------------------- #
   # Running gettexitze.  #
Index: tests/torture.at
===================================================================
RCS file: /cvs/autoconf/tests/torture.at,v
retrieving revision 1.27
diff -u -u -r1.27 torture.at
--- tests/torture.at 2001/10/19 17:34:54 1.27
+++ tests/torture.at 2001/11/08 16:14:18
@@ -523,7 +523,20 @@
 # `-- install-sh
 #
 AT_SETUP([Configuring subdirectories])
+AT_KEYWORDS(autoreconf)
 
+# Move into a fresh testSubDir.  But Autotest is not ready for such
+# tricks, albeit most useful :( It expects to find its files
+# (at-setup-line and so on) in the original `.', and it will complain
+# not to find even one.  So just run mkdir as if it were a test.  This
+# will create at-setup-line blah blah, and Autotest will leave us in
+# peace.
+#
+# FIXME: The more I think about it, the more I am tempted to *always*
+# have test groups run in a subdir, a` la Automake.
+AT_CHECK([AS_MKDIR_P([testSubDir])])
+cd testSubDir
+
 # The contents of `inner/', and `inner/innermost/'.
 AS_MKDIR_P([inner/innermost])
 
@@ -545,15 +558,18 @@
 # The contents of `.'
 AT_DATA([install-sh], [])
 
+# nonexistent is allowed not to exist.
 AT_DATA([configure.ac],
 [AC_INIT(GNU Outer, 1.0)
 AC_ARG_VAR([OUTER], [an outer variable])
+if false; then
+  AC_CONFIG_SUBDIRS([nonexistent])
+fi
 AC_CONFIG_SUBDIRS([inner])
 AC_OUTPUT
 ])
 
-AT_CHECK_AUTOCONF
-AT_CHECK_AUTOCONF([-o inner/configure inner/configure.ac])
+AT_CHECK([autoreconf])
 AT_CHECK([test -f inner/configure])
 
 # Running the outer configure recursively should provide the innermost
@@ -578,4 +594,4 @@
 ])
 
 
-AT_CLEANUP(inner builddir)
+AT_CLEANUP(testSubDir)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]