From 5a97cfbc1734ca439f5eed596e3491e52fd7f8eb Mon Sep 17 00:00:00 2001 From: Willi Goesgens Date: Fri, 9 Jan 2015 15:50:51 +0100 Subject: [PATCH] Make bison script backwards compatible with 2.x --- utils/bison-c.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/utils/bison-c.sh b/utils/bison-c.sh index 0757e254f3..915d4058a8 100755 --- a/utils/bison-c.sh +++ b/utils/bison-c.sh @@ -9,11 +9,18 @@ if test "x$BISON" = x -o "x$OUTPUT" = x -o "x$INPUT" = x; then exit 1 fi +BISON_MAJOR_VER=`${BISON} --version |grep bison|sed -e "s;.* ;;" -e "s;\..*;;"` + +if test "${BISON_MAJOR_VER}" -ge "3"; then + BISON_OPTS="--warnings=deprecated,other,error=conflicts-sr,error=conflicts-rr" + +fi + ############################################################################# ## bison ############################################################################# -${BISON} -d -ra --warnings="deprecated,other,error=conflicts-sr,error=conflicts-rr" -o ${OUTPUT} ${INPUT} +${BISON} -d -ra ${BISON_OPTS} -o ${OUTPUT} ${INPUT} ############################################################################# ## sanity checks