From d4b22e3ce16b26d980fffcadc26b221ac1f7f886 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Thu, 27 Aug 2020 18:36:47 +0200 Subject: [PATCH] olsrd: fix compilation with bison version 3.7.1 Recent bison versions changed the way the parser output is generated, which causes compilation of the generated oparse.c to fail with [CC] src/cfgparser/oparse.c src/cfgparser/oparse.c:265:10: fatal error: oparse.h-tmp: No such file or directory #include "oparse.h-tmp" ^~~~~~~~~~~~~~ Fix the issue by generating the expected output files directly and by modifying the *.c file in-place. Suggested-by: Jo-Philipp Wich Signed-off-by: Nick Hainke --- olsrd/Makefile | 2 +- olsrd/patches/100-bison.patch | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 olsrd/patches/100-bison.patch diff --git a/olsrd/Makefile b/olsrd/Makefile index 8a2f33a..462a0fc 100644 --- a/olsrd/Makefile +++ b/olsrd/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=olsrd PKG_SOURCE_DATE:=2020-06-18 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/OLSR/olsrd.git diff --git a/olsrd/patches/100-bison.patch b/olsrd/patches/100-bison.patch new file mode 100644 index 0000000..e0e5a9e --- /dev/null +++ b/olsrd/patches/100-bison.patch @@ -0,0 +1,20 @@ +diff --git a/src/cfgparser/local.mk b/src/cfgparser/local.mk +index e767abfc..56e594e4 100644 +--- a/src/cfgparser/local.mk ++++ b/src/cfgparser/local.mk +@@ -74,12 +74,8 @@ $(C)oparse.c: $(C)oparse.y $(C)olsrd_conf.h $(C)Makefile + ifeq ($(VERBOSE),0) + @echo "[BISON] $@" + endif +- $(MAKECMDPREFIX)$(BISON) -d -o "$@-tmp" "$<" +- $(MAKECMDPREFIX)sed -e 's/register //' \ +- -e '/^#line/s/$(call quote,$@-tmp)/$(call quote,$@)/' \ +- < "$@-tmp" >"$@" +- $(MAKECMDPREFIX)mv "$(subst .c,.h,$@-tmp)" "$(subst .c,.h,$@)" +- $(MAKECMDPREFIX)$(RM) "$@-tmp" "$(subst .c,.h,$@-tmp)" ++ $(MAKECMDPREFIX)$(BISON) -d -o "$@" "$<" ++ $(MAKECMDPREFIX)sed -e 's/register //' "$@" > "$@.o" && mv "$@.o" "$@" + + $(C)oparse.o: CFLAGS := $(filter-out -Wunreachable-code,$(CFLAGS)) + +