diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-01-10 21:53:01 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-01-10 21:53:01 -0800 |
commit | fb43ab6c8ffff2fc8517d07a2d36e39f870cfd90 (patch) | |
tree | 471ef4b7141f296482d0bd40c2b7ce03d150476d /Makefile | |
parent | 7d5f0b7e3613f8e8be84ac0d541a7bbcb4782f1d (diff) | |
download | txr-fb43ab6c8ffff2fc8517d07a2d36e39f870cfd90.tar.gz txr-fb43ab6c8ffff2fc8517d07a2d36e39f870cfd90.tar.bz2 txr-fb43ab6c8ffff2fc8517d07a2d36e39f870cfd90.zip |
build: deal with the mess of new Bison warnings.
Newer versions of Bison produce spurious warnings in Yacc mode
about %pure-parser being not POSIX conforming and also
deprecated. Plus some strange fluff about "fix-its" that can
be applied if option --update is specified.
Let's detect at configure time whether the Yacc program
being used is actually Bison 3.0 or greater, and if so, give
it some flags to shut up these warnings.
* Makefile (YACC_FLAGS): New variable, conditionally set
based on yacc_is_newer_bison, also new variable, that being
generated into config.make.
(y.tab.c): Invoke $(TXR_YACC) with $(YACC_FLAGS).
(conftest.yacc-version): New phony target for running Yacc
with --version, out of the configure script.
* configure (yacc_is_newer_bison): New variable.
(gen_config_make): Generate yacc_is_newer_bison
make variable. New test for whether Yacc is Bison.
If so, and the version is >= 3.0, sets the
yacc_is_newer_bison variable to y.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -93,6 +93,12 @@ OBJS := $(DBG_OBJS) $(OPT_OBJS) TXR := ./$(PROG) +ifneq ($(yacc_is_newer_bison),) +YACC_FLAGS := -Wno-yacc -Wno-deprecated +else +YACC_FLAGS := +endif + .SUFFIXES: MAKEFLAGS += --no-builtin-rules @@ -288,7 +294,7 @@ y.tab.c: $(top_srcdir)parser.y if [ -e y.tab.h ]; then mv y.tab.h y.tab.h.old ; fi) $(call SH,rm -f y.tab.c) $(call SH, \ - if $(TXR_YACC) -v -d $< ; then \ + if $(TXR_YACC) $(YACC_FLAGS) -v -d $< ; then \ grep -qs '$(BS_LIC_FROM)' y.tab.c && \ grep -qs '$(BS_LIC_TO)' y.tab.c && \ sed -e '/$(BS_LIC_FROM)/$(CM)/$(BS_LIC_TO)/d' \ @@ -552,6 +558,10 @@ conftest.syms: conftest.o conftest.yacc: $(V)echo $(TXR_YACC) +.PHONY: conftest.yacc-version +conftest.yacc-version: + $(V)$(TXR_YACC) --version 2> /dev/null || true + .PHONY: conftest.ccver conftest.ccver: $(V)$(TXR_CC) --version |