From 0389931aad668447b8e7c363d028cb363f1f6a03 Mon Sep 17 00:00:00 2001 From: Jan Maria Matejka Date: Tue, 14 Aug 2018 14:36:44 +0200 Subject: [PATCH] Bison: A bit more verbose error messages in config. --- aclocal.m4 | 2 ++ conf/Makefile | 2 +- configure.ac | 5 +++++ tools/Rules.in | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/aclocal.m4 b/aclocal.m4 index 2cf4da1f..05e46d38 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -151,9 +151,11 @@ AC_DEFUN([BIRD_CHECK_BISON_VERSION], ;; 2.*) bird_bison_synclines=no + bird_bison_enhanced_error=no ;; 3.* | 4.* | 5.* | 6.* | 7.* | 8.* | 9.*) bird_bison_synclines=yes + bird_bison_enhanced_error=yes ;; *) AC_MSG_ERROR([Couldn't parse Bison version $$1. Call the developers for help.]) diff --git a/conf/Makefile b/conf/Makefile index 0eee95ec..f9e9b929 100644 --- a/conf/Makefile +++ b/conf/Makefile @@ -12,7 +12,7 @@ BISON_DEBUG=-t endif cf-parse.tab.c: cf-parse.y - $(BISON) -bcf-parse -dv -pcf_ $(BISON_DEBUG) cf-parse.y + $(BISON) $(BISONFLAGS) -bcf-parse -dv -pcf_ $(BISON_DEBUG) cf-parse.y cf-parse.y: $(conf-fragments) $(conf-src)/gen_parser.m4 $(M4) $(M4FLAGS) -P $(conf-src)/gen_parser.m4 $(conf-fragments) >cf-parse.y diff --git a/configure.ac b/configure.ac index 750d7449..645fdf0d 100644 --- a/configure.ac +++ b/configure.ac @@ -185,7 +185,12 @@ if test "$bird_bison_synclines" = yes; then M4FLAGS="$M4FLAGS -s" fi +if test "$bird_bison_enhanced_error" = yes; then + BISONFLAGS="$BISONFLAGS -Dparse.lac=full -Dparse.error=verbose" +fi + AC_SUBST([M4FLAGS]) +AC_SUBST([BISONFLAGS]) BIRD_CHECK_PROG_FLAVOR_GNU([$M4], [], diff --git a/tools/Rules.in b/tools/Rules.in index 92c61615..3f4aa4f7 100644 --- a/tools/Rules.in +++ b/tools/Rules.in @@ -23,6 +23,7 @@ CPPFLAGS=-I$(root-rel) -I$(srcdir) @CPPFLAGS@ CFLAGS=$(CPPFLAGS) @CFLAGS@ LDFLAGS=@LDFLAGS@ M4FLAGS=@M4FLAGS@ +BISONFLAGS=@BISONFLAGS@ LIBS=@LIBS@ CLIENT_LIBS=@CLIENT_LIBS@ CC=@CC@