Skip to content

Commit edfe72f

Browse files
committed
allow --with-dbmliborder to specify that no dbm modules will be built #6491
1 parent 6c99b4e commit edfe72f

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ C-API
9393
Build
9494
-----
9595

96+
- Issue #6491: Allow --with-dbmliborder to specify that no dbms will be built.
97+
9698
- Issue #6943: Use pkg-config to find the libffi headers when the
9799
--with-system-ffi flag is used.
98100

setup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,14 +1000,15 @@ class db_found(Exception): pass
10001000
else:
10011001
missing.append('bsddb185')
10021002

1003+
dbm_order = ['gdbm']
10031004
# The standard Unix dbm module:
10041005
if platform not in ['cygwin']:
10051006
config_args = [arg.strip("'")
10061007
for arg in sysconfig.get_config_var("CONFIG_ARGS").split()]
1007-
dbm_args = [arg.split('=')[-1] for arg in config_args
1008+
dbm_args = [arg for arg in config_args
10081009
if arg.startswith('--with-dbmliborder=')]
10091010
if dbm_args:
1010-
dbm_order = dbm_args[-1].split(":")
1011+
dbm_order = [arg.split('=')[-1] for arg in dbm_args][-1].split(":")
10111012
else:
10121013
dbm_order = "ndbm:gdbm:bdb".split(":")
10131014
dbmext = None
@@ -1071,7 +1072,8 @@ class db_found(Exception): pass
10711072
missing.append('dbm')
10721073

10731074
# Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm:
1074-
if (self.compiler_obj.find_library_file(lib_dirs, 'gdbm')):
1075+
if ('gdbm' in dbm_order and
1076+
self.compiler_obj.find_library_file(lib_dirs, 'gdbm')):
10751077
exts.append( Extension('gdbm', ['gdbmmodule.c'],
10761078
libraries = ['gdbm'] ) )
10771079
else:

0 commit comments

Comments
 (0)