File tree 1 file changed +17
-1
lines changed
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,23 @@ def customize_compiler(compiler):
196
196
Mainly needed on Unix, so we can plug in the information that
197
197
varies across Unices and is stored in Python's Makefile.
198
198
"""
199
- if compiler .compiler_type == "unix" :
199
+ global _config_vars
200
+ if compiler .compiler_type in ["cygwin" , "mingw32" ]:
201
+ # Note that cygwin use posix build and 'unix' compiler.
202
+ # If build is not based on posix then we must predefine
203
+ # some environment variables corresponding to posix
204
+ # build rules and defaults.
205
+ if not 'GCC' in sys .version :
206
+ _config_vars ['CC' ] = "gcc"
207
+ _config_vars ['CXX' ] = "g++"
208
+ _config_vars ['OPT' ] = "-fwrapv -O3 -Wall -Wstrict-prototypes"
209
+ _config_vars ['CFLAGS' ] = ""
210
+ _config_vars ['CCSHARED' ] = ""
211
+ _config_vars ['LDSHARED' ] = "gcc -shared -Wl,--enable-auto-image-base"
212
+ _config_vars ['AR' ] = "ar"
213
+ _config_vars ['ARFLAGS' ] = "rc"
214
+
215
+ if compiler .compiler_type in ["unix" , "cygwin" , "mingw32" ]:
200
216
if sys .platform == "darwin" :
201
217
# Perform first-time customization of compiler-related
202
218
# config vars on OS X now that we know we need a compiler.
You can’t perform that action at this time.
0 commit comments