diff options
author | Stefan Krah <skrah@bytereef.org> | 2013-11-24 19:56:23 +0100 |
---|---|---|
committer | Stefan Krah <skrah@bytereef.org> | 2013-11-24 19:56:23 +0100 |
commit | 87c0ef4bb1d38245c984e337b988a621c296d638 (patch) | |
tree | 9ffc240830989d5bc5b7910de045dff66408734e /setup.py | |
parent | 989b513394a22ca150b7ba718debb202ef491b95 (diff) | |
parent | cc16d4af76dec337ce88497e5dbae81be9abae60 (diff) | |
download | cpython-87c0ef4bb1d38245c984e337b988a621c296d638.tar.gz |
Merge from 3.3.
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 33 |
1 files changed, 22 insertions, 11 deletions
@@ -1,7 +1,7 @@ # Autodetecting setup.py script for building the Python extensions # -import sys, os, imp, re, optparse +import sys, os, importlib.machinery, re, optparse from glob import glob import sysconfig @@ -259,8 +259,9 @@ class PyBuildExt(build_ext): if missing: print() - print("Python build finished, but the necessary bits to build " - "these modules were not found:") + print("Python build finished successfully!") + print("The necessary bits to build these optional modules were not " + "found:") print_three_column(missing) print("To find the necessary bits, look in setup.py in" " detect_modules() for the module's name.") @@ -325,8 +326,9 @@ class PyBuildExt(build_ext): if cross_compiling: return + loader = importlib.machinery.ExtensionFileLoader(ext.name, ext_filename) try: - imp.load_dynamic(ext.name, ext_filename) + loader.load_module() except ImportError as why: self.failed.append(ext.name) self.announce('*** WARNING: renaming "%s" since importing it' @@ -588,10 +590,14 @@ class PyBuildExt(build_ext): depends=['testcapi_long.h']) ) # Python PEP-3118 (buffer protocol) test module exts.append( Extension('_testbuffer', ['_testbuffer.c']) ) + # Test loading multiple modules from one compiled file (http://bugs.python.org/issue16421) + exts.append( Extension('_testimportmultiple', ['_testimportmultiple.c']) ) # profiler (_lsprof is for cProfile.py) exts.append( Extension('_lsprof', ['_lsprof.c', 'rotatingtree.c']) ) # static Unicode character database exts.append( Extension('unicodedata', ['unicodedata.c']) ) + # _opcode module + exts.append( Extension('_opcode', ['_opcode.c']) ) # Modules with some UNIX dependencies -- on by default: # (If you have a really backward UNIX, select and socket may not be @@ -784,10 +790,10 @@ class PyBuildExt(build_ext): for line in incfile: m = openssl_ver_re.match(line) if m: - openssl_ver = eval(m.group(1)) + openssl_ver = int(m.group(1), 16) + break except IOError as msg: print("IOError while reading opensshv.h:", msg) - pass #print('openssl_ver = 0x%08x' % openssl_ver) min_openssl_ver = 0x00907000 @@ -821,6 +827,15 @@ class PyBuildExt(build_ext): exts.append( Extension('_sha1', ['sha1module.c'], depends=['hashlib.h']) ) + # SHA-3 (Keccak) module + sha3_depends = ['hashlib.h'] + keccak = os.path.join(os.getcwd(), srcdir, 'Modules', '_sha3', + 'keccak') + for pattern in ('*.c', '*.h', '*.macros'): + sha3_depends.extend(glob(os.path.join(keccak, pattern))) + exts.append(Extension("_sha3", ["_sha3/sha3module.c"], + depends=sha3_depends)) + # Modules that provide persistent dictionary-like semantics. You will # probably want to arrange for at least one of them to be available on # your machine, though none are defined by default because of library @@ -1509,10 +1524,6 @@ class PyBuildExt(build_ext): if host_platform == 'darwin': exts.append( - Extension('_gestalt', ['_gestalt.c'], - extra_link_args=['-framework', 'Carbon']) - ) - exts.append( Extension('_scproxy', ['_scproxy.c'], extra_link_args=[ '-framework', 'SystemConfiguration', @@ -2156,7 +2167,7 @@ is also usable as an extension language for applications that need a programmable interface. The Python implementation is portable: it runs on many brands of UNIX, -on Windows, DOS, OS/2, Mac, Amiga... If your favorite system isn't +on Windows, DOS, Mac, Amiga... If your favorite system isn't listed here, it may still be supported, if there's a C compiler for it. Ask around on comp.lang.python -- or just try compiling Python yourself. |