summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorSitsofe Wheeler <sitsofe@yahoo.com>2020-08-31 14:59:59 +0100
committerSitsofe Wheeler <sitsofe@yahoo.com>2020-09-12 11:54:19 +0100
commit63c25ff810bbd3bc960b5954e7894d3a5e9a2ff2 (patch)
tree6a843032c0a457d2e84a24e0d7f9c431f17c9801 /configure
parent32b0e8c3ba9a5c59e556d9a550fd21029a4510f1 (diff)
downloadfio-63c25ff810bbd3bc960b5954e7894d3a5e9a2ff2.tar.gz
fio-63c25ff810bbd3bc960b5954e7894d3a5e9a2ff2.tar.bz2
configure: cleanup lex/yacc tests
- Switch to prebuilt function for finding executable - Search for the fl library from flex too - Test lex command output directly This allows lexing to be more likely to be found (e.g. MSYS2 but sadly not MSYS2 Mingw-w64). Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure24
1 files changed, 10 insertions, 14 deletions
diff --git a/configure b/configure
index 355b6958..12b7cb58 100755
--- a/configure
+++ b/configure
@@ -2241,19 +2241,14 @@ lex="no"
arith="no"
if test "$disable_lex" = "no" || test -z "$disable_lex" ; then
if test "$targetos" != "SunOS" ; then
-LEX=$(which lex 2> /dev/null)
-if test -x "$LEX" ; then
+if has lex; then
lex="yes"
fi
-YACC=$(which bison 2> /dev/null)
-if test -x "$YACC" ; then
+if has bison; then
yacc="yes"
yacc_is_bison="yes"
-else
- YACC=$(which yacc 2> /dev/null)
- if test -x "$YACC" ; then
- yacc="yes"
- fi
+elif has yacc; then
+ yacc="yes"
fi
if test "$yacc" = "yes" && test "$lex" = "yes" ; then
arith="yes"
@@ -2269,7 +2264,9 @@ int main(int argc, char **argv)
return 0;
}
EOF
-if compile_prog "" "-ll" "lex"; then
+if compile_prog "" "-lfl" "flex"; then
+ LIBS="-lfl $LIBS"
+elif compile_prog "" "-ll" "lex"; then
LIBS="-ll $LIBS"
else
arith="no"
@@ -2283,8 +2280,7 @@ if test "$arith" = "yes" ; then
if test "$force_no_lex_o" = "yes" ; then
lex_use_o="no"
else
-$LEX -o lex.yy.c exp/expression-parser.l 2> /dev/null
-if test "$?" = "0" ; then
+if lex -o lex.yy.c exp/expression-parser.l 2> /dev/null; then
lex_use_o="yes"
else
lex_use_o="no"
@@ -2959,9 +2955,9 @@ fi
if test "$arith" = "yes" ; then
output_sym "CONFIG_ARITHMETIC"
if test "$yacc_is_bison" = "yes" ; then
- echo "YACC=$YACC -y" >> $config_host_mak
+ echo "YACC=bison -y" >> $config_host_mak
else
- echo "YACC=$YACC" >> $config_host_mak
+ echo "YACC=yacc" >> $config_host_mak
fi
if test "$lex_use_o" = "yes" ; then
echo "CONFIG_LEX_USE_O=y" >> $config_host_mak