NEWS: prepare for 6.6.1
[xcsoar.git] / build / detect.mk
blob1202c344304159e28ade88a8cd3a63c32c8358c5
1 # Make library that auto-detects the build environment.
3 UNAME_S := $(shell uname -s)
4 UNAME_M := $(shell uname -m)
6 HOST_IS_LINUX := $(call string_equals,$(UNAME_S),Linux)
7 HOST_IS_DARWIN := $(call string_equals,$(UNAME_S),Darwin)
8 HOST_IS_CYGWIN := $(call string_equals,$(UNAME_S),Cygwin)
9 HOST_IS_MINGW := $(call string_contains,$(UNAME_S),MINGW)
10 HOST_IS_WIN32 := $(call bool_or,$(HOST_IS_CYGWIN),$(HOST_IS_MINGW))
11 HOST_IS_UNIX := $(call bool_not,$(HOST_IS_WIN32))
13 HOST_IS_ARM := $(call string_contains,$(UNAME_M),armv)
14 HOST_IS_ARMV6 := $(call string_equals,$(UNAME_M),armv6l)
15 HOST_IS_ARMV7 := $(call string_equals,$(UNAME_M),armv7l)
17 ifeq ($(HOST_IS_ARMV7),y)
18 HOST_HAS_NEON := $(call string_contains,$(shell grep -E ^Features /proc/cpuinfo),neon)
19 else
20 HOST_HAS_NEON := n
21 endif
23 ifeq ($(HOST_IS_LINUX)$(HOST_IS_ARMV6),yy)
24 # Check for VideoCore headers present on a Raspberry Pi
25 HOST_IS_PI := $(call string_equals,$(shell test -f /opt/vc/include/interface/vmcs_host/vc_dispmanx.h && echo y),y)
26 else
27 HOST_IS_PI := n
28 endif