bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: build: be robust to missing flex


From: Akim Demaille
Subject: Re: RFC: build: be robust to missing flex
Date: Tue, 27 Mar 2012 15:43:40 +0200

Le 27 mars 2012 à 15:36, Stefano Lattarini a écrit :

> Hi Akim.

Hi!

>> +if `$LEX --version` 2>/dev/null | grep flex; then
>> 
> Spurious command substitution here?

*blush*...

> Also, grepping "$LEX --version" output is not a good way to determine
> whether $LEX is actually flex; on my Debian box:
> 
>  $ flex --version # Good.
>  flex 2.5.35
>  $ readlink /usr/bin/lex
>  flex
>  $ lex --version # Ouch!
>  lex 2.5.35
> 
> (Yes, I agree this is total breakage on flex's part).

Bummer.  I *had* tested on this machine :(  But the set up
is different:

$ cat =lex
#!/bin/sh
FLEX=$(dirname "$0")/flex
if [ ! -f "${FLEX}" -o ! -x "${FLEX}" ]; then
    FLEX=/usr/bin/flex
fi
if [ "${COMMAND_MODE:=Unix2003}" != "legacy" ]; then
    exec "${FLEX}" -X ${1+"$@"}
else
    exec "${FLEX}" ${1+"$@"}
fi

Well, I would live happily with grep -E 'f?lex 2\.5\.35' actually,
I don't care much about older flexes.  Newer ones can be treated
when needed, and that's not in a foreseeable future.

WDYT?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]