From 797e4c6e2a2d2e1d2441b300be81d90f649d2dfe Mon Sep 17 00:00:00 2001 From: Raja R Harinath Date: Sat, 2 Aug 2003 04:27:03 +0000 Subject: [PATCH] * lib/Automake/Variables.pm (variables): Return a list of Automake::Variable instances, not a list of strings. (dump): Remove support for being invoked with a string. (variables_dump): Adapt to these changes. * automake.in (check_typos): Likewise. (am_primary_prefixes): Likewise. --- ChangeLog | 9 +++++++++ automake.in | 17 +++++++---------- lib/Automake/Variable.pm | 23 ++++++++--------------- 3 files changed, 24 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 70bb425..917b1f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2003-08-01 Raja R Harinath + + * lib/Automake/Variables.pm (variables): Return a list of + Automake::Variable instances, not a list of strings. + (dump): Remove support for being invoked with a string. + (variables_dump): Adapt to these changes. + * automake.in (check_typos): Likewise. + (am_primary_prefixes): Likewise. + 2003-07-31 Ralf Wildenhues (tiny change) * lib/depcomp (aix): Support AIX Compiler version 6. diff --git a/automake.in b/automake.in index e6e4e2d..7d51beb 100755 --- a/automake.in +++ b/automake.in @@ -2746,8 +2746,9 @@ sub check_typos () # It is ok if the user sets this particular variable. set_seen 'AM_LDFLAGS'; - foreach my $varname (variables) + foreach my $var (variables) { + my $varname = $var->name; # A configure variable is always legitimate. next if exists $configure_vars{$varname}; @@ -2763,8 +2764,6 @@ sub check_typos () } next unless $check; - my $var = rvar $varname; - for my $cond ($var->conditions->conds) { msg_var 'syntax', $var, "unused variable: `$varname'" @@ -6544,9 +6543,8 @@ sub am_primary_prefixes ($$@) local $_; my %valid = map { $_ => 0 } @prefixes; $valid{'EXTRA'} = 0; - foreach my $varname (variables) + foreach my $var (variables) { - my $var = var $varname; # Automake is allowed to define variables that look like primaries # but which aren't. E.g. INSTALL_sh_DATA. # Autoconf can also define variables like INSTALL_DATA, so @@ -6554,11 +6552,10 @@ sub am_primary_prefixes ($$@) # redefined in Makefile.am). # FIXME: We should make sure that these variables are not # conditionally defined (or else adjust the condition below). - if ($var) - { - my $def = $var->def (TRUE); - next if $def && $def->owner != VAR_MAKEFILE; - } + my $def = $var->def (TRUE); + next if $def && $def->owner != VAR_MAKEFILE; + + my $varname = $var->name; if ($varname =~ /^(nobase_)?(dist_|nodist_)?(.*)_$primary$/) { diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm index 3e9cb4c..500dc0c 100644 --- a/lib/Automake/Variable.pm +++ b/lib/Automake/Variable.pm @@ -299,7 +299,7 @@ variables defined so far.) use vars '%_variable_dict'; sub variables () { - return keys %_variable_dict; + return values %_variable_dict; } =item C @@ -812,9 +812,7 @@ sub has_conditional_contents ($) =item C<$string = $var-Edump> -=item C<$string = Automake::Variable::dump ($varname)> - -Return a string describing all we know about C<$var> (or C<$varname>). +Return a string describing all we know about C<$var>. For debugging. =cut @@ -823,15 +821,10 @@ sub dump ($) { my ($self) = @_; - my $v = ref $self ? $self : var $self; - - return "$self does not exist\n" - unless $v; - - my $text = $v->name . ": \n {\n"; - foreach my $vcond ($v->conditions->conds) + my $text = $self->name . ": \n {\n"; + foreach my $vcond ($self->conditions->conds) { - $text .= " " . $vcond->human . " => " . $v->rdef ($vcond)->dump; + $text .= " " . $vcond->human . " => " . $self->rdef ($vcond)->dump; } $text .= " }\n"; return $text; @@ -1158,7 +1151,7 @@ sub define ($$$$$$$$) "... overrides Automake variable `$var' defined here"); } verb ("refusing to override the user definition of:\n" - . Automake::Variable::dump $var + . $self->dump ."with `" . $cond->human . "' => `$value'"); } else @@ -1236,9 +1229,9 @@ sub variables_dump () my ($var) = @_; my $text = "All variables:\n{\n"; - foreach my $var (sort variables) + foreach my $var (sort { $a->name cmp $b->name } variables) { - $text .= Automake::Variable::dump $var; + $text .= $var->dump; } $text .= "}\n"; return $text; -- 2.7.4