<<< Date Index >>>     <<< Thread Index >>>

Fix for autoconf BDB Check



Hi,

I could not configure the current tip (changeset f4b2c6eba5fd) of
<URL:http://dev.mutt.org/hg/mutt>, because configure did not find the library
files of my db4 installation. I installed db4 via macports which puts the
header in /opt/local/include/db4, but the library files in /opt/local/lib
(without the trailing "db4").

I had to apply the attached patch to configure.ac in order to successfully
configure mutt with "--with-bdb=/opt/local/ --without-qdbm --without-gdbm".

Regards

Christoph


-- 
FH Worms - University of Applied Sciences
Fachbereich Informatik / Telekommunikation
Erenburgerstr. 19, 67549 Worms, Germany
diff -r 62ac8876d666 -r 3a1feec1fe26 configure.ac
--- a/configure.ac      Sun Jul 15 11:22:04 2007 +0200
+++ b/configure.ac      Sun Jul 15 13:00:02 2007 +0200
@@ -874,25 +874,27 @@ AC_ARG_ENABLE(hcache, AC_HELP_STRING([--
             for v in / $BDB_VERSIONS; do
                 if test -r "$d/include/$v/db.h"; then
                     BDB_INCLUDE_DIR="$d/include/$v"
-                    if test -d "$d/lib/$v"; then
-                        BDB_LIB_DIR="$d/lib/$v"
-                        for l in `echo $BDB_VERSIONS`; do
-                            CPPFLAGS="$OLDCPPFLAGS -I$BDB_INCLUDE_DIR"
-                            LIBS="$OLDLIBS -L$BDB_LIB_DIR -l$l"
-                            AC_TRY_LINK([
-                                #include <stdlib.h>
-                                #include <db.h>
-                            ],[
-                                DB *db = NULL;
-                                db->open(db,NULL,NULL,NULL,0,0,0);
-                            ],[
-                                ac_cv_dbcreate=yes
-                                BDB_LIB="$l"
-                                break
-                            ])
-                        done
-                        test x$ac_cv_dbcreate = xyes && break
-                    fi
+                    for w in "$v" ""; do
+                      if test -d "$d/lib/$w"; then
+                          BDB_LIB_DIR="$d/lib/$v"
+                          for l in `echo $BDB_VERSIONS`; do
+                              CPPFLAGS="$OLDCPPFLAGS -I$BDB_INCLUDE_DIR"
+                              LIBS="$OLDLIBS -L$BDB_LIB_DIR -l$l"
+                              AC_TRY_LINK([
+                                  #include <stdlib.h>
+                                  #include <db.h>
+                              ],[
+                                  DB *db = NULL;
+                                  db->open(db,NULL,NULL,NULL,0,0,0);
+                              ],[
+                                  ac_cv_dbcreate=yes
+                                  BDB_LIB="$l"
+                                  break 
+                              ])
+                          done
+                          test x$ac_cv_dbcreate = xyes && break 2
+                      fi
+                  done
                 fi
             done
             test x$BDB_LIB != x && break