2005-03-03 Alexandre Duret-Lutz <adl@gnu.org>
For PR automake/450:
+ * aclocal.in (scan_file, scan_configure_dep): Skip missing sincluded
+ files.
+ * automake.in (scan_autoconf_traces): Likewise.
+ * tests/sinclude.test: Augment.
+ Report from Peter Breitenlohner.
+
+ 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 ...
my $ac_require_rx = "AC_REQUIRE\\((?:\\[([^]]+)\\]|([^],)\n]+))\\)";
# Matches an m4_include line
-my $m4_include_rx = "(?:m4_)?s?include\\((?:\\[([^]]+)\\]|([^],)\n]+))\\)";
+my $m4_include_rx = "(?:m4_)?(s?)include\\((?:\\[([^]]+)\\]|([^],)\n]+))\\)";
# Match a serial number
my $serial_line_rx = '^#\s*serial\s+(\S*)';
while (/$m4_include_rx/go)
{
- push (@ilist, $1 || $2);
+ my $ifile = $2 || $3;
+ # Skip missing `sinclude'd files.
+ next if $1 eq 's' && ! -f $ifile;
+ push @ilist, $ifile;
}
while (/$ac_require_rx/go)
while ($line =~ /$m4_include_rx/go)
{
- my $ifile = $1 || $2;
+ my $ifile = $2 || $3;
+ # Skip missing `sinclude'd files.
+ next if $1 eq 's' && ! -f $ifile;
# m4_include is relative to the directory of the file which
# perform the include, but we want paths relative to the
# directory where aclocal is run. Do not use
|| $macro eq 'm4_sinclude'
|| $macro eq 'sinclude')
{
+ # Skip missing `sinclude'd files.
+ next if $macro ne 'm4_include' && ! -f $args[1];
+
# Some modified versions of Autoconf don't use
# forzen files. Consequently it's possible that we see all
# m4_include's performed during Autoconf's startup.
#! /bin/sh
-# Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
AC_INIT([amsinclude], [1.0])
AM_INIT_AUTOMAKE
AC_CONFIG_FILES([Makefile])
+sinclude([doesntexist.m4])
EOF
mkdir sub
: > Makefile.am
echo 'sinclude(sub/g.m4)' >> acinclude.m4
+echo 'm4_sinclude(sub/doesntexist.m4)' >> acinclude.m4
$ACLOCAL
$AUTOMAKE
+grep doesntexist Makefile.in && exit 1
grep MAGICALPIG Makefile.in
grep MAGICALHOG Makefile.in
grep GREPME Makefile.in