Changeset 391 for python/trunk/PC/VC6/build_ssl.py
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/PC/VC6/build_ssl.py
r2 r391 13 13 # it should configure and build SSL, then build the ssl Python extension 14 14 # without intervention. 15 16 # Modified by Christian Heimes 17 # Now this script supports pre-generated makefiles and assembly files. 18 # Developers don't need an installation of Perl anymore to build Python. A svn 19 # checkout from our svn repository is enough. 15 20 16 21 import os, sys, re, shutil … … 37 42 def find_working_perl(perls): 38 43 for perl in perls: 39 fh = os.popen( perl + ' -e "use Win32;"')44 fh = os.popen('"%s" -e "use Win32;"' % perl) 40 45 fh.read() 41 46 rc = fh.close() … … 121 126 os.system(do_script) 122 127 128 def cmp(f1, f2): 129 bufsize = 1024 * 8 130 with open(f1, 'rb') as fp1, open(f2, 'rb') as fp2: 131 while True: 132 b1 = fp1.read(bufsize) 133 b2 = fp2.read(bufsize) 134 if b1 != b2: 135 return False 136 if not b1: 137 return True 138 139 def copy(src, dst): 140 if os.path.isfile(dst) and cmp(src, dst): 141 return 142 shutil.copy(src, dst) 143 123 144 def main(): 124 145 debug = "-d" in sys.argv … … 130 151 makefile="ms\\nt.mak" 131 152 m32 = makefile 153 dirsuffix = "32" 132 154 configure += " no-idea no-rc5 no-mdc2" 133 155 make_flags = "" … … 138 160 perls = find_all_on_path("perl.exe", ["\\perl\\bin", "C:\\perl\\bin"]) 139 161 perl = find_working_perl(perls) 140 if perl is None: 162 if perl: 163 print "Found a working perl at '%s'" % (perl,) 164 else: 141 165 print "No Perl installation was found. Existing Makefiles are used." 142 else:143 print "Found a working perl at '%s'" % (perl,)144 166 sys.stdout.flush() 145 # Look for SSL 3 levels up from pcbuild- ie, same place zlib etc all live.167 # Look for SSL 3 levels up from PC/VC6 - ie, same place zlib etc all live. 146 168 ssl_dir = find_best_ssl_dir(("..\\..\\..",)) 147 169 if ssl_dir is None: … … 174 196 175 197 fix_makefile(makefile) 176 shutil.copy(r"crypto\buildinf.h", r"crypto\buildinf_%s.h" % arch) 177 shutil.copy(r"crypto\opensslconf.h", r"crypto\opensslconf_%s.h" % arch) 198 copy(r"crypto\buildinf.h", r"crypto\buildinf_%s.h" % arch) 199 copy(r"crypto\opensslconf.h", r"crypto\opensslconf_%s.h" % arch) 200 201 # If the assembler files don't exist in tmpXX, copy them there 202 if perl is None: 203 if not os.path.exists("tmp"+dirsuffix): 204 os.mkdir("tmp"+dirsuffix) 205 for f in os.listdir("asm"+dirsuffix): 206 if not f.endswith(".asm"): continue 207 if os.path.isfile(r"tmp%s\%s" % (dirsuffix, f)): continue 208 shutil.copy(r"asm%s\%s" % (dirsuffix, f), "tmp"+dirsuffix) 178 209 179 210 # Now run make. 180 shutil.copy(r"crypto\buildinf_%s.h" % arch, r"crypto\buildinf.h")181 shutil.copy(r"crypto\opensslconf_%s.h" % arch, r"crypto\opensslconf.h")211 copy(r"crypto\buildinf_%s.h" % arch, r"crypto\buildinf.h") 212 copy(r"crypto\opensslconf_%s.h" % arch, r"crypto\opensslconf.h") 182 213 183 214 #makeCommand = "nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile)
Note:
See TracChangeset
for help on using the changeset viewer.