summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorNeil Schemenauer <nas-github@arctrix.com>2019-02-08 18:48:46 (GMT)
committerGitHub <noreply@github.com>2019-02-08 18:48:46 (GMT)
commit5741c45acf9b0ce22ff0dbf56322fe0ff16cfcfc (patch)
tree783c08f9a90d37d478e235bc37ecec499cbd7a78 /setup.py
parent64360ada0f6123a051e9dc6cd04f030ec1322e46 (diff)
downloadcpython-5741c45acf9b0ce22ff0dbf56322fe0ff16cfcfc.zip
cpython-5741c45acf9b0ce22ff0dbf56322fe0ff16cfcfc.tar.gz
cpython-5741c45acf9b0ce22ff0dbf56322fe0ff16cfcfc.tar.bz2
bpo-35903: Use autoconfig to probe for shm_open() and shm_unlink(). (#11765)
Use autoconfig to probe for shm_open() and shm_unlink(). Set SHM_NEEDS_LIBRT if we must link with librt to get the shm_* functions. Change setup.py to use the autoconfig defines. These changes should make it more likely that _multiprocessing/posixshmem.c gets built correctly on different platforms.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index d54bbe0..4a01a8f 100644
--- a/setup.py
+++ b/setup.py
@@ -1592,12 +1592,13 @@ class PyBuildExt(build_ext):
if (sysconfig.get_config_var('HAVE_SEM_OPEN') and not
sysconfig.get_config_var('POSIX_SEMAPHORES_NOT_ENABLED')):
multiprocessing_srcs.append('_multiprocessing/semaphore.c')
- if (self.compiler.find_library_file(lib_dirs, 'rt') or
- host_platform != 'cygwin'):
+ if (sysconfig.get_config_var('HAVE_SHM_OPEN') and
+ sysconfig.get_config_var('HAVE_SHM_UNLINK')):
posixshmem_srcs = [ '_multiprocessing/posixshmem.c',
]
libs = []
- if self.compiler.find_library_file(lib_dirs, 'rt'):
+ if sysconfig.get_config_var('SHM_NEEDS_LIBRT'):
+ # need to link with librt to get shm_open()
libs.append('rt')
exts.append( Extension('_posixshmem', posixshmem_srcs,
define_macros={},