From 5daac686ff4bd141118be44eab207f94510a6dd4 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 17 Sep 2002 21:33:35 +0000 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ automake.in | 18 +++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0fb91818..1d47efea 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 5fa9086a..5e42fb54 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) -- 2.43.5