2002-11-21 Alexandre Duret-Lutz <adl@gnu.org>
+ * 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.
## ------------------------------ ##
+# $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)
# --------------------------------------
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);
}
}
$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]")
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]")