From: Jarkko Hietaniemi Date: Thu, 4 Jan 2001 21:14:22 +0000 (+0000) Subject: DB3 NDBM/ODBM emulation tweaks from Stanislav Brabec . X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bb636fa4a888d369d95f00a75923476bd0dae49f;p=p5sagit%2Fp5-mst-13.2.git DB3 NDBM/ODBM emulation tweaks from Stanislav Brabec . p4raw-id: //depot/perl@8320 --- diff --git a/INSTALL b/INSTALL index a46a3ca..3aa80ca 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 ' >>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 49a1db5..c417eb6 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 */ +#undef ENTER #include typedef struct { diff --git a/ext/ODBM_File/ODBM_File.xs b/ext/ODBM_File/ODBM_File.xs index 150f2ef..27174ef 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 */ +# undef ENTER # include #else # ifdef I_RPCSVC_DBM