diff options
author | Skip Montanaro <skip@pobox.com> | 2008-12-06 17:43:30 (GMT) |
---|---|---|
committer | Skip Montanaro <skip@pobox.com> | 2008-12-06 17:43:30 (GMT) |
commit | 45313fe6e0fbb546e9cb781136b098b6eb8c92c7 (patch) | |
tree | acf99db9e5040ccbca667162a03d13fb1352377c /setup.py | |
parent | f5d5a663491bdcf08a135db322eee4ac43522524 (diff) | |
download | cpython-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.py | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -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'] ) ) |