summaryrefslogtreecommitdiff
blob: 5ff920a6de909126b87a7408a476076389bf55f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
diff -NurdB libgda-1.2.3/configure.in libgda-1.2.3-patched/configure.in
--- libgda-1.2.3/configure.in	2005-10-27 04:18:24.000000000 -0500
+++ libgda-1.2.3-patched/configure.in	2006-11-20 16:51:29.000000000 -0500
@@ -831,6 +831,15 @@
 		MDB_CFLAGS=-I${mdbdir}/include
 		MDB_LIBS="-L${mdbdir}/lib -lmdb -lmdbsql"
 		AC_DEFINE(HAVE_MDB, 1, [Have MDB])
+
+		AC_MSG_CHECKING(for MDB Tools version)
+		saved_CFLAGS="$CFLAGS"
+		CFLAGS="$LIBGDA_CFLAGS $MDB_CFLAGS"
+		AC_TRY_COMPILE([#include <mdbtools.h>],
+			[MdbHandle *handle = mdb_open ("dummyfile");],
+			AC_DEFINE(HAVE_MDB_05, 1, [Have mdbtools 0.5 API]) AC_MSG_RESULT([Using 0.5 API]),
+			AC_MSG_RESULT([Using 0.6 API]))
+		CFLAGS="$saved_CFLAGS"
 	fi
 fi
 
diff -NurdB libgda-1.2.3/providers/mdb/gda-mdb-provider.c libgda-1.2.3-patched/providers/mdb/gda-mdb-provider.c
--- libgda-1.2.3/providers/mdb/gda-mdb-provider.c	2004-12-28 08:26:11.000000000 -0500
+++ libgda-1.2.3-patched/providers/mdb/gda-mdb-provider.c	2006-11-20 15:56:25.000000000 -0500
@@ -209,7 +209,11 @@
 	mdb_cnc = g_new0 (GdaMdbConnection, 1);
 	mdb_cnc->cnc = cnc;
 	mdb_cnc->server_version = NULL;
+#ifdef HAVE_MDB_05
+	mdb_cnc->mdb = mdb_open (filename);
+#else
 	mdb_cnc->mdb = mdb_open (filename, MDB_WRITABLE);
+#endif
 	if (!mdb_cnc->mdb) {
 		gda_connection_add_error_string (cnc, _("Could not open file %s"), filename);
 		g_free (mdb_cnc);