mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-07 22:02:12 +08:00
iOS: enable nat-pmp
This patch enables nat-pmp for iOS and macOS and fixes build for iOS by removing USE_SYSCTL_NET_ROUTE, which requires net/route.h that is not available on iOS. Change-Id: I7342f65a85ecbc0d7f291c981cc78ded2e741e58
This commit is contained in:

committed by
Adrien Béraud

parent
4aff5e977c
commit
c3f07d730d
@ -6,12 +6,8 @@ PKGS += dhtnet
|
||||
DEPS_dhtnet += opendht pjproject asio upnp
|
||||
|
||||
ifndef HAVE_WIN32
|
||||
ifndef HAVE_IOS
|
||||
ifndef HAVE_MACOSX
|
||||
DEPS_dhtnet += natpmp
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
DHTNET_CONF = -DBUILD_SHARED_LIBS=Off \
|
||||
|
21
contrib/src/natpmp/disable_sysctl_on_ios.patch
Normal file
21
contrib/src/natpmp/disable_sysctl_on_ios.patch
Normal file
@ -0,0 +1,21 @@
|
||||
diff --git a/getgateway.c b/getgateway.c
|
||||
index d05bc5e..33b8c45 100644
|
||||
--- a/getgateway.c
|
||||
+++ b/getgateway.c
|
||||
@@ -56,10 +56,16 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
+#include <TargetConditionals.h>
|
||||
#undef USE_PROC_NET_ROUTE
|
||||
#undef USE_SOCKET_ROUTE
|
||||
+#if defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR)
|
||||
+// iOS or Simulator: Do not use SYSCTL_NET_ROUTE
|
||||
+#undef USE_SYSCTL_NET_ROUTE
|
||||
+#else
|
||||
#define USE_SYSCTL_NET_ROUTE
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
#if (defined(sun) && defined(__SVR4))
|
||||
#undef USE_PROC_NET_ROUTE
|
@ -3,10 +3,8 @@ NATPMP_VERSION := 007c3a53165a0551c877130eea4d966885ce19ae
|
||||
NATPMP_URL := https://github.com/miniupnp/libnatpmp/archive/${NATPMP_VERSION}.tar.gz
|
||||
|
||||
ifndef HAVE_WIN32
|
||||
ifndef HAVE_IOS
|
||||
PKGS += natpmp
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(call need_pkg,'libnatpmp'),)
|
||||
PKGS_FOUND += natpmp
|
||||
@ -19,6 +17,9 @@ $(TARBALLS)/libnatpmp-$(NATPMP_VERSION).tar.gz:
|
||||
|
||||
natpmp: libnatpmp-$(NATPMP_VERSION).tar.gz .sum-natpmp
|
||||
$(UNPACK)
|
||||
ifdef HAVE_IOS
|
||||
$(APPLY) $(SRC)/natpmp/disable_sysctl_on_ios.patch
|
||||
endif
|
||||
$(MOVE)
|
||||
|
||||
.natpmp: natpmp toolchain.cmake
|
||||
|
Reference in New Issue
Block a user