freebsd-skq/share/mk/bsd.compiler.mk
Brooks Davis 815e67dd3b Add a COMPILER_FEATURES variable that is set in bsd.compiler.mk.
When the compiler is clang add c++11 to COMPILER_FEATURES.

When the compiler supports c++11, default to building libc++.  This will
not impact the compliation of programs, but will make it easier for
users with clang compiled systems to test libc++ by passing -stdlib=libc++
to their c++ compliations.
2012-09-26 17:25:15 +00:00

28 lines
587 B
Makefile

# $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