2002-09-17 Alexandre Duret-Lutz <duret_g@epita.fr>
+ 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.
## ------------------------ ##
-# 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
# 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)