View | Details | Raw Unified | Return to bug 199098
Collapse All | Expand All

(-)b/Mk/Uses/compiler.mk (+19 lines)
Lines 25-30 Link Here
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
# CHOSEN_COMPILER_VERSION: first 2 digits of the version: 33 for clang 3.3.*, 47 for gcc 4.7.*
28
#
29
#
29
# MAINTAINER: portmgr@FreeBSD.org
30
# MAINTAINER: portmgr@FreeBSD.org
30
31
Lines 101-111 ALT_COMPILER_TYPE= gcc Link Here
101
.endif
102
.endif
102
103
103
CHOSEN_COMPILER_TYPE=	${COMPILER_TYPE}
104
CHOSEN_COMPILER_TYPE=	${COMPILER_TYPE}
105
CHOSEN_COMPILER_VERSION=${COMPILER_VERSION}
104
106
105
.if ${_COMPILER_ARGS:Mopenmp}
107
.if ${_COMPILER_ARGS:Mopenmp}
106
.if ${COMPILER_TYPE} == clang
108
.if ${COMPILER_TYPE} == clang
107
USE_GCC=	yes
109
USE_GCC=	yes
108
CHOSEN_COMPILER_TYPE=	gcc
110
CHOSEN_COMPILER_TYPE=	gcc
111
CHOSEN_COMPILER_VERSION=${CC:S/gcc//}
109
.endif
112
.endif
110
.endif
113
.endif
111
114
Lines 113-118 CHOSEN_COMPILER_TYPE= gcc Link Here
113
.if ${COMPILER_TYPE} == clang
116
.if ${COMPILER_TYPE} == clang
114
USE_GCC=	any
117
USE_GCC=	any
115
CHOSEN_COMPILER_TYPE=	gcc
118
CHOSEN_COMPILER_TYPE=	gcc
119
CHOSEN_COMPILER_VERSION=${CC:S/gcc//}
116
.endif
120
.endif
117
.endif
121
.endif
118
122
Lines 143-151 COMPILER_FEATURES+= ${std} Link Here
143
.if !${COMPILER_FEATURES:Mc++11}
147
.if !${COMPILER_FEATURES:Mc++11}
144
USE_GCC=	yes
148
USE_GCC=	yes
145
CHOSEN_COMPILER_TYPE=	gcc
149
CHOSEN_COMPILER_TYPE=	gcc
150
CHOSEN_COMPILER_VERSION=${CC:S/gcc//}
146
.elif ${COMPILER_TYPE} == clang && ${COMPILER_FEATURES:Mlibstdc++}
151
.elif ${COMPILER_TYPE} == clang && ${COMPILER_FEATURES:Mlibstdc++}
147
USE_GCC=	yes
152
USE_GCC=	yes
148
CHOSEN_COMPILER_TYPE=	gcc
153
CHOSEN_COMPILER_TYPE=	gcc
154
CHOSEN_COMPILER_VERSION=${CC:S/gcc//}
149
.endif
155
.endif
150
.endif
156
.endif
151
157
Lines 154-171 CHOSEN_COMPILER_TYPE= gcc Link Here
154
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2
160
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2
155
USE_GCC=	5+
161
USE_GCC=	5+
156
CHOSEN_COMPILER_TYPE=	gcc
162
CHOSEN_COMPILER_TYPE=	gcc
163
CHOSEN_COMPILER_VERSION=${CC:S/gcc//}
157
.elif (${COMPILER_TYPE} == clang && ${COMPILER_VERSION} < 35) || ${COMPILER_TYPE} == gcc
164
.elif (${COMPILER_TYPE} == clang && ${COMPILER_VERSION} < 35) || ${COMPILER_TYPE} == gcc
158
.if ${ALT_COMPILER_TYPE} == clang && ${ALT_COMPILER_VERSION} >= 35
165
.if ${ALT_COMPILER_TYPE} == clang && ${ALT_COMPILER_VERSION} >= 35
159
CPP=	clang-cpp
166
CPP=	clang-cpp
160
CC=	clang
167
CC=	clang
161
CXX=	clang++
168
CXX=	clang++
162
CHOSEN_COMPILER_TYPE=	clang
169
CHOSEN_COMPILER_TYPE=	clang
170
CHOSEN_COMPILER_VERSION=${ALT_COMPILER_VERSION}
163
.else
171
.else
164
BUILD_DEPENDS+=	${LOCALBASE}/bin/clang36:${PORTSDIR}/lang/clang36
172
BUILD_DEPENDS+=	${LOCALBASE}/bin/clang36:${PORTSDIR}/lang/clang36
165
CPP=	${LOCALBASE}/bin/clang-cpp36
173
CPP=	${LOCALBASE}/bin/clang-cpp36
166
CC=	${LOCALBASE}/bin/clang36
174
CC=	${LOCALBASE}/bin/clang36
167
CXX=	${LOCALBASE}/bin/clang++36
175
CXX=	${LOCALBASE}/bin/clang++36
168
CHOSEN_COMPILER_TYPE=	clang
176
CHOSEN_COMPILER_TYPE=	clang
177
CHOSEN_COMPILER_VERSION=36
169
.endif
178
.endif
170
.endif
179
.endif
171
.endif
180
.endif
Lines 176-193 CHOSEN_COMPILER_TYPE= clang Link Here
176
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2
185
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2
177
USE_GCC=	yes
186
USE_GCC=	yes
178
CHOSEN_COMPILER_TYPE=	gcc
187
CHOSEN_COMPILER_TYPE=	gcc
188
CHOSEN_COMPILER_VERSION=${CC:S/gcc//}
179
.elif (${COMPILER_TYPE} == clang && ${COMPILER_VERSION} < 34) || ${COMPILER_TYPE} == gcc
189
.elif (${COMPILER_TYPE} == clang && ${COMPILER_VERSION} < 34) || ${COMPILER_TYPE} == gcc
180
.if ${ALT_COMPILER_TYPE} == clang && ${ALT_COMPILER_VERSION} >= 34
190
.if ${ALT_COMPILER_TYPE} == clang && ${ALT_COMPILER_VERSION} >= 34
181
CPP=	clang-cpp
191
CPP=	clang-cpp
182
CC=	clang
192
CC=	clang
183
CXX=	clang++
193
CXX=	clang++
184
CHOSEN_COMPILER_TYPE=	clang
194
CHOSEN_COMPILER_TYPE=	clang
195
CHOSEN_COMPILER_VERSION=${ALT_COMPILER_VERSION}
185
.else
196
.else
186
BUILD_DEPENDS+=	${LOCALBASE}/bin/clang34:${PORTSDIR}/lang/clang34
197
BUILD_DEPENDS+=	${LOCALBASE}/bin/clang34:${PORTSDIR}/lang/clang34
187
CPP=	${LOCALBASE}/bin/clang-cpp34
198
CPP=	${LOCALBASE}/bin/clang-cpp34
188
CC=	${LOCALBASE}/bin/clang34
199
CC=	${LOCALBASE}/bin/clang34
189
CXX=	${LOCALBASE}/bin/clang++34
200
CXX=	${LOCALBASE}/bin/clang++34
190
CHOSEN_COMPILER_TYPE=	clang
201
CHOSEN_COMPILER_TYPE=	clang
202
CHOSEN_COMPILER_VERSION=34
191
.endif
203
.endif
192
.endif
204
.endif
193
.endif
205
.endif
Lines 198-212 CHOSEN_COMPILER_TYPE= clang Link Here
198
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2
210
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2
199
USE_GCC=	yes
211
USE_GCC=	yes
200
CHOSEN_COMPILER_TYPE=	gcc
212
CHOSEN_COMPILER_TYPE=	gcc
213
CHOSEN_COMPILER_VERSION=${CC:S/gcc//}
201
.elif (${COMPILER_TYPE} == clang && ${COMPILER_VERSION} < 34) || ${COMPILER_TYPE} == gcc
214
.elif (${COMPILER_TYPE} == clang && ${COMPILER_VERSION} < 34) || ${COMPILER_TYPE} == gcc
202
.if ${ALT_COMPILER_TYPE} == clang && ${ALT_COMPILER_VERSION} >= 34
215
.if ${ALT_COMPILER_TYPE} == clang && ${ALT_COMPILER_VERSION} >= 34
203
CPP=	clang-cpp
216
CPP=	clang-cpp
204
CC=	clang
217
CC=	clang
205
CXX=	clang++
218
CXX=	clang++
206
CHOSEN_COMPILER_TYPE=	clang
219
CHOSEN_COMPILER_TYPE=	clang
220
CHOSEN_COMPILER_VERSION=${ALT_COMPILER_VERSION}
207
.else
221
.else
208
BUILD_DEPENDS+=	${LOCALBASE}/bin/clang34:${PORTSDIR}/lang/clang34
222
BUILD_DEPENDS+=	${LOCALBASE}/bin/clang34:${PORTSDIR}/lang/clang34
209
CHOSEN_COMPILER_TYPE=	clang
223
CHOSEN_COMPILER_TYPE=	clang
224
CHOSEN_COMPILER_VERSION=34
210
CPP=	${LOCALBASE}/bin/clang-cpp34
225
CPP=	${LOCALBASE}/bin/clang-cpp34
211
CC=	${LOCALBASE}/bin/clang34
226
CC=	${LOCALBASE}/bin/clang34
212
CXX=	${LOCALBASE}/bin/clang++34
227
CXX=	${LOCALBASE}/bin/clang++34
Lines 220-234 CXX= ${LOCALBASE}/bin/clang++34 Link Here
220
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2
235
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2
221
USE_GCC=	yes
236
USE_GCC=	yes
222
CHOSEN_COMPILER_TYPE=	gcc
237
CHOSEN_COMPILER_TYPE=	gcc
238
CHOSEN_COMPILER_VERSION=${CC:S/gcc//}
223
.elif (${COMPILER_TYPE} == clang && ${COMPILER_VERSION} < 34) || ${COMPILER_TYPE} == gcc
239
.elif (${COMPILER_TYPE} == clang && ${COMPILER_VERSION} < 34) || ${COMPILER_TYPE} == gcc
224
.if ${ALT_COMPILER_TYPE} == clang && ${ALT_COMPILER_VERSION} >= 34
240
.if ${ALT_COMPILER_TYPE} == clang && ${ALT_COMPILER_VERSION} >= 34
225
CPP=	clang-cpp
241
CPP=	clang-cpp
226
CC=	clang
242
CC=	clang
227
CXX=	clang++
243
CXX=	clang++
228
CHOSEN_COMPILER_TYPE=	clang
244
CHOSEN_COMPILER_TYPE=	clang
245
CHOSEN_COMPILER_VERSION=${ALT_COMPILER_VERSION}
229
.else
246
.else
230
BUILD_DEPENDS+=	${LOCALBASE}/bin/clang34:${PORTSDIR}/lang/clang34
247
BUILD_DEPENDS+=	${LOCALBASE}/bin/clang34:${PORTSDIR}/lang/clang34
231
CHOSEN_COMPILER_TYPE=	clang
248
CHOSEN_COMPILER_TYPE=	clang
249
CHOSEN_COMPILER_VERSION=34
232
CPP=	${LOCALBASE}/bin/clang-cpp34
250
CPP=	${LOCALBASE}/bin/clang-cpp34
233
CC=	${LOCALBASE}/bin/clang34
251
CC=	${LOCALBASE}/bin/clang34
234
CXX=	${LOCALBASE}/bin/clang++34
252
CXX=	${LOCALBASE}/bin/clang++34
Lines 240-245 CXX= ${LOCALBASE}/bin/clang++34 Link Here
240
.if ${_COMPILER_ARGS:Mgcc-c++11-lib}
258
.if ${_COMPILER_ARGS:Mgcc-c++11-lib}
241
USE_GCC=	yes
259
USE_GCC=	yes
242
CHOSEN_COMPILER_TYPE=	gcc
260
CHOSEN_COMPILER_TYPE=	gcc
261
CHOSEN_COMPILER_VERSION=${CC:S/gcc//}
243
.if ${COMPILER_FEATURES:Mlibc++}
262
.if ${COMPILER_FEATURES:Mlibc++}
244
LDFLAGS+=	-L${LOCALBASE}/lib/c++
263
LDFLAGS+=	-L${LOCALBASE}/lib/c++
245
CXXFLAGS+=	-nostdinc++ -isystem ${LOCALBASE}/include/c++/v1
264
CXXFLAGS+=	-nostdinc++ -isystem ${LOCALBASE}/include/c++/v1

Return to bug 199098