[source] wireguard: fix portability issue

LEDE Commits lede-commits at lists.infradead.org
Sat Nov 11 04:21:17 PST 2017


nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/12f9305c12d0c6c274a61fc577a36be93a634de4

commit 12f9305c12d0c6c274a61fc577a36be93a634de4
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sat Nov 11 13:15:24 2017 +0100

    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 at nbd.name>
---
 .../services/wireguard/patches/100-portability.patch   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

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 0000000..e55c922
--- /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 at 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)



More information about the lede-commits mailing list