Commit ba466cd2 authored by Hirokazu Yamamoto's avatar Hirokazu Yamamoto

Merged revisions 85071-85072,85894,87132 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85071 | hirokazu.yamamoto | 2010-09-29 03:29:57 +0900 (水, 29 9 2010) | 1 line

  Now perl path with spaces can be used.
........
  r85072 | hirokazu.yamamoto | 2010-09-29 03:36:04 +0900 (水, 29 9 2010) | 1 line

  Updated PC/VC6 openssl build script. (for openssl-1.0.0a)
........
  r85894 | hirokazu.yamamoto | 2010-10-29 02:57:25 +0900 (金, 29 10 2010) | 1 line

  Updated readme.txt about OpenSSL.
........
  r87132 | hirokazu.yamamoto | 2010-12-08 23:47:07 +0900 (水, 08 12 2010) | 3 lines

  Mention NASM which is needed to build openssl-1.0.0a original source.
  (PC/VC6/readme.txt)
........
parent a85b671c
...@@ -13,6 +13,11 @@ ...@@ -13,6 +13,11 @@
# it should configure and build SSL, then build the ssl Python extension # it should configure and build SSL, then build the ssl Python extension
# without intervention. # without intervention.
# Modified by Christian Heimes
# Now this script supports pre-generated makefiles and assembly files.
# Developers don't need an installation of Perl anymore to build Python. A svn
# checkout from our svn repository is enough.
import os, sys, re, shutil import os, sys, re, shutil
# Find all "foo.exe" files on the PATH. # Find all "foo.exe" files on the PATH.
...@@ -36,7 +41,7 @@ def find_all_on_path(filename, extras = None): ...@@ -36,7 +41,7 @@ def find_all_on_path(filename, extras = None):
# is available. # is available.
def find_working_perl(perls): def find_working_perl(perls):
for perl in perls: for perl in perls:
fh = os.popen(perl + ' -e "use Win32;"') fh = os.popen('"%s" -e "use Win32;"' % perl)
fh.read() fh.read()
rc = fh.close() rc = fh.close()
if rc: if rc:
...@@ -120,6 +125,22 @@ def run_configure(configure, do_script): ...@@ -120,6 +125,22 @@ def run_configure(configure, do_script):
print(do_script) print(do_script)
os.system(do_script) os.system(do_script)
def cmp(f1, f2):
bufsize = 1024 * 8
with open(f1, 'rb') as fp1, open(f2, 'rb') as fp2:
while True:
b1 = fp1.read(bufsize)
b2 = fp2.read(bufsize)
if b1 != b2:
return False
if not b1:
return True
def copy(src, dst):
if os.path.isfile(dst) and cmp(src, dst):
return
shutil.copy(src, dst)
def main(): def main():
debug = "-d" in sys.argv debug = "-d" in sys.argv
build_all = "-a" in sys.argv build_all = "-a" in sys.argv
...@@ -129,6 +150,7 @@ def main(): ...@@ -129,6 +150,7 @@ def main():
do_script = "ms\\do_nasm" do_script = "ms\\do_nasm"
makefile="ms\\nt.mak" makefile="ms\\nt.mak"
m32 = makefile m32 = makefile
dirsuffix = "32"
configure += " no-idea no-rc5 no-mdc2" configure += " no-idea no-rc5 no-mdc2"
make_flags = "" make_flags = ""
if build_all: if build_all:
...@@ -137,12 +159,12 @@ def main(): ...@@ -137,12 +159,12 @@ def main():
# as "well known" locations # as "well known" locations
perls = find_all_on_path("perl.exe", ["\\perl\\bin", "C:\\perl\\bin"]) perls = find_all_on_path("perl.exe", ["\\perl\\bin", "C:\\perl\\bin"])
perl = find_working_perl(perls) perl = find_working_perl(perls)
if perl is None: if perl:
print("No Perl installation was found. Existing Makefiles are used.")
else:
print("Found a working perl at '%s'" % (perl,)) print("Found a working perl at '%s'" % (perl,))
else:
print("No Perl installation was found. Existing Makefiles are used.")
sys.stdout.flush() sys.stdout.flush()
# Look for SSL 3 levels up from pcbuild - ie, same place zlib etc all live. # Look for SSL 3 levels up from PC/VC6 - ie, same place zlib etc all live.
ssl_dir = find_best_ssl_dir(("..\\..\\..",)) ssl_dir = find_best_ssl_dir(("..\\..\\..",))
if ssl_dir is None: if ssl_dir is None:
sys.exit(1) sys.exit(1)
...@@ -173,12 +195,21 @@ def main(): ...@@ -173,12 +195,21 @@ def main():
# os.system("perl util\mk1mf.pl debug "+configure+" >"+makefile) # os.system("perl util\mk1mf.pl debug "+configure+" >"+makefile)
fix_makefile(makefile) fix_makefile(makefile)
shutil.copy(r"crypto\buildinf.h", r"crypto\buildinf_%s.h" % arch) copy(r"crypto\buildinf.h", r"crypto\buildinf_%s.h" % arch)
shutil.copy(r"crypto\opensslconf.h", r"crypto\opensslconf_%s.h" % arch) copy(r"crypto\opensslconf.h", r"crypto\opensslconf_%s.h" % arch)
# If the assembler files don't exist in tmpXX, copy them there
if perl is None:
if not os.path.exists("tmp"+dirsuffix):
os.mkdir("tmp"+dirsuffix)
for f in os.listdir("asm"+dirsuffix):
if not f.endswith(".asm"): continue
if os.path.isfile(r"tmp%s\%s" % (dirsuffix, f)): continue
shutil.copy(r"asm%s\%s" % (dirsuffix, f), "tmp"+dirsuffix)
# Now run make. # Now run make.
shutil.copy(r"crypto\buildinf_%s.h" % arch, r"crypto\buildinf.h") copy(r"crypto\buildinf_%s.h" % arch, r"crypto\buildinf.h")
shutil.copy(r"crypto\opensslconf_%s.h" % arch, r"crypto\opensslconf.h") copy(r"crypto\opensslconf_%s.h" % arch, r"crypto\opensslconf.h")
#makeCommand = "nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile) #makeCommand = "nmake /nologo PERL=\"%s\" -f \"%s\"" %(perl, makefile)
makeCommand = "nmake /nologo -f \"%s\"" % makefile makeCommand = "nmake /nologo -f \"%s\"" % makefile
......
...@@ -149,21 +149,27 @@ _ssl ...@@ -149,21 +149,27 @@ _ssl
Get the latest source code for OpenSSL from Get the latest source code for OpenSSL from
http://www.openssl.org http://www.openssl.org
You (probably) don't want the "engine" code. For example, get You (probably) don't want the "engine" code. For example, don't get
openssl-0.9.8g.tar.gz openssl-engine-0.9.6g.tar.gz
not
openssl-engine-0.9.8g.tar.gz
Unpack into the "dist" directory, retaining the folder name from Unpack into the "dist" directory, retaining the folder name from
the archive - for example, the latest stable OpenSSL will install as the archive - for example, the latest stable OpenSSL will install as
dist/openssl-0.9.8g dist/openssl-1.0.0a
You can (theoretically) use any version of OpenSSL you like - the You can (theoretically) use any version of OpenSSL you like - the
build process will automatically select the latest version. build process will automatically select the latest version.
You must also install ActivePerl from You can install the NASM assembler from
http://www.activestate.com/Products/ActivePerl/ http://www.nasm.us/
as this is used by the OpenSSL build process. Complain to them <wink>. for x86 builds. Put nasmw.exe anywhere in your PATH.
Note: recent releases of nasm only have nasm.exe. Just rename it to
nasmw.exe.
You can also install ActivePerl from
http://www.activestate.com/activeperl/
if you like to use the official sources instead of the files from
python's subversion repository. The svn version contains pre-build
makefiles and assembly files.
The MSVC project simply invokes PC/VC6/build_ssl.py to perform The MSVC project simply invokes PC/VC6/build_ssl.py to perform
the build. This Python script locates and builds your OpenSSL the build. This Python script locates and builds your OpenSSL
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# directory. It is likely you will already find the zlib library and # directory. It is likely you will already find the zlib library and
# any other external packages there. # any other external packages there.
# * Install ActivePerl and ensure it is somewhere on your path. # * Install ActivePerl and ensure it is somewhere on your path.
# * Run this script from the PCBuild directory. # * Run this script from the PC/VS8.0 directory.
# #
# it should configure and build SSL, then build the _ssl and _hashlib # it should configure and build SSL, then build the _ssl and _hashlib
# Python extensions without intervention. # Python extensions without intervention.
...@@ -46,7 +46,7 @@ def find_all_on_path(filename, extras = None): ...@@ -46,7 +46,7 @@ def find_all_on_path(filename, extras = None):
# is available. # is available.
def find_working_perl(perls): def find_working_perl(perls):
for perl in perls: for perl in perls:
fh = os.popen(perl + ' -e "use Win32;"') fh = os.popen('"%s" -e "use Win32;"' % perl)
fh.read() fh.read()
rc = fh.close() rc = fh.close()
if rc: if rc:
...@@ -178,12 +178,12 @@ def main(): ...@@ -178,12 +178,12 @@ def main():
# as "well known" locations # as "well known" locations
perls = find_all_on_path("perl.exe", ["\\perl\\bin", "C:\\perl\\bin"]) perls = find_all_on_path("perl.exe", ["\\perl\\bin", "C:\\perl\\bin"])
perl = find_working_perl(perls) perl = find_working_perl(perls)
if perl is None: if perl:
print("Found a working perl at '%s'" % (perl,))
else:
print("No Perl installation was found. Existing Makefiles are used.") print("No Perl installation was found. Existing Makefiles are used.")
print("Found a working perl at '%s'" % (perl,))
sys.stdout.flush() sys.stdout.flush()
# Look for SSL 2 levels up from pcbuild - ie, same place zlib etc all live. # Look for SSL 3 levels up from PC/VS8.0 - ie, same place zlib etc all live.
ssl_dir = find_best_ssl_dir(("..\\..\\..",)) ssl_dir = find_best_ssl_dir(("..\\..\\..",))
if ssl_dir is None: if ssl_dir is None:
sys.exit(1) sys.exit(1)
......
...@@ -46,7 +46,7 @@ def find_all_on_path(filename, extras = None): ...@@ -46,7 +46,7 @@ def find_all_on_path(filename, extras = None):
# is available. # is available.
def find_working_perl(perls): def find_working_perl(perls):
for perl in perls: for perl in perls:
fh = os.popen(perl + ' -e "use Win32;"') fh = os.popen('"%s" -e "use Win32;"' % perl)
fh.read() fh.read()
rc = fh.close() rc = fh.close()
if rc: if rc:
...@@ -186,10 +186,10 @@ def main(): ...@@ -186,10 +186,10 @@ def main():
# as "well known" locations # as "well known" locations
perls = find_all_on_path("perl.exe", ["\\perl\\bin", "C:\\perl\\bin"]) perls = find_all_on_path("perl.exe", ["\\perl\\bin", "C:\\perl\\bin"])
perl = find_working_perl(perls) perl = find_working_perl(perls)
if perl is None: if perl:
print("Found a working perl at '%s'" % (perl,))
else:
print("No Perl installation was found. Existing Makefiles are used.") print("No Perl installation was found. Existing Makefiles are used.")
print("Found a working perl at '%s'" % (perl,))
sys.stdout.flush() sys.stdout.flush()
# Look for SSL 2 levels up from pcbuild - ie, same place zlib etc all live. # Look for SSL 2 levels up from pcbuild - ie, same place zlib etc all live.
ssl_dir = find_best_ssl_dir(("..\\..",)) ssl_dir = find_best_ssl_dir(("..\\..",))
......
...@@ -156,7 +156,7 @@ _ssl ...@@ -156,7 +156,7 @@ _ssl
nasmw.exe. nasmw.exe.
You can also install ActivePerl from You can also install ActivePerl from
http://www.activestate.com/Products/ActivePerl/ http://www.activestate.com/activeperl/
if you like to use the official sources instead of the files from if you like to use the official sources instead of the files from
python's subversion repository. The svn version contains pre-build python's subversion repository. The svn version contains pre-build
makefiles and assembly files. makefiles and assembly files.
......
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