+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.
* 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.
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
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 ";
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;
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
$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