]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] vars: get rid of VAR_SILENT type
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 3 May 2012 13:49:06 +0000 (15:49 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 24 May 2012 09:36:55 +0000 (11:36 +0200)
It's not truly needed by the current code base.

* automake.in (define_configure_variable): in an AC_SUBST'd variable is to
be "ignored" (likely because the user has called 'AM_SUBST_NOTMAKE' on it),
return early without even defining the variable, rather than defining it
with type VAR_SILENT (which would have prevented its definition from being
output in the generated Makefile anyway).
* lib/Automake/VarDef.pm (VAR_SILENT): Delete.
(@EXPORT, Pod documentation): Adjust accordingly.
* lib/Automake/Variable.pm (_check_ambiguous_condition): Don't ignore
variables of type VAR_SILENT: there are no more of them.
(output): Don't skip variables of type VAR_SILENT: there are no more of
them.
(define): The value of the '$pretty' parameter can't be VAR_SILENT anymore.
Adjust internal checks and Pod documentation accordingly.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
automake.in
lib/Automake/VarDef.pm
lib/Automake/Variable.pm

index 8b48cdfa9bf06843127c56e65fff369c2bb9997d..94a728dcd325d3d6b4c2c1cbc12921760a6f1055 100644 (file)
@@ -5953,9 +5953,9 @@ sub define_configure_variable ($)
   # Some variables we do not want to output.  For instance it
   # would be a bad idea to output `U = @U@` when `@U@` can be
   # substituted as `\`.
-  my $pretty = exists $ignored_configure_vars{$var} ? VAR_SILENT : VAR_ASIS;
+  return if exists $ignored_configure_vars{$var};
   Automake::Variable::define ($var, VAR_CONFIGURE, '', TRUE, subst $var,
-                             '', $configure_vars{$var}, $pretty);
+                             '', $configure_vars{$var}, VAR_ASIS);
 }
 
 
index 0ad705fb791226af8f98c8be63fad3c29aad6eb0..ba48d8532ed19547493ad59d20efbbcb08dc14af 100644 (file)
@@ -25,7 +25,7 @@ require Exporter;
 use vars '@ISA', '@EXPORT';
 @ISA = qw/Automake::ItemDef Exporter/;
 @EXPORT = qw (&VAR_AUTOMAKE &VAR_CONFIGURE &VAR_MAKEFILE
-             &VAR_ASIS &VAR_PRETTY &VAR_SILENT);
+             &VAR_ASIS &VAR_PRETTY);
 
 =head1 NAME
 
@@ -91,23 +91,17 @@ use constant VAR_AUTOMAKE => 0; # Variable defined by Automake.
 use constant VAR_CONFIGURE => 1;# Variable defined in configure.ac.
 use constant VAR_MAKEFILE => 2; # Variable defined in Makefile.am.
 
-=item C<VAR_ASIS>, C<VAR_PRETTY>, C<VAR_SILENT>
+=item C<VAR_ASIS>, C<VAR_PRETTY>
 
 Possible print styles.  C<VAR_ASIS> variables should be output as-is.
 C<VAR_PRETTY> variables are wrapped on multiple lines if they cannot
-fit on one.  C<VAR_SILENT> variables are not output at all.
-
-C<VAR_SILENT> variables can also be overridden silently (unlike the
-other kinds of variables whose overriding may sometimes produce
-warnings).
+fit on one.
 
 =cut
 
 # Possible values for pretty.
 use constant VAR_ASIS => 0;    # Output as-is.
 use constant VAR_PRETTY => 1;  # Pretty printed on output.
-use constant VAR_SILENT => 2;  # Not output.  (Can also be
-                               # overridden silently.)
 
 =back
 
@@ -138,7 +132,7 @@ C<VAR_AUTOMAKE>, C<VAR_CONFIGURE>, or C<VAR_MAKEFILE> (see these
 definitions).
 
 Finally, C<$pretty> tells how the variable should be output, and can
-be one of C<VAR_ASIS>, C<VAR_PRETTY>, or C<VAR_SILENT>.
+be one of C<VAR_ASIS>, C<VAR_PRETTY>.
 
 =cut
 
index f4f0db6ae3caf73e2c6fe04011b43a9a3ca8e1a1..1e227c32e6796069c1f01b7bf4ed57222c90a443 100644 (file)
@@ -447,7 +447,7 @@ sub _check_ambiguous_condition ($$$)
   # We allow silent variables to be overridden silently,
   # by either silent or non-silent variables.
   my $def = $self->def ($ambig_cond);
-  if ($message && $def->pretty != VAR_SILENT)
+  if ($message)
     {
       msg 'syntax', $where, "$message ...", partial => 1;
       msg_var ('syntax', $var, "... '$var' previously defined here");
@@ -508,9 +508,6 @@ sub output ($@)
                  . $self->name . "'")
        unless $def;
 
-      next
-       if $def->pretty == VAR_SILENT;
-
       $res .= $def->comment;
 
       my $val = $def->raw_value;
@@ -723,8 +720,8 @@ assignment.
 
 C<$where>: the C<Location> of the assignment.
 
-C<$pretty>: whether C<$value> should be pretty printed (one of C<VAR_ASIS>,
-C<VAR_PRETTY>, or C<VAR_SILENT>, defined by L<Automake::VarDef>).
+C<$pretty>: whether C<$value> should be pretty printed (one of C<VAR_ASIS>
+or C<VAR_PRETTY> defined by L<Automake::VarDef>).
 C<$pretty> applies only to real assignments.  I.e., it does not apply to
 a C<+=> assignment (except when part of it is being done as a conditional
 C<=> assignment).
@@ -743,8 +740,7 @@ sub define ($$$$$$$$)
 
   prog_error "pretty argument missing"
     unless defined $pretty && ($pretty == VAR_ASIS
-                              || $pretty == VAR_PRETTY
-                              || $pretty == VAR_SILENT);
+                              || $pretty == VAR_PRETTY);
 
   # If there's a comment, make sure it is \n-terminated.
   if ($comment)