+2011-01-08 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ yacc: support variable expansions in *YFLAGS definition.
+ This change fixes automake bug#7800.
+ * automake.in (lang_yacc_target_hook): Use 'value_as_list_recursive'
+ instead of 'variable_value' to get the value of *YFLAGS variables.
+ Related changes.
+ ($DASH_D_PATTERN): Removed.
+ * tests/Makefile.am (XFAIL_TESTS): Remove yflags-var-expand.test.
+ * tests/yacc-clean.test: Remove workaround for now-fixed bug.
+ * NEWS: Update.
+
2011-01-08 Stefano Lattarini <stefano.lattarini@gmail.com>
yacc: more tests on *YFLAGS support
- The code for automatic dependency tracking works around a Solaris
make bug triggered by sources containing repeated slashes when the
`subdir-objects' option was used.
+
+ - Automake now detects the presence of the `-d' flag in the various
+ `*YFLAGS' variables even when their definitions involve indirections
+ through other variables, such as in:
+ foo_opts = -d
+ AM_YFLAGS = $(foo_opts)
\f
New in 1.11:
. '|(\$\(srcdir\)/' . $PATH_PATTERN . ')'
. '|([^/\$]' . $PATH_PATTERN . '))\s*(#.*)?' . "\$");
-# Match `-d' as a command-line argument in a string.
-my $DASH_D_PATTERN = "(^|\\s)-d(\\s|\$)";
# Directories installed during 'install-exec' phase.
my $EXEC_DIR_PATTERN =
'^(?:bin|sbin|libexec|sysconf|localstate|lib|pkglib|.*exec.*)' . "\$";
{
my ($self, $aggregate, $output, $input, %transform) = @_;
- my $flag = $aggregate . "_YFLAGS";
- my $flagvar = var $flag;
- my $YFLAGSvar = var 'YFLAGS';
- if (($flagvar && $flagvar->variable_value =~ /$DASH_D_PATTERN/o)
- || ($YFLAGSvar && $YFLAGSvar->variable_value =~ /$DASH_D_PATTERN/o))
+ my $flagvar = var ($aggregate . "_YFLAGS");
+ my $YFLAGSvar = var ('YFLAGS');
+ # We cannot work reliably with conditionally-defined YFLAGS.
+ $flagvar->check_defined_unconditionally if $flagvar;
+ $YFLAGSvar->check_defined_unconditionally if $YFLAGSvar;
+ my @flags = $flagvar ? $flagvar->value_as_list_recursive : ();
+ my @YFLAGS = $YFLAGSvar ? $YFLAGSvar->value_as_list_recursive : ();
+ if (grep (/^-d$/, @flags) || grep (/^-d$/, @YFLAGS))
{
(my $output_base = $output) =~ s/$KNOWN_EXTENSIONS_PATTERN$//;
my $header = $output_base . '.h';
cat > sub2/Makefile.am << 'END'
include $(top_srcdir)/sub1/Makefile.am
AM_YFLAGS = -d
-## FIXME: these apparently redundant definitions are required to
-## work around automake bug#7800.
-bar_YFLAGS += -d
-qux_YFLAGS += -d
END
cat > sub1/parse.y << 'END'
END
cp sub1/main.c sub2/main.c
-
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a