--- configure.orig	2012-06-16 05:25:36.000000000 +1100
+++ configure	2013-11-18 02:00:26.831865533 +1100
@@ -14595,7 +14595,7 @@
 $as_echo_n "checking for Berkeley DB location... " >&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
@@ -14604,9 +14604,9 @@
     if test x"$DB_DIR" = xyes ; then
         as_fn_error $? "cannot find Berkeley DB" "$LINENO" 5
     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}"
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DB_DIR" >&5
 $as_echo "$DB_DIR" >&6; }
     fi
