changeset 17246:bf5bb38bcc7c stable

setup: fix build_hgexe for mingw32 compiler Fixes python setup.py build_hgexe -i --compiler=mingw32
author Adrian Buehlmann <adrian@cadifra.com>
date Wed, 25 Jul 2012 16:50:22 +0200
parents 6e84171a61c8
children 6d51a0c71d4e
files setup.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/setup.py	Sun Jul 22 23:37:53 2012 -0400
+++ b/setup.py	Wed Jul 25 16:50:22 2012 +0200
@@ -342,11 +342,17 @@
     def build_extensions(self):
         if os.name != 'nt':
             return
+        if isinstance(self.compiler, HackedMingw32CCompiler):
+            self.compiler.compiler_so = self.compiler.compiler # no -mdll
+            self.compiler.dll_libraries = [] # no -lmsrvc90
         objects = self.compiler.compile(['mercurial/exewrapper.c'],
                                          output_dir=self.build_temp)
         dir = os.path.dirname(self.get_ext_fullpath('dummy'))
         target = os.path.join(dir, 'hg')
+        pythonlib = ("python%d%d" %
+               (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
         self.compiler.link_executable(objects, target,
+                                      libraries=[pythonlib],
                                       output_dir=self.build_temp)
 
 class hginstallscripts(install_scripts):