# HG changeset patch # User Adrian Buehlmann # Date 2012-06-29 11:10:48 # 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 --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -335,6 +335,19 @@ class buildhgextindex(Command): 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 @@ cmdclass = {'build': hgbuild, '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',