diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2012-05-18 12:23:13 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2012-05-18 12:23:13 (GMT) |
commit | 0857e4e81b9745206e3b1c3537e2302079926936 (patch) | |
tree | cb1bd66880331ed8245d965de33175832afc7834 /PCbuild | |
parent | fc6acccbafc82aa91d69b0b86b2a3a36e4f93d23 (diff) | |
parent | d18c397ed627b2c6885066bc95ae68d4ac255390 (diff) | |
download | cpython-0857e4e81b9745206e3b1c3537e2302079926936.zip cpython-0857e4e81b9745206e3b1c3537e2302079926936.tar.gz cpython-0857e4e81b9745206e3b1c3537e2302079926936.tar.bz2 |
merge heads
Diffstat (limited to 'PCbuild')
-rw-r--r-- | PCbuild/build_ssl.py | 42 |
1 files changed, 9 insertions, 33 deletions
diff --git a/PCbuild/build_ssl.py b/PCbuild/build_ssl.py index 2cf7fc6..6a270f1 100644 --- a/PCbuild/build_ssl.py +++ b/PCbuild/build_ssl.py @@ -46,7 +46,7 @@ def find_all_on_path(filename, extras = None): # is available. def find_working_perl(perls): for perl in perls: - fh = os.popen('"%s" -e "use Win32;"' % perl) + fh = os.popen('""%s" -e "use Win32;""' % perl) fh.read() rc = fh.close() if rc: @@ -63,37 +63,13 @@ def find_working_perl(perls): print(" Please install ActivePerl and ensure it appears on your path") return None -# Locate the best SSL directory given a few roots to look into. -def find_best_ssl_dir(sources): - candidates = [] - for s in sources: - try: - # note: do not abspath s; the build will fail if any - # higher up directory name has spaces in it. - fnames = os.listdir(s) - except os.error: - fnames = [] - for fname in fnames: - fqn = os.path.join(s, fname) - if os.path.isdir(fqn) and fname.startswith("openssl-"): - candidates.append(fqn) - # Now we have all the candidates, locate the best. - best_parts = [] - best_name = None - for c in candidates: - parts = re.split("[.-]", os.path.basename(c))[1:] - # eg - openssl-0.9.7-beta1 - ignore all "beta" or any other qualifiers - if len(parts) >= 4: - continue - if parts > best_parts: - best_parts = parts - best_name = c - if best_name is not None: - print("Found an SSL directory at '%s'" % (best_name,)) - else: - print("Could not find an SSL directory in '%s'" % (sources,)) - sys.stdout.flush() - return best_name +# Fetch SSL directory from VC properties +def get_ssl_dir(): + propfile = (os.path.join(os.path.dirname(__file__), 'pyproject.props')) + with open(propfile) as f: + m = re.search('openssl-([^<]+)<', f.read()) + return "..\..\openssl-"+m.group(1) + def create_makefile64(makefile, m32): """Create and fix makefile for 64bit @@ -202,7 +178,7 @@ def main(): print("No Perl installation was found. Existing Makefiles are used.") sys.stdout.flush() # Look for SSL 2 levels up from pcbuild - ie, same place zlib etc all live. - ssl_dir = find_best_ssl_dir(("..\\..",)) + ssl_dir = get_ssl_dir() if ssl_dir is None: sys.exit(1) |