Fix bison parsing
authorStephen M. Cameron <stephenmcameron@gmail.com>
Tue, 7 Oct 2014 02:18:57 +0000 (20:18 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 7 Oct 2014 02:18:57 +0000 (20:18 -0600)
Changes from me to switch the order in which we choose to use yacc or
bison, default to using bison if we have it.

Signed-off-by: Jens Axboe <axboe@fb.com>
Makefile
configure

index 424a112f68a7fbef21587af5d0a6fceacc93a3b3..5662015218aaf9ed3867aba5042e3332f232afb8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -277,7 +277,7 @@ y.tab.o: y.tab.c y.tab.h
        $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
 
 y.tab.c: exp/expression-parser.y
-       $(QUIET_YACC)$(YACC) --no-lines -d exp/expression-parser.y
+       $(QUIET_YACC)$(YACC) --no-lines -d -b y exp/expression-parser.y
 
 y.tab.h: y.tab.c
 
index f7d8ff92b22cf27200aa04dbbb4a11972d16c02d..e3ec25232706bc7dcb0f41df335626e1cb2d0475 100755 (executable)
--- a/configure
+++ b/configure
@@ -1279,14 +1279,14 @@ LEX=$(which lex 2> /dev/null)
 if test -x "$LEX" ; then
   lex="yes"
 fi
-YACC=$(which yacc 2> /dev/null)
+YACC=$(which bison 2> /dev/null)
 if test -x "$YACC" ; then
   yacc="yes"
+  yacc_is_bison="yes"
 else
-  YACC=$(which bison 2> /dev/null)
+  YACC=$(which yacc 2> /dev/null)
   if test -x "$YACC" ; then
     yacc="yes"
-    yacc_is_bison="yes"
   fi
 fi
 if test "$yacc" = "yes" && test "$lex" = "yes" ; then