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
|
2018-05-16 15:14:15 +00:00
|
|
|
@@ -36,6 +36,9 @@ endif
|
2017-11-11 12:15:24 +00:00
|
|
|
endif
|
2018-05-16 15:14:15 +00:00
|
|
|
|
|
|
|
PLATFORM ?= $(shell uname -s | tr '[:upper:]' '[:lower:]')
|
2017-11-11 12:15:24 +00:00
|
|
|
+ifeq ($(strip $(shell echo __linux__ | $(CC) -E - | grep -v '^\#')),1)
|
2018-05-16 15:14:15 +00:00
|
|
|
+PLATFORM := linux
|
|
|
|
+endif
|
|
|
|
|
|
|
|
CFLAGS ?= -O3
|
|
|
|
CFLAGS += -std=gnu11 -D_GNU_SOURCE
|