summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorDENG Qingfang <dengqf6@mail2.sysu.edu.cn>2019-08-08 17:05:25 +0800
committerDENG Qingfang <dengqf6@mail2.sysu.edu.cn>2019-08-08 17:05:25 +0800
commit178096c9e4555bc41a691ea6742fed8e19cda3f0 (patch)
tree9db8b58ec29d795d2f28d8ff5b09d1d4878546fd /net
parent3ee32eb9bccaa5705fec2a576911ac7f676aaea5 (diff)
zerotier: fix linking to libnatpmp and build with uclibc
Makefile always checks the existence of host's NAT-PMP header, which results in internal NAT-PMP code being used if it's missing. Add a patch to make it check targets' header instead. Use aligned_alloc() instead of valloc() in case of uclibc. Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
Diffstat (limited to 'net')
-rw-r--r--net/zerotier/Makefile6
-rw-r--r--net/zerotier/patches/0005-link-natpmp.patch11
2 files changed, 16 insertions, 1 deletions
diff --git a/net/zerotier/Makefile b/net/zerotier/Makefile
index d1f5533f2..13937b4da 100644
--- a/net/zerotier/Makefile
+++ b/net/zerotier/Makefile
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=zerotier
PKG_VERSION:=1.4.0.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/zerotier/ZeroTierOne/tar.gz/$(PKG_VERSION)?
@@ -56,6 +56,10 @@ endef
TARGET_CFLAGS += -ffunction-sections -fdata-sections
TARGET_LDFLAGS += -Wl,--gc-sections
+ifdef CONFIG_USE_UCLIBC
+ TARGET_CFLAGS += -D'valloc(a)=aligned_alloc(getpagesize(),a)'
+endif
+
define Package/zerotier/conffiles
/etc/config/zerotier
endef
diff --git a/net/zerotier/patches/0005-link-natpmp.patch b/net/zerotier/patches/0005-link-natpmp.patch
new file mode 100644
index 000000000..d1c820947
--- /dev/null
+++ b/net/zerotier/patches/0005-link-natpmp.patch
@@ -0,0 +1,11 @@
+--- a/make-linux.mk
++++ b/make-linux.mk
+@@ -38,7 +38,7 @@ else
+ override DEFS+=-DMINIUPNP_STATICLIB -DMINIUPNPC_SET_SOCKET_TIMEOUT -DMINIUPNPC_GET_SRC_ADDR -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DOS_STRING=\"Linux\" -DMINIUPNPC_VERSION_STRING=\"2.0\" -DUPNP_VERSION_STRING=\"UPnP/1.1\" -DENABLE_STRNATPMPERR
+ ONE_OBJS+=ext/miniupnpc/connecthostport.o ext/miniupnpc/igd_desc_parse.o ext/miniupnpc/minisoap.o ext/miniupnpc/minissdpc.o ext/miniupnpc/miniupnpc.o ext/miniupnpc/miniwget.o ext/miniupnpc/minixml.o ext/miniupnpc/portlistingparse.o ext/miniupnpc/receivedata.o ext/miniupnpc/upnpcommands.o ext/miniupnpc/upnpdev.o ext/miniupnpc/upnperrors.o ext/miniupnpc/upnpreplyparse.o
+ endif
+-ifeq ($(wildcard /usr/include/natpmp.h),)
++ifeq ($(wildcard $(STAGING_DIR)/usr/include/natpmp.h),)
+ ONE_OBJS+=ext/libnatpmp/natpmp.o ext/libnatpmp/getgateway.o
+ else
+ LDLIBS+=-lnatpmp