Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
a49a3ee5
Commit
a49a3ee5
authored
Feb 10, 2012
by
Ned Deily
Browse files
Options
Browse Files
Download
Plain Diff
Issue #13590: merge
parents
eaec962b
008c905d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletion
+32
-1
sysconfig.py
sysconfig.py
+32
-1
No files found.
sysconfig.py
View file @
a49a3ee5
...
...
@@ -146,6 +146,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
"I don't know where Python installs its library "
"on platform '%s'"
%
os
.
name
)
_USE_CLANG
=
None
def
customize_compiler
(
compiler
):
"""Do any platform-specific customization of a CCompiler instance.
...
...
@@ -158,8 +159,38 @@ def customize_compiler(compiler):
get_config_vars
(
'CC'
,
'CXX'
,
'OPT'
,
'CFLAGS'
,
'CCSHARED'
,
'LDSHARED'
,
'SO'
,
'AR'
,
'ARFLAGS'
)
newcc
=
None
if
'CC'
in
os
.
environ
:
cc
=
os
.
environ
[
'CC'
]
newcc
=
os
.
environ
[
'CC'
]
elif
sys
.
platform
==
'darwin'
and
cc
==
'gcc-4.2'
:
# Issue #13590:
# Since Apple removed gcc-4.2 in Xcode 4.2, we can no
# longer assume it is available for extension module builds.
# If Python was built with gcc-4.2, check first to see if
# it is available on this system; if not, try to use clang
# instead unless the caller explicitly set CC.
global
_USE_CLANG
if
_USE_CLANG
is
None
:
from
distutils
import
log
from
subprocess
import
Popen
,
PIPE
p
=
Popen
(
"! type gcc-4.2 && type clang && exit 2"
,
shell
=
True
,
stdout
=
PIPE
,
stderr
=
PIPE
)
p
.
wait
()
if
p
.
returncode
==
2
:
_USE_CLANG
=
True
log
.
warn
(
"gcc-4.2 not found, using clang instead"
)
else
:
_USE_CLANG
=
False
if
_USE_CLANG
:
newcc
=
'clang'
if
newcc
:
# On OS X, if CC is overridden, use that as the default
# command for LDSHARED as well
if
(
sys
.
platform
==
'darwin'
and
'LDSHARED'
not
in
os
.
environ
and
ldshared
.
startswith
(
cc
)):
ldshared
=
newcc
+
ldshared
[
len
(
cc
):]
cc
=
newcc
if
'CXX'
in
os
.
environ
:
cxx
=
os
.
environ
[
'CXX'
]
if
'LDSHARED'
in
os
.
environ
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment