Commits

Martin von Löwis committed 89cfb38

Port build_ssl.py to 2.4; support HOST_PYTHON variable

Comments (0)

Files changed (3)

PCbuild/build_ssl.py

     """
     if not os.path.isfile(m32):
         return
-    with open(m32) as fin:
-        with open(makefile, 'w') as fout:
+    # 2.4 compatibility
+    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:
                 line = line.replace("=tmp32", "=tmp64")
                 line = line.replace("=out32", "=out64")
     """
     if not os.path.isfile(makefile):
         return
-    with open(makefile) as fin:
+    # 2.4 compatibility
+    fin = open(makefile)
+    if 1: # with open(makefile) as fin:
         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:
             if line.startswith("PERL="):
                 continue
                         line = line + noalgo
                 line = line + '\n'
             fout.write(line)
+    fout.close()
 
 def run_configure(configure, do_script):
     print("perl Configure "+configure)

PCbuild/readme.txt

 ------------------
 
 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
 --------------------------------------------------

PCbuild/x64.vsprops

 		Name="VCLinkerTool"
 		TargetMachine="17"
 	/>
+	<UserMacro
+		Name="PythonExe"
+		Value="$(HOST_PYTHON)"
+	/>
 </VisualStudioPropertySheet>