automake
[Top][All Lists]
Advanced

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

31-simplify-contents-traces.patch


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

This patch and a couple of following patches are breaking Automake.
That was the easiest path to finish cleaning up the variable handling.
This series of patches ends with patches that fix some of these issues.

It took me hours to do that, I'd like not to be asked to rewrite
everything so that Automake is never broken, as there are zillions of
ramifications here and there that are extremely hard to keep alive.

At the end Automake works again.

There is one failure which is noteworthy:

=== Running test ./depend3.test
configure.in:6: DEPS multiply defined in condition TRUE
  DEPS (User, where = undefined) =
  {
    TRUE => @DEPS@
  }
FAIL: depend3.test


The thing is that DEPS is an AC_SUBST variable, so it is defined when
reading configure.in, but this test also includes:

cat > Makefile.am << 'END'
[...]
DEPS = @DEPS@
[...]
END

so the variable, indeed, is redefined.

Personally I think the new behavior is better than the former, way too
many bad things can happen if you play with the macros of Automake.

But the policy up to now is `let the user shoot in her foot if she
wants to', therefore patch 42 reestablishes this right.  Maybe in the
future we should issue warnings in these cases?  It's her right to
shoot in her foot, but law requires that you inform her of her rights :)




Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * automake.in (&variable_conditions_sub)
        (&variable_value_as_list_worker): Remove dead code which used to
        handle the cases where not all variables were in %conditional.

Index: automake.in
--- automake.in Sat, 10 Mar 2001 17:40:20 +0100 akim (am/f/39_automake.i 1.149 
755)
+++ automake.in Sat, 10 Mar 2001 17:43:56 +0100 akim (am/f/39_automake.i 1.149 
755)
@@ -5794,40 +5794,6 @@ sub variable_conditions_sub
     }
     $vars_scanned{$var} = 1;

-    if (! $variable_conditionally_defined{$var})
-    {
-       foreach (split (' ', $conditional{$var}{'TRUE'}))
-       {
-           # If a comment seen, just leave.
-           last if /^#/;
-
-           # Handle variable substitutions.
-           if (/^\$\{(.*)\}$/ || /^\$\((.*)\)$/)
-           {
-               push (@new_conds,
-                     &variable_conditions_sub ($1, $var, @parent_conds));
-           }
-       }
-
-       # Now we want to return all permutations of the subvariable
-       # conditions.
-       my %allconds = ();
-       foreach my $item (@new_conds)
-       {
-           foreach (split (' ', $item))
-           {
-               s/_(TRUE|FALSE)$//;
-               $allconds{$_ . '_TRUE'} = 1;
-           }
-       }
-
-       # Unset our entry in vars_scanned.  We only care about recursive
-       # definitions.
-       delete $vars_scanned{$var};
-
-       return &variable_conditions_permutations (sort keys %allconds);
-    }
-
     my @this_conds = ();
     foreach my $vcond (keys %{$conditional{$var}})
     {
@@ -6102,7 +6068,7 @@ sub variable_value_as_list_worker
        # variables we've already examined.
        &am_line_error ($parent, "variable `$var' recursively defined");
     }
-    elsif ($cond eq 'all' && $conditional{$var})
+    elsif ($cond eq 'all')
     {
        $vars_scanned{$var} = 1;
        foreach my $vcond (keys %{$conditional{$var}})
@@ -6111,8 +6077,9 @@ sub variable_value_as_list_worker
            push (@result, &value_to_list ($var, $val, $cond));
        }
     }
-    elsif ($cond && $conditional{$var})
+    else
     {
+        $cond ||= 'TRUE';
        $vars_scanned{$var} = 1;
        my $onceflag;
        foreach my $vcond (keys %{$conditional{$var}})
@@ -6128,13 +6095,6 @@ sub variable_value_as_list_worker
                push (@result, &value_to_list ($var, $val, $cond));
            }
        }
-    }
-    else
-    {
-       $vars_scanned{$var} = 1;
-       &check_variable_defined_unconditionally ($var, $parent);
-       $content_seen{$var} = 1;
-       push (@result, &value_to_list ($var, $conditional{$var}{'TRUE'}, 
$cond));
     }

     # Unset our entry in vars_scanned.  We only care about recursive



reply via email to

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