1# 2# Derived from FreeBSD src/share/mk/bsd.compiler.mk 3# 4 5ifndef COMPILER_TYPE 6 ifeq ($(patsubst gcc%,gcc,$(notdir ${CC})),gcc) 7COMPILER_TYPE:= gcc 8 else ifeq ($(notdir ${CC}), clang) 9COMPILER_TYPE:= clang 10 else 11_COMPILER_VERSION:= $(shell ${CC} --version) 12 ifneq ($(filter gcc (GCC),${_COMPILER_VERSION}),) 13COMPILER_TYPE:= gcc 14 else ifneq ($(filter Free Software Foundation,${_COMPILER_VERSION}),) 15COMPILER_TYPE:= gcc 16 else ifneq ($(findstring clang,${_COMPILER_VERSION}),) 17COMPILER_TYPE:= clang 18 else 19$(error Unable to determine compiler type for ${CC}. Consider setting COMPILER_TYPE.) 20 endif 21# XXX 22#undefine _COMPILER_VERSION 23 endif 24endif 25 26ifeq (${COMPILER_TYPE}, clang) 27COMPILER_FEATURES= c++11 28else 29COMPILER_FEATURES= 30endif 31 32 33