chiark / gitweb /
configure.in, conffile.fl: Remove dependency on `libfl.a'.
The `libfl' library contains two functions:
* `main', which basically just calls `yylex' a lot, as an easy way to
write simple programs in lex(1); and
* `yywap', which lets a lex(1)-generated lexer know what to do when it
encounters end-of-file. Specifically, it can return nonzero to say
`that's it, we're done', or zero to say `there's more: I've set up
``yyin'' so that you can read more stuff'.
The library doesn't do anything very sensible for `yywrap': it just
always returns 1. (If you wanted to do something more complicated, you
should just write `yywrap' yourself.)
Secnet has its own `main' function which is fine. It wants `yywrap',
though. This causes trouble with upstream `flex', which nowadays builds
a shared `libfl.so' library. This contains /both/ `yywrap' /and/
`main', which breaks the `configure' test: what happens is that the test
program requires `yywrap', which brings in `libfl.so', which brings in
its `main', which refers to an undefined symbol `yylex' that's not
defined in the test program. This doesn't go wrong in Debian, because
Debian replaces the shared-library `libfl.so' with a linker script which
says `oh, no, you don't want this: you want that ``libfl_pic.a'' over
there'. The latter is a traditional archive, and ld(1) can pick
`yywrap' out of it without pulling in the bogus `main' and its
dependency on `yylex'.
Anyway, this is all more trouble than it's worth. Define our own
`yywrap' in `conffile.fl', and delete the `configure' machinery.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>