For PR automake/450:
authorAlexandre Duret-Lutz <adl@gnu.org>
Thu, 3 Mar 2005 21:00:20 +0000 (21:00 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Thu, 3 Mar 2005 21:00:20 +0000 (21:00 +0000)
* aclocal.in (write_aclocal, trace_used_macros): Do not add/remove
acinclude.m4 and configure.ac to the include map in these two
places ...
(strip_redundant_includes): ... do it here.  This completes the
previous change from 2005-03-01, that did not update
write_aclocal.
* tests/acloca19.test: Augment.
Report from Peter Breitenlohner.

ChangeLog
aclocal.in
tests/acloca19.test

index 7c82e5f..a9b273c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2005-03-03  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       For PR automake/450:
+       * aclocal.in (write_aclocal, trace_used_macros): Do not add/remove
+       acinclude.m4 and configure.ac to the include map in these two
+       places ...
+       (strip_redundant_includes): ... do it here.  This completes the
+       previous change from 2005-03-01, that did not update
+       write_aclocal.
+       * tests/acloca19.test: Augment.
+       Report from Peter Breitenlohner.
+
 2005-03-02  Alexandre Duret-Lutz  <adl@gnu.org>
 
        * tests/comment9.test: Typo.
@@ -9,7 +21,7 @@
        * tests/Makefile.am (TESTS): Add comment9.test.
        Report from Julien Sopena.
 
-       Fix for PR automake/450:
+       For PR automake/450:
        * aclocal.in (trace_used_macros): Do not explicitly trace files
        included by configure.ac.
        * tests/acloca19.test: New file.
index 5792a09..427185e 100644 (file)
@@ -568,6 +568,12 @@ sub scan_file ($$$)
 sub strip_redundant_includes (%)
 {
   my %files = @_;
+
+  # Always include acinclude.m4, even if it does not appear to be used.
+  $files{'acinclude.m4'} = 1 if -f 'acinclude.m4';
+  # File included by $configure_ac are redundant.
+  $files{$configure_ac} = 1;
+
   # Files at the end of @file_order should override those at the beginning,
   # so it is important to preserve these trailing files.  We can remove
   # a file A if it is going to be output before a file B that includes
@@ -582,18 +588,17 @@ sub strip_redundant_includes (%)
          verb "$ifile is already included by $file";
        }
     }
+
+  # configure.ac is implicitly included.
+  delete $files{$configure_ac};
+
   return %files;
 }
 
 sub trace_used_macros ()
 {
   my %files = map { $map{$_} => 1 } keys %macro_seen;
-  $files{'acinclude.m4'} = 1 if -f 'acinclude.m4';
-  # File included by $configure_ac are redundant.
-  $files{$configure_ac} = 1;
   %files = strip_redundant_includes %files;
-  # configure.ac is implicitly included.
-  delete $files{$configure_ac};
 
   my $traces = ($ENV{AUTOM4TE} || 'autom4te');
   $traces .= " --language Autoconf-without-aclocal-m4 ";
@@ -665,12 +670,8 @@ sub write_aclocal ($@)
        if (exists $map_traced_defs{$m}
            && $map{$m} eq $map_traced_defs{$m});
     }
-  # Always include acinclude.m4, even if it does not appear to be used.
-  $files{'acinclude.m4'} = 1 if -f 'acinclude.m4';
   # Do not explicitly include a file that is already indirectly included.
   %files = strip_redundant_includes %files;
-  # Never include configure.ac :)
-  delete $files{$configure_ac};
 
   my $installed = 0;
 
index be8fd7a..509383f 100755 (executable)
@@ -29,12 +29,13 @@ set -e
 cat >configure.in <<'END'
 AC_INIT([acloca19], [1.0])
 m4_include([aconfig.ac])
+FOO
 AC_OUTPUT
 END
 
 cat >aconfig.ac <<'END'
 AM_INIT_AUTOMAKE
-AC_DEFUN([FOO], [bar])
+AC_DEFUN([FOO], [echo GREPME])
 sinclude([bconfig.ac])
 END
 
@@ -44,7 +45,9 @@ END
 
 $ACLOCAL
 $AUTOCONF
-./configure
+./configure >stdout
+cat stdout
+grep GREPME stdout
 grep 'aconfig\.ac' aclocal.m4 && exit 1
 grep 'bconfig\.ac' aclocal.m4 && exit 1
 grep with-grepme configure