xref: /OK3568_Linux_fs/buildroot/package/olsr/0001-olsrd-migrate-to-using-bison-3.7.1.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From f31eec323ae65124474664f8a0444f7c035556dd Mon Sep 17 00:00:00 2001
2From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3Date: Sun, 6 Sep 2020 22:31:12 +0200
4Subject: [PATCH] olsrd: migrate to using bison 3.7.1
5
6With the upgrade to bison 3.7.1 (openwrt commit 1cf842d) building
7olsrd was failing.  Now, instead of the contents of header files
8being directly inserted into the generated source files, they are
9instead included with a #include directive.
10
11The local.mk has, until now, done some magic with *-tmp files,
12which is not longer necessary and even causes builds to fail.
13
14src/cfgparser/oparse.c:265:10: fatal error: oparse.h-tmp: No such file or directory
15 #include "oparse.h-tmp"
16
17Suggested-by: Jo-Philipp Wich <jo@mein.io>
18Signed-off-by: Perry Melange <isprotejesvalkata@gmail.com>
19[Retrieved from:
20https://github.com/openwrt-routing/packages/commit/5cc8e058850acbc22fe92c5e2b24863efc577971]
21Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
22[Upstream status: https://github.com/OLSR/olsrd/pull/87]
23---
24 src/cfgparser/local.mk | 8 ++------
25 1 file changed, 2 insertions(+), 6 deletions(-)
26
27diff --git a/src/cfgparser/local.mk b/src/cfgparser/local.mk
28index e767abfc..56e594e4 100644
29--- a/src/cfgparser/local.mk
30+++ b/src/cfgparser/local.mk
31@@ -74,12 +74,8 @@ $(C)oparse.c: $(C)oparse.y $(C)olsrd_conf.h $(C)Makefile
32 ifeq ($(VERBOSE),0)
33 	@echo "[BISON] $@"
34 endif
35-	$(MAKECMDPREFIX)$(BISON) -d -o "$@-tmp" "$<"
36-	$(MAKECMDPREFIX)sed	-e 's/register //' \
37-		-e '/^#line/s/$(call quote,$@-tmp)/$(call quote,$@)/' \
38-		< "$@-tmp" >"$@"
39-	$(MAKECMDPREFIX)mv "$(subst .c,.h,$@-tmp)" "$(subst .c,.h,$@)"
40-	$(MAKECMDPREFIX)$(RM) "$@-tmp" "$(subst .c,.h,$@-tmp)"
41+	$(MAKECMDPREFIX)$(BISON) -d -o "$@" "$<"
42+	$(MAKECMDPREFIX)sed -e 's/register //' "$@" > "$@.o" && mv "$@.o" "$@"
43
44 $(C)oparse.o: CFLAGS := $(filter-out -Wunreachable-code,$(CFLAGS))
45
46--
472.28.0
48
49