autoconf-patches
[Top][All Lists]
Advanced

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

Re: Fix autoscan to not search config-subdirs


From: Noah Misch
Subject: Re: Fix autoscan to not search config-subdirs
Date: Mon, 3 Apr 2006 09:01:16 -0700
User-agent: Mutt/1.5.6i

On Mon, Apr 03, 2006 at 05:48:59AM +0200, Ralf Wildenhues wrote:
> * Noah Misch wrote on Fri, Mar 31, 2006 at 03:34:55PM CEST:

> > 2006-03-31  Noah Misch  <address@hidden>
> > 
> >     * bin/autoscan.in (subdirs): New global.
> >     (scan_file): Prune directories with configure{,.{ac,in,gnu}}.
> >     (output): Emit AC_CONFIG_SUBDIRS as needed.
> >     * tests/autoscan.at (autoscan): Remove XFAIL.

> > +  if (-d $_ and
> 
> You should make sure `.' is excluded here, otherwise autoscan won't
> recurse into any subdirs if a configure.ac is already present.
> 
> > +      -f "$_/configure.in"  ||
> > +      -f "$_/configure.ac"  ||
> > +      -f "$_/configure.gnu" ||
> > +      -f "$_/configure")

Thanks for catching that.  I'll make a note to improve the autoscan test case,
so I can't silently break autoscan entirely.

I fixed that problem and installed the change as follows:


diff -urp -X dontdiff ac-clean/bin/autoscan.in ac-an_confirm/bin/autoscan.in
--- ac-clean/bin/autoscan.in    2006-03-26 16:27:56.000000000 -0500
+++ ac-an_confirm/bin/autoscan.in       2006-04-03 11:49:54.000000000 -0400
@@ -47,7 +47,7 @@ use File::Basename;
 use File::Find;
 use strict;
 
-use vars qw(@cfiles @makefiles @shfiles %printed);
+use vars qw(@cfiles @makefiles @shfiles @subdirs %printed);
 
 # The kind of the words we are looking for.
 my @kinds = qw (function header identifier program
@@ -385,6 +385,15 @@ sub scan_file ()
   # Strip a useless leading `./'.
   $File::Find::name =~ s,^\./,,;
 
+  if ($_ ne '.' and -d $_ and
+      -f "$_/configure.in"  ||
+      -f "$_/configure.ac"  ||
+      -f "$_/configure.gnu" ||
+      -f "$_/configure")
+    {
+      $File::Find::prune = 1;
+      push @subdirs, $File::Find::name;
+    }
   if (/\.[chlym](\.in)?$/)
     {
       used 'program', 'cc', $File::Find::name;
@@ -530,6 +539,7 @@ sub output ($)
   output_kind ($file, 'identifier');
   output_kind ($file, 'function');
 
+  print $file "\n";
   if (@makefiles)
     {
       # Change DIR/Makefile.in to DIR/Makefile.
@@ -538,10 +548,16 @@ sub output ($)
          $m =~ s/\.(?:in|am)$//;
          $unique_makefiles{$m}++;
        }
-      print $file ("\nAC_CONFIG_FILES([",
+      print $file ("AC_CONFIG_FILES([",
                   join ("\n                 ",
                         sort keys %unique_makefiles), "])\n");
     }
+  if (@subdirs)
+    {
+      print $file ("AC_CONFIG_SUBDIRS([",
+                  join ("\n                   ",
+                        sort @subdirs), "])\n");
+    }
   print $file "AC_OUTPUT\n";
 
   $file->close;
diff -urp -X dontdiff ac-clean/tests/autoscan.at ac-an_confirm/tests/autoscan.at
--- ac-clean/tests/autoscan.at  2005-08-16 04:17:46.000000000 -0400
+++ ac-an_confirm/tests/autoscan.at     2006-04-03 11:41:38.000000000 -0400
@@ -20,7 +20,6 @@ AT_BANNER([Autoscan.])
 # 02110-1301, USA.
 
 AT_SETUP([autoscan])
-AT_XFAIL_IF(:)
 
 AT_DATA([Makefile.am],
 [[SUBDIRS = subpkg




reply via email to

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