configure: check if lex requires/fails with -o for output
[fio.git] / configure
index af26165e7bc3a7821d2730a8d3efcd858bcf1b79..a0d5a15fa5667295b5375281ffde2b6206fc7c04 100755 (executable)
--- a/configure
+++ b/configure
@@ -1494,6 +1494,16 @@ fi
 fi
 fi
 
+# Check if lex fails using -o
+if test "$arith" = "yes" ; then
+$LEX -o lex.yy.c exp/expression-parser.l 2> /dev/null
+if test "$?" = "0" ; then
+  lex_use_o="yes"
+else
+  lex_use_o="no"
+fi
+fi
+
 echo "lex/yacc for arithmetic       $arith"
 
 ##########################################
@@ -1756,6 +1766,9 @@ if test "$arith" = "yes" ; then
   else
     echo "YACC=$YACC" >> $config_host_mak
   fi
+  if test "$lex_use_o" = "yes" ; then
+    echo "CONFIG_LEX_USE_O=y" >> $config_host_mak
+  fi
 fi
 if test "$getmntent" = "yes" ; then
   output_sym "CONFIG_GETMNTENT"