]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* bin/autoscan.in (scan_file): Scan Makefile.am too. Ignore
authorAlexandre Duret-Lutz <adl@gnu.org>
Thu, 7 Nov 2002 14:11:31 +0000 (14:11 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Thu, 7 Nov 2002 14:11:31 +0000 (14:11 +0000)
Makefile.in if Makefile.am exists.
(output): Strip `.am' from Makefiles.  Don't
output AC_CONFIG_FILES if no Makefiles were found.

ChangeLog
bin/autoscan.in

index 133b39468063e91408fe1f7c49d4c36af54f58f7..296ac4c3009e9a850946d2579e89812a164d5f43 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-11-07  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       * bin/autoscan.in (scan_file): Scan Makefile.am too. Ignore
+       Makefile.in if Makefile.am exists.
+       (output): Strip `.am' from Makefiles.  Don't
+       output AC_CONFIG_FILES if no Makefiles were found.
+
 2002-11-07  Akim Demaille  <akim@epita.fr>
 
        * Makefile.am (cvs_files): Add elisp-comp, mdate-sh.
index c1beeab6ad9cf5712104773038bc809a40608321..74b0bbdbabd09d79a225ebce2be1a95609c7b6c4 100644 (file)
@@ -368,7 +368,7 @@ sub scan_file ()
     if -f "$_.in";
 
   # Save $_ as Find::File requires it to be preserved.
-  my $underscore = $_;
+  local $_ = $_;
 
   # Strip a useless leading `./'.
   $File::Find::name =~ s,^\./,,;
@@ -383,7 +383,8 @@ sub scan_file ()
       used 'program', 'c++', $File::Find::name;
       scan_c_file ($_);
     }
-  elsif (/^[Mm]akefile(\.in)?$/ || /^GNUmakefile(\.in)?$/)
+  elsif ((/^((?:GNUm|M|m)akefile)(\.in)?$/ && ! -f "$1.am")
+        || /^(?:GNUm|M|m)akefile(\.am)?$/)
     {
       scan_makefile ($_);
     }
@@ -391,8 +392,6 @@ sub scan_file ()
     {
       scan_sh_file ($_);
     }
-
-  $_ = $underscore;
 }
 
 
@@ -519,14 +518,18 @@ sub output ($)
   output_kind ($file, 'identifier');
   output_kind ($file, 'function');
 
-  # Change DIR/Makefile.in to DIR/Makefile.
-  foreach my $m (@makefiles)
+  if (@makefiles)
     {
-      $m =~ s/\.in$//;
-      $unique_makefiles{$m}++;
+      # Change DIR/Makefile.in to DIR/Makefile.
+      foreach my $m (@makefiles)
+       {
+         $m =~ s/\.(?:in|am)$//;
+         $unique_makefiles{$m}++;
+       }
+      print $file ("\nAC_CONFIG_FILES([",
+                  join ("\n                 ",
+                        sort keys %unique_makefiles), "])\n");
     }
-  print $file "\nAC_CONFIG_FILES([",
-       join ("\n                 ", sort keys %unique_makefiles), "])\n";
   print $file "AC_OUTPUT\n";
 
   $file->close;