summaryrefslogtreecommitdiffstats
path: root/Lib/distutils
diff options
context:
space:
mode:
authorJason Tishler <jason@tishler.net>2003-04-18 17:27:47 (GMT)
committerJason Tishler <jason@tishler.net>2003-04-18 17:27:47 (GMT)
commitd7e83a1d5178c546fb2c4d5e7d7d284b8a88aeb6 (patch)
tree0f3723379b9d7a4643943783fec006bd6fa87649 /Lib/distutils
parentcf6d74aeddd7cc435ba205895b1126ebc320498a (diff)
downloadcpython-d7e83a1d5178c546fb2c4d5e7d7d284b8a88aeb6.zip
cpython-d7e83a1d5178c546fb2c4d5e7d7d284b8a88aeb6.tar.gz
cpython-d7e83a1d5178c546fb2c4d5e7d7d284b8a88aeb6.tar.bz2
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.
Diffstat (limited to 'Lib/distutils')
-rw-r--r--Lib/distutils/unixccompiler.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py
index 2a6b1be..e444917 100644
--- a/Lib/distutils/unixccompiler.py
+++ b/Lib/distutils/unixccompiler.py
@@ -77,6 +77,8 @@ class UnixCCompiler(CCompiler):
shared_lib_extension = ".so"
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,
output_file=None, macros=None, include_dirs=None,