# HG changeset patch # User Adrian Buehlmann # Date 1340968248 -7200 # Node ID f20e4d76b7114c43933c8a38a93cac559a96e451 # Parent 69fa0459dd3b5fc8f7a4e1c5ca632fd7c8788c00 setup: compile hg.exe This implements a new command $ python setup.py build_hgexe -i which places the hg.exe in the root of the source tree. diff -r 69fa0459dd3b -r f20e4d76b711 setup.py --- a/setup.py Fri Jun 29 15:21:35 2012 +0200 +++ b/setup.py Fri Jun 29 13:10:48 2012 +0200 @@ -335,6 +335,19 @@ f.write(out) f.close() +class buildhgexe(build_ext): + description = 'compile hg.exe from mercurial/exewrapper.c' + + def build_extensions(self): + if os.name != 'nt': + return + 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') + self.compiler.link_executable(objects, target, + output_dir=self.build_temp) + class hginstallscripts(install_scripts): ''' This is a specialization of install_scripts that replaces the @LIBDIR@ with @@ -386,7 +399,9 @@ 'build_ext': hgbuildext, 'build_py': hgbuildpy, 'build_hgextindex': buildhgextindex, - 'install_scripts': hginstallscripts} + 'install_scripts': hginstallscripts, + 'build_hgexe': buildhgexe, + } packages = ['mercurial', 'mercurial.hgweb', 'mercurial.httpclient', 'hgext', 'hgext.convert', 'hgext.highlight', 'hgext.zeroconf',