+2001-03-23 Akim Demaille <akim@epita.fr>
+
+ * automake.in (&file_contents): Maintain $cond_string sync with
+ @cond_stack.
+ Output rules only if not under `FALSE'.
+ Define variables under $cond_string.
+ * scripts.am: For the time being if/endif does not work properly
+ with macros.
+
2001-03-23 Akim Demaille <akim@epita.fr>
* automake.in (IF_PATTERN): Unobfuscate the parens.
my $comment = '';
my $separator = '';
my @cond_stack = ();
+ my $cond_string = '';
foreach (split (/(?<!\\)\n(?![\t#])/, $contents))
{
# Strip leading new lines. This can happen for comments:
if ! $configure_cond{$cond} && $cond !~ /^TRUE|FALSE$/;
push (@cond_stack,
($cond =~ /^TRUE|FALSE$/) ? "$cond" : "${cond}_TRUE");
+ $cond_string = conditional_string (@cond_stack);
}
elsif (/$ELSE_PATTERN/o)
{
else
{
$cond_stack[$#cond_stack] =~ s/TRUE$/FALSE/;
+ $cond_string = conditional_string (@cond_stack);
}
}
elsif (/$ENDIF_PATTERN/o)
else
{
pop @cond_stack;
+ $cond_string = conditional_string (@cond_stack);
}
}
{
# FIXME: We are not robust to people defining several targets
# at once, only some of them being in %dependencies.
- if (defined $dependencies{$_})
+
+ # Output only if not in FALSE.
+ if (defined $dependencies{$_}
+ && $cond_string ne "#")
{
&depend ($_, @deps);
$actions{$_} .= $actions;
{
# Free lance dependency. Output the rule for all the
# targets instead of one by one.
- if (!defined $targets{$targets})
+ if (!defined $targets{$targets}
+ && $cond_string ne "#")
{
$result_rules .= "$separator$comment$paragraph\n";
- rule_define ($targets, 1,
- conditional_string (@cond_stack), $.);
+ rule_define ($targets, 1, $cond_string, $.);
}
$comment = $separator = '';
last;
if /\\$/;;
# Accumulating variables must not be output.
- macro_define ($var, 1, $type, '', $val, $.);
+ macro_define ($var, 1, $type, $cond_string, $val, $.);
# If the user has set some variables we were in charge
# of (which is detected by the first reading of