mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #18080: When building a C extension module on OS X, if the compiler
is overriden with the CC environment variable, use the new compiler as the default for linking if LDSHARED is not also overriden. This restores Distutils behavior introduced in 3.2.3 and inadvertently dropped in 3.3.0.
This commit is contained in:
parent
dce05500a1
commit
97345680dc
3 changed files with 47 additions and 4 deletions
|
@ -195,9 +195,15 @@ def customize_compiler(compiler):
|
|||
get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
|
||||
'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')
|
||||
|
||||
newcc = None
|
||||
if 'CC' in os.environ:
|
||||
cc = os.environ['CC']
|
||||
newcc = os.environ['CC']
|
||||
if (sys.platform == 'darwin'
|
||||
and 'LDSHARED' not in os.environ
|
||||
and ldshared.startswith(cc)):
|
||||
# On OS X, if CC is overridden, use that as the default
|
||||
# command for LDSHARED as well
|
||||
ldshared = newcc + ldshared[len(cc):]
|
||||
cc = newcc
|
||||
if 'CXX' in os.environ:
|
||||
cxx = os.environ['CXX']
|
||||
if 'LDSHARED' in os.environ:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue