GNU bug report logs -
#7804
Automake does not warn if AM_YFLAGS is conditionally extended
Previous Next
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hello automakers.
Due to current implementation details, when dealing with Yacc sources, automake
must know the contents of the `$(AM_YFLAGS)' variable (or similar `$(foo_YFLAGS)'
variables) *statically and unconditionally* in order to always generate proper
code.
This is due to the special handling of the `-d' yacc flag; on this issue, read
at <http://www.gnu.org/software/automake/manual/html_node/Yacc-and-Lex.html>:
``AM_YFLAGS is usually used to pass the -d option to yacc. Automake knows what
this means and will automatically adjust its rules to update and distribute
the header file built by 'yacc -d'. ''
And while automake correctly warns if AM_YFLAGS is conditionally *defined*:
$ cat configure.ac
AC_INIT(x,0)
AM_INIT_AUTOMAKE(foreign)
AC_PROG_CC
AC_PROG_YACC
AC_CONFIG_FILES(Makefile)
AM_CONDITIONAL(COND,:)
$ aclocal
$ cat > Makefile.am <<'END'
bin_PROGRAMS = foo bar
foo_SOURCES = foo.y
bar_SOURCES = bar.y
if COND
AM_YFLAGS = -d
endif
END
$ automake -a -Werror; echo status=$?
Makefile.am:5: automake does not support AM_YFLAGS being defined conditionally
status=1
it erronously doesn't warn if AM_YFLAGS is conditionally *extended*:
$ cat configure.ac
AC_INIT(x,0)
AM_INIT_AUTOMAKE(foreign)
AC_PROG_CC
AC_PROG_YACC
AC_CONFIG_FILES(Makefile)
AM_CONDITIONAL(COND,:)
$ aclocal
$ cat > Makefile.am <<'END'
bin_PROGRAMS = foo bar
foo_SOURCES = foo.y
bar_SOURCES = bar.y
AM_YFLAGS =
if COND
AM_YFLAGS += -d
endif
END
$ automake -a -Werror; echo status=$?
status=0
I think this bug shouldn't be difficult to fix, and I'll attempt a fix
soonish; but as usual, having it in the bug tracker doesn't hurt IMHO.
Regards,
Stefano
This bug report was last modified 14 years and 133 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.