summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-10-13 13:22:35 (GMT)
committerGitHub <noreply@github.com>2021-10-13 13:22:35 (GMT)
commitbbe7497c5a44c2b4ec726605cf5a9086ba02daf1 (patch)
tree87e8aa9ffd1b9da84a8ea6e9a44279fcb463acc9 /setup.py
parenta8b9350964f43cb648c98c179c8037fbf3ff8a7d (diff)
downloadcpython-bbe7497c5a44c2b4ec726605cf5a9086ba02daf1.zip
cpython-bbe7497c5a44c2b4ec726605cf5a9086ba02daf1.tar.gz
cpython-bbe7497c5a44c2b4ec726605cf5a9086ba02daf1.tar.bz2
bpo-45434: Remove pystrhex.h header file (GH-28923)
Move Include/pystrhex.h to Include/internal/pycore_strhex.h. The header file only contains private functions. The following C extensions are now built with Py_BUILD_CORE_MODULE macro defined to get access to the internal C API: * _blake2 * _hashopenssl * _md5 * _sha1 * _sha3 * _ssl * binascii
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py21
1 files changed, 13 insertions, 8 deletions
diff --git a/setup.py b/setup.py
index 039c96b..56c06cb 100644
--- a/setup.py
+++ b/setup.py
@@ -1709,12 +1709,12 @@ class PyBuildExt(build_ext):
# Helper module for various ascii-encoders. Uses zlib for an optimized
# crc32 if we have it. Otherwise binascii uses its own.
+ extra_compile_args = ['-DPy_BUILD_CORE_MODULE']
if have_zlib:
- extra_compile_args = ['-DUSE_ZLIB_CRC32']
+ extra_compile_args.append('-DUSE_ZLIB_CRC32')
libraries = ['z']
extra_link_args = zlib_extra_link_args
else:
- extra_compile_args = []
libraries = []
extra_link_args = []
self.add(Extension('binascii', ['binascii.c'],
@@ -2469,6 +2469,7 @@ class PyBuildExt(build_ext):
library_dirs=openssl_libdirs,
libraries=openssl_libs,
runtime_library_dirs=runtime_library_dirs,
+ extra_compile_args=['-DPy_BUILD_CORE_MODULE'],
)
# This static linking is NOT OFFICIALLY SUPPORTED.
@@ -2530,27 +2531,29 @@ class PyBuildExt(build_ext):
if "sha256" in configured:
self.add(Extension(
'_sha256', ['sha256module.c'],
+ depends=['hashlib.h'],
extra_compile_args=['-DPy_BUILD_CORE_MODULE'],
- depends=['hashlib.h']
))
if "sha512" in configured:
self.add(Extension(
'_sha512', ['sha512module.c'],
+ depends=['hashlib.h'],
extra_compile_args=['-DPy_BUILD_CORE_MODULE'],
- depends=['hashlib.h']
))
if "md5" in configured:
self.add(Extension(
'_md5', ['md5module.c'],
- depends=['hashlib.h']
+ depends=['hashlib.h'],
+ extra_compile_args=['-DPy_BUILD_CORE_MODULE'],
))
if "sha1" in configured:
self.add(Extension(
'_sha1', ['sha1module.c'],
- depends=['hashlib.h']
+ depends=['hashlib.h'],
+ extra_compile_args=['-DPy_BUILD_CORE_MODULE'],
))
if "blake2" in configured:
@@ -2565,7 +2568,8 @@ class PyBuildExt(build_ext):
'_blake2/blake2b_impl.c',
'_blake2/blake2s_impl.c'
],
- depends=blake2_deps
+ depends=blake2_deps,
+ extra_compile_args=['-DPy_BUILD_CORE_MODULE'],
))
if "sha3" in configured:
@@ -2576,7 +2580,8 @@ class PyBuildExt(build_ext):
self.add(Extension(
'_sha3',
['_sha3/sha3module.c'],
- depends=sha3_deps
+ depends=sha3_deps,
+ extra_compile_args=['-DPy_BUILD_CORE_MODULE'],
))
def detect_nis(self):