From: Tom Tromey Date: Sun, 6 May 2001 05:25:58 +0000 (+0000) Subject: * automake.in (conditional_true_when): Use a hash, not index(). X-Git-Tag: handle-languages~17 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=d6a419b5d3f4546d6bad0cda794a5dcfda496287;p=automake.git * 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. --- diff --git a/ChangeLog b/ChangeLog index d48a692b..d19496ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-05-05 Tom Tromey + + * 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 For PR automake/164: diff --git a/automake.in b/automake.in index 807a1722..6c857dd1 100755 --- a/automake.in +++ b/automake.in @@ -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; diff --git a/tests/Makefile.am b/tests/Makefile.am index 3db461e4..e07bb33b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 47206b67..225c7c6e 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -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 \