summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2008-12-06 17:25:02 +0000
committerSkip Montanaro <skip@pobox.com>2008-12-06 17:25:02 +0000
commitf1b0d7a2c0e650a7edafe1aa1d9e40086a417b20 (patch)
tree5c065fdde5220063e3954ec23610323b20c4a464 /setup.py
parent7dbd063aebb23d8b440c72eabe1324e3285c8ffc (diff)
downloadcpython-f1b0d7a2c0e650a7edafe1aa1d9e40086a417b20.tar.gz
issue 4483 - _dbm build failures on systems with gdbm_compat lib.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/setup.py b/setup.py
index d2931d1692..d6d9c97e7b 100644
--- a/setup.py
+++ b/setup.py
@@ -783,11 +783,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):
- exts.append( Extension('_dbm', ['_dbmmodule.c'],
- define_macros=[('HAVE_GDBM_NDBM_H',None)],
- libraries = ['gdbm'] ) )
+ 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 ) )
elif db_incs is not None:
exts.append( Extension('_dbm', ['_dbmmodule.c'],
library_dirs=dblib_dir,