From b75eb2c0e33ce237dc8a49aa7c9ba52776c1ba5a Mon Sep 17 00:00:00 2001 From: Zachary Whitley Date: Tue, 21 Jan 2020 15:38:51 +0000 Subject: [PATCH] Add Conditional bison build for Centos 7 - Remove definition api.parser.class from zparser.yy - Define either api.parser.class or parser_class_name depending on the value of OS_FAMILY - Pass definition to bison as command argument --- src/Makefile | 8 +++++++- src/zparser.yy | 3 --- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Makefile b/src/Makefile index 7368bf31..ba02588a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -41,6 +41,12 @@ ifeq ($(ENABLE_GCOV), yes) SHFLAGS += $(COVERAGE_LINKER) endif +ifeq ($(OS_FAMILY), redhat) + BISON_PARSER_DEF="parser_class_name=Parser" +else + BISON_PARSER_DEF="api.parser.class=Parser" +endif + ZSYM_OBJS = zobject.o zerror.o zprng.o zsymcrypto.o LIBRARYH=header @@ -55,7 +61,7 @@ zml/zelement.o: $(CC) $(CCFLAGS) -c zml/zelement.c -o zelement.o zparser.o: zparser.yy - $(BISON) -d -v zparser.yy + $(BISON) -d -D $(BISON_PARSER_DEF) -v zparser.yy cp *.hh $(OABE_INCLUDE_DIR) $(CXX) $(CXXFLAGS) -c -o zparser.o zparser.tab.cc diff --git a/src/zparser.yy b/src/zparser.yy index bcde1330..f434158a 100644 --- a/src/zparser.yy +++ b/src/zparser.yy @@ -38,9 +38,6 @@ /* namespace to enclose parser in */ %name-prefix "oabe" -/* set the parser's class identifier */ -%define api.parser.class {Parser} - /* keep track of the current position within the input */ %locations %initial-action