From 1a279e3e739108448ad4195a3441c01ee32a3286 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 6 May 2001 05:25:59 +0000 Subject: [PATCH] * 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. --- ChangeLog | 7 +++++++ automake.in | 10 ++++++---- tests/Makefile.am | 2 +- tests/Makefile.in | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index d48a692..d19496c 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 807a172..6c857dd 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 3db461e..e07bb33 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 47206b6..225c7c6 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 \ -- 2.7.4