[Python-checkins] python/dist/src/Lib/distutils unixccompiler.py,1.51,1.52

jlt63@users.sourceforge.net jlt63@users.sourceforge.net
Fri, 18 Apr 2003 10:27:49 -0700


Update of /cvsroot/python/python/dist/src/Lib/distutils
In directory sc8-pr-cvs1:/tmp/cvs-serv30186

Modified Files:
	unixccompiler.py 
Log Message:
Patch #718049: Setting exe_extension for cygwin

On cygwin, the setup.py script uses unixccompiler.py for compiling and linking
C extensions. The unixccompiler.py script assumes that executables do not get
special extensions, which makes sense for Unix.  However, on Cygwin,
executables get an .exe extension. 

This causes a problem during the configuration step (python setup.py config),
in which some temporary executables may be generated. As unixccompiler.py does
not know about the .exe extension, distutils fails to clean up after itself: it
does not remove _configtest.exe but tries to remove _configtest instead. 

The attached patch to unixccompiler.py sets the correct exe_extension for
cygwin by checking if sys.platform is 'cygwin'. With this patch, distutils
cleans up after itself correctly. 

Michiel de Hoon 
University of Tokyo, Human Genome Center.


Index: unixccompiler.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/unixccompiler.py,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** unixccompiler.py	21 Nov 2002 20:33:24 -0000	1.51
--- unixccompiler.py	18 Apr 2003 17:27:47 -0000	1.52
***************
*** 78,81 ****
--- 78,83 ----
      dylib_lib_extension = ".dylib"
      static_lib_format = shared_lib_format = dylib_lib_format = "lib%s%s"
+     if sys.platform == "cygwin":
+         exe_extension = ".exe"
  
      def preprocess(self, source,