From 2ccadcbe7c7555495b9710d1a6a12ebc5e86adae Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 18 Mar 2003 05:15:05 +0000 Subject: [PATCH] * Applied a patch sent in by Clint Adams to handle building on Debian's unstable with Berkeley DB 4.1, compiled with the --with-db-uniquename when errno is a macro (as in glibc 2.3.1). --- citadel/ChangeLog | 6 +++++- citadel/acinclude.m4 | 26 ++++++++++++++++++++++++++ citadel/configure.ac | 13 +++++++++---- citadel/database_sleepycat.c | 6 +++--- citadel/docs/citadel.html | 6 ++++++ citadel/whobbs.c | 1 + 6 files changed, 50 insertions(+), 8 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 7dca54f8e..66a2f786a 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,9 @@ $Log$ + Revision 605.22 2003/03/18 05:15:05 ajc + * Applied a patch sent in by Clint Adams to handle + building on Debian's unstable with Berkeley DB 4.1, compiled with + the --with-db-uniquename when errno is a macro (as in glibc 2.3.1). + Revision 605.21 2003/03/17 11:56:35 error * Fix oto in alternate_semantics - it actually marks messages read now. @@ -4569,4 +4574,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/acinclude.m4 b/citadel/acinclude.m4 index ae541a64b..ad9663b49 100644 --- a/citadel/acinclude.m4 +++ b/citadel/acinclude.m4 @@ -20,3 +20,29 @@ if test "$ac_cv_member_struct_tm_tm_gmtoff" != yes; then fi fi ])# CIT_STRUCT_TM + +AC_DEFUN([AC_CHECK_DB],[ +for lib in $1 +do + AS_VAR_PUSHDEF([ac_tr_db], [ac_cv_db_lib_${lib}])dnl + bogo_saved_LIBS="$LIBS" + LIBS="$LIBS -l$lib" + AC_CACHE_CHECK([for db_create in -l${lib}], ac_tr_db, + [AC_TRY_LINK([#include ], [int foo=db_create((void *)0, (void *) 0, +0 )], + [AS_VAR_SET(ac_tr_db, yes)], + [AS_VAR_SET(ac_tr_db, no)]) + ]) + AS_IF([test AS_VAR_GET(ac_tr_db) = yes], + [$2 + db=yes], + [LIBS="$bogo_saved_LIBS" + db=no]) + AS_VAR_POPDEF([ac_tr_db])dnl +test "$db" = "yes" && break +done +if test "$db" = "no"; then +$3 +fi +])# AC_CHECK_DB + diff --git a/citadel/configure.ac b/citadel/configure.ac index be9985a6b..a4ef11f4e 100644 --- a/citadel/configure.ac +++ b/citadel/configure.ac @@ -341,10 +341,15 @@ if test "x$with_db" != xno -a "x$with_gdbm" != xyes; then dblib="db3" fi - AC_SEARCH_LIBS(db_env_create, [$dblib db db4 db3], [ - DATABASE=database_sleepycat.c - with_gdbm=no - ]) + + AC_CHECK_DB([db db-4.1 db-4 db4 db-3.3 db-3.2 db-3.1 db-3 db3], + [ + DATABASE=database_sleepycat.c + with_gdbm=no + ], + AC_MSG_ERROR([[Can not locate a suitable Berkeley DB + library. Use --with-db=PATH to specify + the path]])) fi diff --git a/citadel/database_sleepycat.c b/citadel/database_sleepycat.c index df38f880d..a0f132016 100644 --- a/citadel/database_sleepycat.c +++ b/citadel/database_sleepycat.c @@ -71,7 +71,7 @@ static pthread_key_t tsdkey; /* just a little helper function */ static void txabort(DB_TXN *tid) { - int ret = txn_abort(tid); + int ret = tid->abort(tid); if (ret) { lprintf(1, "cdb_*: txn_abort: %s\n", db_strerror(ret)); @@ -81,7 +81,7 @@ static void txabort(DB_TXN *tid) { /* this one is even more helpful than the last. */ static void txcommit(DB_TXN *tid) { - int ret = txn_commit(tid, 0); + int ret = tid->commit(tid, 0); if (ret) { lprintf(1, "cdb_*: txn_commit: %s\n", db_strerror(ret)); @@ -91,7 +91,7 @@ static void txcommit(DB_TXN *tid) { /* are you sensing a pattern yet? */ static void txbegin(DB_TXN **tid) { - int ret = txn_begin(dbenv, NULL, tid, 0); + int ret = dbenv->txn_begin(dbenv, NULL, tid, 0); if (ret) { lprintf(1, "cdb_*: txn_begin: %s\n", db_strerror(ret)); diff --git a/citadel/docs/citadel.html b/citadel/docs/citadel.html index babd1dc8e..9dcb16362 100644 --- a/citadel/docs/citadel.html +++ b/citadel/docs/citadel.html @@ -18,6 +18,12 @@ + + + + diff --git a/citadel/whobbs.c b/citadel/whobbs.c index 917189a2b..1ccd5a6b4 100644 --- a/citadel/whobbs.c +++ b/citadel/whobbs.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "citadel.h" #include "citadel_ipc.h" #include "tools.h" -- 2.39.2
Clint Adams
+
portability enhancements
+
Steven M. Bellovin