$Log$
+ Revision 605.22 2003/03/18 05:15:05 ajc
+ * Applied a patch sent in by Clint Adams <schizo@debian.org> 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 <G>oto in alternate_semantics - it actually marks messages read now.
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
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 <db.h>], [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
+
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
/* 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));
/* 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));
/* 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));
<table cellpadding="2" cellspacing="2" border="0" align="center">
<tbody>
+ <tr>
+ <td valign="top">Clint Adams<br>
+ </td>
+ <td valign="top"><i>portability enhancements<br>
+ </i></td>
+ </tr>
<tr>
<td valign="top">Steven M. Bellovin<br>
</td>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
+#include <errno.h>
#include "citadel.h"
#include "citadel_ipc.h"
#include "tools.h"