allow --with-dbmliborder to specify that no dbm modules will be built #6491

This commit is contained in:
Benjamin Peterson 2010-01-01 15:21:13 +00:00
parent 6c99b4e0d6
commit edfe72f66f
2 changed files with 7 additions and 3 deletions

View File

@ -93,6 +93,8 @@ C-API
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
--with-system-ffi flag is used.

View File

@ -1000,14 +1000,15 @@ class PyBuildExt(build_ext):
else:
missing.append('bsddb185')
dbm_order = ['gdbm']
# The standard Unix dbm module:
if platform not in ['cygwin']:
config_args = [arg.strip("'")
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 dbm_args:
dbm_order = dbm_args[-1].split(":")
dbm_order = [arg.split('=')[-1] for arg in dbm_args][-1].split(":")
else:
dbm_order = "ndbm:gdbm:bdb".split(":")
dbmext = None
@ -1071,7 +1072,8 @@ class PyBuildExt(build_ext):
missing.append('dbm')
# 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'],
libraries = ['gdbm'] ) )
else: