Index: ChangeLog from 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. Index: automake.in =================================================================== RCS file: /cvs/automake/automake/automake.in,v retrieving revision 1.1489 diff -u -p -u -r1.1489 automake.in --- automake.in 30 Jul 2003 16:45:22 -0000 1.1489 +++ automake.in 1 Aug 2003 21:13:21 -0000 @@ -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$/) { Index: lib/Automake/Variable.pm =================================================================== RCS file: /cvs/automake/automake/lib/Automake/Variable.pm,v retrieving revision 1.12 diff -u -p -u -r1.12 Variable.pm --- lib/Automake/Variable.pm 27 Jul 2003 21:25:17 -0000 1.12 +++ lib/Automake/Variable.pm 1 Aug 2003 21:13:21 -0000 @@ -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;