Commit 9e051359 authored by Martin v. Löwis's avatar Martin v. Löwis

Port build_ssl.py to 2.4; support HOST_PYTHON variable

parent 3fd0c442
...@@ -102,8 +102,11 @@ def create_makefile64(makefile, m32): ...@@ -102,8 +102,11 @@ def create_makefile64(makefile, m32):
""" """
if not os.path.isfile(m32): if not os.path.isfile(m32):
return return
with open(m32) as fin: # 2.4 compatibility
with open(makefile, 'w') as fout: fin = open(m32)
if 1: # with open(m32) as fin:
fout = open(makefile, 'w')
if 1: # with open(makefile, 'w') as fout:
for line in fin: for line in fin:
line = line.replace("=tmp32", "=tmp64") line = line.replace("=tmp32", "=tmp64")
line = line.replace("=out32", "=out64") line = line.replace("=out32", "=out64")
...@@ -121,9 +124,13 @@ def fix_makefile(makefile): ...@@ -121,9 +124,13 @@ def fix_makefile(makefile):
""" """
if not os.path.isfile(makefile): if not os.path.isfile(makefile):
return return
with open(makefile) as fin: # 2.4 compatibility
fin = open(makefile)
if 1: # with open(makefile) as fin:
lines = fin.readlines() lines = fin.readlines()
with open(makefile, 'w') as fout: fin.close()
fout = open(makefile, 'w')
if 1: # with open(makefile, 'w') as fout:
for line in lines: for line in lines:
if line.startswith("PERL="): if line.startswith("PERL="):
continue continue
...@@ -139,6 +146,7 @@ def fix_makefile(makefile): ...@@ -139,6 +146,7 @@ def fix_makefile(makefile):
line = line + noalgo line = line + noalgo
line = line + '\n' line = line + '\n'
fout.write(line) fout.write(line)
fout.close()
def run_configure(configure, do_script): def run_configure(configure, do_script):
print("perl Configure "+configure) print("perl Configure "+configure)
......
...@@ -303,7 +303,8 @@ Building for AMD64 ...@@ -303,7 +303,8 @@ Building for AMD64
------------------ ------------------
The build process for AMD64 / x64 is very similar to standard builds. You just The build process for AMD64 / x64 is very similar to standard builds. You just
have to set x64 as platform. have to set x64 as platform. In addition, the HOST_PYTHON environment variable
must point to a Python interpreter (at least 2.4), to support cross-compilation.
Building Python Using the free MS Toolkit Compiler Building Python Using the free MS Toolkit Compiler
-------------------------------------------------- --------------------------------------------------
......
...@@ -15,4 +15,8 @@ ...@@ -15,4 +15,8 @@
Name="VCLinkerTool" Name="VCLinkerTool"
TargetMachine="17" TargetMachine="17"
/> />
<UserMacro
Name="PythonExe"
Value="$(HOST_PYTHON)"
/>
</VisualStudioPropertySheet> </VisualStudioPropertySheet>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment