+2001-03-23 Akim Demaille <akim@epita.fr>
+
+ * automake.in (¯o_define): Don't lose the location if we
+ redefine a variable.
+ Don't push all the variables in @var_list, let...
+ (&read_am_file, &file_contents): ... do it.
+ (&define_pretty_variable): Use macro_define.
+ (&am_install_var): Delete the value of variables being redefined
+ to pacify ¯o_define which checks that variables are not
+ doubly defined.
+
2001-03-23 Akim Demaille <akim@epita.fr>
* automake.in (&conditional_dump): Rename as...
# The first assignment to a macro sets the line number. Ideally
# I suppose we would associate line numbers with random bits of
# text.
- $content_lines{$var} = $where;
+ # FIXME: We sometimes redefine some variables, but we want to keep
+ # the original location. More subs are needed to handle properly
+ # variables. Once this done, remove this hack.
+ $content_lines{$var} = $where
+ unless defined $content_lines{$var};
# If first assignment, set `+=' indicator.
$var_was_plus_eq{$var} = $type eq '+' && ! $var_is_am{$var};
# FIXME: I don't understand what's so special wrt `:', nor
# why we forget the `+' nature of a var.
$def_type{$var} = ($type eq ':') ? ':' : '';
- push (@var_list, $var);
}
sub define_pretty_variable
{
my ($var, $cond, @value) = @_;
+
if (! defined $contents{$var}
|| ($cond && ! &variable_defined ($var, $cond)))
{
- $contents{$var} = join (' ', @value);
- if ($cond)
- {
- ${$conditional{$var}}{$cond} = $contents{$var};
- }
+ macro_define ($var, 0, '', $cond, join (' ', @value), undef);
my $make_condition = &make_condition ($cond);
&pretty_print ($make_condition . $var . ' =',
$make_condition, @value);
macro_define ($last_var_name, 0, $type,
conditional_string (@conditional_stack),
$value, $.);
+ push (@var_list, $last_var_name);
# FIXME: this doesn't always work correctly; it will group
# all comments for a given variable, no matter where
# Accumulating variables must not be output.
macro_define ($var, 1, $type, $cond_string, $val, $.);
+ push (@var_list, $var);
# If the user has set some variables we were in charge
# of (which is detected by the first reading of
{
my $cond = shift (@condvals);
my @val = split (' ', shift (@condvals));
+ delete $conditional{$one_name}{$cond};
&define_pretty_variable ($one_name, $cond, @val);
}
}