mirror of
https://github.com/python/cpython.git
synced 2025-07-24 19:54:21 +00:00
bpo-43158: Use configure values for building _uuid extension (GH-29353)
This commit is contained in:
parent
3409899128
commit
77a1f8d94c
5 changed files with 86 additions and 7 deletions
12
setup.py
12
setup.py
|
@ -1842,15 +1842,15 @@ class PyBuildExt(build_ext):
|
|||
|
||||
def detect_uuid(self):
|
||||
# Build the _uuid module if possible
|
||||
uuid_incs = find_file("uuid.h", self.inc_dirs, ["/usr/include/uuid"])
|
||||
if uuid_incs is not None:
|
||||
if self.compiler.find_library_file(self.lib_dirs, 'uuid'):
|
||||
uuid_libs = ['uuid']
|
||||
uuid_h = sysconfig.get_config_var("HAVE_UUID_H")
|
||||
uuid_uuid_h = sysconfig.get_config_var("HAVE_UUID_UUID_H")
|
||||
if uuid_h or uuid_uuid_h:
|
||||
if sysconfig.get_config_var("HAVE_LIBUUID"):
|
||||
uuid_libs = ["uuid"]
|
||||
else:
|
||||
uuid_libs = []
|
||||
self.add(Extension('_uuid', ['_uuidmodule.c'],
|
||||
libraries=uuid_libs,
|
||||
include_dirs=uuid_incs))
|
||||
libraries=uuid_libs))
|
||||
else:
|
||||
self.missing.append('_uuid')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue