build: add HOST_OS_LINUX and HOST_OS_MACOS config symbols

This can be used to simplify host os tests in various places

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2021-10-27 11:47:52 +02:00
parent a44e4aaef9
commit 2d5b83197a
2 changed files with 9 additions and 0 deletions

View File

@ -13,6 +13,14 @@ config HAVE_DOT_CONFIG
bool
default y
HOST_OS := $(shell, uname)
config HOST_OS_LINUX
def_bool $(shell, ./config/check-uname.sh Linux)
config HOST_OS_MACOS
def_bool $(shell, ./config/check-uname.sh Darwin)
source "target/Config.in"
source "config/Config-images.in"

1
config/check-uname.sh Executable file
View File

@ -0,0 +1 @@
[ "$(uname)" = "$1" ] && echo y || echo n