Hello Clifford,

* Clifford Yapp wrote on Wed, Mar 10, 2010 at 02:28:00AM CET:
> I have a problem with some Lex and Yacc files.  They require newer
> versions of flex/bison/m4 be present on the system to correctly
> generate code, and that's not something that can always be assumed.
> I've cooked up some configure logic to check the version of flex
> available in configure.ac.  What I'm trying to do is have the build
> run flex and bison if the versions available are high enough, and if
> that's not possible I'd like to fall back to building alternate static
> copies of the generated source code.  This functions in normal build
> situations, but a make distcheck on a machine where flex and yacc are
> not up to par still results in make attempting to process the .ll and
> .yy files, despite the conditional logic.
> 
> Is there a way at the Makefile.am level to prevent the distcheck
> target running flex and bison on these files?

Right after AM_PROG_LEX or AC_PROG_LEX in configure.ac, check for the
version requirements, and if they are not met, set LEX to
  $(top_srcdir)/$auxdir/missing --run flex

with $auxdir being the directory set with AC_CONFIG_AUX_DIR.  Hmm,
neither Autoconf nor Autoconf provide a public variable for this.
You might need $(abs_top_srcdir) if lex is used in weird ways.

Yacc/bison should work similarly.

Completely untested; please report back whether that worked as intended.
Thanks.  If it doesn't, a small example package to look at would be
good.

Cheers,
Ralf


Reply via email to