From 7dae6e4d7d7789a3b75d88a46bfbdf837f15891b Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Thu, 21 Nov 2002 14:27:34 +0000 Subject: [PATCH] * automake.in (make_condition_string): New function. (cond_stack_if, cond_stack_else, cond_stack_endif): Use it. Suggested by Raja R Harinath. --- ChangeLog | 4 ++++ automake.in | 34 ++++++++++++++++++---------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index d33f5945..2d5ac16f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2002-11-21 Alexandre Duret-Lutz + * automake.in (make_condition_string): New function. + (cond_stack_if, cond_stack_else, cond_stack_endif): Use it. + Suggested by Raja R Harinath. + * tests/texinfo13.test: Require texi2dvi-o. * tests/defs.in: Handle required=texi2dvi-o. diff --git a/automake.in b/automake.in index d88aa3b9..272033c3 100755 --- a/automake.in +++ b/automake.in @@ -5929,6 +5929,20 @@ sub pretty_print_rule ## ------------------------------ ## +# $STRING +# make_conditional_string ($NEGATE, $COND) +# ---------------------------------------- +sub make_conditional_string ($$) +{ + my ($negate, $cond) = @_; + $cond = "${cond}_TRUE" + unless $cond =~ /^TRUE|FALSE$/; + $cond = Automake::Conditional::condition_negate ($cond) + if $negate; + return $cond; +} + + # $COND # cond_stack_if ($NEGATE, $COND, $WHERE) # -------------------------------------- @@ -5939,12 +5953,7 @@ sub cond_stack_if ($$$) err $where, "$cond does not appear in AM_CONDITIONAL" if ! $configure_cond{$cond} && $cond !~ /^TRUE|FALSE$/; - $cond = "${cond}_TRUE" - unless $cond =~ /^TRUE|FALSE$/; - $cond = Automake::Conditional::condition_negate ($cond) - if $negate; - - push (@cond_stack, $cond); + push (@cond_stack, make_conditional_string ($negate, $cond)); return new Automake::Conditional (@cond_stack); } @@ -5964,15 +5973,12 @@ sub cond_stack_else ($$$) } $cond_stack[$#cond_stack] = - Automake::Conditional::condition_negate ($cond_stack[$#cond_stack]); + Automake::Conditional::condition_negate ($cond_stack[$#cond_stack]); # If $COND is given, check against it. if (defined $cond) { - $cond = "${cond}_TRUE" - unless $cond =~ /^TRUE|FALSE$/; - $cond = Automake::Conditional::condition_negate ($cond) - if $negate; + $cond = make_conditional_string ($negate, $cond); err ($where, "else reminder ($negate$cond) incompatible with " . "current conditional: $cond_stack[$#cond_stack]") @@ -5997,14 +6003,10 @@ sub cond_stack_endif ($$$) return; } - # If $COND is given, check against it. if (defined $cond) { - $cond = "${cond}_TRUE" - unless $cond =~ /^TRUE|FALSE$/; - $cond = Automake::Conditional::condition_negate ($cond) - if $negate; + $cond = make_conditional_string ($negate, $cond); err ($where, "endif reminder ($negate$cond) incompatible with " . "current conditional: $cond_stack[$#cond_stack]") -- 2.43.5