Sophie

Sophie

distrib > Mandriva > 2008.0 > x86_64 > by-pkgid > b97b431312a701e433ad0279d91657e5 > files > 6

ocaml-3.10.0-4mdv2008.0.src.rpm

--- ocaml-3.09.2/configure.orig	2006-12-29 12:39:21.000000000 +0000
+++ ocaml-3.09.2/configure	2006-12-29 12:53:44.000000000 +0000
@@ -1241,8 +1241,15 @@
 dbm_include="not found"
 dbm_link="not found"
 use_gdbm_ndbm=no
+use_bdb_ndbm=no
 
-for dir in /usr/include /usr/include/db1 /usr/include/gdbm; do
+for dir in /usr/include /usr/include/db4 /usr/include/gdbm; do
+  if test -f $dir/db.h; then
+    dbm_include="$dir -DDB_DBM_HSEARCH"
+    dbm_link="-ldb"
+    use_bdb_ndbm=yes
+    break
+  fi
   if test -f $dir/ndbm.h; then
     dbm_include=$dir
     if sh ./hasgot dbm_open; then
@@ -1281,6 +1288,9 @@
   if test "$use_gdbm_ndbm" = "yes"; then
     echo "#define DBM_USES_GDBM_NDBM" >> s.h
   fi
+  if test "$use_bdb_ndbm" = "yes"; then
+    echo "#define DBM_USES_BDB_NDBM" >> s.h
+  fi
   otherlibraries="$otherlibraries dbm"
 fi
 
--- ocaml-3.09.2/otherlibs/dbm/cldbm.c.orig	2006-12-29 12:55:51.000000000 +0000
+++ ocaml-3.09.2/otherlibs/dbm/cldbm.c	2006-12-29 12:59:54.000000000 +0000
@@ -21,8 +21,10 @@
 #include <fail.h>
 #include <callback.h>
 
-#ifdef DBM_USES_GDBM_NDBM
+#if defined(DBM_USES_GDBM_NDBM)
 #include <gdbm-ndbm.h>
+#elif defined(DBM_USES_BDB_NDBM)
+#include <db.h>
 #else
 #include <ndbm.h>
 #endif