aboutsummaryrefslogtreecommitdiffstats
path: root/package/network
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2017-11-11 13:15:24 +0100
committerHans Dedecker <dedeckeh@gmail.com>2017-11-16 22:44:45 +0100
commitd851d7fa56d68f45c647d4c567268b08e852d258 (patch)
tree6795833f662f4afdbf0f293ec862d1d169d62313 /package/network
parent8751bd771d8ade9c15519e5ee869a57a3bd67e41 (diff)
downloadupstream-d851d7fa56d68f45c647d4c567268b08e852d258.tar.gz
upstream-d851d7fa56d68f45c647d4c567268b08e852d258.tar.bz2
upstream-d851d7fa56d68f45c647d4c567268b08e852d258.zip
wireguard: fix portability issue
Check if the compiler defines __linux__, instead of assuming that the host OS is the same as the target OS. Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package/network')
-rw-r--r--package/network/services/wireguard/patches/100-portability.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/package/network/services/wireguard/patches/100-portability.patch b/package/network/services/wireguard/patches/100-portability.patch
new file mode 100644
index 0000000000..e55c922073
--- /dev/null
+++ b/package/network/services/wireguard/patches/100-portability.patch
@@ -0,0 +1,18 @@
+tools: fix portability issue
+
+Check if the compiler defines __linux__, instead of assuming that the
+host OS is the same as the target OS.
+
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+---
+--- a/src/tools/Makefile
++++ b/src/tools/Makefile
+@@ -39,7 +39,7 @@ CFLAGS += -DRUNSTATEDIR="\"$(RUNSTATEDIR
+ ifeq ($(DEBUG_TOOLS),y)
+ CFLAGS += -g
+ endif
+-ifeq ($(shell uname -s),Linux)
++ifeq ($(strip $(shell echo __linux__ | $(CC) -E - | grep -v '^\#')),1)
+ LIBMNL_CFLAGS := $(shell $(PKG_CONFIG) --cflags libmnl 2>/dev/null)
+ LIBMNL_LDLIBS := $(shell $(PKG_CONFIG) --libs libmnl 2>/dev/null || echo -lmnl)
+ CFLAGS += $(LIBMNL_CFLAGS)