summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-01-01 15:21:13 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-01-01 15:21:13 (GMT)
commitedfe72f66fd789d65b0c7125540c08d3e98a901e (patch)
tree5f206ac9177024b9b973e7c1c2ef7c2fbdeba5e4 /setup.py
parent6c99b4e0d6f867709bd9c3749cb90f93f693969b (diff)
downloadcpython-edfe72f66fd789d65b0c7125540c08d3e98a901e.zip
cpython-edfe72f66fd789d65b0c7125540c08d3e98a901e.tar.gz
cpython-edfe72f66fd789d65b0c7125540c08d3e98a901e.tar.bz2
allow --with-dbmliborder to specify that no dbm modules will be built #6491
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index 3749054..faf2c33 100644
--- a/setup.py
+++ b/setup.py
@@ -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: