versions. With its movement to src.opts.mk, bsd.prog.mk was testing COMPILER_TYPE without including the bsd.compiler.mk anymore. In the source tree, this caused no problems, for reasons that aren't clear, but does cause problems outside of the source tree. Allow bsd.compiler.mk to be included multiple times safely, and always include bsd.compiler.mk at the top of bsd.prog.mk. Resist the urge to put it in bsd.init.mk, since that would reintroduce the implicit include.
33 lines
671 B
Makefile
33 lines
671 B
Makefile
# $FreeBSD$
|
|
|
|
.if !target(__<bsd.compiler.mk>__)
|
|
__<bsd.compiler.mk>__:
|
|
|
|
.if !defined(COMPILER_TYPE)
|
|
. if ${CC:T:Mgcc*}
|
|
COMPILER_TYPE:= gcc
|
|
. elif ${CC:T:Mclang}
|
|
COMPILER_TYPE:= clang
|
|
. else
|
|
_COMPILER_VERSION!= ${CC} --version
|
|
. if ${_COMPILER_VERSION:Mgcc}
|
|
COMPILER_TYPE:= gcc
|
|
. elif ${_COMPILER_VERSION:M\(GCC\)}
|
|
COMPILER_TYPE:= gcc
|
|
. elif ${_COMPILER_VERSION:Mclang}
|
|
COMPILER_TYPE:= clang
|
|
. else
|
|
.error Unable to determine compiler type for ${CC}. Consider setting COMPILER_TYPE.
|
|
. endif
|
|
. undef _COMPILER_VERSION
|
|
. endif
|
|
.endif
|
|
|
|
.if ${COMPILER_TYPE} == "clang"
|
|
COMPILER_FEATURES= c++11
|
|
.else
|
|
COMPILER_FEATURES=
|
|
.endif
|
|
|
|
.endif # !target(__<bsd.compiler.mk>__)
|