Merge pull request #533 from micmac1/rtpe-parallel

rtpengine: build fix and patch improvement
This commit is contained in:
micmac1 2020-05-22 10:50:48 +02:00 committed by GitHub
commit fbc8250bb3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 53 additions and 35 deletions

View file

@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=rtpengine PKG_NAME:=rtpengine
PKG_VERSION:=mr8.3.1.4 PKG_VERSION:=mr8.3.1.4
PKG_RELEASE:=2 PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/sipwise/rtpengine/tar.gz/$(PKG_VERSION)? PKG_SOURCE_URL:=https://codeload.github.com/sipwise/rtpengine/tar.gz/$(PKG_VERSION)?
@ -21,7 +21,11 @@ PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net> PKG_MAINTAINER:=Sebastian Kemper <sebastian_ml@gmx.net>
PKG_BUILD_PARALLEL:=1 # When building in parallel, some files (like streambuf.c or dtmflib.c)
# are generated multiple times by the rtpengine build system.
# Intermittently they then contain garbage, leading to redefinition
# errors.
PKG_BUILD_PARALLEL:=0
PKG_BUILD_DEPENDS:=gperf/host PKG_BUILD_DEPENDS:=gperf/host

View file

@ -1,41 +1,55 @@
--- a/daemon/Makefile
+++ b/daemon/Makefile
@@ -51,7 +51,7 @@ endif
endif
endif
-CFLAGS= -g -Wall -Wstrict-prototypes -pthread -fno-strict-aliasing
+CFLAGS+= -g -Wall -Wstrict-prototypes -pthread -fno-strict-aliasing
CFLAGS+= -std=c99
CFLAGS+= $(shell pkg-config --cflags glib-2.0)
CFLAGS+= $(shell pkg-config --cflags gthread-2.0)
--- a/lib/lib.Makefile --- a/lib/lib.Makefile
+++ b/lib/lib.Makefile +++ b/lib/lib.Makefile
@@ -47,8 +47,6 @@ endif @@ -62,3 +62,6 @@ ifneq ($(DBG),yes)
LDLIBS+= $(shell dpkg-buildflags --get LDLIBS)
ifeq ($(DBG),yes) endif
CFLAGS+= -D__DEBUG=1
-else
-CFLAGS+= -O3
endif endif
+
+CFLAGS+=$(OpenWrt_CFLAGS)
+LDFLAGS+=$(OpenWrt_LDFLAGS)
--- a/daemon/Makefile
+++ b/daemon/Makefile
@@ -1,3 +1,6 @@
+OpenWrt_CFLAGS:=$(CFLAGS)
+OpenWrt_LDFLAGS:=$(LDFLAGS)
+
TARGET= rtpengine
with_iptables_option ?= yes
--- a/iptables-extension/Makefile
+++ b/iptables-extension/Makefile
@@ -1,5 +1,5 @@
CC?=gcc
-CFLAGS = -O2 -Wall -Wstrict-prototypes -shared -fPIC
+CFLAGS += -Wall -Wstrict-prototypes -shared -fPIC
ifneq ($(RTPENGINE_VERSION),)
CFLAGS += -DRTPENGINE_VERSION="\"$(RTPENGINE_VERSION)\""
else
--- a/recording-daemon/Makefile --- a/recording-daemon/Makefile
+++ b/recording-daemon/Makefile +++ b/recording-daemon/Makefile
@@ -1,6 +1,6 @@ @@ -1,3 +1,6 @@
+OpenWrt_CFLAGS:=$(CFLAGS)
+OpenWrt_LDFLAGS:=$(LDFLAGS)
+
TARGET= rtpengine-recording TARGET= rtpengine-recording
-CFLAGS= -g -Wall -Wstrict-prototypes -pthread -I. -I../lib/ -I../kernel-module/ CFLAGS= -g -Wall -Wstrict-prototypes -pthread -I. -I../lib/ -I../kernel-module/
+CFLAGS+= -g -Wall -Wstrict-prototypes -pthread -I. -I../lib/ -I../kernel-module/ --- a/iptables-extension/Makefile
CFLAGS+= -std=c99 -fno-strict-aliasing +++ b/iptables-extension/Makefile
CFLAGS+= -D_GNU_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE @@ -1,3 +1,6 @@
CFLAGS+= $(shell pkg-config --cflags glib-2.0) +OpenWrt_CFLAGS:=$(CFLAGS)
+OpenWrt_LDFLAGS:=$(LDFLAGS)
+
CC?=gcc
CFLAGS = -O2 -Wall -Wstrict-prototypes -shared -fPIC
ifneq ($(RTPENGINE_VERSION),)
@@ -22,6 +25,9 @@ else
XTABLES = $(shell test -e /usr/include/xtables.h && echo 1)
endif
+CFLAGS+=$(OpenWrt_CFLAGS)
+LDFLAGS+=$(OpenWrt_LDFLAGS)
+
IPTABLES = $(shell test -e /usr/include/iptables.h && echo 1)
IP6TABLES = $(shell test -e /usr/include/ip6tables.h && echo 1)
@@ -37,7 +43,7 @@ WORK=1
module: libxt_RTPENGINE.so
libxt_RTPENGINE.so: libxt_RTPENGINE.c
- $(CC) $(CFLAGS) -o libxt_RTPENGINE.so libxt_RTPENGINE.c
+ $(CC) $(LDFLAGS) $(CFLAGS) -o libxt_RTPENGINE.so libxt_RTPENGINE.c
else