342 if os.name != 'nt': |
342 if os.name != 'nt': |
343 return |
343 return |
344 if isinstance(self.compiler, HackedMingw32CCompiler): |
344 if isinstance(self.compiler, HackedMingw32CCompiler): |
345 self.compiler.compiler_so = self.compiler.compiler # no -mdll |
345 self.compiler.compiler_so = self.compiler.compiler # no -mdll |
346 self.compiler.dll_libraries = [] # no -lmsrvc90 |
346 self.compiler.dll_libraries = [] # no -lmsrvc90 |
|
347 hv = sys.hexversion |
|
348 pythonlib = 'python%d%d' % (hv >> 24, (hv >> 16) & 0xff) |
|
349 f = open('mercurial/hgpythonlib.h', 'wb') |
|
350 f.write('/* this file is autogenerated by setup.py */\n') |
|
351 f.write('#define HGPYTHONLIB "%s"\n' % pythonlib) |
|
352 f.close() |
347 objects = self.compiler.compile(['mercurial/exewrapper.c'], |
353 objects = self.compiler.compile(['mercurial/exewrapper.c'], |
348 output_dir=self.build_temp) |
354 output_dir=self.build_temp) |
349 dir = os.path.dirname(self.get_ext_fullpath('dummy')) |
355 dir = os.path.dirname(self.get_ext_fullpath('dummy')) |
350 target = os.path.join(dir, 'hg') |
356 target = os.path.join(dir, 'hg') |
351 pythonlib = ("python%d%d" % |
|
352 (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff)) |
|
353 self.compiler.link_executable(objects, target, |
357 self.compiler.link_executable(objects, target, |
354 libraries=[pythonlib], |
358 libraries=[], |
355 output_dir=self.build_temp) |
359 output_dir=self.build_temp) |
356 |
360 |
357 class hginstallscripts(install_scripts): |
361 class hginstallscripts(install_scripts): |
358 ''' |
362 ''' |
359 This is a specialization of install_scripts that replaces the @LIBDIR@ with |
363 This is a specialization of install_scripts that replaces the @LIBDIR@ with |