Lines 1-245
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 |
.if ${compiler_ARGS} == gcc-c++11-lib |
40 |
.if ${compiler_ARGS} == gcc-c++11-lib |
41 |
_COMPILER_ARGS+= features gcc-c++11-lib |
41 |
_COMPILER_ARGS+= features gcc-c++11-lib |
42 |
.elif ${compiler_ARGS} == c++11-lib |
42 |
.elif ${compiler_ARGS} == c++11-lib |
43 |
_COMPILER_ARGS+= features c++11-lib |
43 |
_COMPILER_ARGS+= features c++11-lib |
44 |
.elif ${compiler_ARGS} == c++0x |
44 |
.elif ${compiler_ARGS} == c++0x |
45 |
_COMPILER_ARGS+= features c++0x |
45 |
_COMPILER_ARGS+= features c++0x |
46 |
.elif ${compiler_ARGS} == c++11-lang |
46 |
.elif ${compiler_ARGS} == c++11-lang |
47 |
_COMPILER_ARGS+= features c++11-lang |
47 |
_COMPILER_ARGS+= features c++11-lang |
48 |
.elif ${compiler_ARGS} == c++14-lang |
48 |
.elif ${compiler_ARGS} == c++14-lang |
49 |
_COMPILER_ARGS+= features c++14-lang |
49 |
_COMPILER_ARGS+= features c++14-lang |
50 |
.elif ${compiler_ARGS} == c11 |
50 |
.elif ${compiler_ARGS} == c11 |
51 |
_COMPILER_ARGS+= features c11 |
51 |
_COMPILER_ARGS+= features c11 |
52 |
.elif ${compiler_ARGS} == features |
52 |
.elif ${compiler_ARGS} == features |
53 |
_COMPILER_ARGS+= features |
53 |
_COMPILER_ARGS+= features |
54 |
.elif ${compiler_ARGS} == env |
54 |
.elif ${compiler_ARGS} == env |
55 |
_COMPILER_ARGS+= env |
55 |
_COMPILER_ARGS+= env |
56 |
.elif ${compiler_ARGS} == openmp |
56 |
.elif ${compiler_ARGS} == openmp |
57 |
_COMPILER_ARGS+= env openmp |
57 |
_COMPILER_ARGS+= env openmp |
58 |
.elif ${compiler_ARGS} == nestedfct |
58 |
.elif ${compiler_ARGS} == nestedfct |
59 |
_COMPILER_ARGS+= env nestedfct |
59 |
_COMPILER_ARGS+= env nestedfct |
60 |
.else |
60 |
.else |
61 |
IGNORE= Invalid argument "${compiler_ARGS}", valid arguments are: ${VALID_ARGS} |
61 |
IGNORE= Invalid argument "${compiler_ARGS}", valid arguments are: ${VALID_ARGS} |
62 |
_COMPILER_ARGS= # |
62 |
_COMPILER_ARGS= # |
63 |
.endif |
63 |
.endif |
64 |
|
64 |
|
65 |
.if ${_COMPILER_ARGS:Mc++*} || ${_COMPILER_ARGS:Mc11} |
65 |
.if ${_COMPILER_ARGS:Mc++*} || ${_COMPILER_ARGS:Mc11} |
66 |
_COMPILER_ARGS+= features |
66 |
_COMPILER_ARGS+= features |
67 |
.endif |
67 |
.endif |
68 |
|
68 |
|
69 |
_CCVERSION!= ${CC} --version |
69 |
_CCVERSION!= ${CC} --version |
70 |
COMPILER_VERSION= ${_CCVERSION:M[0-9].[0-9]*:tW:C/([0-9]).([0-9]).*/\1\2/g} |
70 |
COMPILER_VERSION= ${_CCVERSION:M[0-9].[0-9]*:tW:C/([0-9]).([0-9]).*/\1\2/g} |
71 |
.if ${_CCVERSION:Mclang} |
71 |
.if ${_CCVERSION:Mclang} |
72 |
COMPILER_TYPE= clang |
72 |
COMPILER_TYPE= clang |
73 |
.else |
73 |
.else |
74 |
COMPILER_TYPE= gcc |
74 |
COMPILER_TYPE= gcc |
75 |
.endif |
75 |
.endif |
76 |
|
76 |
|
77 |
ALT_COMPILER_VERSION= 0 |
77 |
ALT_COMPILER_VERSION= 0 |
78 |
ALT_COMPILER_TYPE= none |
78 |
ALT_COMPILER_TYPE= none |
79 |
_ALTCCVERSION= |
79 |
_ALTCCVERSION= |
80 |
.if ${COMPILER_TYPE} == gcc && exists(/usr/bin/clang) |
80 |
.if ${COMPILER_TYPE} == gcc && exists(/usr/bin/clang) |
81 |
.if ${ARCH} == amd64 || ${ARCH} == i386 # clang often non-default for a reason |
81 |
.if ${ARCH} == amd64 || ${ARCH} == i386 # clang often non-default for a reason |
82 |
_ALTCCVERSION!= /usr/bin/clang --version |
82 |
_ALTCCVERSION!= /usr/bin/clang --version |
83 |
.endif |
83 |
.endif |
84 |
.elif ${COMPILER_TYPE} == clang && exists(/usr/bin/gcc) |
84 |
.elif ${COMPILER_TYPE} == clang && exists(/usr/bin/gcc) |
85 |
_ALTCCVERSION!= /usr/bin/gcc --version |
85 |
_ALTCCVERSION!= /usr/bin/gcc --version |
86 |
.endif |
86 |
.endif |
87 |
|
87 |
|
88 |
ALT_COMPILER_VERSION= ${_ALTCCVERSION:M[0-9].[0-9]*:tW:C/([0-9]).([0-9]).*/\1\2/g} |
88 |
ALT_COMPILER_VERSION= ${_ALTCCVERSION:M[0-9].[0-9]*:tW:C/([0-9]).([0-9]).*/\1\2/g} |
89 |
.if ${_ALTCCVERSION:Mclang} |
89 |
.if ${_ALTCCVERSION:Mclang} |
90 |
ALT_COMPILER_TYPE= clang |
90 |
ALT_COMPILER_TYPE= clang |
91 |
.elif !empty(_ALTCCVERSION) |
91 |
.elif !empty(_ALTCCVERSION) |
92 |
ALT_COMPILER_TYPE= gcc |
92 |
ALT_COMPILER_TYPE= gcc |
93 |
.endif |
93 |
.endif |
94 |
|
94 |
|
95 |
CHOSEN_COMPILER_TYPE= ${COMPILER_TYPE} |
95 |
CHOSEN_COMPILER_TYPE= ${COMPILER_TYPE} |
96 |
|
96 |
|
97 |
.if ${_COMPILER_ARGS:Mopenmp} |
97 |
.if ${_COMPILER_ARGS:Mopenmp} |
98 |
.if ${COMPILER_TYPE} == clang |
98 |
.if ${COMPILER_TYPE} == clang && ${ARCH} == amd64 |
99 |
USE_GCC= yes |
99 |
_USES_POST+= localbase:ldflags |
|
|
100 |
BUILD_DEPENDS+= llvm50>=0:devel/llvm50 |
101 |
CPP= ${LOCALBASE}/bin/clang-cpp50 |
102 |
CC= ${LOCALBASE}/bin/clang50 |
103 |
CXX= ${LOCALBASE}/bin/clang++50 |
104 |
CHOSEN_COMPILER_TYPE= clang |
105 |
.else |
106 |
USE_GCC= yes |
100 |
CHOSEN_COMPILER_TYPE= gcc |
107 |
CHOSEN_COMPILER_TYPE= gcc |
|
|
108 |
.if ${COMPILER_FEATURES:Mlibc++} |
109 |
CXXFLAGS+= -nostdinc++ -isystem /usr/include/c++/v1 |
110 |
LDFLAGS+= -L${WRKDIR} |
111 |
|
112 |
_USES_configure+= 200:gcc-libc++-configure |
113 |
gcc-libc++-configure: |
114 |
@${LN} -fs /usr/lib/libc++.so ${WRKDIR}/libstdc++.so |
115 |
.endif |
101 |
.endif |
116 |
.endif |
102 |
.endif |
117 |
.endif |
103 |
|
118 |
|
104 |
.if ${_COMPILER_ARGS:Mnestedfct} |
119 |
.if ${_COMPILER_ARGS:Mnestedfct} |
105 |
.if ${COMPILER_TYPE} == clang |
120 |
.if ${COMPILER_TYPE} == clang |
106 |
USE_GCC= any |
121 |
USE_GCC= any |
107 |
CHOSEN_COMPILER_TYPE= gcc |
122 |
CHOSEN_COMPILER_TYPE= gcc |
108 |
.endif |
123 |
.endif |
109 |
.endif |
124 |
.endif |
110 |
|
125 |
|
111 |
.if ${_COMPILER_ARGS:Mfeatures} |
126 |
.if ${_COMPILER_ARGS:Mfeatures} |
112 |
_CXXINTERNAL!= ${CXX} -\#\#\# /dev/null 2>&1 |
127 |
_CXXINTERNAL!= ${CXX} -\#\#\# /dev/null 2>&1 |
113 |
.if ${_CXXINTERNAL:M\"-lc++\"} |
128 |
.if ${_CXXINTERNAL:M\"-lc++\"} |
114 |
COMPILER_FEATURES= libc++ |
129 |
COMPILER_FEATURES= libc++ |
115 |
.else |
130 |
.else |
116 |
COMPILER_FEATURES= libstdc++ |
131 |
COMPILER_FEATURES= libstdc++ |
117 |
.endif |
132 |
.endif |
118 |
|
133 |
|
119 |
CSTD= c89 c99 c11 gnu89 gnu99 gnu11 |
134 |
CSTD= c89 c99 c11 gnu89 gnu99 gnu11 |
120 |
CXXSTD= c++98 c++0x c++11 c++14 gnu++98 gnu++11 |
135 |
CXXSTD= c++98 c++0x c++11 c++14 gnu++98 gnu++11 |
121 |
|
136 |
|
122 |
.for std in ${CSTD} ${CXXSTD} |
137 |
.for std in ${CSTD} ${CXXSTD} |
123 |
_LANG=c |
138 |
_LANG=c |
124 |
.if ${CXXSTD:M${std}} |
139 |
.if ${CXXSTD:M${std}} |
125 |
_LANG=c++ |
140 |
_LANG=c++ |
126 |
.endif |
141 |
.endif |
127 |
OUTPUT_${std}!= echo | ${CC} -std=${std} -c -x ${_LANG} /dev/null -o /dev/null 2>&1; echo |
142 |
OUTPUT_${std}!= echo | ${CC} -std=${std} -c -x ${_LANG} /dev/null -o /dev/null 2>&1; echo |
128 |
.if !${OUTPUT_${std}:M*error*} |
143 |
.if !${OUTPUT_${std}:M*error*} |
129 |
COMPILER_FEATURES+= ${std} |
144 |
COMPILER_FEATURES+= ${std} |
130 |
.endif |
145 |
.endif |
131 |
.endfor |
146 |
.endfor |
132 |
.endif |
147 |
.endif |
133 |
|
148 |
|
134 |
.if ${_COMPILER_ARGS:Mc++11-lib} |
149 |
.if ${_COMPILER_ARGS:Mc++11-lib} |
135 |
.if !${COMPILER_FEATURES:Mc++11} |
150 |
.if !${COMPILER_FEATURES:Mc++11} |
136 |
USE_GCC= yes |
151 |
USE_GCC= yes |
137 |
CHOSEN_COMPILER_TYPE= gcc |
152 |
CHOSEN_COMPILER_TYPE= gcc |
138 |
.elif ${COMPILER_TYPE} == clang && ${COMPILER_FEATURES:Mlibstdc++} |
153 |
.elif ${COMPILER_TYPE} == clang && ${COMPILER_FEATURES:Mlibstdc++} |
139 |
USE_GCC= yes |
154 |
USE_GCC= yes |
140 |
CHOSEN_COMPILER_TYPE= gcc |
155 |
CHOSEN_COMPILER_TYPE= gcc |
141 |
.endif |
156 |
.endif |
142 |
.endif |
157 |
.endif |
143 |
|
158 |
|
144 |
.if ${_COMPILER_ARGS:Mc++14-lang} |
159 |
.if ${_COMPILER_ARGS:Mc++14-lang} |
145 |
.if !${COMPILER_FEATURES:Mc++14} |
160 |
.if !${COMPILER_FEATURES:Mc++14} |
146 |
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2 |
161 |
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2 |
147 |
USE_GCC= yes |
162 |
USE_GCC= yes |
148 |
CHOSEN_COMPILER_TYPE= gcc |
163 |
CHOSEN_COMPILER_TYPE= gcc |
149 |
.elif (${COMPILER_TYPE} == clang && ${COMPILER_VERSION} < 35) || ${COMPILER_TYPE} == gcc |
164 |
.elif (${COMPILER_TYPE} == clang && ${COMPILER_VERSION} < 35) || ${COMPILER_TYPE} == gcc |
150 |
.if ${ALT_COMPILER_TYPE} == clang && ${ALT_COMPILER_VERSION} >= 35 |
165 |
.if ${ALT_COMPILER_TYPE} == clang && ${ALT_COMPILER_VERSION} >= 35 |
151 |
CPP= clang-cpp |
166 |
CPP= clang-cpp |
152 |
CC= clang |
167 |
CC= clang |
153 |
CXX= clang++ |
168 |
CXX= clang++ |
154 |
CHOSEN_COMPILER_TYPE= clang |
169 |
CHOSEN_COMPILER_TYPE= clang |
155 |
.else |
170 |
.else |
156 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/clang40:devel/llvm40 |
171 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/clang40:devel/llvm40 |
157 |
CPP= ${LOCALBASE}/bin/clang-cpp40 |
172 |
CPP= ${LOCALBASE}/bin/clang-cpp40 |
158 |
CC= ${LOCALBASE}/bin/clang40 |
173 |
CC= ${LOCALBASE}/bin/clang40 |
159 |
CXX= ${LOCALBASE}/bin/clang++40 |
174 |
CXX= ${LOCALBASE}/bin/clang++40 |
160 |
CHOSEN_COMPILER_TYPE= clang |
175 |
CHOSEN_COMPILER_TYPE= clang |
161 |
.endif |
176 |
.endif |
162 |
.endif |
177 |
.endif |
163 |
.endif |
178 |
.endif |
164 |
.endif |
179 |
.endif |
165 |
|
180 |
|
166 |
.if ${_COMPILER_ARGS:Mc++11-lang} |
181 |
.if ${_COMPILER_ARGS:Mc++11-lang} |
167 |
.if !${COMPILER_FEATURES:Mc++11} |
182 |
.if !${COMPILER_FEATURES:Mc++11} |
168 |
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2 |
183 |
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2 |
169 |
USE_GCC= yes |
184 |
USE_GCC= yes |
170 |
CHOSEN_COMPILER_TYPE= gcc |
185 |
CHOSEN_COMPILER_TYPE= gcc |
171 |
.elif ${COMPILER_TYPE} == gcc |
186 |
.elif ${COMPILER_TYPE} == gcc |
172 |
.if ${ALT_COMPILER_TYPE} == clang |
187 |
.if ${ALT_COMPILER_TYPE} == clang |
173 |
CPP= clang-cpp |
188 |
CPP= clang-cpp |
174 |
CC= clang |
189 |
CC= clang |
175 |
CXX= clang++ |
190 |
CXX= clang++ |
176 |
CHOSEN_COMPILER_TYPE= clang |
191 |
CHOSEN_COMPILER_TYPE= clang |
177 |
.else |
192 |
.else |
178 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/clang34:lang/clang34 |
193 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/clang34:lang/clang34 |
179 |
CPP= ${LOCALBASE}/bin/clang-cpp34 |
194 |
CPP= ${LOCALBASE}/bin/clang-cpp34 |
180 |
CC= ${LOCALBASE}/bin/clang34 |
195 |
CC= ${LOCALBASE}/bin/clang34 |
181 |
CXX= ${LOCALBASE}/bin/clang++34 |
196 |
CXX= ${LOCALBASE}/bin/clang++34 |
182 |
CHOSEN_COMPILER_TYPE= clang |
197 |
CHOSEN_COMPILER_TYPE= clang |
183 |
.endif |
198 |
.endif |
184 |
.endif |
199 |
.endif |
185 |
.endif |
200 |
.endif |
186 |
.endif |
201 |
.endif |
187 |
|
202 |
|
188 |
.if ${_COMPILER_ARGS:Mc++0x} |
203 |
.if ${_COMPILER_ARGS:Mc++0x} |
189 |
.if !${COMPILER_FEATURES:Mc++0x} |
204 |
.if !${COMPILER_FEATURES:Mc++0x} |
190 |
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2 |
205 |
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2 |
191 |
USE_GCC= yes |
206 |
USE_GCC= yes |
192 |
CHOSEN_COMPILER_TYPE= gcc |
207 |
CHOSEN_COMPILER_TYPE= gcc |
193 |
.elif ${COMPILER_TYPE} == gcc |
208 |
.elif ${COMPILER_TYPE} == gcc |
194 |
.if ${ALT_COMPILER_TYPE} == clang |
209 |
.if ${ALT_COMPILER_TYPE} == clang |
195 |
CPP= clang-cpp |
210 |
CPP= clang-cpp |
196 |
CC= clang |
211 |
CC= clang |
197 |
CXX= clang++ |
212 |
CXX= clang++ |
198 |
CHOSEN_COMPILER_TYPE= clang |
213 |
CHOSEN_COMPILER_TYPE= clang |
199 |
.else |
214 |
.else |
200 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/clang34:lang/clang34 |
215 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/clang34:lang/clang34 |
201 |
CHOSEN_COMPILER_TYPE= clang |
216 |
CHOSEN_COMPILER_TYPE= clang |
202 |
CPP= ${LOCALBASE}/bin/clang-cpp34 |
217 |
CPP= ${LOCALBASE}/bin/clang-cpp34 |
203 |
CC= ${LOCALBASE}/bin/clang34 |
218 |
CC= ${LOCALBASE}/bin/clang34 |
204 |
CXX= ${LOCALBASE}/bin/clang++34 |
219 |
CXX= ${LOCALBASE}/bin/clang++34 |
205 |
.endif |
220 |
.endif |
206 |
.endif |
221 |
.endif |
207 |
.endif |
222 |
.endif |
208 |
.endif |
223 |
.endif |
209 |
|
224 |
|
210 |
.if ${_COMPILER_ARGS:Mc11} |
225 |
.if ${_COMPILER_ARGS:Mc11} |
211 |
.if !${COMPILER_FEATURES:Mc11} |
226 |
.if !${COMPILER_FEATURES:Mc11} |
212 |
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2 |
227 |
.if (defined(FAVORITE_COMPILER) && ${FAVORITE_COMPILER} == gcc) || (${ARCH} != amd64 && ${ARCH} != i386) # clang not always supported on Tier-2 |
213 |
USE_GCC= yes |
228 |
USE_GCC= yes |
214 |
CHOSEN_COMPILER_TYPE= gcc |
229 |
CHOSEN_COMPILER_TYPE= gcc |
215 |
.elif ${COMPILER_TYPE} == gcc |
230 |
.elif ${COMPILER_TYPE} == gcc |
216 |
.if ${ALT_COMPILER_TYPE} == clang |
231 |
.if ${ALT_COMPILER_TYPE} == clang |
217 |
CPP= clang-cpp |
232 |
CPP= clang-cpp |
218 |
CC= clang |
233 |
CC= clang |
219 |
CXX= clang++ |
234 |
CXX= clang++ |
220 |
CHOSEN_COMPILER_TYPE= clang |
235 |
CHOSEN_COMPILER_TYPE= clang |
221 |
.else |
236 |
.else |
222 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/clang34:lang/clang34 |
237 |
BUILD_DEPENDS+= ${LOCALBASE}/bin/clang34:lang/clang34 |
223 |
CHOSEN_COMPILER_TYPE= clang |
238 |
CHOSEN_COMPILER_TYPE= clang |
224 |
CPP= ${LOCALBASE}/bin/clang-cpp34 |
239 |
CPP= ${LOCALBASE}/bin/clang-cpp34 |
225 |
CC= ${LOCALBASE}/bin/clang34 |
240 |
CC= ${LOCALBASE}/bin/clang34 |
226 |
CXX= ${LOCALBASE}/bin/clang++34 |
241 |
CXX= ${LOCALBASE}/bin/clang++34 |
227 |
.endif |
242 |
.endif |
228 |
.endif |
243 |
.endif |
229 |
.endif |
244 |
.endif |
230 |
.endif |
245 |
.endif |
231 |
|
246 |
|
232 |
.if ${_COMPILER_ARGS:Mgcc-c++11-lib} |
247 |
.if ${_COMPILER_ARGS:Mgcc-c++11-lib} |
233 |
USE_GCC= yes |
248 |
USE_GCC= yes |
234 |
CHOSEN_COMPILER_TYPE= gcc |
249 |
CHOSEN_COMPILER_TYPE= gcc |
235 |
.if ${COMPILER_FEATURES:Mlibc++} |
250 |
.if ${COMPILER_FEATURES:Mlibc++} |
236 |
CXXFLAGS+= -nostdinc++ -isystem /usr/include/c++/v1 |
251 |
CXXFLAGS+= -nostdinc++ -isystem /usr/include/c++/v1 |
237 |
LDFLAGS+= -L${WRKDIR} |
252 |
LDFLAGS+= -L${WRKDIR} |
238 |
|
253 |
|
239 |
_USES_configure+= 200:gcc-libc++-configure |
254 |
_USES_configure+= 200:gcc-libc++-configure |
240 |
gcc-libc++-configure: |
255 |
gcc-libc++-configure: |
241 |
@${LN} -fs /usr/lib/libc++.so ${WRKDIR}/libstdc++.so |
256 |
@${LN} -fs /usr/lib/libc++.so ${WRKDIR}/libstdc++.so |
242 |
.endif |
257 |
.endif |
243 |
.endif |
258 |
.endif |
244 |
|
259 |
|
245 |
.endif |
260 |
.endif |