Flex check in configure

[email protected] (Dave Hill) Tue, 11 Mar 2003 17:42:32 -0500
Newsgroups php.dev
Message-ID <[email protected]>

Hi again,
    I am looking at the flex check in configure.in again. If flex is not 
present, or is not version 2.5.4 then you may get your environment 
dumped to stdout while running configure. This is due to the set command 
being run with no arguments.

Although non-fatal - it certainly is ugly.

Part of the problem with flex versions is that they are not consistant :-p

I took a crack at a fix, but am uncomfortable making the change as I 
don't really have the history on this one. If some of you out there 
would be so kind as to point out any flaws in my reasoning, I would 
apreciate it. (For example, there is a grep for the line containing 
'version' that I don't seem to need with the 3 versions of flex I checked).

If one of you config wizards wants to make the change - be my guest.

Dave

here is what the current test looks like:

set `echo "" | $LEX -V -v --version 2>/dev/null | grep 'version' | cut 
-d ' ' -f
 3 | sed -e 's/\./ /g' | sed -e 's/[^0-9 ]//g'`
if test "${1}" != "2" -o "${2}" != "5" -o "${3}" -lt "4"; then
         AC_MSG_WARN(You will need flex 2.5.4 or later if you want to 
regenerate
 Zend/PHP lexical parsers.)
fi

I am proposing:

flexvers=`echo "" | $LEX -V -v --version 2>/dev/null | sed -e 's/^.* //' 
-e 's/\
./ /g'`
if test ! -z "$flexvers"; then
    set $flexvers
    if test "${1}" != "2" -o "${2}" != "5" -o "${3}" -lt "4"; then
        AC_MSG_WARN(You will need flex 2.5.4 or later if you want to 
regenerate
Zend/PHP lexical parsers.)
    fi
fi