$Log$
+ Revision 590.3 2001/12/13 22:29:57 nbryant
+ make it compile with Berkeley DB 4.0.x
+
Revision 590.2 2001/12/11 21:31:07 nbryant
- test for -ldb3 before -ldb
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
+
test "$db_dir" && CPPFLAGS="$CPPFLAGS -I$db_dir/include"
-AC_CHECK_HEADERS(curses.h dl.h fcntl.h limits.h termios.h sys/ioctl.h sys/select.h sys/time.h syslog.h unistd.h utmp.h utmpx.h paths.h db3/db.h)
+
+AC_CHECK_HEADERS(curses.h dl.h fcntl.h limits.h termios.h sys/ioctl.h sys/select.h sys/time.h syslog.h unistd.h utmp.h utmpx.h paths.h db.h db3/db.h)
AC_CHECK_HEADER(resolv.h, [SMTP=modules/libsmtp.la; DOMAIN=domain.c])
AC_SUBST(SMTP)
#include <sys/stat.h>
#include <dirent.h>
-#ifdef HAVE_DB3_DB_H
+#ifdef HAVE_DB_H
+#include <db.h>
+#elif defined(HAVE_DB3_DB_H)
#include <db3/db.h>
#else
-#include <db.h>
+#error Neither <db.h> nor <db3/db.h> was found by configure. Install db3-devel.
#endif
#include <pthread.h>
/* Get the list of names. */
#if DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR < 3
if ((ret = log_archive(dbenv, &list, flags, NULL)) != 0) {
+#elif DB_VERSION_MAJOR >= 4
+ if ((ret = dbenv->log_archive(dbenv, &list, flags)) != 0) {
#else
if ((ret = log_archive(dbenv, &list, flags)) != 0) {
#endif
int ret;
static time_t last_cull = 0L;
+#if DB_VERSION_MAJOR >= 4
+ ret = dbenv->txn_checkpoint(dbenv,
+#else
ret = txn_checkpoint(dbenv,
+#endif
MAX_CHECKPOINT_KBYTES,
MAX_CHECKPOINT_MINUTES,
0);
cdb_free_tsd();
+#if DB_VERSION_MAJOR >= 4
+ if ((ret = dbenv->txn_checkpoint(dbenv, 0, 0, 0))) {
+#else
if ((ret = txn_checkpoint(dbenv, 0, 0, 0))) {
+#endif
lprintf(1, "cdb_*: txn_checkpoint: %s\n", db_strerror(ret));
abort();
}