spot/m4/bison.m4
Alexandre Duret-Lutz 3c943d836a Add support for Bison 3.0.
We still want to remain compatible with Bison 2.7 so instead of fixing
all the new errors reported by 3.0 we silence some warning.  We should
fix these for good once Bison 3.0 is more widespread.

* m4/bison.m4: New file. Test if bison support -Wno-empty-rule and
-Wno-deprecated.  Define BISON and BISON_EXTRA_FLAGS.
* configure.ac: Do not test for yacc, use the above test instead.
* src/dstarparse/Makefile.am, src/eltlparse/Makefile.am,
src/kripkeparse/Makefile.am, src/ltlparse/Makefile.am,
src/neverparse/Makefile.am, src/tgbaparse/Makefile.am: Use BISON
and BISON_EXTRA_FLAGS.
* src/ltlparse/ltlparse.yy: Fix or and remove useless %right/%nonassoc
settings.
* src/eltlparse/eltlparse.yy: Likewise, and remove "%pure-parser".
2013-09-30 20:32:15 +02:00

15 lines
654 B
Text

AC_DEFUN([adl_CHECK_BISON],
[AC_ARG_VAR([BISON], [Bison parser generator])
AC_CHECK_PROGS([BISON], [bison])
if test -n "$BISON"; then
# Bison 3.0 has warning about issues that cannot be fixed in a
# compatible way with Bison 2.7. Since we want to be compatible
# with both version AND use -Werror, disable those warnings.
# (Unfortunately -Wno-error=empty-rule,no-error=deprecated does not
# work: https://lists.gnu.org/archive/html/bug-bison/2013-09/index.html)
opt='-Wno-empty-rule -Wno-deprecated -Wno-precedence'
if AM_RUN_LOG([$BISON $opt --version]); then
BISON_EXTRA_FLAGS=$opt
fi
fi
AC_SUBST([BISON_EXTRA_FLAGS])])