[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: part of PR/353
From: |
Alexandre Duret-Lutz |
Subject: |
FYI: part of PR/353 |
Date: |
17 Sep 2002 23:32:38 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 |
Sample output on coreutils-4.5.1:
src/Makefile.am:157: PERL multiply defined in condition TRUE ...
configure.ac:12: ... `PERL' previously defined here.
I'm not closing PR/353, because the diagnostic is still
inaccurate in presence of conditionals. What we really need is
to record variable locatations for each condition, but I don't
have the time to do this today.
2002-09-17 Alexandre Duret-Lutz <address@hidden>
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.
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1354
diff -u -r1.1354 automake.in
--- automake.in 17 Sep 2002 21:11:48 -0000 1.1354
+++ automake.in 17 Sep 2002 21:27:57 -0000
@@ -6030,19 +6030,23 @@
## ------------------------ ##
-# 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 @@
# 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)
--
Alexandre Duret-Lutz
- FYI: part of PR/353,
Alexandre Duret-Lutz <=