comparison setup.py @ 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 d13f47c800fd
children 318fb32b980e
comparison
equal deleted inserted replaced
17245:6e84171a61c8 17246:bf5bb38bcc7c
340 description = 'compile hg.exe from mercurial/exewrapper.c' 340 description = 'compile hg.exe from mercurial/exewrapper.c'
341 341
342 def build_extensions(self): 342 def build_extensions(self):
343 if os.name != 'nt': 343 if os.name != 'nt':
344 return 344 return
345 if isinstance(self.compiler, HackedMingw32CCompiler):
346 self.compiler.compiler_so = self.compiler.compiler # no -mdll
347 self.compiler.dll_libraries = [] # no -lmsrvc90
345 objects = self.compiler.compile(['mercurial/exewrapper.c'], 348 objects = self.compiler.compile(['mercurial/exewrapper.c'],
346 output_dir=self.build_temp) 349 output_dir=self.build_temp)
347 dir = os.path.dirname(self.get_ext_fullpath('dummy')) 350 dir = os.path.dirname(self.get_ext_fullpath('dummy'))
348 target = os.path.join(dir, 'hg') 351 target = os.path.join(dir, 'hg')
352 pythonlib = ("python%d%d" %
353 (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
349 self.compiler.link_executable(objects, target, 354 self.compiler.link_executable(objects, target,
355 libraries=[pythonlib],
350 output_dir=self.build_temp) 356 output_dir=self.build_temp)
351 357
352 class hginstallscripts(install_scripts): 358 class hginstallscripts(install_scripts):
353 ''' 359 '''
354 This is a specialization of install_scripts that replaces the @LIBDIR@ with 360 This is a specialization of install_scripts that replaces the @LIBDIR@ with