mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-22 23:12:32 +00:00
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>
This commit is contained in:
parent
8751bd771d
commit
d851d7fa56
@ -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)
|
Loading…
Reference in New Issue
Block a user