summaryrefslogtreecommitdiff
path: root/automake.in
diff options
context:
space:
mode:
authorAlexandre Duret-Lutz <adl@gnu.org>2002-11-19 20:02:40 +0000
committerAlexandre Duret-Lutz <adl@gnu.org>2002-11-19 20:02:40 +0000
commit149abece6e6ed39a6a625922cedd0bd343ff53cc (patch)
tree8368ed419179c9242029ce2376d44d05a5381e46 /automake.in
parent180cd66e4ebb2d48afb38dee88c47107a2cf7b27 (diff)
downloadautomake-149abece6e6ed39a6a625922cedd0bd343ff53cc.tar.gz
* lib/Automake/ConditionalSet.pm (_simplify, simplify): New methods.
(true): Cache return value, so _simplify can use it. * lib/Automake/tests/ConditionalSet.pl (test_simplify): New function. * automake.in (variable_not_always_defined_in_cond): Return a simplified ConditionalSet. (macro_define, require_variables): Adjust. * tests/Makefile.am (TEST): Add library3.test. * tests/library3.test: New file. * tests/pluseq9.test: Adjust. Thanks to Raja R Harinath.
Diffstat (limited to 'automake.in')
-rwxr-xr-xautomake.in17
1 files changed, 9 insertions, 8 deletions
diff --git a/automake.in b/automake.in
index ebc29f0e5..c026a45af 100755
--- a/automake.in
+++ b/automake.in
@@ -6184,7 +6184,7 @@ sub variable_not_always_defined_in_cond ($$)
push @res, $icond
if ($cond->true_when ($icond)); # (3)
}
- return @res;
+ return (new Automake::ConditionalSet @res)->simplify;
}
# &macro_define($VAR, $OWNER, $TYPE, $COND, $VALUE, $WHERE)
@@ -6326,13 +6326,14 @@ sub macro_define ($$$$$$)
# X += Z
# should be rejected because X is not defined for all conditions
# where `+=' applies.
- my @undef_cond = variable_not_always_defined_in_cond $var, $cond;
- if (@undef_cond != 0)
+ my $undef_cond = variable_not_always_defined_in_cond $var, $cond;
+ if (! $undef_cond->false)
{
err ($where,
"Cannot apply `+=' because `$var' is not defined "
. "in\nthe following conditions:\n "
- . join ("\n ", map { $_->string } @undef_cond)
+ . join ("\n ",
+ map { $_->string } $undef_cond->conds)
. "\nEither define `$var' in these conditions,"
. " or use\n`+=' in the same conditions as"
. " the definitions.");
@@ -8961,15 +8962,15 @@ sub require_variables ($$$@)
if ((exists $var_value{$var} && exists $var_value{$var}{$cond})
|| exists $configure_vars{$var});
- my @undef_cond = variable_not_always_defined_in_cond $var, $cond;
+ my $undef_cond = variable_not_always_defined_in_cond $var, $cond;
next VARIABLE
- unless @undef_cond;
+ if $undef_cond->false;
my $text = "$reason`$var' is undefined\n";
- if (@undef_cond && $undef_cond[0] != TRUE)
+ if (! $undef_cond->true)
{
$text .= ("in the following conditions:\n "
- . join ("\n ", map { $_->string } @undef_cond));
+ . join ("\n ", map { $_->string } $undef_cond->conds));
}
++$res;