2017-11-11 12:15:24 +00:00
|
|
|
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
|
2017-12-12 19:34:17 +00:00
|
|
|
@@ -43,7 +43,7 @@ CFLAGS += -DRUNSTATEDIR="\"$(RUNSTATEDIR
|
2017-11-11 12:15:24 +00:00
|
|
|
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)
|