mirror of
https://github.com/python/cpython.git
synced 2025-09-16 21:56:14 +00:00
allow --with-dbmliborder to specify that no dbm modules will be built #6491
This commit is contained in:
parent
6c99b4e0d6
commit
edfe72f66f
2 changed files with 7 additions and 3 deletions
|
@ -93,6 +93,8 @@ C-API
|
||||||
Build
|
Build
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
- Issue #6491: Allow --with-dbmliborder to specify that no dbms will be built.
|
||||||
|
|
||||||
- Issue #6943: Use pkg-config to find the libffi headers when the
|
- Issue #6943: Use pkg-config to find the libffi headers when the
|
||||||
--with-system-ffi flag is used.
|
--with-system-ffi flag is used.
|
||||||
|
|
||||||
|
|
8
setup.py
8
setup.py
|
@ -1000,14 +1000,15 @@ class PyBuildExt(build_ext):
|
||||||
else:
|
else:
|
||||||
missing.append('bsddb185')
|
missing.append('bsddb185')
|
||||||
|
|
||||||
|
dbm_order = ['gdbm']
|
||||||
# The standard Unix dbm module:
|
# The standard Unix dbm module:
|
||||||
if platform not in ['cygwin']:
|
if platform not in ['cygwin']:
|
||||||
config_args = [arg.strip("'")
|
config_args = [arg.strip("'")
|
||||||
for arg in sysconfig.get_config_var("CONFIG_ARGS").split()]
|
for arg in sysconfig.get_config_var("CONFIG_ARGS").split()]
|
||||||
dbm_args = [arg.split('=')[-1] for arg in config_args
|
dbm_args = [arg for arg in config_args
|
||||||
if arg.startswith('--with-dbmliborder=')]
|
if arg.startswith('--with-dbmliborder=')]
|
||||||
if dbm_args:
|
if dbm_args:
|
||||||
dbm_order = dbm_args[-1].split(":")
|
dbm_order = [arg.split('=')[-1] for arg in dbm_args][-1].split(":")
|
||||||
else:
|
else:
|
||||||
dbm_order = "ndbm:gdbm:bdb".split(":")
|
dbm_order = "ndbm:gdbm:bdb".split(":")
|
||||||
dbmext = None
|
dbmext = None
|
||||||
|
@ -1071,7 +1072,8 @@ class PyBuildExt(build_ext):
|
||||||
missing.append('dbm')
|
missing.append('dbm')
|
||||||
|
|
||||||
# Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm:
|
# Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm:
|
||||||
if (self.compiler_obj.find_library_file(lib_dirs, 'gdbm')):
|
if ('gdbm' in dbm_order and
|
||||||
|
self.compiler_obj.find_library_file(lib_dirs, 'gdbm')):
|
||||||
exts.append( Extension('gdbm', ['gdbmmodule.c'],
|
exts.append( Extension('gdbm', ['gdbmmodule.c'],
|
||||||
libraries = ['gdbm'] ) )
|
libraries = ['gdbm'] ) )
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue