blob: 7e74cc706fd6f8ade8cfd06df160b1f9df4d9aff [file] [log] [blame]
diff -Naur Python-2.7.9-orig/Lib/distutils/sysconfig.py Python-2.7.9/Lib/distutils/sysconfig.py
--- Python-2.7.9-orig/Lib/distutils/sysconfig.py 2014-12-10 18:59:34.000000000 +0300
+++ Python-2.7.9/Lib/distutils/sysconfig.py 2014-12-11 13:49:51.607400000 +0300
@@ -154,7 +154,23 @@
Mainly needed on Unix, so we can plug in the information that
varies across Unices and is stored in Python's Makefile.
"""
- if compiler.compiler_type == "unix":
+ global _config_vars
+ if compiler.compiler_type in ["cygwin", "mingw32"]:
+ # Note that cygwin use posix build and 'unix' compiler.
+ # If build is not based on posix then we must predefine
+ # some environment variables corresponding to posix
+ # build rules and defaults.
+ if not 'GCC' in sys.version:
+ _config_vars['CC'] = "gcc"
+ _config_vars['CXX'] = "g++"
+ _config_vars['OPT'] = "-fwrapv -O3 -Wall -Wstrict-prototypes"
+ _config_vars['CFLAGS'] = ""
+ _config_vars['CCSHARED'] = ""
+ _config_vars['LDSHARED'] = "gcc -shared -Wl,--enable-auto-image-base"
+ _config_vars['AR'] = "ar"
+ _config_vars['ARFLAGS'] = "rc"
+
+ if compiler.compiler_type in ["unix", "cygwin", "mingw32"]:
if sys.platform == "darwin":
# Perform first-time customization of compiler-related
# config vars on OS X now that we know we need a compiler.
@@ -164,7 +180,6 @@
# that Python itself was built on. Also the user OS
# version and build tools may not support the same set
# of CPU architectures for universal builds.
- global _config_vars
# Use get_config_var() to ensure _config_vars is initialized.
if not get_config_var('CUSTOMIZED_OSX_COMPILER'):
import _osx_support