summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2008-12-06 17:25:02 (GMT)
committerSkip Montanaro <skip@pobox.com>2008-12-06 17:25:02 (GMT)
commitc1ce286061d02b8e3701633dd22c3ce813f9a6f6 (patch)
treed7846d1669940c0efb046796b815826fbfd03a74
parent008d8ef1a87dcf8fdada5ab01e27dcb6e4100472 (diff)
downloadcpython-c1ce286061d02b8e3701633dd22c3ce813f9a6f6.zip
cpython-c1ce286061d02b8e3701633dd22c3ce813f9a6f6.tar.gz
cpython-c1ce286061d02b8e3701633dd22c3ce813f9a6f6.tar.bz2
issue 4483 - _dbm build failures on systems with gdbm_compat lib.
-rw-r--r--Misc/NEWS3
-rw-r--r--Modules/_dbmmodule.c3
-rw-r--r--setup.py19
3 files changed, 20 insertions, 5 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 472751f..9445457 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -25,6 +25,9 @@ Core and Builtins
Library
-------
+- Issue #4483: _dbm module now builds on systems with gdbm & gdbm_compat
+ libs.
+
- Issue #4542: On Windows, binascii.crc32 still accepted str as binary input;
the corresponding tests now pass.
diff --git a/Modules/_dbmmodule.c b/Modules/_dbmmodule.c
index 1aef3d9..5775511 100644
--- a/Modules/_dbmmodule.c
+++ b/Modules/_dbmmodule.c
@@ -21,6 +21,9 @@ static char *which_dbm = "GNU gdbm"; /* EMX port of GDBM */
#elif defined(HAVE_GDBM_NDBM_H)
#include <gdbm/ndbm.h>
static char *which_dbm = "GNU gdbm";
+#elif defined(HAVE_GDBM_DASH_NDBM_H)
+#include <gdbm-ndbm.h>
+static char *which_dbm = "GNU gdbm";
#elif defined(HAVE_BERKDB_H)
#include <db.h>
static char *which_dbm = "Berkeley DB";
diff --git a/setup.py b/setup.py
index d2931d1..d6d9c97 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,