On Sun, Jan 16, 2000 at 09:13:03PM +0100, Peter Eisentraut wrote:
>
> This puzzles me a bit still, but it seems to work. GNU suggests putting
> yacc and lex files in distributions, so I can't imagine why they would do
> that if you need to have lib[f]l.a anyway.
>
> $ nm /usr/lib/libfl.a
>
> libmain.o:
> 00000000 t gcc2_compiled.
> 00000000 T main
> U yylex
>
> libyywrap.o:
> 00000000 t gcc2_compiled.
> 00000000 T yywrap
I think those are defaults for the case where you just have a lex file, but
didn't bother with defining a main() after the last %% eg:
%%
A putchar('b');
%%
When linked with -lfl, you get an executable. In the postgresql case, life
is more complicated and the parser calls yylex rather than a fake main(), so
-lfl isn't needed.
Cheers,
Patrick