diff options
Diffstat (limited to 'share/mk/bsd.compiler.mk')
-rw-r--r-- | share/mk/bsd.compiler.mk | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk new file mode 100644 index 0000000..02d152e --- /dev/null +++ b/share/mk/bsd.compiler.mk @@ -0,0 +1,27 @@ +# $FreeBSD$ + +.if !defined(COMPILER_TYPE) +. if ${CC:T:Mgcc} == "gcc" +COMPILER_TYPE:= gcc +. elif ${CC:T:Mclang} == "clang" +COMPILER_TYPE:= clang +. else +_COMPILER_VERSION!= ${CC} --version +. if ${_COMPILER_VERSION:Mgcc} == "gcc" +COMPILER_TYPE:= gcc +. elif ${_COMPILER_VERSION:M\(GCC\)} == "(GCC)" +COMPILER_TYPE:= gcc +. elif ${_COMPILER_VERSION:Mclang} == "clang" +COMPILER_TYPE:= clang +. else +.error Unable to determing compiler type for ${CC} +. endif +. undef _COMPILER_VERSION +. endif +.endif + +.if ${COMPILER_TYPE} == "clang" +COMPILER_FEATURES= c++11 +.else +COMPILER_FEATURES= +.endif |