summarylogtreecommitdiffstats
path: root/0084-distutils-compiler-customize-mingw-cygwin-compilers.patch
diff options
context:
space:
mode:
Diffstat (limited to '0084-distutils-compiler-customize-mingw-cygwin-compilers.patch')
-rw-r--r--0084-distutils-compiler-customize-mingw-cygwin-compilers.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/0084-distutils-compiler-customize-mingw-cygwin-compilers.patch b/0084-distutils-compiler-customize-mingw-cygwin-compilers.patch
new file mode 100644
index 000000000000..a4ce9d2d0274
--- /dev/null
+++ b/0084-distutils-compiler-customize-mingw-cygwin-compilers.patch
@@ -0,0 +1,54 @@
+From 68b961fb34930195f208a85d0123e3a6d700f515 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?=
+ <alexey.pawlow@gmail.com>
+Date: Thu, 17 Jun 2021 18:51:21 +0530
+Subject: [PATCH 084/N] distutils: compiler customize mingw cygwin compilers
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Co-authored-by: Алексей <alexey.pawlow@gmail.com>
+---
+ Lib/distutils/sysconfig.py | 19 +++++++++++++++++--
+ 1 file changed, 17 insertions(+), 2 deletions(-)
+
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index 37feae5..bbe8e3c 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -176,7 +176,23 @@ def customize_compiler(compiler):
+ 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.
+@@ -186,7 +202,6 @@ def customize_compiler(compiler):
+ # 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
+--
+2.33.0
+