automake
[Top][All Lists]
Advanced

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

33-simplify-contents-traces.patch


From: Akim Demaille
Subject: 33-simplify-contents-traces.patch
Date: Sun, 11 Mar 2001 19:08:45 +0100

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        * automake.in (&generate_makefile) Use variable_define to define
        SOURCES and OBJECTS.
        (&variable_defined): Don't check for $conditional{VAR}{COND} as
        this would make perl create $condition{VAR}, which we don't want.

Index: automake.in
--- automake.in Sat, 10 Mar 2001 18:21:17 +0100 akim (am/f/39_automake.i 1.151 
755)
+++ automake.in Sat, 10 Mar 2001 18:39:58 +0100 akim (am/f/39_automake.i 1.151 
755)
@@ -1070,8 +1070,10 @@ sub generate_makefile

     # Re-init SOURCES and OBJECTS.  FIXME: other code shouldn't depend
     # on this (but currently does).
-    $conditional{'SOURCES'}{'TRUE'} = join (' ', @sources);
-    $conditional{'OBJECTS'}{'TRUE'} = join (' ', @objects);
+    variable_define ('SOURCES', 1, '', 'TRUE',
+                    join (' ', @sources), 'internal');
+    variable_define ('OBJECTS', 1, '', 'TRUE',
+                    join (' ', @objects), 'internal');
     &define_pretty_variable ('DIST_SOURCES', '', @dist_sources);

     &handle_multilib;
@@ -5693,25 +5695,30 @@ sub variable_defined ($$)

     $cond ||= 'TRUE';

-    if (!$var_is_am{$var})
-    {
-      if (!exists $conditional{$var}{$cond})
-       {
-         # The variable is not defined for the given condition.
-         return 0;
-       }
-
-      # Even a conditional examination is good enough for us.  FIXME:
-      # really should maintain examined status on a per-condition
-      # basis.
-      $content_seen{$var} = 1;
-      return 1;
-    }
+    # Unfortunately we can't just check for $conditional{VAR}{COND}
+    # as this would make perl create $condition{VAR}, which we
+    # don't want.
+    if (!exists $conditional{$var})
+      {
+       if (defined $targets{$var})
+         {
+           &am_line_error ($var, "`$var' is a target; expected a variable")
+         }
+       # The variable is not defined
+       return 0;
+      }

-    &am_line_error ($var, "`$var' is a target; expected a variable")
-      if defined $targets{$var};
+    if ($var_is_am{$var}
+       || !exists $conditional{$var}{$cond})
+      {
+       # The variable is not defined for the given condition.
+       return 0;
+      }

-    return 0;
+    # Even a conditional examination is good enough for us.  FIXME:
+    # really should maintain examined status on a per-condition basis.
+    $content_seen{$var} = 1;
+    return 1;
 }

 # Mark a variable as examined.



reply via email to

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