summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2008-12-06 17:43:30 (GMT)
committerSkip Montanaro <skip@pobox.com>2008-12-06 17:43:30 (GMT)
commit45313fe6e0fbb546e9cb781136b098b6eb8c92c7 (patch)
treeacf99db9e5040ccbca667162a03d13fb1352377c /setup.py
parentf5d5a663491bdcf08a135db322eee4ac43522524 (diff)
downloadcpython-45313fe6e0fbb546e9cb781136b098b6eb8c92c7.zip
cpython-45313fe6e0fbb546e9cb781136b098b6eb8c92c7.tar.gz
cpython-45313fe6e0fbb546e9cb781136b098b6eb8c92c7.tar.bz2
issue 4483 - dbm build failures on systems with gdbm_compat lib.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index 5c37e45..e7d3ad3 100644
--- a/setup.py
+++ b/setup.py
@@ -1019,8 +1019,20 @@ class PyBuildExt(build_ext):
exts.append( Extension('dbm', ['dbmmodule.c'],
define_macros=[('HAVE_NDBM_H',None)],
libraries = ndbm_libs ) )
- elif (self.compiler.find_library_file(lib_dirs, 'gdbm')
- and find_file("gdbm/ndbm.h", inc_dirs, []) is not None):
+ elif self.compiler.find_library_file(lib_dirs, 'gdbm'):
+ gdbm_libs = ['gdbm']
+ if self.compiler.find_library_file(lib_dirs, 'gdbm_compat'):
+ gdbm_libs.append('gdbm_compat')
+ if find_file("gdbm/ndbm.h", inc_dirs, []) is not None:
+ exts.append( Extension(
+ 'dbm', ['dbmmodule.c'],
+ define_macros=[('HAVE_GDBM_NDBM_H',None)],
+ libraries = gdbm_libs ) )
+ elif find_file("gdbm-ndbm.h", inc_dirs, []) is not None:
+ exts.append( Extension(
+ 'dbm', ['dbmmodule.c'],
+ define_macros=[('HAVE_GDBM_DASH_NDBM_H',None)],
+ libraries = gdbm_libs ) )
exts.append( Extension('dbm', ['dbmmodule.c'],
define_macros=[('HAVE_GDBM_NDBM_H',None)],
libraries = ['gdbm'] ) )