summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Donnelly <mingw.android@gmail.com>2013-05-21 23:00:01 +0100
committerRay Donnelly <mingw.android@gmail.com>2013-05-21 23:00:01 +0100
commit3efae45396e3db0c7ce3eb7feffbcdd8c4f25add (patch)
treece5c74c0cf1291e02ba24865a8e2786094671d42
parent0ecd9a25924cb4a4765855dce359155299997a8c (diff)
downloadpython-3efae45396e3db0c7ce3eb7feffbcdd8c4f25add.tar.gz
Distutils (cygwinccompiler): Use CC and LD env. variables
..also, if gcc is found then override LD with the output from 'CC --print-prog-name ld'
-rw-r--r--Python-2.7.5/Lib/distutils/cygwinccompiler.py9
-rw-r--r--Python-2.7.5/Modules/Setup.config.in2
2 files changed, 8 insertions, 3 deletions
diff --git a/Python-2.7.5/Lib/distutils/cygwinccompiler.py b/Python-2.7.5/Lib/distutils/cygwinccompiler.py
index 488379b..3dd7f4d 100644
--- a/Python-2.7.5/Lib/distutils/cygwinccompiler.py
+++ b/Python-2.7.5/Lib/distutils/cygwinccompiler.py
@@ -442,7 +442,8 @@ def get_versions():
from distutils.spawn import find_executable
import re
- gcc_exe = find_executable('gcc')
+ gcc_exe = os.environ.get('CC') or find_executable('gcc')
+ ld_exe = os.environ.get('LD') or find_executable('ld')
if gcc_exe:
out = os.popen(gcc_exe + ' -dumpversion','r')
out_string = out.read()
@@ -452,9 +453,11 @@ def get_versions():
gcc_version = LooseVersion(result.group(1))
else:
gcc_version = None
+ out = os.popen(gcc_exe + ' --print-prog-name ld','r')
+ ld_exe = out.read().decode('ascii').split()[0]
+ out.close()
else:
gcc_version = None
- ld_exe = find_executable('ld')
if ld_exe:
out = os.popen(ld_exe + ' -v','r')
out_string = out.read()
@@ -466,7 +469,7 @@ def get_versions():
ld_version = None
else:
ld_version = None
- dllwrap_exe = find_executable('dllwrap')
+ dllwrap_exe = os.environ.get('DLLWRAP') or find_executable('dllwrap')
if dllwrap_exe:
out = os.popen(dllwrap_exe + ' --version','r')
out_string = out.read()
diff --git a/Python-2.7.5/Modules/Setup.config.in b/Python-2.7.5/Modules/Setup.config.in
index c62417d..ac6fc2e 100644
--- a/Python-2.7.5/Modules/Setup.config.in
+++ b/Python-2.7.5/Modules/Setup.config.in
@@ -18,6 +18,8 @@
@BUILDIN_WIN32_MODULE@operator operator.c # operator.add() and similar goodies
@BUILDIN_WIN32_MODULE@_locale _localemodule.c # -lintl
@BUILDIN_WIN32_MODULE@_winreg ../PC/_winreg.c
+@BUILDIN_WIN32_MODULE@time timemodule.c
+@BUILDIN_WIN32_MODULE@msvcrt ../PC/msvcrtmodule.c
# The rest of the modules previously listed in this file are built