From: Alexandre Duret-Lutz Date: Tue, 17 Sep 2002 21:33:35 +0000 (+0000) Subject: For PR automake/353: X-Git-Tag: Release-1-6d~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d60581b2c1b3839c40552a99e7dc59525ef494f;p=thirdparty%2Fautomake.git For PR automake/353: * automake.in (check_ambiguous_conditional): Display locations for the two definitions of the ambiguous variable. Show the macro_dump output in --verbose only. Accept $where as a third argument, (macro_define): Pass $where. --- diff --git a/ChangeLog b/ChangeLog index 0fb91818f..1d47efeac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2002-09-17 Alexandre Duret-Lutz + For PR automake/353: + * automake.in (check_ambiguous_conditional): Display locations for + the two definitions of the ambiguous variable. Show the macro_dump + output in --verbose only. Accept $where as a third argument, + (macro_define): Pass $where. + * automake.in (handle_programs): Ooops. Really add LDADD objects into _DEPENDENCIES. * tests/libobj12.test: Check for it. diff --git a/automake.in b/automake.in index 5fa9086af..5e42fb54c 100755 --- a/automake.in +++ b/automake.in @@ -6030,19 +6030,23 @@ sub cond_stack_endif ($$$) ## ------------------------ ## -# check_ambiguous_conditional ($VAR, $COND) -# ----------------------------------------- +# check_ambiguous_conditional ($VAR, $COND, $WHERE) +# ------------------------------------------------- # Check for an ambiguous conditional. This is called when a variable # is being defined conditionally. If we already know about a # definition that is true under the same conditions, then we have an # ambiguity. -sub check_ambiguous_conditional ($$) +sub check_ambiguous_conditional ($$$) { - my ($var, $cond) = @_; + my ($var, $cond, $where) = @_; my ($message, $ambig_cond) = conditional_ambiguous_p ($var, $cond, keys %{$var_value{$var}}); - err_var $var, "$message\n" . macro_dump ($var) - if $message; + if ($message) + { + err $where, "$message ..."; + err_var ($var, "... `$var' previously defined here."); + verb (macro_dump ($var)); + } } # $STRING, $AMBIG_COND @@ -6338,7 +6342,7 @@ sub macro_define ($$$$$$) # There must be no previous value unless the user is redefining # an Automake variable or an AC_SUBST variable for an existing # condition. - check_ambiguous_conditional ($var, $cond) + check_ambiguous_conditional ($var, $cond, $where) unless (exists $var_value{$var}{$cond} && (($var_owner{$var} == VAR_AUTOMAKE && $owner != VAR_AUTOMAKE)