]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Port build_ssl.py to 2.4; support HOST_PYTHON variable
authorMartin v. Löwis <martin@v.loewis.de>
Fri, 29 Feb 2008 18:54:45 +0000 (18:54 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Fri, 29 Feb 2008 18:54:45 +0000 (18:54 +0000)
PCbuild/build_ssl.py
PCbuild/readme.txt
PCbuild/x64.vsprops

index 2ccceec0804247a787ddd835c2bdc9b459d838bd..f24c9068ae0db9614cdd5548b717a4da5d859335 100644 (file)
@@ -102,8 +102,11 @@ def create_makefile64(makefile, m32):
     """
     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")
@@ -121,9 +124,13 @@ def fix_makefile(makefile):
     """
     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
@@ -139,6 +146,7 @@ def fix_makefile(makefile):
                         line = line + noalgo
                 line = line + '\n'
             fout.write(line)
+    fout.close()
 
 def run_configure(configure, do_script):
     print("perl Configure "+configure)
index f8b3f65062aa0b70f6133ab5800f954ff62a2555..4d2f9b6173dd01e8a35f2c86cf9edee05ae31dff 100644 (file)
@@ -303,7 +303,8 @@ Building for AMD64
 ------------------
 
 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
 --------------------------------------------------
index c7eabbea46204e5e21fedc3b0c17e74452070c02..07200842d311a2e126c561ee3432e95c2853e489 100644 (file)
@@ -15,4 +15,8 @@
                Name="VCLinkerTool"
                TargetMachine="17"
        />
+       <UserMacro
+               Name="PythonExe"
+               Value="$(HOST_PYTHON)"
+       />
 </VisualStudioPropertySheet>