automake
[Top][All Lists]
Advanced

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

Re: problem: unitialized +=


From: Akim Demaille
Subject: Re: problem: unitialized +=
Date: 17 Apr 2001 18:41:40 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley)

| >>>>> "Robert" == Robert Collins <address@hidden> writes:
| Robert> 3) src/Makefile.am: cf_gen_DEPENDENCIES must be set with `='
| Robert> before using `+='
| >> We recently talked about this with Tom, and we agreed that there is
| >> no reason not to do that (but to protect the user from herself, but
| >> it's not our job).  So consider this is solved.  I don't have time
| >> now, but I'll submit a patch soon.
| 
| Robert> The same applies to CFLAGS. In fact for CFLAGS it's probably
| Robert> more important - you want to add to the configured CFLAGS
| Robert> variable, not replace it. No rush for me though :].
| 
| Hm, I don't understand this sentence too well.  CFLAGS should be
| initialized, so you should not face this problem.
| 
| Could you give a try to Automake without the following else branch?
| Just remove the - lines below from macro_define:

I apply this:

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * automake.in (&macro_define): User variables can be first defined
        with `+='.

Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1044
diff -u -u -r1.1044 automake.in
--- automake.in 2001/04/12 16:38:04 1.1044
+++ automake.in 2001/04/17 16:36:38
@@ -5664,24 +5664,12 @@
   $cond ||= 'TRUE';
 
   # An Automake variable must be consistently defined with the same
-  # sign by Automake.  A user variable must be set by either `=' or
-  # `:=', and later promoted to `+='.
-  if ($var_is_am)
-    {
-      if (defined $var_type{$var} && $var_type{$var} ne $type)
-       {
-         am_line_error ($var,
-                        ("$var was set with `$var_type{$var}=' "
-                         . "and is now set with `$type='"));
-       }
-    }
-  else
-    {
-      if (!defined $var_type{$var} && $type eq '+')
-       {
-         am_line_error ($var, "$var must be set with `=' before using `+='");
-       }
-    }
+  # sign by Automake.
+  am_line_error ($var, ("$var was set with `$var_type{$var}=' "
+                        . "and is now set with `$type='"))
+    if $var_is_am && defined $var_type{$var} && $var_type{$var} ne $type;
+
   $var_type{$var} = $type;
 
   # Differentiate the first assignment (including with `+=').



reply via email to

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