On Sun, Jul 31, 2016 at 03:40:14PM -0400, Thomas Dickey wrote:
>I normally don't build with "new" flex, but took a look today and had
>no problem building with the version in testing (which appears to match
>that in experimental).
>
>What is the problem that you are seeing when building?

The problem is not with building, but that the resulting .so refers to, but
doesn't define the whatever_wrap() function, so dynamic linking fails.

configure doesn't cope with the new version in so far as to say that it
expects to find flex >= 2.5 and <= 2.6, but the substitution on line 259 of
configure.in doesn't cope with 2.6:

  sed -e 's/^2.5.//

resulting in this output from configure:

  checking version of flex... 2.6.0
  ../configure: 5316: test: Illegal number: 2.6.0

at the time I didn't look too deeply, but just figured that it was simplest to
go back to flex-old (2.5.4) and will probably just stick with that for now.

For reference, I ran configure with flex-old (2.5.4), the newest version of
flex I could find in the archive >= 2.5 (2.5.39), and the current version
(2.6.0).  I then generated mailfilt.c for each.  See attached.

All three produced an identical config.h.

I suspect that the actual problem is this code in filters/filters.h (line
157):

  #if defined(FLEX_SCANNER) && defined(FLEX_BETA)
  #define YY_SKIP_YYWRAP
  #define yywrap() private_yywrap()
  #define USE_LEXWRAP(name) static int private_yywrap(void) { return 1; }
  #else
  #define USE_LEXWRAP(name) /* nothing */
  #endif

which doesn't choose the first case on 2.6.0, since FLEX_BETA is not defined.
See this fragment from the generated mailfilt.c:

  #define FLEX_SCANNER
  #define YY_FLEX_MAJOR_VERSION 2
  #define YY_FLEX_MINOR_VERSION 6
  #define YY_FLEX_SUBMINOR_VERSION 0
  #if YY_FLEX_SUBMINOR_VERSION > 0
  #define FLEX_BETA
  #endif

the equivalent code for 2.5.x works since YY_FLEX_SUBMINOR_VERSION is
non-zero.

Out of curiosity, why does USE_LEXWRAP take an option?  It doesn't appear to
do anything with it.

--bod

Attachment: vile-vs-flex.tar.gz
Description: application/gzip

Reply via email to