automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] {yacc-work} tests: don't define YACC and LEX in the Makefile


From: Stefano Lattarini
Subject: Re: [PATCH] {yacc-work} tests: don't define YACC and LEX in the Makefiles
Date: Mon, 31 Jan 2011 19:36:22 +0100
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

On Sunday 30 January 2011, Ralf Wildenhues wrote:
> * Stefano Lattarini wrote on Sat, Jan 29, 2011 at 07:50:05PM CET:
> > We don't want YACC and LEX defined as make variables, otherwise
> > the values determined at configure time will override those from
> > the environment, even in the make-spawned testcases.
> 
> You can use 'make -e', or you call test cases directly, without 'make',
> or you pass YACC as make command-line argument.
>
Yes, but I (or someone else) can also easily forgot that one needs to do
so, simply run "YACC='bison1.8 -y' MAKE check" instead, see the testsuite
pass, and think that the testcases are portable to bison 1.8 (while maybe
they're not).

> How is this different from other variables set in makefiles?
>
Most other variables that are set in the makefiles are used there, while
YACC and LEX aren't.  Also, most of those variables are not meant to be
also environment variables.

> I'm actually quite ambivalent on this one, but I guess my point is that
> you might have to reconsider anyway at the point where YACC is used
> anywhere in the makefiles (which could arguably be the case for creating
> some tests or so).
>
At that point we could simply do AC_SUBST([am_YACC], [$YACC]) in
configure.ac, and use $(am_YACC) in the Makefiles ...  A bit ugly,
but it should work.

> If you need a comparison, why should it be treated
> differently from PERL in the Automake package?
>
Because, even when running the testsuite, it makes little sense to override
the $PERL automake has been configured with, while on the other hand it
makes perfect sense to override $YACC in order to improve the coverage.

But here is a more on-spot objection that could be raised: why should YACC
be treated differently from AUTOCONF in the Automake package?  After all,
they can be both meaningfully overridden in the testsuite.

Well, this objections shows that my proposed patch is unfortuntely not
good as-is (since it would worsen the present situation by introducing
unnecessary inconsistencies)  and that we should either drop it, or
ensure that the environment variables used in the testsuite are *all*
namespace-safe, e.g.:

  PERL=${AM_TESTSUITE_PERL-${PERL-'@PERL@'}}
  YACC=${AM_TESTSUITE_YACC-${YACC-'@YACC@'}}
  ...

WDYT?

Regards,
   Stefano



reply via email to

[Prev in Thread] Current Thread [Next in Thread]