Closed p5pRT closed 21 years ago
Hallo Perl developers\,
I am adding small patch fixing some problems of ndbm/odbm emulation in DB3:
- Some ndbm/odbm defines are disabled by default. On systems\, where dbm.h and ndbm.h are simple symlinks to db.h\, emualtion needs set-u define.
- ACTION is defined in both DB and PERL (unfortunatelly in different meaning). Carefull permutation of includes can simply workaround the problem.
The patch was not tested with real historic implementations of ndbm/dbm\, but I guess it should work.
Notes:
lib/ndbm.............ok lib/odbm.............FAILED at test 9 Failed 1/64 tests\, 98.44% okay
DB3 is\, by default installed without links to historical names. This patch doesn't solve this - simply if these links are not created\, perl builds without odbm/ndbm emulation. But it's problem of DB3's packager\, not Perl.
ln -s libdb-3.so /usr/lib/libdb.so ln -s libdb-3.so /usr/lib/libdbm.so ln -s libdb-3.so /usr/lib/libndbm.so ln -s libdb-3.so /usr/lib/libdb1.so ln -s db.h /usr/include/ndbm.h ln -s db.h /usr/include/dbm.h
-- Stanislav Brabec
On Wed\, Dec 13\, 2000 at 11:27:18PM +0100\, Stanislav Brabec wrote:
Hallo Perl developers\,
I am adding small patch fixing some problems of ndbm/odbm emulation in DB3:
- Some ndbm/odbm defines are disabled by default. On systems\, where dbm.h and ndbm.h are simple symlinks to db.h\, emualtion needs set-u define.
You mean this define before including dbm.h/ndbm.h?
> +#define DB_DBM_HSEARCH 1
I guess that can be added.
- ACTION is defined in both DB and PERL (unfortunatelly in different meaning). Carefull permutation of includes can simply workaround the problem.
I do not see Perl defining ACTION anywhere. And even if it were\, wouldn't a #undef ACTION before including dbm.h/ndbm.h work?
+++ perl-5.6.0/ext/ODBM_File/ODBM_File.xs Wed Dec 13 20:33:05 2000 @@ -1\,7 +1\,7 @@ -#include "EXTERN.h" -#include "perl.h" -#include "XSUB.h" +#include "config.h" +#undef VOIDUSED
Why this?
The patch was not tested with real historic implementations of ndbm/dbm\, but I guess it should work.
Notes:
lib/ndbm.............ok lib/odbm.............FAILED at test 9 Failed 1/64 tests\, 98.44% okay
DB3 is\, by default installed without links to historical names. This patch doesn't solve this - simply if these links are not created\, perl builds without odbm/ndbm emulation. But it's problem of DB3's packager\, not Perl.
ln -s libdb-3.so /usr/lib/libdb.so ln -s libdb-3.so /usr/lib/libdbm.so ln -s libdb-3.so /usr/lib/libndbm.so ln -s libdb-3.so /usr/lib/libdb1.so ln -s db.h /usr/include/ndbm.h ln -s db.h /usr/include/dbm.h
This information could be added to somewhere in the INSTALL file.
Hallo Perl developers\,
There is my mail with final patch for DB3 support and new README.db3 file. I have sent this mail three weeks ago\, but accidentally replied only to Jarkko Hietaniemi \jhi@​iki\.fi:
-- Stanislav Brabec
Message RFC822:
Date: Wed, 3 Jan 2001 15:32:16 +0100
From: Stanislav Brabec
Well, I have decided to make changes in code as small ass possible and write README with DB emulation description.
The patch becomes as simple as possible (undefine ENTER).
Notes on building DB, ODBM and NDBM interfaces with Berkeley DB3.
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
ODBM emulation seems not to be perfect, but is quite usable. The results on my machine are: lib/odbm.............FAILED at test 9 Failed 1/64 tests, 98.44% okay
This stuff was tested against DB 3.1.17.
On Sat, Dec 30, 2000 at 04:03:24PM -0600, Jarkko Hietaniemi wrote:
On Wed, Dec 13, 2000 at 11:27:18PM +0100, Stanislav Brabec wrote:
+#define DB_DBM_HSEARCH 1
I guess that can be added.
- ACTION is defined in both DB and PERL (unfortunatelly in different meaning). Carefull permutation of includes can simply workaround the problem.
I do not see Perl defining ACTION anywhere. And even if it were, wouldn't a #undef ACTION before including dbm.h/ndbm.h work?
You are true. It was a token before: ENTER. And undef works.
-- Stanislav Brabec
--- perl-5.6.0/ext/NDBM_File/NDBM_File.xs.orig Tue Feb 15 06:42:40 2000 +++ perl-5.6.0/ext/NDBM_File/NDBM_File.xs Wed Jan 3 12:45:23 2001 @@ -1,6 +1,7 @@
+#undef ENTER
typedef struct { --- perl-5.6.0/ext/ODBM_File/ODBM_File.xs.orig Wed Feb 16 07:12:17 2000 +++ perl-5.6.0/ext/ODBM_File/ODBM_File.xs Wed Jan 3 12:47:12 2001 @@ -3,6 +3,7 @@
+# undef ENTER
From: Stanislav Brabec [mailto:sb]
Well\, I have decided to make changes in code as small ass possible and write README with DB emulation description.
The patch becomes as simple as possible (undefine ENTER).
Text for README (maybe README.db3): ----------- Notes on building DB\, ODBM and NDBM interfaces with Berkeley DB3.
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 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ NOT True.
I've written DB_File so that it can be built with any version of Berkeley DB that is currently available\, regardless of whether it has been built with DB1 compatibility mode. This is possible because I have implemented my own DB1 computability mode layer in DB_File.
Paul
_________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
Migrated from rt.perl.org#4906 (status was 'resolved')
Searchable as RT4906$