automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

why do we keep the *initial* location of each variable?


From: Alexandre Duret-Lutz
Subject: why do we keep the *initial* location of each variable?
Date: 17 Sep 2002 23:49:31 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

The comment says "we want the original location" but without
justification.  Any idea why?

It seems to me locations should be overwritten when values are
overwritten.  At least with the following patch the error
message on Coreutils is correct:

src/Makefile.am:157: PERL multiply defined in condition TRUE ...
src/Makefile.am:147: ... `PERL' previously defined here.

(Compare with the diagnostic shown previously that mention
configure.ac because PERL was originally defined here.)

2002-09-17  Alexandre Duret-Lutz  <address@hidden>

        * automake.in (macro_define): Reset $var_location{$var} on
        each time a variable is overridden.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1355
diff -u -r1.1355 automake.in
--- automake.in 17 Sep 2002 21:33:35 -0000      1.1355
+++ automake.in 17 Sep 2002 21:41:49 -0000
@@ -6319,14 +6319,6 @@
   # 3. first assignment (=, :=, or +=)
   else
     {
-      # The first assignment to a macro sets its location.  Ideally I
-      # suppose we would associate line numbers with random bits of text.
-      # FIXME: We sometimes redefine some variables, but we want to keep
-      # the original location.  More subs are needed to handle
-      # properly variables.  Once this done, remove this hack.
-      $var_location{$var} = $where
-       unless defined $var_location{$var};
-
       # If Automake tries to override a value specified by the user,
       # just don't let it do.
       if (defined $var_value{$var}{$cond}
@@ -6349,6 +6341,7 @@
                        || $var_owner{$var} == VAR_CONFIGURE));
 
          $var_value{$var}{$cond} = $value;
+         $var_location{$var} = $where;
        }
     }
 
-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]