summaryrefslogtreecommitdiffstats
path: root/share/mk/bsd.compiler.mk
blob: cca3968046e7b8c03f1744dbae5ac60d58a5bf86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# $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
OpenPOWER on IntegriCloud