From: Alexandre Duret-Lutz Date: Thu, 3 Mar 2005 21:35:44 +0000 (+0000) Subject: For PR automake/450: X-Git-Tag: Release-1-9b~172 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c031805c117e56aaba38c6d45952347570df2a45;p=thirdparty%2Fautomake.git 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. --- diff --git a/ChangeLog b/ChangeLog index a9b273c4b..2dd656875 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2005-03-03 Alexandre Duret-Lutz + 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 diff --git a/aclocal.in b/aclocal.in index 427185e39..2d6177320 100644 --- a/aclocal.in +++ b/aclocal.in @@ -135,7 +135,7 @@ my $ac_defun_rx = 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*)'; @@ -351,7 +351,10 @@ sub scan_configure_dep ($) 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) @@ -525,7 +528,9 @@ sub scan_file ($$$) 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 diff --git a/automake.in b/automake.in index b42739989..9e2a98687 100755 --- a/automake.in +++ b/automake.in @@ -4899,6 +4899,9 @@ sub scan_autoconf_traces ($) || $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. diff --git a/tests/sinclude.test b/tests/sinclude.test index ffe65cc8a..7c7ab2a4d 100755 --- a/tests/sinclude.test +++ b/tests/sinclude.test @@ -1,5 +1,5 @@ #! /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. # @@ -31,6 +31,7 @@ cat > configure.in < Makefile.am echo 'sinclude(sub/g.m4)' >> acinclude.m4 +echo 'm4_sinclude(sub/doesntexist.m4)' >> acinclude.m4 $ACLOCAL @@ -57,6 +59,7 @@ echo 'm4_include(sub/h.m4)' >> aclocal.m4 $AUTOMAKE +grep doesntexist Makefile.in && exit 1 grep MAGICALPIG Makefile.in grep MAGICALHOG Makefile.in grep GREPME Makefile.in