[Top][All Lists]

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

Re: AC_PROG_YACC question

From: Bob Proulx
Subject: Re: AC_PROG_YACC question
Date: Sun, 7 Oct 2001 17:05:38 -0600

> Aaah OK, now I understand. I haven't used those beasts (lex/yacc) for a long
> time and had forgotten about this feature. I came across this while
> attempting to build a package ; the package doesn't distribute the generated
> files, but instead attempts to build them at compile time. It's the package
> that is broken, not the autoconf macro :) : either it really needs to use
> yacc at compile time because of some yacc subtlety that makes the generated
> files system-dependant, or it should just distribute the generated files. 

The classic lex has a problem which may have led to that behavior.  It
generates a line like: FILE *yyin = {stdin}, *yyout = {stdout}; But
stdin is not a static value on all systems, it is not required to be,
and so this won't compile cleanly on all systems.  (Flex corrects this
problem, and others.  Generally I avoid [f]lex all together, however,
and write those myself.  Your mileage may vary.)  Different yaccs may
have similar problems.  Bison, at least at one time as I have hot
checked lately, used alloca() internally for stack growth which is
also not portable.

In any event generated C files from some tools will not work portably.
I could easily guess that someone working with those tools would not
distribute the generated files as it would not do any good!  On the
other hand, in my experience both flex and byacc do pretty well.

> > > I probably need to upgrade, as I have found no mention of
> > > am_missing_run on the files owned by my current autoconf package,
> > > whereas it is defined in m4/missing.m4 in autoconf 2.52.

> > It might not be a public interface!

> Can't tell. What surprises me is that I haven't found it anywhere in the
> files of my 2.13 binary package, but still autoconf doesn't complain about
> it when it sees it :).

Being a shell variable, if it is not set at run time then it will
expand to nothing.  If you are using a version that does not set
am_missing_run then "${am_missing_run}yacc" will be just "yacc" and
will work within the limits of reasonability.  That is, it will either
work, or will cause a command failure in make in lieu of a the more
desirable "missing --run yacc" output.  I could set a minimum autoconf
version to force the issue but I prefer to have something work even if
it is not as nice as it could be.


reply via email to

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