]> sourceware.org Git - automake.git/commitdiff
* lib/Automake/Variable.pm (output): Declare as a method, since it
authorAlexandre Duret-Lutz <adl@gnu.org>
Thu, 29 May 2003 17:34:52 +0000 (17:34 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Thu, 29 May 2003 17:34:52 +0000 (17:34 +0000)
is only used this way.
(define): Fix documentation of $cond.
Suggested by Raja R. Harinath.

ChangeLog
lib/Automake/Variable.pm

index 941b10d3f479c944dc7e7b0f94e4d4217f1ce363..b6e54ca414fbe84ff60a811b0ecae90628902c82 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2003-05-29  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       * lib/Automake/Variable.pm (output): Declare as a method, since it
+       is only used this way.
+       (define): Fix documentation of $cond.
+       Suggested by Raja R. Harinath.
+
 2003-05-25  Alexandre Duret-Lutz  <adl@gnu.org>
 
        * lib/Automake/Variable.pm, lib/Automake/VarDef.pm: New files.
index c7a57bf0b03fe1bc62efd7477ddb8ac6b06fc908..e5dffb5485207011a30bf0f6a90192df3a5b16c5 100644 (file)
@@ -552,6 +552,56 @@ sub check_defined_unconditionally ($;$)
     }
 }
 
+=item C<$str = $var->output ([@conds])>
+
+Format all the definitions of C<$var> if C<@cond> is not specified,
+else only that corresponding to C<@cond>.
+
+=cut
+
+sub output ($@)
+{
+  my ($var, @conds) = @_;
+
+  @conds = $var->conditions->conds
+    unless @conds;
+
+  my $res = '';
+  my $name = $var->name;
+
+  foreach my $cond (@conds)
+    {
+      my $def = $var->def ($cond);
+      prog_error ("unknown condition `" . $cond->human . "' for `$var'")
+       unless $def;
+
+      next
+       if $def->pretty == VAR_SILENT;
+
+      $res .= $def->comment;
+
+      my $val = $def->value;
+      my $equals = $def->type eq ':' ? ':=' : '=';
+      my $str = $cond->subst_string;
+
+      if ($def->pretty == VAR_PRETTY)
+       {
+         # Suppress escaped new lines.  &makefile_wrap will
+         # add them back, maybe at other places.
+         $val =~ s/\\$//mg;
+         $res .= makefile_wrap ("$str$name $equals", "$str\t",
+                                split (' ' , $val));
+       }
+      else                     # VAR_ASIS
+       {
+         my $output_var = "$name $equals $val";
+         $output_var =~ s/^/$str/meg;
+         $res .= "$output_var\n";
+       }
+    }
+  return $res;
+}
+
 =back
 
 =head2 Utility functions
@@ -680,7 +730,7 @@ Variables can be overriden, provided the new owner is not weaker
 C<$type>: the type of the assignment (C<''> for C<FOO = bar>,
 C<':'> for C<FOO := bar>, and C<'+'> for C<'FOO += bar'>).
 
-C<$cond>: the DisjConditions in which C<$var> is being defined.
+C<$cond>: the C<Condition> in which C<$var> is being defined.
 
 C<$value>: the value assigned to C<$var> in condition C<$cond>.
 
@@ -1247,58 +1297,6 @@ sub variable_value_as_list($$;$)
   return @result;
 }
 
-=item C<$str = output ($var, [@conds])>
-
-Format all the definitions of C<$var> if C<@cond> is not specified,
-else only that corresponding to C<@cond>.
-
-=cut
-
-sub output ($@)
-{
-  my ($var, @conds) = @_;
-
-  $var = ref ($var) ? $var : rvar ($var);
-
-  @conds = $var->conditions->conds
-    unless @conds;
-
-  my $res = '';
-  my $name = $var->name;
-
-  foreach my $cond (@conds)
-    {
-      my $def = $var->def ($cond);
-      prog_error ("unknown condition `" . $cond->human . "' for `$var'")
-       unless $def;
-
-      next
-       if $def->pretty == VAR_SILENT;
-
-      $res .= $def->comment;
-
-      my $val = $def->value;
-      my $equals = $def->type eq ':' ? ':=' : '=';
-      my $str = $cond->subst_string;
-
-      if ($def->pretty == VAR_PRETTY)
-       {
-         # Suppress escaped new lines.  &makefile_wrap will
-         # add them back, maybe at other places.
-         $val =~ s/\\$//mg;
-         $res .= makefile_wrap ("$str$name $equals", "$str\t",
-                                split (' ' , $val));
-       }
-      else                     # VAR_ASIS
-       {
-         my $output_var = "$name $equals $val";
-         $output_var =~ s/^/$str/meg;
-         $res .= "$output_var\n";
-       }
-    }
-  return $res;
-}
-
 
 =item C<$str = output_variables>
 
This page took 0.034445 seconds and 5 git commands to generate.