From: Alexandre Duret-Lutz Date: Sun, 22 Sep 2002 14:35:19 +0000 (+0000) Subject: * automake.in (macro_define): Update a variable's location each X-Git-Tag: Release-1-7~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=749fdb7f37da1f6f39e3fa7b3fb150a4e46e7c63;p=thirdparty%2Fautomake.git * automake.in (macro_define): Update a variable's location each time its owner is updated. * tests/gnuwarn.test: Append to CFLAGS to check for this. Reported by Harlan Stenn. --- diff --git a/ChangeLog b/ChangeLog index a9336d603..c15eb3e8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-09-22 Alexandre Duret-Lutz + + * automake.in (macro_define): Update a variable's location each + time its owner is updated. + * tests/gnuwarn.test: Append to CFLAGS to check for this. + Reported by Harlan Stenn. + 2002-09-20 Alexandre Duret-Lutz * configure.in: Bump version to 1.6g. diff --git a/automake.in b/automake.in index a8c9800be..ecad4ae30 100755 --- a/automake.in +++ b/automake.in @@ -6392,6 +6392,10 @@ sub macro_define ($$$$$$) || $owner > $var_owner{$var}{$cond})) { $var_owner{$var}{$cond} = $owner; + # Always adjust the location when the owner changes (even for + # `+=' statements). The risk otherwise is to warn about + # a VAR_MAKEFILE variable and locate it in configure.ac... + $var_location{$var}{$cond} = $where; } # Call var_VAR_trigger if it's defined. diff --git a/tests/gnuwarn.test b/tests/gnuwarn.test index 9aff88b5a..9dca3b177 100755 --- a/tests/gnuwarn.test +++ b/tests/gnuwarn.test @@ -36,7 +36,7 @@ END : > ChangeLog cat > Makefile.am << 'END' -CFLAGS = -I.. +CFLAGS += -I.. LDFLAGS = -lfoo CXXFLAGS = -Wall bin_PROGRAMS = bar @@ -48,8 +48,8 @@ $AUTOMAKE -Wnone --add-missing --foreign # Warn in gnu mode $AUTOMAKE -Wnone --add-missing --gnu 2>stderr && exit 1 cat stderr -grep CFLAGS stderr -grep LDFLAGS stderr +grep 'Makefile.am:1:.*CFLAGS' stderr +grep 'Makefile.am:2:.*LDFLAGS' stderr # No reason to warn about CXXFLAGS since it's not used. grep CXXFLAGS stderr && exit 1 # Don't warn if -Wno-gnu.