]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* automake.in (make_condition_string): New function.
authorAlexandre Duret-Lutz <adl@gnu.org>
Thu, 21 Nov 2002 14:27:34 +0000 (14:27 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Thu, 21 Nov 2002 14:27:34 +0000 (14:27 +0000)
(cond_stack_if, cond_stack_else, cond_stack_endif): Use it.
Suggested by Raja R Harinath.

ChangeLog
automake.in

index d33f5945b8a539d991d820ad802f5d2f563ab0b7..2d5ac16f519cedcb30f1db14f7a6e66ab828ec5e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 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.
 
index d88aa3b98aca0352e736103e2208489b0d3675ad..272033c378b615e0c341c032113f783afe8473f7 100755 (executable)
@@ -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]")