summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--INSTALL33
-rw-r--r--ext/NDBM_File/NDBM_File.xs5
-rw-r--r--ext/ODBM_File/ODBM_File.xs5
3 files changed, 43 insertions, 0 deletions
diff --git a/INSTALL b/INSTALL
index a46a3ca6a7..3aa80ca9b7 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1148,6 +1148,39 @@ you have some libraries under /usr/local/ and others under
=back
+=head2 Building DB, NDBM, and ODBM interfaces with Berkeley DB 3
+
+Perl interface for DB3 is part of Berkeley DB, but if you want to
+compile standard Perl DB/ODBM/NDBM interfaces, you must follow
+following instructions.
+
+Berkeley DB3 from Sleepycat Software is by default installed without
+DB1 compatibility code (needed for DB_File interface) and without
+links to compatibility files. So if you want to use packages written
+for DB/ODBM/NDBM interfaces, you need to configure DB3 with
+--enable-compat185 (and optionally with --enable-dump185) and create
+additional references (suppose you are installing DB3 with
+--prefix=/usr):
+
+ ln -s libdb-3.so /usr/lib/libdbm.so
+ ln -s libdb-3.so /usr/lib/libndbm.so
+ echo '#define DB_DBM_HSEARCH 1' >dbm.h
+ echo '#include <db.h>' >>dbm.h
+ install -m 0644 dbm.h /usr/include/dbm.h
+ install -m 0644 dbm.h /usr/include/ndbm.h
+
+Optionally, if you have compiled with --enable-compat185 (not needed
+for ODBM/NDBM):
+
+ ln -s libdb-3.so /usr/lib/libdb1.so
+ ln -s libdb-3.so /usr/lib/libdb.so
+
+ODBM emulation seems not to be perfect, but is quite usable,
+using DB 3.1.17:
+
+ lib/odbm.............FAILED at test 9
+ Failed 1/64 tests, 98.44% okay
+
=head2 What if it doesn't work?
If you run into problems, try some of the following ideas.
diff --git a/ext/NDBM_File/NDBM_File.xs b/ext/NDBM_File/NDBM_File.xs
index 49a1db5e56..c417eb693e 100644
--- a/ext/NDBM_File/NDBM_File.xs
+++ b/ext/NDBM_File/NDBM_File.xs
@@ -1,6 +1,11 @@
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
+/* If using the DB3 emulation, ENTER is defined both
+ * by DB3 and Perl. We drop the Perl definition now.
+ * See also INSTALL section on DB3.
+ * -- Stanislav Brabec <utx@penguin.cz> */
+#undef ENTER
#include <ndbm.h>
typedef struct {
diff --git a/ext/ODBM_File/ODBM_File.xs b/ext/ODBM_File/ODBM_File.xs
index 150f2ef894..27174ef062 100644
--- a/ext/ODBM_File/ODBM_File.xs
+++ b/ext/ODBM_File/ODBM_File.xs
@@ -3,6 +3,11 @@
#include "XSUB.h"
#ifdef I_DBM
+/* If using the DB3 emulation, ENTER is defined both
+ * by DB3 and Perl. We drop the Perl definition now.
+ * See also INSTALL section on DB3.
+ * -- Stanislav Brabec <utx@penguin.cz> */
+# undef ENTER
# include <dbm.h>
#else
# ifdef I_RPCSVC_DBM