]> sourceware.org Git - automake.git/commitdiff
* automake.in (variable_conditions_sub): Move parent-only code
authorTom Tromey <tromey@redhat.com>
Sun, 3 Jun 2001 17:16:39 +0000 (17:16 +0000)
committerTom Tromey <tromey@redhat.com>
Sun, 3 Jun 2001 17:16:39 +0000 (17:16 +0000)
from here...
(variable_conditions): ... to here.
(variable_conditions_sub): Include this variable's conditions in
the resulting condition list.
* tests/Makefile.am (XFAIL_TESTS): Removed ltdeps.test.

ChangeLog
TODO
automake.in
tests/Makefile.am
tests/Makefile.in

index c34cdbc2d5933baf0510bed9e4a9577903662a78..a806c9701958483075e5de65d573ad1de2bc4583 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-06-02  Tom Tromey  <tromey@redhat.com>
+
+       * automake.in (variable_conditions_sub): Move parent-only code
+       from here...
+       (variable_conditions): ... to here.
+       (variable_conditions_sub): Include this variable's conditions in
+       the resulting condition list.
+       * tests/Makefile.am (XFAIL_TESTS): Removed ltdeps.test.
+
 2001-06-01  Tom Tromey  <tromey@redhat.com>
 
        * tests/Makefile.am (XFAIL_TESTS): Added ltdeps.test.
diff --git a/TODO b/TODO
index fd2e64076b473b107b30d42f1ca08d26a7983008..d2e235d9633ab73de8cfcc0281ddc1f9da904a7c 100644 (file)
--- a/TODO
+++ b/TODO
@@ -269,9 +269,6 @@ Alex Hornby
   (maybe doesn't matter since people who even know about
   maintainer-clean already have a clue)
 
-* There are probably more bugs in variable_conditions_sub along
-  the lines of the one that caused cond4.test to fail.
-
 * reintroduce AM_FUNC_FNMATCH which sets LIBOBJS
   Then have automake know about fnmatch.h.
     [ probably should wait for autoconf to get right functionality ]
index b967edfdcea7326bcd55176b3a7dde4c50428bad..2a6df3c8e0a597aeb99984e2ca19281d1fefac7c 100755 (executable)
@@ -5228,7 +5228,9 @@ sub pretty_print_rule
 # $STRING
 # &conditional_string(@COND-STACK)
 # --------------------------------
-# Build a string de
+# Build a string which denotes the conditional in @COND-STACK.  Some
+# simplifications are done: `TRUE' entries are elided, and any `FALSE'
+# entry results in a return of `FALSE'.
 sub conditional_string
 {
   my (@stack) = @_;
@@ -5732,10 +5734,26 @@ sub variable_conditions ($)
     my @uniq_list;
 
     %vars_scanned = ();
-    foreach my $cond (&variable_conditions_sub ($var, '', ()))
+
+    my @new_conds = &variable_conditions_sub ($var, '', ());
+    # Now we want to return all permutations of the subvariable
+    # conditions.
+    my %allconds = ();
+    foreach my $item (@new_conds)
+    {
+       foreach (split (' ', $item))
+       {
+           s/^(.*)_(TRUE|FALSE)$/$1_TRUE/;
+           $allconds{$_} = 1;
+       }
+    }
+    @new_conds = &variable_conditions_permutations (sort keys %allconds);
+
+    foreach my $cond (@new_conds)
     {
+       my $reduce = &variable_conditions_reduce (split (' ', $cond));
         next
-         if $cond eq 'FALSE';
+           if $reduce eq 'FALSE';
        $uniqify{$cond} = 1;
     }
 
@@ -5764,8 +5782,9 @@ sub variable_conditionally_defined ($)
 
 # &variable_conditions_sub ($VAR, $PARENT, @PARENT_CONDS)
 # -------------------------------------------------------
-# A subroutine of variable_conditions.  We only return conditions
-# which are true for all the conditions in @PARENT_CONDS.
+# A subroutine of variable_conditions.  This returns all the
+# conditions of $VAR which are satisfiable when all of @PARENT_CONDS
+# are true.
 sub variable_conditions_sub
 {
     my ($var, $parent, @parent_conds) = @_;
@@ -5779,13 +5798,18 @@ sub variable_conditions_sub
     $vars_scanned{$var} = 1;
 
     my @this_conds = ();
+    # Examine every condition under which $VAR is defined.
     foreach my $vcond (keys %{$var_value{$var}})
     {
+       # If this condition cannot be true when the parent conditions
+       # are true, then skip it.
        next
          if ! conditionals_true_when ((@parent_conds), ($vcond));
 
        push (@this_conds, $vcond);
 
+       # If $VAR references some other variable, then compute the
+       # conditions for that subvariable.
        push (@parent_conds, $vcond);
        my @subvar_conds = ();
        foreach (split (' ', $var_value{$var}{$vcond}))
@@ -5796,15 +5820,25 @@ sub variable_conditions_sub
            # Handle variable substitutions.
            if (/^\$\{(.*)\}$/ || /^\$\((.*)\)$/)
            {
-               push (@subvar_conds,
-                     &variable_conditions_sub ($1, $var, @parent_conds));
+
+               # Here we compute all the conditions under which the
+               # subvariable is defined.  Then we go through and add
+               # $VCOND to each.
+               my @svc = &variable_conditions_sub ($1, $var, @parent_conds);
+               foreach my $item (@svc)
+               {
+                   my $val = conditional_string ($vcond, split (' ', $item));
+                   $val ||= 'TRUE';
+                   push (@subvar_conds, $val);
+               }
            }
        }
        pop (@parent_conds);
 
        # If there are no conditional subvariables, then we want to
        # return this condition.  Otherwise, we want to return the
-       # permutations of the subvariables.
+       # permutations of the subvariables, taking into account the
+       # conditions of $VAR.
        if (! @subvar_conds)
        {
            push (@new_conds, $vcond);
@@ -5819,23 +5853,6 @@ sub variable_conditions_sub
     # definitions.
     delete $vars_scanned{$var};
 
-    # If there are no parents, then this call is the top level call.
-    if (! $parent)
-      {
-       # Now we want to return all permutations of the subvariable
-       # conditions.
-       my %allconds = ();
-       foreach my $item (@new_conds)
-       {
-           foreach (split (' ', $item))
-           {
-               s/^(.*)_(TRUE|FALSE)$/$1_TRUE/;
-               $allconds{$_} = 1;
-           }
-       }
-       return &variable_conditions_permutations (sort keys %allconds);
-      }
-
     # If we are being called on behalf of another variable, we need to
     # return all possible permutations of the conditions.  We have
     # already handled everything in @this_conds along with their
index dc6e2744c025746d8fdf62fea4e2b7e0cf0999db..96e633b40b6fee42ec5a49fccd376d1cd26d24ff 100644 (file)
@@ -2,7 +2,7 @@
 
 AUTOMAKE_OPTIONS = gnits
 
-XFAIL_TESTS = subdir5.test ltdeps.test
+XFAIL_TESTS = subdir5.test
 
 TESTS =        \
 acinclude.test \
index 3fe9bd27155939371f0c41ea94e8024f65fc9273..4a9574a7a9ed48be1f7139565e4c726d52ea746c 100644 (file)
@@ -68,7 +68,7 @@ install_sh = @install_sh@
 
 AUTOMAKE_OPTIONS = gnits
 
-XFAIL_TESTS = subdir5.test ltdeps.test
+XFAIL_TESTS = subdir5.test
 
 TESTS = \
 acinclude.test \
This page took 0.047845 seconds and 5 git commands to generate.