* automake.in (conditional_true_when): Use a hash, not index().
authorTom Tromey <tromey@redhat.com>
Sun, 6 May 2001 05:25:59 +0000 (05:25 +0000)
committerTom Tromey <tromey@redhat.com>
Sun, 6 May 2001 05:25:59 +0000 (05:25 +0000)
Also, a TRUE component always results in a true return.
Fixes test cond10.test.  For PR automake/164.
* tests/Makefile.am (XFAIL_TESTS): Removed cond10.test.

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

index d48a692..d19496c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2001-05-05  Tom Tromey  <tromey@redhat.com>
+
+       * automake.in (conditional_true_when): Use a hash, not index().
+       Also, a TRUE component always results in a true return.
+       Fixes test cond10.test.  For PR automake/164.
+       * tests/Makefile.am (XFAIL_TESTS): Removed cond10.test.
+
 2001-05-05  Raja R Harinath  <harinath@cs.umn.edu>
 
        For PR automake/164:
index 807a172..6c857dd 100755 (executable)
@@ -5487,13 +5487,15 @@ sub conditional_true_when ($$)
 {
     my ($cond, $when) = @_;
 
+    # Make a hash holding all the values from $WHEN.
+    my %cond_vals = map { $_ => 1 } split (' ', $when);
+
     # Check each component of $cond, which looks `COND1 COND2'.
     foreach my $comp (split (' ', $cond))
     {
-       if (index ($when, $comp) == -1)
-       {
-           return 0;
-       }
+       # TRUE is always true.
+       return 1 if $comp eq 'TRUE';
+       return 0 if ! defined $cond_vals{$comp};
     }
 
     return 1;
index 3db461e..e07bb33 100644 (file)
@@ -2,7 +2,7 @@
 
 AUTOMAKE_OPTIONS = gnits
 
-XFAIL_TESTS = man.test objc.test subobj2.test yaccvpath.test cond10.test
+XFAIL_TESTS = man.test objc.test subobj2.test yaccvpath.test
 
 TESTS =        \
 acinclude.test \
index 47206b6..225c7c6 100644 (file)
@@ -75,7 +75,7 @@ install_sh = @install_sh@
 
 AUTOMAKE_OPTIONS = gnits
 
-XFAIL_TESTS = man.test objc.test subobj2.test yaccvpath.test cond10.test
+XFAIL_TESTS = man.test objc.test subobj2.test yaccvpath.test
 
 TESTS = \
 acinclude.test \