* Applied a patch sent in by Clint Adams <schizo@debian.org> to handle
authorArt Cancro <ajc@citadel.org>
Tue, 18 Mar 2003 05:15:05 +0000 (05:15 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 18 Mar 2003 05:15:05 +0000 (05:15 +0000)
  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
citadel/acinclude.m4
citadel/configure.ac
citadel/database_sleepycat.c
citadel/docs/citadel.html
citadel/whobbs.c

index 7dca54f8ed96ffae31d64139cbc7ad8ade1bc6c3..66a2f786ac9f47958cfb4f8fc9f47d319b389cee 100644 (file)
@@ -1,4 +1,9 @@
  $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.
 
@@ -4569,4 +4574,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
-
index ae541a64b1242f0f47ea4d3b10a15f4e3496660c..ad9663b49120794bfa85f120d0f001929d2ab264 100644 (file)
@@ -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 <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
+
index be9985a6b30a86440bfb26ec9776a707d4509c65..a4ef11f4e07334c86578ae23213ec265150ba1ac 100644 (file)
@@ -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
 
index df38f880d9a4665f4aff1fea391bdf6b5d5f69e6..a0f13201664a2440debe465d7a48ebec21c653ee 100644 (file)
@@ -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));
index babd1dc8e03b711cfed1e5aeebf7d07c0ae4ecc0..9dcb16362ad62d3ea66a65f56592923c6ea653c1 100644 (file)
                            
 <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>
index 917189a2b2bc410fe0f5064e373658403af8fb65..1ccd5a6b4e09e8f9a34d29d997078975aaf187c4 100644 (file)
@@ -10,6 +10,7 @@
 #include <unistd.h>
 #include <stdio.h>
 #include <string.h>
+#include <errno.h>
 #include "citadel.h"
 #include "citadel_ipc.h"
 #include "tools.h"