Building inn with Berkley db v 4.1.24
Marco d'Itri
md at Linux.IT
Thu Oct 10 11:50:56 UTC 2002
On Oct 09, Russ Allbery <rra at stanford.edu> wrote:
>I believe some code was committed to CURRENT to make it work with 4.x; I
>don't know how difficult that would be to backport to STABLE.
This is what I use for the debian package, I believe somebody is even
using it:
(Just ignore the first #defines.)
--- inn2-2.3.3+20020922.orig/storage/ovdb/ovdb.c
+++ inn2-2.3.3+20020922/storage/ovdb/ovdb.c
@@ -93,13 +93,16 @@
#else /* USE_BERKELEY_DB */
#include <db.h>
+#define txn_begin __txn_begin_4000
+#define txn_commit __txn_commit_4000
+#define txn_abort __txn_abort_4000
#if DB_VERSION_MAJOR == 2
#if DB_VERSION_MINOR < 6
#error Need BerkeleyDB 2.6.x, 2.7.x, or 3.x
#endif
#else
-#if DB_VERSION_MAJOR != 3
+#if DB_VERSION_MAJOR != 3 && DB_VERSION_MAJOR != 4
#error Need BerkeleyDB 2.6.x, 2.7.x, or 3.x
#endif
#endif
@@ -590,7 +593,7 @@
return TRUE;
}
-#if DB_VERSION_MAJOR == 3
+#if DB_VERSION_MAJOR >= 3
static int upgrade_database(char *name)
{
int ret;
@@ -659,7 +662,7 @@
if(flags & OVDB_RECOVER)
ai_flags |= DB_RECOVER;
-#if DB_VERSION_MAJOR == 2 || DB_VERSION_MINOR < 2
+#if DB_VERSION_MAJOR == 2 || (DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR < 2)
if(ovdb_conf.txn_nosync)
ai_flags |= DB_TXN_NOSYNC;
#endif
@@ -697,12 +700,12 @@
OVDBenv->set_errcall(OVDBenv, OVDBerror);
OVDBenv->set_cachesize(OVDBenv, 0, ovdb_conf.cachesize, 1);
-#if DB_VERSION_MINOR >= 2
+#if (DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR >= 2) || DB_VERSION_MAJOR == 4
if(ovdb_conf.txn_nosync)
OVDBenv->set_flags(OVDBenv, DB_TXN_NOSYNC, 1);
#endif
-#if DB_VERSION_MINOR == 0
+#if DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR == 0
if(ret = OVDBenv->open(OVDBenv, ovdb_conf.home, NULL, ai_flags, 0666)) {
#else
if(ret = OVDBenv->open(OVDBenv, ovdb_conf.home, ai_flags, 0666)) {
--
ciao,
Marco
More information about the inn-workers
mailing list