--- dbm.m4	Sun Feb 22 22:04:18 2004
+++ ../../../../subversion-1.0.0/apr-util/build/dbm.m4	Mon Feb 23 20:09:47 2004
@@ -383,6 +383,25 @@
   fi
 ])
 
+dnl
+dnl APU_CHECK_DB42: is DB4.2 present?
+dnl
+dnl if present: sets apu_db_header, apu_db_lib, and apu_db_version
+dnl
+AC_DEFUN(APU_CHECK_DB42, [
+  places=$1
+  if test -z "$places"; then
+    places="std /usr/local/BerkeleyDB.4.2"
+  fi
+  APU_CHECK_BERKELEY_DB("4", "2", "-1",
+    "$places",
+    "db4/db.h db.h",
+    "db-4.2 db4 db"
+  )
+  if test "$apu_have_db" = "1"; then
+    apu_db_version=4
+  fi
+])
 
 AC_DEFUN(APU_CHECK_DB, [
   requested=$1
@@ -431,6 +450,12 @@
       AC_MSG_ERROR(Berkeley db4 not found)
     fi
     ;;
+  db42)
+    APU_CHECK_DB42("$check_places")
+    if test "$apu_db_version" != "4"; then
+      AC_MSG_ERROR(Berkeley db4 not found)
+    fi
+    ;;
   default)
     APU_CHECK_DB_ALL("$check_places")
     ;;
@@ -442,18 +467,21 @@
 dnl
 AC_DEFUN(APU_CHECK_DB_ALL, [
   all_places=$1
-  
-  APU_CHECK_DB41("$all_places")
-  if test "$apu_db_version" != "4"; then
-    APU_CHECK_DB4("$all_places")
+ 
+  APU_CHECK_DB42("$all_places")
+  if test "$apu_db_version" != "4"; then 
+    APU_CHECK_DB41("$all_places")
     if test "$apu_db_version" != "4"; then
-      APU_CHECK_DB3("$all_places")
-      if test "$apu_db_version" != "3"; then
-        APU_CHECK_DB2("$all_places")
-        if test "$apu_db_version" != "2"; then
-          APU_CHECK_DB1("$all_places")
-          if test "$apu_db_version" != "1"; then
-            APU_CHECK_DB185("$all_places")
+      APU_CHECK_DB4("$all_places")
+      if test "$apu_db_version" != "4"; then
+        APU_CHECK_DB3("$all_places")
+        if test "$apu_db_version" != "3"; then
+          APU_CHECK_DB2("$all_places")
+          if test "$apu_db_version" != "2"; then
+            APU_CHECK_DB1("$all_places")
+            if test "$apu_db_version" != "1"; then
+              APU_CHECK_DB185("$all_places")
+            fi
           fi
         fi
       fi
