Berkely DB-4 patch



hello,

here an attachment that checks for the berkeley db headers more accurate
e.g. not only searching in db3/db.h, also in other directories like in
the main include dir where berkeley db installs the headerfile by
default. addational this patch got enchanced to use the db-4 headers and
libraries too because they are still backwardscompatible.

apply to gconf cvs head from today.

-- 
Name....: Ali Akcaagac
Status..: Student Of Computer & Economic Science
E-Mail..: mailto:ali akcaagac stud fh-wilhelmshaven de
WWW.....: http://www.fh-wilhelmshaven.de/~akcaagaa
--- gconf/configure.in.orig	2002-04-30 12:56:02.000000000 +0200
+++ gconf/configure.in	2002-05-02 09:43:55.000000000 +0200
@@ -192,72 +192,74 @@
 
 
 AC_ARG_ENABLE(bdbbackend, Enable BDB backend,,enable_bdbbackend=no)
-AC_ARG_WITH(db3-includes, [  --with-db3-includes=PREFIX     Location of DB3 includes.],
-            with_db3_includes="$withval", with_db3_includes="/usr/include")
-AC_ARG_WITH(db3-libs, [  --with-db3-libs=PREFIX     Location of DB3 libs.],
-            with_db3_libs="$withval", with_db3_libs="/usr/lib")
+AC_ARG_WITH(db-includes, [  --with-db-includes=PREFIX     Location of DB includes.],
+            with_db_includes="$withval", with_db_includes="/usr/include")
+AC_ARG_WITH(db-libs, [  --with-db-libs=PREFIX     Location of DB libs.],
+            with_db_libs="$withval", with_db_libs="/usr/lib")
 
 BDB_LIBS=
 BDB_CFLAGS=
 
 if test "x$enable_bdbbackend" = "xyes"; then
-    have_db3_includes="no"
-    if test "x${with_db3_includes}" != "xno"; then
+    have_db_includes="no"
+    if test "x${with_db_includes}" != "xno"; then
         CPPFLAGS_save="$CPPFLAGS"
 	
-        AC_MSG_CHECKING(for DB3 includes in $with_db3_includes)
+        AC_MSG_CHECKING(for DB includes in $with_db_includes)
         AC_MSG_RESULT("")
 	
-        CPPFLAGS="$CPPFLAGS -I$with_db3_includes"
-        AC_CHECK_HEADERS(db3/db.h, [ db3_includes="yes" ])
+        CPPFLAGS="$CPPFLAGS -I$with_db_includes"
+        AC_CHECK_HEADERS(db4/db.h, [ db_includes="yes" ])
+        AC_CHECK_HEADERS(db3/db.h, [ db_includes="yes" ])
+        AC_CHECK_HEADERS(db.h, [ db_includes="yes" ])
         CPPFLAGS="$CPPFLAGS_save"
 	
-        if test "x{$db3_includes}" != "xno" -a "x{$db3_includes}" != "x" ; then
-                have_db3_includes="yes"
-                BDB_CFLAGS="-I$with_db3_includes"
+        if test "x{$db_includes}" != "xno" -a "x{$db_includes}" != "x" ; then
+                have_db_includes="yes"
+                BDB_CFLAGS="-I$with_db_includes"
         fi
     else
-        AC_MSG_CHECKING(for DB3 includes)
+        AC_MSG_CHECKING(for DB includes)
         AC_MSG_RESULT(no)
     fi
 
-    have_db3_libs="no"
-    if test "x${with_db3_libs}" != "xno" -a "x${have_db3_includes}" != "xno"; then
+    have_db_libs="no"
+    if test "x${with_db_libs}" != "xno" -a "x${have_db_includes}" != "xno"; then
 	CFLAGS_save="$CFLAGS"
 	LIBS_save="$LDFLAGS"
 	
-	AC_CACHE_CHECK([for DB3 libraries], db3_libs,
+	AC_CACHE_CHECK([for DB libraries], db_libs,
 	[
-	    for db3libs in "-ldb-3.3" "-ldb-3.2" "-ldb-3.1" "-ldb-3"; do
-		if test "x${with_db3_libs}" != "x"; then
-			LIBS="$LIBS -L$with_db3_libs $db3libs"
+	    for dblibs in "-ldb-4" "-ldb-3.3" "-ldb-3.2" "-ldb-3.1" "-ldb-3" "-ldb"; do
+		if test "x${with_db_libs}" != "x"; then
+			LIBS="$LIBS -L$with_db_libs $dblibs"
 		else
-			LIBS="$LIBS $db3libs"
+			LIBS="$LIBS $dblibs"
 		fi
 		
-		AC_TRY_LINK_FUNC(db_env_create, db3_libs="yes", db3_libs="no")
+		AC_TRY_LINK_FUNC(db_env_create, db_libs="yes", db_libs="no")
 		CFLAGS="$CFLAGS_save"
 		LIBS="$LIBS_save"
 
-		if test "$db3_libs" = "yes"; then
+		if test "$db_libs" = "yes"; then
 			break
 		fi
 	    done
 	])
-	if test "x${db3_libs}" != "xno"; then
-		have_db3_libs="yes"
-		BDB_LIBS="-L$with_db3_libs $db3libs"
+	if test "x${db_libs}" != "xno"; then
+		have_db_libs="yes"
+		BDB_LIBS="-L$with_db_libs $dblibs"
 	else
 		BDB_LIBS=""
 	fi
    else
-	AC_MSG_CHECKING(for DB3 libraries)
+	AC_MSG_CHECKING(for DB libraries)
 	AC_MSG_RESULT(no)
    fi
 fi
 
 if test "x$BDB_LIBS" = x; then
-  AC_MSG_WARN(No db3 library found or bdb not enabled. Not building bdb backend.)
+  AC_MSG_WARN(No db library found or bdb not enabled. Not building bdb backend.)
 fi
 
 AM_CONDITIONAL(BDB, test -n "$BDB_LIBS")


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]