Changeset 391 for python/trunk/Lib/distutils/cygwinccompiler.py
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Lib/distutils/cygwinccompiler.py
r2 r391 48 48 # This module should be kept compatible with Python 2.1. 49 49 50 __revision__ = "$Id : cygwinccompiler.py 73349 2009-06-11 09:17:19Z tarek.ziade$"50 __revision__ = "$Id$" 51 51 52 52 import os,sys,copy … … 320 320 entry_point = '' 321 321 322 self.set_executables(compiler='gcc -mno-cygwin -O -Wall', 323 compiler_so='gcc -mno-cygwin -mdll -O -Wall', 324 compiler_cxx='g++ -mno-cygwin -O -Wall', 325 linker_exe='gcc -mno-cygwin', 326 linker_so='%s -mno-cygwin %s %s' 327 % (self.linker_dll, shared_option, 328 entry_point)) 322 if self.gcc_version < '4' or is_cygwingcc(): 323 no_cygwin = ' -mno-cygwin' 324 else: 325 no_cygwin = '' 326 327 self.set_executables(compiler='gcc%s -O -Wall' % no_cygwin, 328 compiler_so='gcc%s -mdll -O -Wall' % no_cygwin, 329 compiler_cxx='g++%s -O -Wall' % no_cygwin, 330 linker_exe='gcc%s' % no_cygwin, 331 linker_so='%s%s %s %s' 332 % (self.linker_dll, no_cygwin, 333 shared_option, entry_point)) 329 334 # Maybe we should also append -mthreads, but then the finished 330 335 # dlls need another dll (mingwm10.dll see Mingw32 docs) … … 383 388 # But we do this only once, and it is fast enough 384 389 f = open(fn) 385 s = f.read() 386 f.close() 390 try: 391 s = f.read() 392 finally: 393 f.close() 387 394 388 395 except IOError, exc: … … 446 453 dllwrap_version = None 447 454 return (gcc_version, ld_version, dllwrap_version) 455 456 def is_cygwingcc(): 457 '''Try to determine if the gcc that would be used is from cygwin.''' 458 out = os.popen('gcc -dumpmachine', 'r') 459 out_string = out.read() 460 out.close() 461 # out_string is the target triplet cpu-vendor-os 462 # Cygwin's gcc sets the os to 'cygwin' 463 return out_string.strip().endswith('cygwin')
Note:
See TracChangeset
for help on using the changeset viewer.