|
Lines 145-180
Link Here
|
| 145 |
_osx_support.customize_compiler(_config_vars) |
145 |
_osx_support.customize_compiler(_config_vars) |
| 146 |
_config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True' |
146 |
_config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True' |
| 147 |
|
147 |
|
| 148 |
(cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \ |
148 |
(cc, cxx, ccshared, ldshared, ldcxxshared, shlib_suffix, ar, ar_flags) = \ |
| 149 |
get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS', |
149 |
get_config_vars('CC', 'CXX', 'CCSHARED', 'LDSHARED', 'LDCXXSHARED', |
| 150 |
'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS') |
150 |
'SHLIB_SUFFIX', 'AR', 'ARFLAGS') |
|
|
151 |
|
| 152 |
cflags = '' |
| 153 |
cxxflags = '' |
| 151 |
|
154 |
|
| 152 |
if 'CC' in os.environ: |
155 |
if 'CC' in os.environ: |
| 153 |
newcc = os.environ['CC'] |
156 |
newcc = os.environ['CC'] |
| 154 |
if (sys.platform == 'darwin' |
157 |
if (True |
| 155 |
and 'LDSHARED' not in os.environ |
158 |
and 'LDSHARED' not in os.environ |
| 156 |
and ldshared.startswith(cc)): |
159 |
and ldshared.startswith(cc)): |
| 157 |
# On OS X, if CC is overridden, use that as the default |
160 |
# On OS X, if CC is overridden, use that as the default |
| 158 |
# command for LDSHARED as well |
161 |
# command for LDSHARED as well |
|
|
162 |
# Gentoo: s/OS X/every system/ |
| 159 |
ldshared = newcc + ldshared[len(cc):] |
163 |
ldshared = newcc + ldshared[len(cc):] |
| 160 |
cc = newcc |
164 |
cc = newcc |
| 161 |
if 'CXX' in os.environ: |
165 |
if 'CXX' in os.environ: |
| 162 |
cxx = os.environ['CXX'] |
166 |
newcxx = os.environ['CXX'] |
|
|
167 |
if ('LDCXXSHARED' not in os.environ |
| 168 |
and ldcxxshared.startswith(cxx)): |
| 169 |
ldcxxshared = newcxx + ldcxxshared[len(cxx):] |
| 170 |
cxx = newcxx |
| 163 |
if 'LDSHARED' in os.environ: |
171 |
if 'LDSHARED' in os.environ: |
| 164 |
ldshared = os.environ['LDSHARED'] |
172 |
ldshared = os.environ['LDSHARED'] |
|
|
173 |
if 'LDCXXSHARED' in os.environ: |
| 174 |
ldcxxshared = os.environ['LDCXXSHARED'] |
| 165 |
if 'CPP' in os.environ: |
175 |
if 'CPP' in os.environ: |
| 166 |
cpp = os.environ['CPP'] |
176 |
cpp = os.environ['CPP'] |
| 167 |
else: |
177 |
else: |
| 168 |
cpp = cc + " -E" # not always |
178 |
cpp = cc + " -E" # not always |
| 169 |
if 'LDFLAGS' in os.environ: |
179 |
if 'LDFLAGS' in os.environ: |
| 170 |
ldshared = ldshared + ' ' + os.environ['LDFLAGS'] |
180 |
ldshared = ldshared + ' ' + os.environ['LDFLAGS'] |
|
|
181 |
ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS'] |
| 171 |
if 'CFLAGS' in os.environ: |
182 |
if 'CFLAGS' in os.environ: |
| 172 |
cflags = opt + ' ' + os.environ['CFLAGS'] |
183 |
cflags = os.environ['CFLAGS'] |
| 173 |
ldshared = ldshared + ' ' + os.environ['CFLAGS'] |
184 |
ldshared = ldshared + ' ' + os.environ['CFLAGS'] |
|
|
185 |
if 'CXXFLAGS' in os.environ: |
| 186 |
cxxflags = os.environ['CXXFLAGS'] |
| 187 |
ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS'] |
| 174 |
if 'CPPFLAGS' in os.environ: |
188 |
if 'CPPFLAGS' in os.environ: |
| 175 |
cpp = cpp + ' ' + os.environ['CPPFLAGS'] |
189 |
cpp = cpp + ' ' + os.environ['CPPFLAGS'] |
| 176 |
cflags = cflags + ' ' + os.environ['CPPFLAGS'] |
190 |
cflags = cflags + ' ' + os.environ['CPPFLAGS'] |
|
|
191 |
cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS'] |
| 177 |
ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] |
192 |
ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] |
|
|
193 |
ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS'] |
| 178 |
if 'AR' in os.environ: |
194 |
if 'AR' in os.environ: |
| 179 |
ar = os.environ['AR'] |
195 |
ar = os.environ['AR'] |
| 180 |
if 'ARFLAGS' in os.environ: |
196 |
if 'ARFLAGS' in os.environ: |
|
Lines 183-195
Link Here
|
| 183 |
archiver = ar + ' ' + ar_flags |
199 |
archiver = ar + ' ' + ar_flags |
| 184 |
|
200 |
|
| 185 |
cc_cmd = cc + ' ' + cflags |
201 |
cc_cmd = cc + ' ' + cflags |
|
|
202 |
cxx_cmd = cxx + ' ' + cxxflags |
| 186 |
compiler.set_executables( |
203 |
compiler.set_executables( |
| 187 |
preprocessor=cpp, |
204 |
preprocessor=cpp, |
| 188 |
compiler=cc_cmd, |
205 |
compiler=cc_cmd, |
| 189 |
compiler_so=cc_cmd + ' ' + ccshared, |
206 |
compiler_so=cc_cmd + ' ' + ccshared, |
| 190 |
compiler_cxx=cxx, |
207 |
compiler_cxx=cxx_cmd, |
|
|
208 |
compiler_so_cxx=cxx_cmd + ' ' + ccshared, |
| 191 |
linker_so=ldshared, |
209 |
linker_so=ldshared, |
| 192 |
linker_exe=cc, |
210 |
linker_exe=cc, |
|
|
211 |
linker_so_cxx=ldcxxshared, |
| 212 |
linker_exe_cxx=cxx, |
| 193 |
archiver=archiver) |
213 |
archiver=archiver) |
| 194 |
|
214 |
|
| 195 |
compiler.shared_lib_extension = shlib_suffix |
215 |
compiler.shared_lib_extension = shlib_suffix |