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.
This commit is contained in:
parent
37274fc04c
commit
815e67dd3b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=240966
@ -19,3 +19,9 @@ COMPILER_TYPE:= clang
|
||||
. undef _COMPILER_VERSION
|
||||
. endif
|
||||
.endif
|
||||
|
||||
.if ${COMPILER_TYPE} == "clang"
|
||||
COMPILER_FEATURES= c++11
|
||||
.else
|
||||
COMPILER_FEATURES=
|
||||
.endif
|
||||
|
@ -432,7 +432,6 @@ __DEFAULT_NO_OPTIONS = \
|
||||
ICONV \
|
||||
IDEA \
|
||||
INSTALL_AS_USER \
|
||||
LIBCPLUSPLUS \
|
||||
NAND \
|
||||
OFED \
|
||||
SHARED_TOOLCHAIN
|
||||
@ -642,6 +641,33 @@ MK_${vv:H}:= ${MK_${vv:T}}
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
#
|
||||
# MK_* options that default to "yes" if the compiler is a C++11 compiler.
|
||||
#
|
||||
.include <bsd.compiler.mk>
|
||||
.for var in \
|
||||
LIBCPLUSPLUS
|
||||
.if defined(WITH_${var}) && defined(WITHOUT_${var})
|
||||
.error WITH_${var} and WITHOUT_${var} can't both be set.
|
||||
.endif
|
||||
.if defined(MK_${var})
|
||||
.error MK_${var} can't be set by a user.
|
||||
.endif
|
||||
.if ${COMPILER_FEATURES:Mc++11}
|
||||
.if defined(WITHOUT_${var})
|
||||
MK_${var}:= no
|
||||
.else
|
||||
MK_${var}:= yes
|
||||
.endif
|
||||
.else
|
||||
.if defined(WITH_${var})
|
||||
MK_${var}:= yes
|
||||
.else
|
||||
MK_${var}:= no
|
||||
.endif
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
.if ${MK_CTF} != "no"
|
||||
CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
|
||||
.elif defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300
|
||||
|
Loading…
Reference in New Issue
Block a user