diff options
Diffstat (limited to 'setup.py')
| -rw-r--r-- | setup.py | 59 | 
1 files changed, 39 insertions, 20 deletions
| @@ -186,7 +186,7 @@ def find_module_file(module, dirlist):      if not list:          return module      if len(list) > 1: -        log.info("WARNING: multiple copies of %s found"%module) +        log.info("WARNING: multiple copies of %s found", module)      return os.path.join(list[0], module)  class PyBuildExt(build_ext): @@ -652,7 +652,8 @@ class PyBuildExt(build_ext):          # profiler (_lsprof is for cProfile.py)          exts.append( Extension('_lsprof', ['_lsprof.c', 'rotatingtree.c']) )          # static Unicode character database -        exts.append( Extension('unicodedata', ['unicodedata.c']) ) +        exts.append( Extension('unicodedata', ['unicodedata.c'], +                               depends=['unicodedata_db.h', 'unicodename_db.h']) )          # _opcode module          exts.append( Extension('_opcode', ['_opcode.c']) ) @@ -838,7 +839,7 @@ class PyBuildExt(build_ext):          # find out which version of OpenSSL we have          openssl_ver = 0          openssl_ver_re = re.compile( -            '^\s*#\s*define\s+OPENSSL_VERSION_NUMBER\s+(0x[0-9a-fA-F]+)' ) +            r'^\s*#\s*define\s+OPENSSL_VERSION_NUMBER\s+(0x[0-9a-fA-F]+)' )          # look for the openssl version header on the compiler search path.          opensslv_h = find_file('openssl/opensslv.h', [], @@ -889,6 +890,29 @@ class PyBuildExt(build_ext):          exts.append( Extension('_sha1', ['sha1module.c'],                                 depends=['hashlib.h']) ) +        blake2_deps = glob(os.path.join(os.getcwd(), srcdir, +                                        'Modules/_blake2/impl/*')) +        blake2_deps.append('hashlib.h') + +        blake2_macros = [] +        if not cross_compiling and os.uname().machine == "x86_64": +            # Every x86_64 machine has at least SSE2. +            blake2_macros.append(('BLAKE2_USE_SSE', '1')) + +        exts.append( Extension('_blake2', +                               ['_blake2/blake2module.c', +                                '_blake2/blake2b_impl.c', +                                '_blake2/blake2s_impl.c'], +                               define_macros=blake2_macros, +                               depends=blake2_deps) ) + +        sha3_deps = glob(os.path.join(os.getcwd(), srcdir, +                                      'Modules/_sha3/kcp/*')) +        sha3_deps.append('hashlib.h') +        exts.append( Extension('_sha3', +                               ['_sha3/sha3module.c'], +                               depends=sha3_deps)) +          # 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 @@ -1701,7 +1725,7 @@ class PyBuildExt(build_ext):          # All existing framework builds of Tcl/Tk don't support 64-bit          # architectures.          cflags = sysconfig.get_config_vars('CFLAGS')[0] -        archs = re.findall('-arch\s+(\w+)', cflags) +        archs = re.findall(r'-arch\s+(\w+)', cflags)          tmpfile = os.path.join(self.build_temp, 'tk.arch')          if not os.path.exists(self.build_temp): @@ -1888,6 +1912,9 @@ class PyBuildExt(build_ext):              if host_platform == 'darwin':                  return self.configure_ctypes_darwin(ext) +            print('warning: building with the bundled copy of libffi is' +                  ' deprecated on this platform.  It will not be' +                  ' distributed with Python 3.7')              srcdir = sysconfig.get_config_var('srcdir')              ffi_builddir = os.path.join(self.build_temp, 'libffi')              ffi_srcdir = os.path.abspath(os.path.join(srcdir, 'Modules', @@ -1984,13 +2011,14 @@ class PyBuildExt(build_ext):                       libraries=math_libs)          self.extensions.extend([ext, ext_test]) -        if not '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"): -            return -          if host_platform == 'darwin': +            if '--with-system-ffi' not in sysconfig.get_config_var("CONFIG_ARGS"): +                return              # OS X 10.5 comes with libffi.dylib; the include files are              # in /usr/include/ffi              inc_dirs.append('/usr/include/ffi') +        elif '--without-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"): +            return          ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]          if not ffi_inc or ffi_inc[0] == '': @@ -2009,7 +2037,7 @@ class PyBuildExt(build_ext):                            'ffi_wrapper_h'.format(ffi_h))          ffi_lib = None          if ffi_inc is not None: -            for lib_name in ('ffi_convenience', 'ffi_pic', 'ffi'): +            for lib_name in ('ffi', 'ffi_pic'):                  if (self.compiler.find_library_file(lib_dirs, lib_name)):                      ffi_lib = lib_name                      break @@ -2062,7 +2090,7 @@ class PyBuildExt(build_ext):                '_decimal/libmpdec/fnt.h',                '_decimal/libmpdec/fourstep.h',                '_decimal/libmpdec/io.h', -              '_decimal/libmpdec/memory.h', +              '_decimal/libmpdec/mpalloc.h',                '_decimal/libmpdec/mpdecimal.h',                '_decimal/libmpdec/numbertheory.h',                '_decimal/libmpdec/sixstep.h', @@ -2128,15 +2156,6 @@ class PyBuildExt(build_ext):          if not sysconfig.get_config_var('WITH_THREAD'):              define_macros.append(('WITHOUT_THREADS', 1)) -        # Increase warning level for gcc: -        if 'gcc' in cc: -            cmd = ("echo '' | %s -Wextra -Wno-missing-field-initializers -E - " -                   "> /dev/null 2>&1" % cc) -            ret = os.system(cmd) -            if ret >> 8 == 0: -                extra_compile_args.extend(['-Wextra', -                                           '-Wno-missing-field-initializers']) -          # Uncomment for extra functionality:          #define_macros.append(('EXTRA_FUNCTIONALITY', 1))          ext = Extension ( @@ -2215,7 +2234,7 @@ class PyBuildScripts(build_scripts):                  newfilename = filename + fullversion              else:                  newfilename = filename + minoronly -            log.info('renaming {} to {}'.format(filename, newfilename)) +            log.info('renaming %s to %s', filename, newfilename)              os.rename(filename, newfilename)              newoutfiles.append(newfilename)              if filename in updated_files: @@ -2257,7 +2276,7 @@ def main():      setup(# PyPI Metadata (PEP 301)            name = "Python",            version = sys.version.split()[0], -          url = "http://www.python.org/%s" % sys.version[:3], +          url = "http://www.python.org/%d.%d" % sys.version_info[:2],            maintainer = "Guido van Rossum and the Python community",            maintainer_email = "python-dev@python.org",            description = "A high-level object-oriented programming language", | 
