wireguard: bump to 20180514
[openwrt/openwrt.git] / package / network / services / wireguard / patches / 100-portability.patch
1 tools: fix portability issue
2
3 Check if the compiler defines __linux__, instead of assuming that the
4 host OS is the same as the target OS.
5
6 Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 ---
8 --- a/src/tools/Makefile
9 +++ b/src/tools/Makefile
10 @@ -36,6 +36,9 @@ endif
11 endif
12
13 PLATFORM ?= $(shell uname -s | tr '[:upper:]' '[:lower:]')
14 +ifeq ($(strip $(shell echo __linux__ | $(CC) -E - | grep -v '^\#')),1)
15 +PLATFORM := linux
16 +endif
17
18 CFLAGS ?= -O3
19 CFLAGS += -std=gnu11 -D_GNU_SOURCE