[PATCH] Fix check for BerkleyDB when db_create is macro

Petr Mladek pmladek at suse.cz
Thu Jan 6 11:47:15 PST 2011


It seems more safe to check for dbopen; it has just one
other variant in db-3, see
http://lists.debian.org/debian-devel/2001/04/msg01770.html
---
 configure.in |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/configure.in b/configure.in
index 266f7e3..409c756 100644
--- a/configure.in
+++ b/configure.in
@@ -4312,12 +4312,16 @@ int main(int argc, char **argv) {
        else return 1;
 }
     ], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([no. you need at least db 4.1])])
-    save_LIBS="$LIBS"
+    DB_LIB=
     for dbver in '' -5.1 5.1 -5.0 5.0 -5 5 -4.8 4.8 -4.7 4.7 -4 4; do
-        AC_CHECK_LIB(db$dbver, db_create, [ DB_LIB="db$dbver"; DB_CPPLIB="db_cxx$dbver"; LIBS="-ldb$dbver $LIBS"; break ])
+        AC_CHECK_LIB(db$dbver, dbopen, [ DB_LIB="db$dbver"; DB_CPPLIB="db_cxx$dbver"; break; ] ,
+            AC_CHECK_LIB(db$dbver, __db185_open, [ DB_LIB="db$dbver"; DB_CPPLIB="db_cxx$dbver"; break; ]
+            )
+        )
     done
-    AC_CHECK_FUNC(db_create, [], [ AC_MSG_ERROR([db not installed or functional]) ])
-    LIBS="$save_LIBS"
+    if test -z "$DB_LIB" ; then 
+        AC_MSG_ERROR([db not installed or functional])
+    fi
     SCPDEFS="$SCPDEFS -DSYSTEM_DB"
 else
     AC_MSG_RESULT([internal])
-- 
1.7.3.4


--=-nZcgtf5LqDlS4Kgi/FzR--



More information about the LibreOffice mailing list