configure.in, conffile.fl: Remove dependency on `libfl.a'.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 21 Sep 2019 13:35:44 +0000 (14:35 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 21 Sep 2019 13:45:20 +0000 (14:45 +0100)
commitfe0c91cce702525cc26669b382d3d8a234b7e65f
tree27acf78ddd77803139538497c0ef67242c1badcd
parent788bcfbc2c627552067942bc63e3ce5263503f90
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>
conffile.fl
config.h.in
configure
configure.in