##// END OF EJS Templates
setup: copy pythonXY.dll next to the hg.exe wrapper when building...
Matt Harbison -
r46930:2960b7fa default
parent child Browse files
Show More
@@ -782,6 +782,9 b' class buildhgexe(build_ext):'
782
782
783 pythonlib = None
783 pythonlib = None
784
784
785 dir = os.path.dirname(self.get_ext_fullpath('dummy'))
786 self.hgtarget = os.path.join(dir, 'hg')
787
785 if getattr(sys, 'dllhandle', None):
788 if getattr(sys, 'dllhandle', None):
786 # Different Python installs can have different Python library
789 # Different Python installs can have different Python library
787 # names. e.g. the official CPython distribution uses pythonXY.dll
790 # names. e.g. the official CPython distribution uses pythonXY.dll
@@ -807,6 +810,19 b' class buildhgexe(build_ext):'
807 )
810 )
808 pythonlib = dllbasename[:-4]
811 pythonlib = dllbasename[:-4]
809
812
813 # Copy the pythonXY.dll next to the binary so that it runs
814 # without tampering with PATH.
815 fsdecode = lambda x: x
816 if sys.version_info[0] >= 3:
817 fsdecode = os.fsdecode
818 dest = os.path.join(
819 os.path.dirname(self.hgtarget),
820 fsdecode(dllbasename),
821 )
822
823 if not os.path.exists(dest):
824 shutil.copy(buf.value, dest)
825
810 if not pythonlib:
826 if not pythonlib:
811 log.warn(
827 log.warn(
812 'could not determine Python DLL filename; assuming pythonXY'
828 'could not determine Python DLL filename; assuming pythonXY'
@@ -829,8 +845,6 b' class buildhgexe(build_ext):'
829 output_dir=self.build_temp,
845 output_dir=self.build_temp,
830 macros=macros,
846 macros=macros,
831 )
847 )
832 dir = os.path.dirname(self.get_ext_fullpath('dummy'))
833 self.hgtarget = os.path.join(dir, 'hg')
834 self.compiler.link_executable(
848 self.compiler.link_executable(
835 objects, self.hgtarget, libraries=[], output_dir=self.build_temp
849 objects, self.hgtarget, libraries=[], output_dir=self.build_temp
836 )
850 )
General Comments 0
You need to be logged in to leave comments. Login now