1# $FreeBSD$ 2 3.if ${MACHINE} == "common" 4COMPILER_TYPE= none 5.endif 6 7.if !defined(COMPILER_TYPE) 8. if ${CC:T:Mgcc*} 9COMPILER_TYPE:= gcc 10. elif ${CC:T:Mclang} 11COMPILER_TYPE:= clang 12. else 13_COMPILER_VERSION!= ${CC} --version 14. if ${_COMPILER_VERSION:Mgcc} 15COMPILER_TYPE:= gcc 16. elif ${_COMPILER_VERSION:M\(GCC\)} 17COMPILER_TYPE:= gcc 18. elif ${_COMPILER_VERSION:Mclang} 19COMPILER_TYPE:= clang 20. else 21.error Unable to determine compiler type for ${CC}. Consider setting COMPILER_TYPE. 22. endif 23. undef _COMPILER_VERSION 24. endif 25.endif 26 27.if ${COMPILER_TYPE} == "clang" 28COMPILER_FEATURES= c++11 29.if !defined(_COMPILER_VERSION) 30_COMPILER_VERSION!= ${CC} --version 31.endif 32# some warnings are version specific 33COMPILER_VERSION:= ${_COMPILER_VERSION:M[1-9].[0-9]*} 34.else 35COMPILER_FEATURES= 36.endif 37