Fix up QDBM autoconf test for arguments and includes in subdirectories
authorBrendan Cully <brendan@kublai.com>
Fri, 6 Apr 2007 02:22:00 +0000 (19:22 -0700)
committerBrendan Cully <brendan@kublai.com>
Fri, 6 Apr 2007 02:22:00 +0000 (19:22 -0700)
ChangeLog
configure.ac
hcache.c

index 5a27e34da8872218d9105099b9b1bfa624982b1f..67ec8a5a5766ff254f16876239d88f67b8d7c0bb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,14 @@
-2007-04-05 17:07 -0700  Brendan Cully  <brendan@kublai.com>  (26b19fc9b78c)
+2007-04-05 18:52 -0700  Brendan Cully  <brendan@kublai.com>  (94d3441e86d0)
+
+       * imap/message.c: Fix logic error introduced in [efbcef81ac49]
+
+       * hcache.c: Fix typo in 26b19fc9b78c
+
+       * imap/imap_private.h, imap/message.c, imap/util.c: IMAP header cache
+       API improvements.
+
+       * imap/imap.c, imap/imap_private.h, imap/message.c, imap/util.c:
+       Keep hcache pointer in idata, open and close with mailbox
 
        * hcache.c: Do not cache some unsafe header fields.
 
index 7e59d4a87c330440b725880b1d4b4db2bc86ff62..604815479233b2bcf138b8727650ff59590536bb 100644 (file)
@@ -831,20 +831,28 @@ AC_ARG_ENABLE(hcache, AC_HELP_STRING([--enable-hcache], [Enable header caching])
 
     need_md5="yes"
 
-    ac_prefer_qdbm=yes
-    AC_ARG_WITH(qdbm, AC_HELP_STRING([--without-qdbm], [Don't use qdbm even if it is available]),
-        ac_prefer_qdbm=$withval)
-    if test x$ac_prefer_qdbm != xno; then
-        CPPFLAGS="$OLDCPPFLAGS"
-        LIBS="$OLDLIBS -lqdbm";
-        AC_CACHE_CHECK(for vlopen, ac_cv_vlopen,[
-            ac_cv_vlopen=no
-            AC_TRY_LINK([#include <villa.h>],[vlopen(0,0,0);],[ac_cv_vlopen=yes])
-        ])
+    use_qdbm=no
+    AC_ARG_WITH(qdbm, AC_HELP_STRING([--without-qdbm], [Don't use qdbm even if it is available]))
+    if test "$with_qdbm" != "no"
+    then
+      if test -n "$with_qdbm" -a "$with_qdbm" != "yes"
+      then
+        CPPFLAGS="$CPPFLAGS -I$with_qdbm/include"
+        LDFLAGS="$LDFLAGS -L$with_qdbm/lib"
+      fi
+
+      saved_LIBS="$LIBS"
+      AC_CHECK_HEADERS(villa.h qdbm/villa.h)
+      AC_CHECK_LIB(qdbm, vlopen, [MUTTLIBS="$MUTTLIBS -lqdbm"; use_qdbm=yes])
+      LIBS="$saved_LIBS"
+      if test -n "$with_qdbm" -a "$use_qdbm" != yes
+      then
+        AC_MSG_ERROR([QDBM could not be used. Check config.log for details.])
+      fi
     fi
 
     AC_ARG_WITH(gdbm, AC_HELP_STRING([--without-gdbm], [Don't use gdbm even if it is available]))
-    if test x$with_gdbm != xno -a x$ac_cv_vlopen != xyes; then
+    if test x$with_gdbm != xno -a $use_qdbm != yes; then
         if test "$with_gdbm" != "yes"
         then
           CPPFLAGS="$CPPFLAGS -I$with_gdbm/include"
@@ -861,7 +869,7 @@ AC_ARG_ENABLE(hcache, AC_HELP_STRING([--enable-hcache], [Enable header caching])
     ac_bdb_prefix=yes
     AC_ARG_WITH(bdb, AC_HELP_STRING([--with-bdb[=DIR]], [Use BerkeleyDB4 if gdbm is not available]),
         ac_bdb_prefix=$withval)
-    if test x$ac_bdb_prefix != xno -a x$ac_cv_gdbmopen != xyes -a x$ac_cv_vlopen != xyes; then
+    if test x$ac_bdb_prefix != xno -a x$ac_cv_gdbmopen != xyes -a $use_qdbm != yes; then
         test x$ac_bdb_prefix = xyes && ac_bdb_prefix="$mutt_cv_prefix /opt/csw/bdb4 /opt /usr/local /usr"
         for d in $ac_bdb_prefix; do
             bdbpfx="$bdbpfx $d"
@@ -909,9 +917,7 @@ AC_ARG_ENABLE(hcache, AC_HELP_STRING([--enable-hcache], [Enable header caching])
         fi
     fi
 
-    if test x$ac_cv_vlopen = xyes; then
-        CPPFLAGS="$OLDCPPFLAGS"
-        LIBS="$OLDLIBS -lqdbm";
+    if test "$use_qdbm" = yes; then
         AC_DEFINE(HAVE_QDBM, 1, [QDBM Support])
     elif test x$ac_cv_gdbmopen = xyes; then
         CPPFLAGS="$OLDCPPFLAGS"
@@ -920,9 +926,9 @@ AC_ARG_ENABLE(hcache, AC_HELP_STRING([--enable-hcache], [Enable header caching])
     elif test x$ac_cv_dbcreate = xyes; then
         CPPFLAGS="$OLDCPPFLAGS -I$BDB_INCLUDE_DIR"
         LIBS="$OLDLIBS -L$BDB_LIB_DIR -l$BDB_LIB"
-        AC_DEFINE(HAVE_DB4, 1, [Sleepycat DB4 Support])
+        AC_DEFINE(HAVE_DB4, 1, [Berkeley DB4 Support])
     else
-        AC_MSG_ERROR([You need QDBM, GDBM or Sleepycat DB4 for hcache])
+        AC_MSG_ERROR([You need QDBM, GDBM or Berkeley DB4 for hcache])
     fi
 fi])
 dnl -- end cache --
index 7d1ffe4ef90d02f22a6ec21fa663e09cea78f4e8..0ee890ad59f221cc6d0e7b3a231b0e91413a713b 100644 (file)
--- a/hcache.c
+++ b/hcache.c
 #include "config.h"
 #endif                         /* HAVE_CONFIG_H */
 
-#if HAVE_QDBM
+#if HAVE_VILLA_H
 #include <depot.h>
 #include <cabin.h>
 #include <villa.h>
+#elif HAVE_QDBM_VILLA_H
+#include <qdbm/depot.h>
+#include <qdbm/cabin.h>
+#include <qdbm/villa.h>
+#endif
 #elif HAVE_GDBM
 #include <gdbm.h>
 #elif HAVE_DB4