summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/sysconfig.py
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2013-05-28 23:35:30 (GMT)
committerNed Deily <nad@acm.org>2013-05-28 23:35:30 (GMT)
commit97345680dcf920d6def6217213499be362ed1921 (patch)
tree5107b35f06c3790713c07f67c9ecc7e4b191c1e7 /Lib/distutils/sysconfig.py
parentdce05500a16db7563eda12d1c31e59b472150799 (diff)
downloadcpython-97345680dcf920d6def6217213499be362ed1921.zip
cpython-97345680dcf920d6def6217213499be362ed1921.tar.gz
cpython-97345680dcf920d6def6217213499be362ed1921.tar.bz2
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.
Diffstat (limited to 'Lib/distutils/sysconfig.py')
-rw-r--r--Lib/distutils/sysconfig.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index b73503d..b947988 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -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: