--- configure.orig	2010-03-25 06:10:36.000000000 +1000
+++ configure	2012-06-27 21:44:02.000000000 +1100
@@ -15762,7 +15762,7 @@
 echo $ECHO_N "checking for Berkeley DB location... $ECHO_C" >&6; }
     if test x"$DB_DIR" = xyes ; then
         for dir in $prefix /usr/local /usr ; do
-            if test -f "$dir/include/db.h" ; then
+            if test -f "$dir/include/${DB_VER}/db.h" ; then
                 DB_DIR=$dir
                 break
             fi
@@ -15773,9 +15773,9 @@
 echo "$as_me: error: cannot find Berkeley DB" >&2;}
    { (exit 1); exit 1; }; }
     else
-        DB_CPPFLAGS="-I$DB_DIR/include"
+        DB_CPPFLAGS="-I$DB_DIR/include/${DB_VER}"
         DB_LDFLAGS="-L$DB_DIR/lib"
-        DB_LIBS="-ldb"
+        DB_LIBS="-l${DB_LIB}"
         { echo "$as_me:$LINENO: result: $DB_DIR" >&5
 echo "${ECHO_T}$DB_DIR" >&6; }
     fi
