[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCHES] yacc: support variable expansions in *YFLAGS definition
From: |
Stefano Lattarini |
Subject: |
Re: [PATCHES] yacc: support variable expansions in *YFLAGS definition |
Date: |
Sat, 8 Jan 2011 21:18:00 +0100 |
User-agent: |
KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) |
On Saturday 08 January 2011, Ralf Wildenhues wrote:
> [ dropping the PR Cc: ]
>
> * Stefano Lattarini wrote on Fri, Jan 07, 2011 at 11:50:51PM CET:
> > On Friday 07 January 2011, Ralf Wildenhues wrote:
> > > * Stefano Lattarini wrote on Fri, Jan 07, 2011 at 03:36:43PM CET:
> > > > Currently, automake is not smart enough to resolve variable expansions
> > > > in AM_YFLAGS (or foo_YFLAGS) when scanning them for the `-d' flag.
>
> > The attached two-patch series should fix the bug (the first patch
> > is a testsuite enhancement, the second one really fixes the bug).
> >
> > OK to apply to the temporary branch 'yacc-clean' (recently merged into
> > master with commit v1.11-575-ga297a16) and merge to master again?
>
> The first one is OK with nits addressed. I'll reply to the second
> separately (as my mailer somehow only quoted the first patch).
>
> I note that some of the tests ({cmdline,force}-override) in these
> patches require either yacc or bison to be present, but don't have
> 'required' lines.
>
Hmpf, another stupid oversight. Fixed, and sorry.
> If you want to make a distinction (feel free to
> decide), then you could add a 'yacc' entry in tests/defs.in that doesn't
> check --version (as non-GNU yaccs won't understand that); preapproved.
>
I will. That might be the starting point to re-propose an oldish but
IMHO quite useful patch series aimed at making it easier to run the
automake testsuite with non-GNU compilers and tools -- for a reference,
see:
<http://lists.gnu.org/archive/html/automake-patches/2010-07/msg00001.html>
> Thanks!
> Ralf
> > Subject: [PATCH 1/2] tests: more on *YFLAGS support
> >
> > * tests/yflags-var-expand.test: New test, still xfailing. It
> > exposes automake bug#7800 -- "automake fails to honor `-d' in
> > AM_YFLAGS when variable expansions are involved".
> > * tests/yflags-d-false-positive.test: New test, checking that
> > automake do not spuriously see `-d' in *YFLAGS when that isn't
> > really there.
> > * tests/yflags-force-override.test: New test, checking that
> > automake can cope with definition of the YFLAGS variable in
> > Makefile.am (even if that is an extremely bad practice, as that
> > variable is user-reserved).
> > * tests/yflags-cmdline-override.test: New test, checking that
> > automake can cope with user-redefinition of YFLAGS at configure
> > time and/or at make time.
> > * tests/yflags-conditional.test: New test, checks that automake
> > warns on conditionally-defined *YFLAGS variables.
> > * tests/Makefile.am (TESTS, XFAIL_TESTS): Update.
> > --- /dev/null
> > +++ b/tests/yflags-d-false-positives.test
>
> > +# Check for false positives in automake recognition of `-d' in YFLAGS.
> > +
> > +. ./defs || Exit 1
> > +
> > +set -e
> > +
> > +cat >> configure.in <<'END'
> > +AC_PROG_CC
> > +AC_PROG_YACC
> > +END
> > +
> > +$ACLOCAL
> > +
> > +cat > Makefile.am <<'END'
> > +bin_PROGRAMS = zardoz foobar
> > +zardoz_SOURCES = zardoz.y
> > +foobar_SOURCES = foobar.y
> > +AM_YFLAGS = -xd --d - d --output=d
> > +foobar_YFLAGS = - d $(foovar)-d -dd
>
> Is that '- d' a typo?
>
No, they are all meant. I added a comment about this, just to be sure.
> > --- /dev/null
> > +++ b/tests/yflags-force-override.test
>
> > +# Check that automake can cope with definition of the $(YFLAGS) variable
>
> a definition
>
> > +# in Makefile.am (even if that is an extremely bad practice, because that
>
> s/an //
>
> > +# variable is user-reserved).
> > +
> > +. ./defs || Exit 1
> > +
> > +set -e
> > +
> > +cat >> configure.in <<'END'
> > +AC_PROG_CC
> > +AC_PROG_YACC
> > +AC_OUTPUT
> > +END
> > +
> > +cat > Makefile.am <<'END'
> > +bin_PROGRAMS = foo
> > +foo_SOURCES = foo.y
> > +YFLAGS = -d -v
I've added a "cautionary comment" here:
# Don't do this in a real-life Makefile.am
-*-*-
Thanks for the timely review,
Stefano