configure: fix for the cases where bison provides yacc
Signed-off-by: Jens Axboe <axboe@fb.com>
diff --git a/configure b/configure
index 706edeb..1a456ff 100755
--- a/configure
+++ b/configure
@@ -1255,15 +1255,22 @@
# Check if we have lex/yacc available
yacc="no"
+yacc_is_bison="no"
lex="no"
arith="no"
-LEX=$(which lex)
+LEX=$(which lex 2> /dev/null)
if test -x "$LEX" ; then
lex="yes"
fi
-YACC=$(which yacc)
+YACC=$(which yacc 2> /dev/null)
if test -x "$YACC" ; then
yacc="yes"
+else
+ YACC=$(which bison 2> /dev/null)
+ if test -x "$YACC" ; then
+ yacc="yes"
+ yacc_is_bison="yes"
+ fi
fi
if test "$yacc" = "yes" && test "$lex" = "yes" ; then
arith="yes"
@@ -1435,6 +1442,11 @@
fi
if test "$arith" = "yes" ; then
output_sym "CONFIG_ARITHMETIC"
+ if test "$yacc_is_bison" = "yes" ; then
+ echo "YACC=$YACC -y" >> $config_host_mak
+ else
+ echo "YACC=$YACC" >> $config_host_mak
+ fi
fi
if test "$zlib" = "no" ; then