poprouting: Fix build with external toolchains
The Makefile would not consistently honour CFLAGS or LDFLAGS, and we were not correctly setting them in the OpenWrt/LEDE Makefile either. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
This commit is contained in:
parent
c57701f439
commit
6ad08f74da
2 changed files with 31 additions and 1 deletions
|
@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=prince
|
PKG_NAME:=prince
|
||||||
PKG_VERSION:=v0.3.1
|
PKG_VERSION:=v0.3.1
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||||
PKG_USE_MIPS16:=0
|
PKG_USE_MIPS16:=0
|
||||||
|
@ -33,6 +33,9 @@ the timer's value are optimized. Finally the timers are pushed back to the routi
|
||||||
Currently it only supports OLSRd2 (aka OONF).
|
Currently it only supports OLSRd2 (aka OONF).
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
CFLAGS += $(TARGET_CFLAGS) $(TARGET_CPPFLAGS)
|
||||||
|
LDFLAGS += $(TARGET_LDFLAGS)
|
||||||
|
|
||||||
define Package/prince/install
|
define Package/prince/install
|
||||||
$(INSTALL_DIR) $(1)/usr/lib
|
$(INSTALL_DIR) $(1)/usr/lib
|
||||||
$(INSTALL_DIR) $(1)/usr/sbin
|
$(INSTALL_DIR) $(1)/usr/sbin
|
||||||
|
|
27
poprouting/patches/001-cflags.patch
Normal file
27
poprouting/patches/001-cflags.patch
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
From dda5c5a0cd2204816f2f83f18e7820ded6c962df Mon Sep 17 00:00:00 2001
|
||||||
|
From: Florian Fainelli <f.fainelli@gmail.com>
|
||||||
|
Date: Mon, 5 Jun 2017 17:30:24 -0700
|
||||||
|
Subject: [PATCH] Honor CFLAGS and LDFLAGS when passed
|
||||||
|
|
||||||
|
---
|
||||||
|
Makefile | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
Index: prince-v0.3.1/Makefile
|
||||||
|
===================================================================
|
||||||
|
--- prince-v0.3.1.orig/Makefile
|
||||||
|
+++ prince-v0.3.1/Makefile
|
||||||
|
@@ -1,11 +1,11 @@
|
||||||
|
CFLAGS+=-lm -ldl -ljson-c -pthread
|
||||||
|
poprouting:out libs
|
||||||
|
cp prince/src/common_c.h prince/src/common.h
|
||||||
|
- $(CC) $(LDFLAGS) prince/src/prince.c prince/src/lib/ini.c prince/src/parser.c prince/src/socket.c graph-parser_c/src/brandes.c graph-parser_c/src/biconnected.c graph-parser_c/src/graph_parser.c graph-parser_c/src/graph/graph.c graph-parser_c/src/graph/list.c graph-parser_c/src/network_change.c -o output/prince $(CFLAGS)
|
||||||
|
+ $(CC) $(LDFLAGS) $(CFLAGS) prince/src/prince.c prince/src/lib/ini.c prince/src/parser.c prince/src/socket.c graph-parser_c/src/brandes.c graph-parser_c/src/biconnected.c graph-parser_c/src/graph_parser.c graph-parser_c/src/graph/graph.c graph-parser_c/src/graph/list.c graph-parser_c/src/network_change.c -o output/prince
|
||||||
|
rm prince/src/common.h
|
||||||
|
libs:
|
||||||
|
cp prince/src/common_c.h prince/src/common.h
|
||||||
|
- $(CC) -shared -fPIC -o output/libprince_oonf_c.so prince/src/oonf.c prince/src/socket.c prince/src/parser.c graph-parser_c/src/brandes.c graph-parser_c/src/biconnected.c graph-parser_c/src/graph_parser.c graph-parser_c/src/graph/graph.c graph-parser_c/src/graph/list.c graph-parser_c/src/network_change.c
|
||||||
|
+ $(CC) $(LDFLAGS) $(CFLAGS) -shared -fPIC -o output/libprince_oonf_c.so prince/src/oonf.c prince/src/socket.c prince/src/parser.c graph-parser_c/src/brandes.c graph-parser_c/src/biconnected.c graph-parser_c/src/graph_parser.c graph-parser_c/src/graph/graph.c graph-parser_c/src/graph/list.c graph-parser_c/src/network_change.c
|
||||||
|
clean:
|
||||||
|
rm output/*
|
||||||
|
|
Loading…
Reference in a new issue