Nick wrote:
Jim,

I don't think it's too verbose, but maybe you could delay it to the end of the configure script so you don't have to either interrupt with control-C or scroll back to see what went "wrong."

Good point. I'll move it to the end. Since most systems still ship with the older flex, most people that compile mod_python will see this message.

Here's another idea: Fail the flex test fairly silently (e.g. just "no"), but fall back to a script that generates a nice, verbose error message explaining the situation. That way, when the user tries to call "make" after modifying the .l file, the fake flex alternative script gets called, displays the message, and exits with status 1.

My personal preference is to keep this sort of thing in configure. I hate it when configure succeeds but then make fails. I'm more inclined to leave the message in configure, but with the additional test you suggest added just in case the .l file has changed.

Jim

Nick

Jim Gallacher wrote:

Gregory (Grisha) Trubetskoy wrote:


OK, here is the flex scoop - as the the docs point out, anything before 2.5.31 is not reentrant and I think even uses a slightly different interface so older flex won't even process the psp_parser.l file correctly.

Looking at Fedora Core 4, it still has flex 2.5.4a. (Note that 2.5.31 > 2.5.4 because 31 > 4 - I for a while had trouble seeing that for some reason), so the new flex is still not commonplace.

So until reentrant flex becomes commonplace, the solution was to include
a pre-parsed psp_parser.c so that you woudln't need flex at all to compile mod_python. Looks like this still should be the case.

The ./configure should just print a warning that if flex is not found or too old, should you need to rebuild psp_parser.c you will need to get the right version of flex.


I've made the changes to configure.in, but before I commit I wanted to get some feedback. Are the following configure messages unclear or too verbose?

For the case of the missing flex, ./configure will generate:
...
checking for --with-flex... no
checking for flex... no
configure: WARNING: flex  not found
  You can generally ignore this warning unless you need to regenerate
  psp_parser.c from psp_parse.l. If you do need regenerate psp_parser.c,
  use --with-flex to specify the location of flex.
  See the README for more information.
...

For the case of the wrong flex version, ./configure will generate:
...
checking for --with-flex... no
checking for flex... /usr/local/sbin/flex
found /usr/local/sbin/flex, we'll use this. Use --with-flex to specify another.
checking flex version... configure: WARNING: Flex version 2.5.4 found.
  Version 2.5.31 or greater is required.
  You can generally ignore this warning unless you need to regenerate
  psp_parser.c from psp_parse.l. If you do need regenerate psp_parser.c,
  use --with-flex to specify the location of the correct flex version.
  See the README for more information.
...

Any comments?

Jim



Reply via email to