westes / flex

The Fast Lexical Analyzer - scanner generator for lexing in C and C++
Other
3.6k stars 538 forks source link

flex fails to build on the system with too old flex #570

Closed yurivict closed 1 year ago

yurivict commented 1 year ago

Current revision a97872a fails to build on the system with flex-2.5.4

Configure succeeds:

checking for flex... flex
checking lex output file root... lex.yy
checking lex library... -lfl

But the build then fails:

yuri@xx:~/flex $ make
Making all in src
make[1]: Entering directory '/u/yuri/flex/src'
make  all-am
make[2]: Entering directory '/u/yuri/flex/src'
/bin/sh ../build-aux/ylwrap scan.l lex.yy.c scan.c -- flex
"/u/yuri/flex/src/scan.l", line 3: unrecognized '%' directive
"/u/yuri/flex/src/scan.l", line 6: bad character: #
"/u/yuri/flex/src/scan.l", line 6: unknown error processing section 1
"/u/yuri/flex/src/scan.l", line 6: unknown error processing section 1
"/u/yuri/flex/src/scan.l", line 6: bad character: "
"/u/yuri/flex/src/scan.l", line 6: unknown error processing section 1
"/u/yuri/flex/src/scan.l", line 6: bad character: .
"/u/yuri/flex/src/scan.l", line 6: unknown error processing section 1
"/u/yuri/flex/src/scan.l", line 6: bad character: "
"/u/yuri/flex/src/scan.l", line 7: bad character: }
make[2]: *** [Makefile:1433: scan.c] Error 1
make[2]: Leaving directory '/u/yuri/flex/src'
make[1]: *** [Makefile:551: all] Error 2
make[1]: Leaving directory '/u/yuri/flex/src'
make: *** [Makefile:530: all-recursive] Error 1
yuri@xx:~/flex $ flex --version
flex version 2.5.4

Configure should check if the pre-installed flex version is compatible and it should recommend what the minimal compatible version is.

Or, even better, do not require flex dependency at all - it isn't a good idea to depend on itself. flex can just store the C module that results in the flex run in the source tree.

Mightyjo commented 1 year ago

Thanks for pointing this out!

Did the output you provided come from building a clone of this repo or from building the tarball produced by make distcheck?

On Wed, Jun 7, 2023, 13:36 @. @.> wrote:

Current revision a97872a https://github.com/westes/flex/commit/a97872a31146ddbd652994f3b05a7e86705a89c2 fails to build on the system with flex-2.5.4

Configure succeeds:

checking for flex... flex checking lex output file root... lex.yy checking lex library... -lfl

But the build then fails:

@.:~/flex $ make Making all in src make[1]: Entering directory '/u/yuriv/flex/src' make all-am make[2]: Entering directory '/u/yuriv/flex/src' /bin/sh ../build-aux/ylwrap scan.l lex.yy.c scan.c -- flex "/u/yuri/flex/src/scan.l", line 3: unrecognized '%' directive "/u/yuri/flex/src/scan.l", line 6: bad character: # "/u/yuri/flex/src/scan.l", line 6: unknown error processing section 1 "/u/yuri/flex/src/scan.l", line 6: unknown error processing section 1 "/u/yuri/flex/src/scan.l", line 6: bad character: " "/u/yuri/flex/src/scan.l", line 6: unknown error processing section 1 "/u/yuri/flex/src/scan.l", line 6: bad character: . "/u/yuri/flex/src/scan.l", line 6: unknown error processing section 1 "/u/yuri/flex/src/scan.l", line 6: bad character: " "/u/yuri/flex/src/scan.l", line 7: bad character: } make[2]: [Makefile:1433: scan.c] Error 1 make[2]: Leaving directory '/u/yuri/flex/src' make[1]: [Makefile:551: all] Error 2 make[1]: Leaving directory '/u/yuri/flex/src' make: [Makefile:530: all-recursive] Error 1 @.***:~/flex $ flex --version flex version 2.5.4

Configure should check if the pre-installed flex version is compatible and it should recommend what the minimal compatible version is.

Or, even better, do not require flex dependency at all - it isn't a good idea to depend on itself. flex can just store the C module that results in the flex run in the source tree.

— Reply to this email directly, view it on GitHub https://github.com/westes/flex/issues/570, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVJXILIQFYRPFUQ5ROLBKDXKC3YDANCNFSM6AAAAAAY6FTRVA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

yurivict commented 1 year ago

Did the output you provided come from building a clone of this repo or from building the tarball produced by make distcheck?

It is a git clone.

westes commented 1 year ago

A few thoughts:

While I'm going to close this issue, I will open up a separate one to document clearly the need for flex in building flex. It's about half there in the INSTALL.md file, but not as clearly as it might be.