aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/wireguard/patches/100-portability.patch
blob: 33a7373cc7a73dafa6bdbe7c43ed9555d9651cdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
@@ -36,6 +36,9 @@ endif
 endif
 
 PLATFORM ?= $(shell uname -s | tr '[:upper:]' '[:lower:]')
+ifeq ($(strip $(shell echo __linux__ | $(CC) -E - | grep -v '^\#')),1)
+PLATFORM := linux
+endif
 
 CFLAGS ?= -O3
 CFLAGS += -std=gnu11 -D_GNU_SOURCE