Lines 1-272
Link Here
|
1 |
# $FreeBSD$ |
1 |
# $FreeBSD$ |
2 |
# |
2 |
# |
3 |
# Allows to determine the compiler being used |
3 |
# Allows to determine the compiler being used |
4 |
# |
4 |
# |
5 |
# Feature: compiler |
5 |
# Feature: compiler |
6 |
# Usage: USES=compiler or USES=compiler:ARGS |
6 |
# Usage: USES=compiler or USES=compiler:ARGS |
7 |
# Valid ARGS: env (default, implicit) c++0x c++11-lib c++11-lang c11 openmp nestedfct features |
7 |
# Valid ARGS: env (default, implicit) c++0x c++11-lib c++11-lang c11 openmp nestedfct features |
8 |
# |
8 |
# |
9 |
# c++0x: The port needs a compiler understanding C++0X |
9 |
# c++0x: The port needs a compiler understanding C++0X |
10 |
# c++11-lang: The port needs a compiler understanding C++11 |
10 |
# c++11-lang: The port needs a compiler understanding C++11 |
11 |
# c++14-lang: The port needs a compiler understanding C++14 |
11 |
# c++14-lang: The port needs a compiler understanding C++14 |
12 |
# gcc-c++11-lib:The port needs g++ compiler with a C++11 library |
12 |
# gcc-c++11-lib:The port needs g++ compiler with a C++11 library |
13 |
# c++11-lib: The port needs a compiler understanding C++11 and with a C++11 ready standard library |
13 |
# c++11-lib: The port needs a compiler understanding C++11 and with a C++11 ready standard library |
14 |
# c11: The port needs a compiler understanding C11 |
14 |
# c11: The port needs a compiler understanding C11 |
15 |
# openmp: The port needs a compiler understanding openmp |
15 |
# openmp: The port needs a compiler understanding openmp |
16 |
# nestedfct: The port needs a compiler understanding nested functions |
16 |
# nestedfct: The port needs a compiler understanding nested functions |
17 |
# features: The port will determine the features supported by the default compiler |
17 |
# features: The port will determine the features supported by the default compiler |
18 |
# |
18 |
# |
19 |
# Variable to test after <bsd.port.pre.mk> |
19 |
# Variable to test after <bsd.port.pre.mk> |
20 |
# |
20 |
# |
21 |
# COMPILER_TYPE: can be gcc or clang |
21 |
# COMPILER_TYPE: can be gcc or clang |
22 |
# ALT_COMPILER_TYPE: can be gcc or clang depending on COMPILER_TYPE, only set if the base system has 2 compilers |
22 |
# ALT_COMPILER_TYPE: can be gcc or clang depending on COMPILER_TYPE, only set if the base system has 2 compilers |
23 |
# COMPILER_VERSION: first 2 digits of the version: 33 for clang 3.3.*, 47 for gcc 4.7.* |
23 |
# COMPILER_VERSION: first 2 digits of the version: 33 for clang 3.3.*, 47 for gcc 4.7.* |
24 |
# ALT_COMPILER_VERSION: first 2 digits of the version: 33 for clang 3.3.*, 47 for gcc 4.7.* of the ALT_COMPILER_TYPE |
24 |
# ALT_COMPILER_VERSION: first 2 digits of the version: 33 for clang 3.3.*, 47 for gcc 4.7.* of the ALT_COMPILER_TYPE |
25 |
# |
25 |
# |
26 |
# COMPILER_FEATURES: the list of features supported by the compiler includes the standard C++ library. |
26 |
# COMPILER_FEATURES: the list of features supported by the compiler includes the standard C++ library. |
27 |
# CHOSEN_COMPILER_TYPE: can be gcc or clang (type of compiler chosen by the framework) |
27 |
# CHOSEN_COMPILER_TYPE: can be gcc or clang (type of compiler chosen by the framework) |
28 |
# |
28 |
# |
29 |
# MAINTAINER: portmgr@FreeBSD.org |
29 |
# MAINTAINER: portmgr@FreeBSD.org |
30 |
|
30 |
|
31 |
.if !defined(_INCLUDE_USES_COMPILER_MK) |
31 |
.if !defined(_INCLUDE_USES_COMPILER_MK) |
32 |
_INCLUDE_USES_COMPILER_MK= yes |
32 |
_INCLUDE_USES_COMPILER_MK= yes |
33 |
|
33 |
|
34 |
.if empty(compiler_ARGS) |
34 |
.if empty(compiler_ARGS) |
35 |
compiler_ARGS= env |
35 |
compiler_ARGS= env |
36 |
.endif |
36 |
.endif |
37 |
|
37 |
|
38 |
VALID_ARGS= c++11-lib c++11-lang c++14-lang c11 features openmp env nestedfct c++0x gcc-c++11-lib |
38 |
VALID_ARGS= c++11-lib c++11-lang c++14-lang c11 features openmp env nestedfct c++0x gcc-c++11-lib |
39 |
|
39 |
|
40 |
_CC_hash:= ${CC:hash} |
40 |
_CC_hash:= ${CC:hash} |
41 |
_CXX_hash:= ${CXX:hash} |
41 |
_CXX_hash:= ${CXX:hash} |
42 |
|
42 |
|
43 |
.if ${compiler_ARGS} == gcc-c++11-lib |
43 |
.if ${compiler_ARGS} == gcc-c++11-lib |
44 |
_COMPILER_ARGS+= features gcc-c++11-lib |
44 |
_COMPILER_ARGS+= features gcc-c++11-lib |
45 |
.elif ${compiler_ARGS} == c++11-lib |
45 |
.elif ${compiler_ARGS} == c++11-lib |
46 |
_COMPILER_ARGS+= features c++11-lib |
46 |
_COMPILER_ARGS+= features c++11-lib |
47 |
.elif ${compiler_ARGS} == c++0x |
47 |
.elif ${compiler_ARGS} == c++0x |
48 |
_COMPILER_ARGS+= features c++0x |
48 |
_COMPILER_ARGS+= features c++0x |
49 |
.elif ${compiler_ARGS} == c++11-lang |
49 |
.elif ${compiler_ARGS} == c++11-lang |
50 |
_COMPILER_ARGS+= features c++11-lang |
50 |
_COMPILER_ARGS+= features c++11-lang |
51 |
.elif ${compiler_ARGS} == c++14-lang |
51 |
.elif ${compiler_ARGS} == c++14-lang |
52 |
_COMPILER_ARGS+= features c++14-lang |
52 |
_COMPILER_ARGS+= features c++14-lang |
53 |
.elif ${compiler_ARGS} == c11 |
53 |
.elif ${compiler_ARGS} == c11 |
54 |
_COMPILER_ARGS+= features c11 |
54 |
_COMPILER_ARGS+= features c11 |
55 |
.elif ${compiler_ARGS} == features |
55 |
.elif ${compiler_ARGS} == features |
56 |
_COMPILER_ARGS+= features |
56 |
_COMPILER_ARGS+= features |
57 |
.elif ${compiler_ARGS} == env |
57 |
.elif ${compiler_ARGS} == env |
58 |
_COMPILER_ARGS+= env |
58 |
_COMPILER_ARGS+= env |
59 |
.elif ${compiler_ARGS} == openmp |
59 |
.elif ${compiler_ARGS} == openmp |
60 |
_COMPILER_ARGS+= env openmp |
60 |
_COMPILER_ARGS+= env openmp |
61 |
.elif ${compiler_ARGS} == nestedfct |
61 |
.elif ${compiler_ARGS} == nestedfct |
62 |
_COMPILER_ARGS+= env nestedfct |
62 |
_COMPILER_ARGS+= env nestedfct |
63 |
.else |
63 |
.else |
64 |
IGNORE= Invalid argument "${compiler_ARGS}", valid arguments are: ${VALID_ARGS} |
64 |
IGNORE= Invalid argument "${compiler_ARGS}", valid arguments are: ${VALID_ARGS} |
65 |
_COMPILER_ARGS= # |
65 |
_COMPILER_ARGS= # |
66 |
.endif |
66 |
.endif |
67 |
|
67 |
|
68 |
.if ${_COMPILER_ARGS:Mc++*} || ${_COMPILER_ARGS:Mc11} |
68 |
.if ${_COMPILER_ARGS:Mc++*} || ${_COMPILER_ARGS:Mc11} |
69 |
_COMPILER_ARGS+= features |
69 |
_COMPILER_ARGS+= features |
70 |
.endif |
70 |
.endif |
71 |
|
71 |
|
72 |
.if defined(_CCVERSION_${_CC_hash}) |
72 |
.if defined(_CCVERSION_${_CC_hash}) |
73 |
_CCVERSION= ${_CCVERSION_${_CC_hash}} |
73 |
_CCVERSION= ${_CCVERSION_${_CC_hash}} |
74 |
.else |
74 |
.else |
75 |
_CCVERSION!= ${CC} --version |
75 |
_CCVERSION!= ${CC} --version |
76 |
_CCVERSION_${_CC_hash}= ${_CCVERSION} |
76 |
_CCVERSION_${_CC_hash}= ${_CCVERSION} |
77 |
PORTS_ENV_VARS+= _CCVERSION_${_CC_hash} |
77 |
PORTS_ENV_VARS+= _CCVERSION_${_CC_hash} |
78 |
.endif |
78 |
.endif |
79 |
COMPILER_VERSION= ${_CCVERSION:M[0-9].[0-9]*:tW:C/([0-9]).([0-9]).*/\1\2/g} |
79 |
COMPILER_VERSION= ${_CCVERSION:M[0-9].[0-9]*:tW:C/([0-9]).([0-9]).*/\1\2/g} |
80 |
.if ${_CCVERSION:Mclang} |
80 |
.if ${_CCVERSION:Mclang} |
81 |
COMPILER_TYPE= clang |
81 |
COMPILER_TYPE= clang |
82 |
.else |
82 |
.else |
83 |
COMPILER_TYPE= gcc |
83 |
COMPILER_TYPE= gcc |
84 |
.endif |
84 |
.endif |
85 |
|
85 |
|
86 |
ALT_COMPILER_VERSION= 0 |
86 |
ALT_COMPILER_VERSION= 0 |
87 |
ALT_COMPILER_TYPE= none |
87 |
ALT_COMPILER_TYPE= none |
88 |
_ALTCCVERSION= none |
88 |
_ALTCCVERSION= none |
89 |
.if defined(_ALTCCVERSION_${_CC_hash}) |
89 |
.if defined(_ALTCCVERSION_${_CC_hash}) |
90 |
_ALTCCVERSION= ${_ALTCCVERSION_${_CC_hash}} |
90 |
_ALTCCVERSION= ${_ALTCCVERSION_${_CC_hash}} |
91 |
.else |
91 |
.else |
92 |
.if ${COMPILER_TYPE} == gcc && exists(/usr/bin/clang) |
92 |
.if ${COMPILER_TYPE} == gcc && exists(/usr/bin/clang) |
93 |
.if ${ARCH} == amd64 || ${ARCH} == i386 # clang often non-default for a reason |
93 |
.if ${ARCH} == amd64 || ${ARCH} == i386 # clang often non-default for a reason |
94 |
_ALTCCVERSION!= /usr/bin/clang --version |
94 |
_ALTCCVERSION!= /usr/bin/clang --version |
95 |
.endif |
95 |
.endif |
96 |
.elif ${COMPILER_TYPE} == clang && exists(/usr/bin/gcc) |
96 |
.elif ${COMPILER_TYPE} == clang && exists(/usr/bin/gcc) |
97 |
_ALTCCVERSION!= /usr/bin/gcc --version |
97 |
_ALTCCVERSION!= /usr/bin/gcc --version |
98 |
.endif |
98 |
.endif |
99 |
_ALTCCVERSION_${_CC_hash}= ${_ALTCCVERSION} |
99 |
_ALTCCVERSION_${_CC_hash}= ${_ALTCCVERSION} |
100 |
PORTS_ENV_VARS+= _ALTCCVERSION_${_CC_hash} |
100 |
PORTS_ENV_VARS+= _ALTCCVERSION_${_CC_hash} |
101 |
.endif |
101 |
.endif |
102 |
|
102 |
|
103 |
ALT_COMPILER_VERSION= ${_ALTCCVERSION:M[0-9].[0-9]*:tW:C/([0-9]).([0-9]).*/\1\2/g} |
103 |
ALT_COMPILER_VERSION= ${_ALTCCVERSION:M[0-9].[0-9]*:tW:C/([0-9]).([0-9]).*/\1\2/g} |
104 |
.if ${_ALTCCVERSION:Mclang} |
104 |
.if ${_ALTCCVERSION:Mclang} |
105 |
ALT_COMPILER_TYPE= clang |
105 |
ALT_COMPILER_TYPE= clang |
106 |
.elif ${_ALTCCVERSION} != none |
106 |
.elif ${_ALTCCVERSION} != none |
107 |
ALT_COMPILER_TYPE= gcc |
107 |
ALT_COMPILER_TYPE= gcc |
108 |
.endif |
108 |
.endif |
109 |
|
109 |
|
110 |
CHOSEN_COMPILER_TYPE= ${COMPILER_TYPE} |
110 |
CHOSEN_COMPILER_TYPE= ${COMPILER_TYPE} |
111 |
|
111 |
|
112 |
.if ${_COMPILER_ARGS:Mopenmp} |
112 |
.if ${_COMPILER_ARGS:Mopenmp} |
113 |
.if ${COMPILER_TYPE} == clang |
113 |
.if ${COMPILER_TYPE} == clang && ${ARCH} == amd64 |
114 |
USE_GCC= yes |
114 |
_USES_POST+= localbase:ldflags |
|
|
115 |
BUILD_DEPENDS+= llvm60>=0:devel/llvm60 |
116 |
RUN_DEPENDS+= llvm60>=0:devel/llvm60 |
117 |
CPP= ${LOCALBASE}/bin/clang-cpp60 |
118 |
CC= ${LOCALBASE}/bin/clang60 |
119 |
CXX= ${LOCALBASE}/bin/clang++60 |
120 |
CHOSEN_COMPILER_TYPE= clang |
121 |
.else |
122 |
USE_GCC= yes |
115 |
CHOSEN_COMPILER_TYPE= gcc |
123 |
CHOSEN_COMPILER_TYPE= gcc |
|
|
124 |
.if ${COMPILER_FEATURES:Mlibc++} |
125 |
CXXFLAGS+= -nostdinc++ -isystem /usr/include/c++/v1 |
126 |
LDFLAGS+= -L${WRKDIR} |
127 |
|
128 |
_USES_configure+= 200:gcc-libc++-configure |
129 |
gcc-libc++-configure: |
130 |
@${LN} -fs /usr/lib/libc++.so ${WRKDIR}/libstdc++.so |
131 |
.endif |
116 |
.endif |
132 |
.endif |
117 |
.endif |
133 |
.endif |
118 |
|
134 |
|
119 |
.if ${_COMPILER_ARGS:Mnestedfct} |
135 |
.if ${_COMPILER_ARGS:Mnestedfct} |
120 |
.if ${COMPILER_TYPE} == clang |
136 |
.if ${COMPILER_TYPE} == clang |
121 |
USE_GCC= any |
137 |
USE_GCC= any |
122 |
CHOSEN_COMPILER_TYPE= gcc |
138 |
CHOSEN_COMPILER_TYPE= gcc |
123 |
.endif |
139 |
.endif |
124 |
.endif |
140 |
.endif |
125 |
|
141 |
|
126 |
.if ${_COMPILER_ARGS:Mfeatures} |
142 |
.if ${_COMPILER_ARGS:Mfeatures} |
127 |
.if defined(_CXXINTERNAL_${_CXX_hash}) |
143 |
.if defined(_CXXINTERNAL_${_CXX_hash}) |
128 |
_CXXINTERNAL= ${_CXXINTERNAL_${_CXX_hash}} |
144 |
_CXXINTERNAL= ${_CXXINTERNAL_${_CXX_hash}} |
129 |
.else |
145 |
.else |
130 |
_CXXINTERNAL!= ${CXX} -\#\#\# /dev/null 2>&1 |
146 |
_CXXINTERNAL!= ${CXX} -\#\#\# /dev/null 2>&1 |
131 |
_CXXINTERNAL_${_CXX_hash}= ${_CXXINTERNAL} |
147 |
_CXXINTERNAL_${_CXX_hash}= ${_CXXINTERNAL} |
132 |
PORTS_ENV_VARS+= _CXXINTERNAL_${_CXX_hash} |
148 |
PORTS_ENV_VARS+= _CXXINTERNAL_${_CXX_hash} |
133 |
.endif |
149 |
.endif |
134 |
.if ${_CXXINTERNAL:M\"-lc++\"} |
150 |
.if ${_CXXINTERNAL:M\"-lc++\"} |
135 |
COMPILER_FEATURES= libc++ |
151 |
COMPILER_FEATURES= libc++ |
136 |
.else |
152 |
.else |
137 |
COMPILER_FEATURES= libstdc++ |
153 |
COMPILER_FEATURES= libstdc++ |
138 |
.endif |
154 |
.endif |
139 |
|
155 |
|
140 |
CSTD= c89 c99 c11 gnu89 gnu99 gnu11 |
156 |
CSTD= c89 c99 c11 gnu89 gnu99 gnu11 |
141 |
CXXSTD= c++98 c++0x c++11 c++14 gnu++98 gnu++11 |
157 |
CXXSTD= c++98 c++0x c++11 c++14 gnu++98 gnu++11 |
142 |
|
158 |
|
143 |
.for std in ${CSTD} ${CXXSTD} |
159 |
.for std in ${CSTD} ${CXXSTD} |
144 |
_LANG=c |
160 |
_LANG=c |
145 |
.if ${CXXSTD:M${std}} |
161 |
.if ${CXXSTD:M${std}} |
146 |
_LANG=c++ |
162 |
_LANG=c++ |
147 |
.endif |
163 |
.endif |
148 |
.if defined(CC_OUTPUT_${_CC_hash}_${std:hash}) |
164 |
.if defined(CC_OUTPUT_${_CC_hash}_${std:hash}) |
149 |
OUTPUT_${std}= ${CC_OUTPUT_${_CC_hash}_${std:hash}} |
165 |
OUTPUT_${std}= ${CC_OUTPUT_${_CC_hash}_${std:hash}} |
150 |
.else |
166 |
.else |
151 |
OUTPUT_${std}!= if ${CC} -std=${std} -c -x ${_LANG} /dev/null -o /dev/null 2>&1; then echo yes; fi; echo |
167 |
OUTPUT_${std}!= if ${CC} -std=${std} -c -x ${_LANG} /dev/null -o /dev/null 2>&1; then echo yes; fi; echo |
152 |
CC_OUTPUT_${_CC_hash}_${std:hash}= ${OUTPUT_${std}} |
168 |
CC_OUTPUT_${_CC_hash}_${std:hash}= ${OUTPUT_${std}} |
153 |
PORTS_ENV_VARS+= CC_OUTPUT_${_CC_hash}_${std:hash} |
169 |
PORTS_ENV_VARS+= CC_OUTPUT_${_CC_hash}_${std:hash} |
154 |
.endif |
170 |
.endif |
155 |
.if !${OUTPUT_${std}:M*error*} |
171 |
.if !${OUTPUT_${std}:M*error*} |
156 |
COMPILER_FEATURES+= ${std} |
172 |
COMPILER_FEATURES+= ${std} |
157 |
.endif |
173 |
.endif |
158 |
.endfor |
174 |
.endfor |
159 |
.endif |
175 |
.endif |
160 |
|
176 |
|
161 |
.if ${_COMPILER_ARGS:Mc++11-lib} |
177 |
.if ${_COMPILER_ARGS:Mc++11-lib} |
162 |
.if !${COMPILER_FEATURES:Mc++11} |
178 |
.if !${COMPILER_FEATURES:Mc++11} |
163 |
USE_GCC= yes |
179 |
USE_GCC= yes |
164 |
CHOSEN_COMPILER_TYPE= gcc |
180 |
CHOSEN_COMPILER_TYPE= gcc |
165 |
.elif ${COMPILER_TYPE} == clang && ${COMPILER_FEATURES:Mlibstdc++} |
181 |
.elif ${COMPILER_TYPE} == clang && ${COMPILER_FEATURES:Mlibstdc++} |
166 |
USE_GCC= yes |
182 |
USE_GCC= yes |
167 |
CHOSEN_COMPILER_TYPE= gcc |
183 |
CHOSEN_COMPILER_TYPE= gcc |
168 |
.endif |
184 |
.endif |
169 |
.endif |
185 |
.endif |
170 |
|
186 |
|
171 |
.if ${_COMPILER_ARGS:Mc++14-lang} |
187 |
.if ${_COMPILER_ARGS:Mc++14-lang} |
172 |
.if !${COMPILER_FEATURES:Mc++14} |
188 |
.if !${COMPILER_FEATURES:Mc++14} |
173 |
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2 |
189 |
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2 |
174 |
USE_GCC= yes |
190 |
USE_GCC= yes |
175 |
CHOSEN_COMPILER_TYPE= gcc |
191 |
CHOSEN_COMPILER_TYPE= gcc |
176 |
.elif (${COMPILER_TYPE} == clang && ${COMPILER_VERSION} < 35) || ${COMPILER_TYPE} == gcc |
192 |
.elif (${COMPILER_TYPE} == clang && ${COMPILER_VERSION} < 35) || ${COMPILER_TYPE} == gcc |
177 |
.if ${ALT_COMPILER_TYPE} == clang && ${ALT_COMPILER_VERSION} >= 35 |
193 |
.if ${ALT_COMPILER_TYPE} == clang && ${ALT_COMPILER_VERSION} >= 35 |
178 |
CPP= clang-cpp |
194 |
CPP= clang-cpp |
179 |
CC= clang |
195 |
CC= clang |
180 |
CXX= clang++ |
196 |
CXX= clang++ |
181 |
CHOSEN_COMPILER_TYPE= clang |
197 |
CHOSEN_COMPILER_TYPE= clang |
182 |
.else |
198 |
.else |
183 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/clang60:devel/llvm60 |
199 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/clang60:devel/llvm60 |
184 |
CPP= ${LOCALBASE}/bin/clang-cpp60 |
200 |
CPP= ${LOCALBASE}/bin/clang-cpp60 |
185 |
CC= ${LOCALBASE}/bin/clang60 |
201 |
CC= ${LOCALBASE}/bin/clang60 |
186 |
CXX= ${LOCALBASE}/bin/clang++60 |
202 |
CXX= ${LOCALBASE}/bin/clang++60 |
187 |
CHOSEN_COMPILER_TYPE= clang |
203 |
CHOSEN_COMPILER_TYPE= clang |
188 |
.endif |
204 |
.endif |
189 |
.endif |
205 |
.endif |
190 |
.endif |
206 |
.endif |
191 |
.endif |
207 |
.endif |
192 |
|
208 |
|
193 |
.if ${_COMPILER_ARGS:Mc++11-lang} |
209 |
.if ${_COMPILER_ARGS:Mc++11-lang} |
194 |
.if !${COMPILER_FEATURES:Mc++11} |
210 |
.if !${COMPILER_FEATURES:Mc++11} |
195 |
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2 |
211 |
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2 |
196 |
USE_GCC= yes |
212 |
USE_GCC= yes |
197 |
CHOSEN_COMPILER_TYPE= gcc |
213 |
CHOSEN_COMPILER_TYPE= gcc |
198 |
.elif ${COMPILER_TYPE} == gcc |
214 |
.elif ${COMPILER_TYPE} == gcc |
199 |
.if ${ALT_COMPILER_TYPE} == clang |
215 |
.if ${ALT_COMPILER_TYPE} == clang |
200 |
CPP= clang-cpp |
216 |
CPP= clang-cpp |
201 |
CC= clang |
217 |
CC= clang |
202 |
CXX= clang++ |
218 |
CXX= clang++ |
203 |
CHOSEN_COMPILER_TYPE= clang |
219 |
CHOSEN_COMPILER_TYPE= clang |
204 |
.else |
220 |
.else |
205 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/clang60:devel/llvm60 |
221 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/clang60:devel/llvm60 |
206 |
CPP= ${LOCALBASE}/bin/clang-cpp60 |
222 |
CPP= ${LOCALBASE}/bin/clang-cpp60 |
207 |
CC= ${LOCALBASE}/bin/clang60 |
223 |
CC= ${LOCALBASE}/bin/clang60 |
208 |
CXX= ${LOCALBASE}/bin/clang++60 |
224 |
CXX= ${LOCALBASE}/bin/clang++60 |
209 |
CHOSEN_COMPILER_TYPE= clang |
225 |
CHOSEN_COMPILER_TYPE= clang |
210 |
.endif |
226 |
.endif |
211 |
.endif |
227 |
.endif |
212 |
.endif |
228 |
.endif |
213 |
.endif |
229 |
.endif |
214 |
|
230 |
|
215 |
.if ${_COMPILER_ARGS:Mc++0x} |
231 |
.if ${_COMPILER_ARGS:Mc++0x} |
216 |
.if !${COMPILER_FEATURES:Mc++0x} |
232 |
.if !${COMPILER_FEATURES:Mc++0x} |
217 |
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2 |
233 |
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2 |
218 |
USE_GCC= yes |
234 |
USE_GCC= yes |
219 |
CHOSEN_COMPILER_TYPE= gcc |
235 |
CHOSEN_COMPILER_TYPE= gcc |
220 |
.elif ${COMPILER_TYPE} == gcc |
236 |
.elif ${COMPILER_TYPE} == gcc |
221 |
.if ${ALT_COMPILER_TYPE} == clang |
237 |
.if ${ALT_COMPILER_TYPE} == clang |
222 |
CPP= clang-cpp |
238 |
CPP= clang-cpp |
223 |
CC= clang |
239 |
CC= clang |
224 |
CXX= clang++ |
240 |
CXX= clang++ |
225 |
CHOSEN_COMPILER_TYPE= clang |
241 |
CHOSEN_COMPILER_TYPE= clang |
226 |
.else |
242 |
.else |
227 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/clang60:devel/llvm60 |
243 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/clang60:devel/llvm60 |
228 |
CHOSEN_COMPILER_TYPE= clang |
244 |
CHOSEN_COMPILER_TYPE= clang |
229 |
CPP= ${LOCALBASE}/bin/clang-cpp60 |
245 |
CPP= ${LOCALBASE}/bin/clang-cpp60 |
230 |
CC= ${LOCALBASE}/bin/clang60 |
246 |
CC= ${LOCALBASE}/bin/clang60 |
231 |
CXX= ${LOCALBASE}/bin/clang++60 |
247 |
CXX= ${LOCALBASE}/bin/clang++60 |
232 |
.endif |
248 |
.endif |
233 |
.endif |
249 |
.endif |
234 |
.endif |
250 |
.endif |
235 |
.endif |
251 |
.endif |
236 |
|
252 |
|
237 |
.if ${_COMPILER_ARGS:Mc11} |
253 |
.if ${_COMPILER_ARGS:Mc11} |
238 |
.if !${COMPILER_FEATURES:Mc11} |
254 |
.if !${COMPILER_FEATURES:Mc11} |
239 |
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2 |
255 |
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2 |
240 |
USE_GCC= yes |
256 |
USE_GCC= yes |
241 |
CHOSEN_COMPILER_TYPE= gcc |
257 |
CHOSEN_COMPILER_TYPE= gcc |
242 |
.elif ${COMPILER_TYPE} == gcc |
258 |
.elif ${COMPILER_TYPE} == gcc |
243 |
.if ${ALT_COMPILER_TYPE} == clang |
259 |
.if ${ALT_COMPILER_TYPE} == clang |
244 |
CPP= clang-cpp |
260 |
CPP= clang-cpp |
245 |
CC= clang |
261 |
CC= clang |
246 |
CXX= clang++ |
262 |
CXX= clang++ |
247 |
CHOSEN_COMPILER_TYPE= clang |
263 |
CHOSEN_COMPILER_TYPE= clang |
248 |
.else |
264 |
.else |
249 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/clang60:devel/llvm60 |
265 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/clang60:devel/llvm60 |
250 |
CHOSEN_COMPILER_TYPE= clang |
266 |
CHOSEN_COMPILER_TYPE= clang |
251 |
CPP= ${LOCALBASE}/bin/clang-cpp60 |
267 |
CPP= ${LOCALBASE}/bin/clang-cpp60 |
252 |
CC= ${LOCALBASE}/bin/clang60 |
268 |
CC= ${LOCALBASE}/bin/clang60 |
253 |
CXX= ${LOCALBASE}/bin/clang++60 |
269 |
CXX= ${LOCALBASE}/bin/clang++60 |
254 |
.endif |
270 |
.endif |
255 |
.endif |
271 |
.endif |
256 |
.endif |
272 |
.endif |
257 |
.endif |
273 |
.endif |
258 |
|
274 |
|
259 |
.if ${_COMPILER_ARGS:Mgcc-c++11-lib} |
275 |
.if ${_COMPILER_ARGS:Mgcc-c++11-lib} |
260 |
USE_GCC= yes |
276 |
USE_GCC= yes |
261 |
CHOSEN_COMPILER_TYPE= gcc |
277 |
CHOSEN_COMPILER_TYPE= gcc |
262 |
.if ${COMPILER_FEATURES:Mlibc++} |
278 |
.if ${COMPILER_FEATURES:Mlibc++} |
263 |
CXXFLAGS+= -nostdinc++ -isystem /usr/include/c++/v1 |
279 |
CXXFLAGS+= -nostdinc++ -isystem /usr/include/c++/v1 |
264 |
LDFLAGS+= -L${WRKDIR} |
280 |
LDFLAGS+= -L${WRKDIR} |
265 |
|
281 |
|
266 |
_USES_configure+= 200:gcc-libc++-configure |
282 |
_USES_configure+= 200:gcc-libc++-configure |
267 |
gcc-libc++-configure: |
283 |
gcc-libc++-configure: |
268 |
@${LN} -fs /usr/lib/libc++.so ${WRKDIR}/libstdc++.so |
284 |
@${LN} -fs /usr/lib/libc++.so ${WRKDIR}/libstdc++.so |
269 |
.endif |
285 |
.endif |
270 |
.endif |
286 |
.endif |
271 |
|
287 |
|
272 |
.endif |
288 |
.endif |