[libgda] Moved BDB and MySQL detection in specific M4 files



commit 4a563432f5b834fa4f49cad5179e6b718a55703d
Author: Vivien Malerba <malerba gnome-db org>
Date:   Sat Oct 2 10:16:31 2010 +0200

    Moved BDB and MySQL detection in specific M4 files

 INSTALL                     |  200 ++++++++++++++++++++++++++------
 configure.ac                |  255 +++--------------------------------------
 m4/.gitignore               |    8 ++
 m4/bdb.m4                   |  269 +++++++++++++++++++++++++++++++++++++++++++
 m4/mdbtools.m4              |   36 ++++--
 m4/mysql.m4                 |  191 ++++++++++++++++++++++++++++++
 providers/Makefile.am       |    5 -
 tests/providers/Makefile.am |    5 -
 8 files changed, 673 insertions(+), 296 deletions(-)
---
diff --git a/INSTALL b/INSTALL
index d3c5b40..7d1c323 100644
--- a/INSTALL
+++ b/INSTALL
@@ -2,18 +2,24 @@ Installation Instructions
 *************************
 
 Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006, 2007 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
-This file is free documentation; the Free Software Foundation gives
-unlimited permission to copy, distribute and modify it.
+   Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.  This file is offered as-is,
+without warranty of any kind.
 
 Basic Installation
 ==================
 
-Briefly, the shell commands `./configure; make; make install' should
+   Briefly, the shell commands `./configure; make; make install' should
 configure, build, and install this package.  The following
 more-detailed instructions are generic; see the `README' file for
-instructions specific to this package.
+instructions specific to this package.  Some packages provide this
+`INSTALL' file but do not implement all of the features documented
+below.  The lack of an optional feature in a given package is not
+necessarily a bug.  More recommendations for GNU packages can be found
+in *note Makefile Conventions: (standards)Makefile Conventions.
 
    The `configure' shell script attempts to guess correct values for
 various system-dependent variables used during compilation.  It uses
@@ -42,7 +48,7 @@ may remove or edit it.
 you want to change it or regenerate `configure' using a newer version
 of `autoconf'.
 
-The simplest way to compile this package is:
+   The simplest way to compile this package is:
 
   1. `cd' to the directory containing the package's source code and type
      `./configure' to configure the package for your system.
@@ -53,12 +59,22 @@ The simplest way to compile this package is:
   2. Type `make' to compile the package.
 
   3. Optionally, type `make check' to run any self-tests that come with
-     the package.
+     the package, generally using the just-built uninstalled binaries.
 
   4. Type `make install' to install the programs and any data files and
-     documentation.
-
-  5. You can remove the program binaries and object files from the
+     documentation.  When installing into a prefix owned by root, it is
+     recommended that the package be configured and built as a regular
+     user, and only the `make install' phase executed with root
+     privileges.
+
+  5. Optionally, type `make installcheck' to repeat any self-tests, but
+     this time using the binaries in their final installed location.
+     This target does not install anything.  Running this target as a
+     regular user, particularly if the prior `make install' required
+     root privileges, verifies that the installation completed
+     correctly.
+
+  6. You can remove the program binaries and object files from the
      source code directory by typing `make clean'.  To also remove the
      files that `configure' created (so you can compile the package for
      a different kind of computer), type `make distclean'.  There is
@@ -67,15 +83,22 @@ The simplest way to compile this package is:
      all sorts of other programs in order to regenerate files that came
      with the distribution.
 
-  6. Often, you can also type `make uninstall' to remove the installed
-     files again.
+  7. Often, you can also type `make uninstall' to remove the installed
+     files again.  In practice, not all packages have tested that
+     uninstallation works correctly, even though it is required by the
+     GNU Coding Standards.
+
+  8. Some packages, particularly those that use Automake, provide `make
+     distcheck', which can by used by developers to test that all other
+     targets like `make install' and `make uninstall' work correctly.
+     This target is generally not run by end users.
 
 Compilers and Options
 =====================
 
-Some systems require unusual options for compilation or linking that the
-`configure' script does not know about.  Run `./configure --help' for
-details on some of the pertinent environment variables.
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  Run `./configure --help'
+for details on some of the pertinent environment variables.
 
    You can give `configure' initial values for configuration parameters
 by setting variables in the command line or in the environment.  Here
@@ -88,25 +111,41 @@ is an example:
 Compiling For Multiple Architectures
 ====================================
 
-You can compile the package for more than one kind of computer at the
+   You can compile the package for more than one kind of computer at the
 same time, by placing the object files for each architecture in their
 own directory.  To do this, you can use GNU `make'.  `cd' to the
 directory where you want the object files and executables to go and run
 the `configure' script.  `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
+source code in the directory that `configure' is in and in `..'.  This
+is known as a "VPATH" build.
 
    With a non-GNU `make', it is safer to compile the package for one
 architecture at a time in the source code directory.  After you have
 installed the package for one architecture, use `make distclean' before
 reconfiguring for another architecture.
 
+   On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor.  Like
+this:
+
+     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CPP="gcc -E" CXXCPP="g++ -E"
+
+   This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
 Installation Names
 ==================
 
-By default, `make install' installs the package's commands under
+   By default, `make install' installs the package's commands under
 `/usr/local/bin', include files under `/usr/local/include', etc.  You
 can specify an installation prefix other than `/usr/local' by giving
-`configure' the option `--prefix=PREFIX'.
+`configure' the option `--prefix=PREFIX', where PREFIX must be an
+absolute file name.
 
    You can specify separate installation prefixes for
 architecture-specific files and architecture-independent files.  If you
@@ -117,16 +156,47 @@ Documentation and other data files still use the regular prefix.
    In addition, if you use an unusual directory layout you can give
 options like `--bindir=DIR' to specify different values for particular
 kinds of files.  Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
+you can set and what kinds of files go in them.  In general, the
+default for these options is expressed in terms of `${prefix}', so that
+specifying just `--prefix' will affect all of the other directory
+specifications that were not explicitly provided.
+
+   The most portable way to affect installation locations is to pass the
+correct locations to `configure'; however, many packages provide one or
+both of the following shortcuts of passing variable assignments to the
+`make install' command line to change installation locations without
+having to reconfigure or recompile.
+
+   The first method involves providing an override variable for each
+affected directory.  For example, `make install
+prefix=/alternate/directory' will choose an alternate location for all
+directory configuration variables that were expressed in terms of
+`${prefix}'.  Any directories that were specified during `configure',
+but not in terms of `${prefix}', must each be overridden at install
+time for the entire installation to be relocated.  The approach of
+makefile variable overrides for each directory variable is required by
+the GNU Coding Standards, and ideally causes no recompilation.
+However, some platforms have known limitations with the semantics of
+shared libraries that end up requiring recompilation when using this
+method, particularly noticeable in packages that use GNU Libtool.
+
+   The second method involves providing the `DESTDIR' variable.  For
+example, `make install DESTDIR=/alternate/directory' will prepend
+`/alternate/directory' before all installation names.  The approach of
+`DESTDIR' overrides is not required by the GNU Coding Standards, and
+does not work on platforms that have drive letters.  On the other hand,
+it does better at avoiding recompilation issues, and works well even
+when some directory options were not specified in terms of `${prefix}'
+at `configure' time.
+
+Optional Features
+=================
 
    If the package supports it, you can cause programs to be installed
 with an extra prefix or suffix on their names by giving `configure' the
 option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
 
-Optional Features
-=================
-
-Some packages pay attention to `--enable-FEATURE' options to
+   Some packages pay attention to `--enable-FEATURE' options to
 `configure', where FEATURE indicates an optional part of the package.
 They may also pay attention to `--with-PACKAGE' options, where PACKAGE
 is something like `gnu-as' or `x' (for the X Window System).  The
@@ -138,14 +208,53 @@ find the X include and library files automatically, but if it doesn't,
 you can use the `configure' options `--x-includes=DIR' and
 `--x-libraries=DIR' to specify their locations.
 
+   Some packages offer the ability to configure how verbose the
+execution of `make' will be.  For these packages, running `./configure
+--enable-silent-rules' sets the default to minimal output, which can be
+overridden with `make V=1'; while running `./configure
+--disable-silent-rules' sets the default to verbose, which can be
+overridden with `make V=0'.
+
+Particular systems
+==================
+
+   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+     ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
+a workaround.  If GNU CC is not installed, it is therefore recommended
+to try
+
+     ./configure CC="cc"
+
+and if that doesn't work, try
+
+     ./configure CC="cc -nodtk"
+
+   On Solaris, don't put `/usr/ucb' early in your `PATH'.  This
+directory contains several dysfunctional programs; working variants of
+these programs are available in `/usr/bin'.  So, if you need `/usr/ucb'
+in your `PATH', put it _after_ `/usr/bin'.
+
+   On Haiku, software installed for all users goes in `/boot/common',
+not `/usr/local'.  It is recommended to use the following options:
+
+     ./configure --prefix=/boot/common
+
 Specifying the System Type
 ==========================
 
-There may be some features `configure' cannot figure out automatically,
-but needs to determine by the type of machine the package will run on.
-Usually, assuming the package is built to be run on the _same_
-architectures, `configure' can figure that out, but if it prints a
-message saying it cannot guess the machine type, give it the
+   There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on.  Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
 `--build=TYPE' option.  TYPE can either be a short name for the system
 type, such as `sun4', or a canonical name which has the form:
 
@@ -153,7 +262,8 @@ type, such as `sun4', or a canonical name which has the form:
 
 where SYSTEM can have one of these forms:
 
-     OS KERNEL-OS
+     OS
+     KERNEL-OS
 
    See the file `config.sub' for the possible values of each field.  If
 `config.sub' isn't included in this package, then this package doesn't
@@ -171,9 +281,9 @@ eventually be run) with `--host=TYPE'.
 Sharing Defaults
 ================
 
-If you want to set default values for `configure' scripts to share, you
-can create a site shell script called `config.site' that gives default
-values for variables like `CC', `cache_file', and `prefix'.
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
 `configure' looks for `PREFIX/share/config.site' if it exists, then
 `PREFIX/etc/config.site' if it exists.  Or, you can set the
 `CONFIG_SITE' environment variable to the location of the site script.
@@ -182,7 +292,7 @@ A warning: not all `configure' scripts look for a site script.
 Defining Variables
 ==================
 
-Variables not defined in a site shell script can be set in the
+   Variables not defined in a site shell script can be set in the
 environment passed to `configure'.  However, some packages may run
 configure again during the build, and the customized values of these
 variables may be lost.  In order to avoid this problem, you should set
@@ -201,11 +311,19 @@ an Autoconf bug.  Until the bug is fixed you can use this workaround:
 `configure' Invocation
 ======================
 
-`configure' recognizes the following options to control how it operates.
+   `configure' recognizes the following options to control how it
+operates.
 
 `--help'
 `-h'
-     Print a summary of the options to `configure', and exit.
+     Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+     Print a summary of the options unique to this package's
+     `configure', and exit.  The `short' variant lists options used
+     only in the top level, while the `recursive' variant lists options
+     also present in any nested packages.
 
 `--version'
 `-V'
@@ -232,6 +350,16 @@ an Autoconf bug.  Until the bug is fixed you can use this workaround:
      Look for the package's source code in directory DIR.  Usually
      `configure' can determine that directory automatically.
 
+`--prefix=DIR'
+     Use DIR as the installation prefix.  *note Installation Names::
+     for more details, including other options available for fine-tuning
+     the installation locations.
+
+`--no-create'
+`-n'
+     Run the configure checks, but stop before creating any output
+     files.
+
 `configure' also accepts some other, not widely useful, options.  Run
 `configure --help' for more details.
 
diff --git a/configure.ac b/configure.ac
index 2806bef..5c53773 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,9 +2,12 @@ m4_define(major, 4)
 m4_define(minor, 2)
 m4_define(micro, 0)
 m4_define([gda_stable],
-	m4_if(m4_eval(minor % 2), [0], [yes], [no])) 
+	m4_if(m4_eval(minor % 2), [0], [yes], [no]))
+AC_CONFIG_MACRO_DIR([m4])
 m4_include(m4/introspection.m4)
 m4_include(m4/mdbtools.m4)
+m4_include(m4/bdb.m4)
+m4_include(m4/mysql.m4)
 
 AC_INIT(GNU Data Access, major.minor.micro, gnome-db-list gnome org, libgda)
 AC_PREREQ(2.59)
@@ -303,7 +306,6 @@ case "$host" in
 *-cygwin*)
     AC_MSG_RESULT([Win32 - cygwin])
     NO_UNDEFINED='-no-undefined'
-    SOPREFIX='cyg'
     LIBTOOL_EXPORT_OPTIONS=$EXPORT_SYM_REGEX
     LIBTOOL_PROV_EXPORT_OPTIONS=$EXPORT_PROV_SYM_REGEX
     LIBTOOL_UI_EXPORT_OPTIONS=$EXPORT_UI_SYM_REGEX
@@ -315,11 +317,10 @@ case "$host" in
     platform_win32=yes
     AC_DEFINE(USING_MINGW)
     NO_UNDEFINED='-no-undefined'
-    SOPREFIX='lib'
     LIBTOOL_EXPORT_OPTIONS=
     LIBTOOL_PROV_EXPORT_OPTIONS=
     LIBTOOL_UI_EXPORT_OPTIONS=
-    linklibext=".dll.a"
+    linklibext=".dll"
     AC_CHECK_TOOL(WINDRES, windres, windres)
     AC_SUBST(WINDRES)
     AC_CHECK_TOOL(DLLTOOL, dlltool, dlltool)
@@ -329,7 +330,6 @@ case "$host" in
     dnl Darwin based distributions (including Mac OS X)
     AC_MSG_RESULT([Mac OS X - carbon])
     platform_carbon=yes
-    SOPREFIX='lib'
     if test "$enable_binreloc" != "no"
     then
 	AC_DEFINE(ENABLE_BINRELOC)
@@ -347,7 +347,6 @@ case "$host" in
     LIBTOOL_UI_EXPORT_OPTIONS=$EXPORT_UI_SYM_REGEX
     AC_DEFINE(HAVE_CARBON)
     LIBGDA_LIBS="$LIBGDA_LIBS -framework Carbon"
-    dnl SO_SUFFIX=dylib
   ;;
 *)
     AC_MSG_RESULT([Unix])
@@ -402,11 +401,10 @@ AC_SUBST(LIBXSLT_LIBS)
 dnl ******************************
 dnl Checks for json-glib
 dnl ******************************
-enable_json=no
 have_json=no
 AC_ARG_ENABLE([json],
 	AS_HELP_STRING([--enable-json], [Enable support for JSON, disabled by default]),
-	[enable_json=yes])
+	[enable_json=yes],[enable_json=no])
 
 if test "x$enable_json" = xyes
 then
@@ -490,227 +488,17 @@ dnl ******************************
 dnl Checks for providers
 dnl ******************************
 
-dnl Test for lib64 architectures
-dnl FIXME: should really check target
-case $host_cpu in
-x86_64* | sparc64* | s390x* | ppc64* | powerpc64* ) lib="lib64";;
-*) lib="lib";;
-esac
+AC_ARG_WITH(libdir-name,
+    AS_HELP_STRING([--with-libdir-name[=@<:@<dir. name>@:>@]],
+                   [Speficy the library name used to locate libraries, relative to the prefix of each install (for example lib64)]),
+                   [lib=$withval],
+		   [lib=""])
 
 dnl Test for Berkeley DB
-try_bdb=true
-AC_ARG_WITH(bdb,
-[  --with-bdb=<directory>	use bdb library in <directory>],[
-if test $withval = no
-then
-	try_bdb=false
-elif test $withval = yes
-then
-	dir="/usr /usr/local"
-else
-	dir=$withval
-fi
-])
-bdbdir=""
-if test $try_bdb = true
-then
-	if test $withval = yes
-	then
-		AC_CHECK_HEADER(db.h, bdb_ok=yes, bdb_ok=no, [])
-		if test $bdb_ok = yes ; then
-		        bdbdir=yes
-		   	BDB_LIB="libdb$linklibext"
-			BDB_LIBS="-ldb"
-		fi
-	else
-		AC_MSG_CHECKING(for Berkeley DB files)
-		for d in $dir
-		do
-			if test $platform_win32 = yes -a -f $d/include/db.h -a -f $d/bin/libdb51.dll
-			then
-				AC_MSG_RESULT(found Berkeley DB in $d)
-				AC_DEFINE(HAVE_BDB, 1, [Have Berkeley DB])
-				bdbdir=$d
-				BDB_CFLAGS="-I${bdbdir}/include"
-				BDB_LIB="$d/bin/libdb51.dll"
-				BDB_LIBS="-L${bdbdir}/bin -ldb51"
-				break
-			fi
-
-			if test $platform_win32 = no -a -f $d/include/db.h -a -f $d/$lib/libdb$linklibext
-			then
-				AC_MSG_RESULT(found Berkeley DB in $d)
-				AC_DEFINE(HAVE_BDB, 1, [Have Berkeley DB])
-				bdbdir=$d
-				BDB_CFLAGS="-I${bdbdir}/include"
-				BDB_LIB="$d/$lib/libdb$linklibext"
-				BDB_LIBS="-L${bdbdir}/${lib} -ldb"
-				break
-			fi
-			if test $platform_win32 = no -a -f $d/include/db.h -a -f $d/lib/libdb$linklibext
-			then
-				AC_MSG_RESULT(found Berkeley DB in $d)
-				AC_DEFINE(HAVE_BDB, 1, [Have Berkeley DB])
-				bdbdir=$d
-				BDB_CFLAGS="-I${bdbdir}/include"
-				BDB_LIB="$d/lib/libdb$linklibext"
-				BDB_LIBS="-L${bdbdir}/lib -ldb"
-				break
-			fi
-			dnl FIXME: check for db1 (non-sleepycat implementation)
-		done
-		if test x$bdbdir = x
-		then
-			AC_MSG_WARN(Berkeley DB backend not used)
-		fi
-	fi
-fi
-
-bdbsqldir=""
-AM_CONDITIONAL(BDB, test x$bdbdir != x)
-if test x$bdbdir != x; then
-	LIBGDA_BDB_INC="#include <libgda/gda-data-model-bdb.h>"
-	LIBGDA_BDB_TYPE="gda_data_model_bdb_get_type"
-
-	if test -f $bdbdir/include/dbsql.h
-	then
-		BDBSQL_CFLAGS="-I${bdbdir}/include"
-		BDBSQL_LIBS="-L${bdbdir}/lib -ldb_sql"
-		BDBSQL_PATH="${bdbdir}/lib"
-		AC_CHECK_LIB(db_sql, sqlite3_table_column_metadata,[bdbsql_api=1], [bdbsql_api=0], $BDBSQL_CFLAGS $BDBSQL_LIBS -pthread -ldl)
-
-		if test $bdbsql_api = 0
-		then
-			BDBSQL_CFLAGS=""
-			BDBSQL_LIBS=""
-			AC_MSG_WARN([Installed BDB Sql was not compiled with the SQLITE_ENABLE_COLUMN_METADATA, BDB Sql provider not compiled])
-		else
-			bdbsqldir="$bdbdir"
-			AC_DEFINE(HAVE_BDBSQL, 1, [Have Berkeley DB SQL])
-		fi
-	fi
-fi
-AM_CONDITIONAL(BDBSQL, test x$bdbsqldir != x)
-AC_SUBST(LIBGDA_BDB_INC)
-AC_SUBST(LIBGDA_BDB_TYPE)
-
-dnl Test for ODBC
-try_odbc=true
-AC_ARG_WITH(odbc,
-[  --with-odbc=<directory>	use ODBC libraries in <directory>],[
-if test $withval = no
-then
-	try_odbc=false
-elif test $withval = yes
-then
-	dir="/usr/local"
-else
-	dir=$withval
-fi
-])
-odbcdir=""
-if test $try_odbc = true
-then
-	AC_MSG_CHECKING(for ODBC files)
-	for d in $dir /usr /usr/local
-	do
-		if test -f $d/$lib/libodbc$linklibext -a -f $d/include/sql.h
-		then
-			AC_MSG_RESULT(found ODBC in $d)
-			odbclib="-lodbc"
-			odbcdir=$d
-			break
-		fi
-		if test -f $d/$lib/libiodbc$linklibext -a -f $d/include/sql.h
-		then
-			AC_MSG_RESULT(found iODBC in $d)
-			odbclib="-liodbc"
-			odbcdir=$d
-			break
-		fi
-		if test -f $d/$lib/w32api/libodbc32.a -a -f $d/include/w32api/sql.h
-		then
-			AC_MSG_RESULT(found ODBC32 in $d)
-			odbclib="-lodbc32"
-			odbcdir=$d
-			break
-		fi
-	done
-	if test x$odbcdir = x
-	then
-		AC_MSG_WARN(ODBC backend not used)
-	else
-		AC_DEFINE(HAVE_ODBC, 1, [Have ODBC])
-		ODBC_CFLAGS="-I${odbcdir}/include"
-		ODBC_LIBS="-L${odbcdir}/lib ${odbclib}"
-	fi
-fi
-
-AM_CONDITIONAL(ODBC, test x$odbcdir != x)
+BDB_CHECK($lib)
 
 dnl Test for MySQL
-mysql_req=auto
-AC_ARG_WITH(mysql,
-[  --with-mysql=<directory>	use mysql backend in <directory>],[
-if test $withval = no
-then
-	mysql_req=none
-elif test $withval = yes
-then
-	mysql_req=none
-	if test $cross_compiling = yes
-	then
-		AC_MSG_WARN(Can't auto determine Mysql installation in cross-compiling environment)
-	else
-		AC_MSG_CHECKING(for MySQL files)
-		AC_PATH_PROGS(MYSQL_CONFIG, mysql_config mysql_config5)
-	fi
-else
-	AC_MSG_CHECKING(for MySQL files in $withval)
-	if test $cross_compiling = yes
-	then
-		mysql_req=$withval	
-	else
-		AC_PATH_PROGS(MYSQL_CONFIG, mysql_config mysql_config5, [], $withval/bin)
-	fi	
-fi
-])
-mysqldir=""
-
-if test $mysql_req = auto
-then
-	AC_MSG_CHECKING(for MySQL files)
-	AC_PATH_PROGS(MYSQL_CONFIG, mysql_config mysql_config5)
-fi
-
-if test x$MYSQL_CONFIG != x
-then
-	mysqldir=yes
-	AC_MSG_RESULT(found mysql)
-	AC_DEFINE(HAVE_MYSQL, 1, [Have MySQL])
-	if test "x$MYSQL_CFLAGS" = "x"; then
-		MYSQL_CFLAGS=`$MYSQL_CONFIG --cflags`
-	fi
-	MYSQL_LIBS=`$MYSQL_CONFIG --libs`
-else
-	if test $cross_compiling = yes
-	then
-		if test $platform_win32 = yes -a -f $mysql_req/$lib/opt/libmysql.lib
-		then
-			mysqldir=$mysql_req
-			
-			mysqllibdir_suffix=/opt
-			AC_MSG_RESULT(found mysql)
-			AC_DEFINE(HAVE_MYSQL, 1, [Have MySQL])
-			MYSQL_CFLAGS="-I${mysqldir}/include${mysqldir_suffix}"
-			MYSQL_LIBS="-L${mysqldir}/${lib}${mysqllibdir_suffix} -lmysql"
-		else
-			AC_MSG_WARN(MySQL backend not used)
-		fi
-	fi
-fi
-AM_CONDITIONAL(MYSQL, test x$mysqldir != x)
-
+MYSQL_CHECK($lib)
 
 dnl Test for mSQL
 try_msql=true
@@ -1642,16 +1430,6 @@ AC_SUBST(LIBGDA_DTDDIR)
 dnl ******************************
 dnl Variables
 dnl ******************************
-AC_SUBST(BDB_LIB)
-AC_SUBST(BDB_LIBS)
-AC_SUBST(BDB_CFLAGS)
-AC_SUBST(BDBSQL_LIBS)
-AC_SUBST(BDBSQL_PATH)
-AC_SUBST(BDBSQL_CFLAGS)
-AC_SUBST(ODBC_LIBS)
-AC_SUBST(ODBC_CFLAGS)
-AC_SUBST(MYSQL_LIBS)
-AC_SUBST(MYSQL_CFLAGS)
 AC_SUBST(MSQL_LIBS)
 AC_SUBST(HAVE_MSQL3)
 AC_SUBST(MSQL_CFLAGS)
@@ -1836,18 +1614,17 @@ echo "   Installation prefix = $prefix"
 echo "   Building GTK+ UI extension: `if test x$have_ui != xno; then echo yes; else echo no; fi`"
 echo "   Building Libxslt extension: `if test x$have_xslt != xno; then echo yes; else echo no; fi`"
 echo "   Compiled providers:"
-echo "      Berkeley DB = `if test x$bdbdir != x; then echo yes; else echo no; fi`"
-echo "      Berkeley DB SQL = `if test x$bdbsqldir = x; then echo no; else echo yes; fi`"
+echo "      Berkeley DB = $bdb_found"
+echo "      Berkeley DB SQL = $bdbsql_found"
 dnl echo "      FireBird = `if test x$firebirddir != x; then echo yes; else echo no; fi`"
 dnl echo "      FreeTDS = `if test x$freetdsdir != x; then echo yes; else echo no; fi`"
 dnl echo "      IBM DB2 = `if test x$ibmdb2dir != x; then echo yes; else echo no; fi`"
 echo "      MDB (MS Access) = $mdbtools_found"
-echo "      MySQL = `if test x$mysqldir != x; then echo yes; else echo no; fi`"
+echo "      MySQL = $mysql_found"
 dnl echo "      mSQL = `if test x$msqldir != x; then echo yes; else echo no; fi`"
 dnl echo "      ODBC = `if test x$odbcdir != x; then echo yes; else echo no; fi`"
 echo "      Oracle = `if test x$oracledir != x; then echo yes; else echo no; fi`"
 echo "      PostgreSQL = `if test x$postgresdir != x; then echo yes; else echo no; fi`"
-echo "      JSON = `if test x$have_json != xyes; then echo no; else echo yes; fi`"
 echo "      SQLite = yes `if test x$have_sqlite = xyes; then echo '(from system installation)'; else echo '(embedded)'; fi`"
 echo "      SQLCipher = `if test x$have_crypto != xyes; then echo no; else echo yes; fi`"
 dnl echo "      Sybase = `if test x$sybasedir != x; then echo yes; else echo no; fi`"
diff --git a/m4/.gitignore b/m4/.gitignore
new file mode 100644
index 0000000..bae0334
--- /dev/null
+++ b/m4/.gitignore
@@ -0,0 +1,8 @@
+gnome-doc-utils.m4
+gtk-doc.m4
+intltool.m4
+libtool.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+lt~obsolete.m4
diff --git a/m4/bdb.m4 b/m4/bdb.m4
new file mode 100644
index 0000000..7cdf663
--- /dev/null
+++ b/m4/bdb.m4
@@ -0,0 +1,269 @@
+dnl -*- mode: autoconf -*-
+dnl Copyright 2010 Vivien Malerba
+dnl
+dnl SYNOPSIS
+dnl
+dnl   BDB_CHECK([libdirname])
+dnl
+dnl   [libdirname]: defaults to "lib". Can be overridden by the --with-bdb-libdir-name option
+dnl
+dnl DESCRIPTION
+dnl
+dnl   This macro tries to find the Bdb libraries and header files. If the BDB setup is found
+dnl   then it also tries to find the SQL extension to BDB (starting from version 5.0)
+dnl
+dnl   It defined two options:
+dnl   --with-bdb=yes/no/<directory>
+dnl   --with-bdb-libdir-name=<dir. name>
+dnl
+dnl   If the 1st option is "yes" then the macro in several well known directories
+dnl
+dnl   If the 1st option is "no" then the macro does not attempt at locating the
+dnl   bdb package
+dnl
+dnl   If the 1st option is a drectory name, then the macro tries to locate the bdb package
+dnl   in the specified directory.
+dnl
+dnl   If the macro has to try to locate the bdb package in one or more directories, it will
+dnl   try to locate the header files in $dir/include and the library files in $dir/lib, unless
+dnl   the second option is used to specify a directory name to be used instead of "lib" (for
+dnl   example lib64).
+dnl
+dnl USED VARIABLES
+dnl
+dnl   $linklibext: contains the library suffix (like ".so"). If not specified ".so" is used.
+dnl   $platform_win32: contains "yes" on Windows platforms. If not specified, assumes "no"
+dnl
+dnl
+dnl DEFINED VARIABLES
+dnl
+dnl   This macro always calls:
+dnl
+dnl    AC_SUBST(BDB_LIBS)
+dnl    AC_SUBST(BDB_LIB)
+dnl    AC_SUBST(BDB_CFLAGS)
+dnl    AC_SUBST(LIBGDA_BDB_INC)
+dnl    AC_SUBST(LIBGDA_BDB_TYPE)
+dnl    bdb_found=yes/no
+dnl    bdbsql_found=yes/no
+dnl    AC_SUBST(BDBSQL_LIBS)
+dnl    AC_SUBST(BDBSQL_CFLAGS)
+dnl
+dnl   and if the bdb package is found:
+dnl
+dnl    AM_CONDITIONAL(BDB, true)
+dnl    AM_CONDITIONAL(BDBSQL, true)
+dnl
+dnl
+dnl LICENSE
+dnl
+dnl This file is free software; the author(s) gives unlimited
+dnl permission to copy and/or distribute it, with or without
+dnl modifications, as long as this notice is preserved.
+dnl
+
+m4_define([_BDB_CHECK_INTERNAL],
+[
+    AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
+    AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
+    AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
+
+    bdb_loclibdir=$1
+    if test "x$bdb_loclibdir" = x
+    then
+        if test "x$platform_win32" = xyes
+	then
+	    bdb_loclibdir=bin
+	else
+	    bdb_loclibdir=lib
+	fi
+    fi
+
+    # determine if Bdb should be searched for
+    # and use pkg-config if the "yes" option is used
+    bdb_found=no
+    try_bdb=true
+    BDB_LIBS=""
+    bdb_test_dir="/usr /usr/local /local"
+    AC_ARG_WITH(bdb,
+              AS_HELP_STRING([--with-bdb[=@<:@yes/no/<directory>@:>@]],
+                             [Locate Berkeley DB files]),[
+			     if test $withval = no
+			     then
+			         try_bdb=false
+			     elif test $withval != yes
+			     then
+			         bdb_test_dir=$withval
+			     fi])
+    AC_ARG_WITH(bdb-libdir-name,
+              AS_HELP_STRING([--with-bdb-libdir-name[=@<:@<dir. name>@:>@]],
+                             [Locate BDB library file, related to the prefix specified from --with-bdb]),
+			     [bdb_loclibdir=$withval])
+
+    # try to locate files
+    if test $try_bdb = true
+    then
+	if test "x$linklibext" = x
+	then
+	    bdb_libext=".so"
+	else
+	    bdb_libext="$linklibext"
+	fi
+	bdbdir=""
+	for d in $bdb_test_dir
+	do
+	    bdbdir=""
+	    AC_MSG_CHECKING([for Berkeley DB files in $d])
+	    for version in "" 5.1 5.0 4.9 4.8 4.7
+	    do
+	        if test $platform_win32 = yes
+		then
+		    sversion=`echo $version | sed -e 's,\.,,g'`
+		else
+		    sversion=`echo $version | sed -e 's,\..*,,g'`
+		fi
+		if test -z $version
+		then
+		    db_libfilename="libdb$bdb_libext"
+        	    db_lib="-ldb"
+		    db_libfile="$d/$bdb_loclibdir/libdb$bdb_libext"
+		    try_headers="db.h"
+    		else
+		    if test $platform_win32 = yes
+		    then
+		        db_libfilename="libdb$sversion$bdb_libext"
+        	        db_lib="-ldb$sversion"
+		        db_libfile="$d/$bdb_loclibdir/libdb$sversion$bdb_libext"
+        	        try_headers="db.h db$version/db.h db$sversion/db.h"
+		    else
+		        db_libfilename="libdb-$version$bdb_libext"
+        	        db_lib="-ldb-$version"
+		        db_libfile="$d/$bdb_loclibdir/libdb-$version$bdb_libext"
+        	        try_headers="db.h db$version/db.h db$sversion/db.h"
+    		    fi
+		fi
+
+		for db_hdr in $try_headers
+		do
+		    if test -f $d/include/$db_hdr -a -f $db_libfile
+		    then
+  	                save_CFLAGS="$CFLAGS"
+	                CFLAGS="$CFLAGS -I$d/include"
+  	                save_LIBS="$LIBS"
+	                LIBS="$LIBS -L$d/$bdb_loclibdir $db_lib"
+   	                AC_LINK_IFELSE([[
+#include <${db_hdr}>
+int main() {
+    printf("%p", db_create);
+    return 0;
+}
+]],
+	                             bdbdir=$d)
+	                CFLAGS="$save_CFLAGS"
+  	                LIBS="$save_LIBS"
+	                if test x$bdbdir != x
+		        then
+		            break;
+		        fi
+		    fi
+		done
+	        if test x$bdbdir != x
+		then
+		    break;
+		fi
+	    done
+	    if test x$bdbdir != x
+	    then
+		if test -z $version
+	        then
+		    AC_MSG_RESULT([found])
+		else
+		    AC_MSG_RESULT([found version $version])
+		fi
+		BDB_CFLAGS=-I${bdbdir}/include
+	    	BDB_LIBS="-L${bdbdir}/$bdb_loclibdir $db_lib"
+		BDB_LIB=$db_libfilename
+		BDB_DIR="$bdbdir"
+		AC_MSG_NOTICE([the runtime shared library to load will be $BDB_LIB])
+		break
+  	    else
+	        AC_MSG_RESULT([not found])
+	    fi
+	done
+
+	if test "x$BDB_LIBS" = x
+	then
+	    AC_MSG_NOTICE([BDB backend not used])
+	else
+	    LIBGDA_BDB_INC="#include <libgda/gda-data-model-bdb.h>"
+	    LIBGDA_BDB_TYPE="gda_data_model_bdb_get_type"
+    	    bdb_found=yes
+	fi
+    fi
+
+    AM_CONDITIONAL(BDB,[test "$bdb_found" = "yes"])
+    AC_SUBST(BDB_LIB)
+    AC_SUBST(BDB_LIBS)
+    AC_SUBST(BDB_CFLAGS)
+    AC_SUBST(LIBGDA_BDB_INC)
+    AC_SUBST(LIBGDA_BDB_TYPE)
+])
+
+m4_define([_BDBSQL_CHECK_INTERNAL],
+[
+    AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
+    AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
+    AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
+
+    m4_if([$1],[],[bdbsql_loclibdir=""],[bdbsql_loclibdir=$1])
+    if test "x$bdbsql_loclibdir" = x
+    then
+        if test "x$platform_win32" = xyes
+	then
+	    bdbsql_loclibdir=bin
+	else
+	    bdbsql_loclibdir=lib
+	fi
+    fi
+
+    bdbsql_found=no
+    bdbsqldir=""
+    if test "x$BDB_DIR" != x
+    then
+        AC_MSG_CHECKING([for Berkeley DB SQL files along with found BDB installation])
+	if test -f $BDB_DIR/include/dbsql.h
+	then
+	    BDBSQL_CFLAGS="$BDB_CFLAGS"
+	    BDBSQL_LIBS="-L$BDB_DIR/$bdb_loclibdir -ldb_sql"
+	    BDBSQL_PATH="$BDB_DIR/$bdb_loclibdir"
+	    AC_MSG_RESULT([found])
+	    AC_CHECK_LIB(db_sql, sqlite3_table_column_metadata,[bdbsql_api=1], [bdbsql_api=0], $BDBSQL_CFLAGS $BDBSQL_LIBS -pthread -ldl)
+
+	    if test $bdbsql_api = 0
+	    then
+		BDBSQL_CFLAGS=""
+		BDBSQL_LIBS=""
+		AC_MSG_NOTICE([Installed BDB Sql was not compiled with the SQLITE_ENABLE_COLUMN_METADATA, BDB Sql provider not compiled])
+	    else
+	        bdbsql_found=yes
+		bdbsqldir="$BDB_DIR"
+	    fi
+	else
+	    AC_MSG_RESULT([not found])
+	fi
+    fi
+
+    AM_CONDITIONAL(BDBSQL,[test "bdbsql_found" = "yes"])
+    AC_SUBST(BDBSQL_LIBS)
+    AC_SUBST(BDBSQL_CFLAGS)
+])
+
+
+dnl Usage:
+dnl   BDB_CHECK([libdirname])
+
+AC_DEFUN([BDB_CHECK],
+[
+    _BDB_CHECK_INTERNAL([$1])
+    _BDBSQL_CHECK_INTERNAL([$1])
+])
diff --git a/m4/mdbtools.m4 b/m4/mdbtools.m4
index ed959f6..e64f053 100644
--- a/m4/mdbtools.m4
+++ b/m4/mdbtools.m4
@@ -25,7 +25,7 @@ dnl
 dnl   If the 1st option is "no" then the macro does not attempt at locating the
 dnl   mdbtools package
 dnl
-dnl   If the 1st option is a drectory name, then the macro tries to locate the mdbtools package
+dnl   If the 1st option is a directory name, then the macro tries to locate the mdbtools package
 dnl   in the specified directory.
 dnl
 dnl   If the macro has to try to locate the mdbtools package in one or more directories, it will
@@ -48,7 +48,6 @@ dnl    mdbtools_found=yes/no
 dnl
 dnl   and if the mdbtools package is found:
 dnl
-dnl    AC_DEFINE(HAVE_MDB, 1, [Have MDB])
 dnl    AM_CONDITIONAL(MDB, true)
 dnl    AC_DEFINE(MDB_WITH_WRITE_SUPPORT,[1],[define if mdb_open accepts MDB_WRITABLE])
 dnl    AC_DEFINE(MDB_BIND_COLUMN_FOUR_ARGS,[1],[define if mdb_bind_column accepts four args])
@@ -67,9 +66,28 @@ m4_define([_MDBTOOLS_CHECK_INTERNAL],
     AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
     AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
 
-    m4_if([$1],[],[mdb_loclibdir=lib],[mdb_loclibdir=$1])
-    m4_if([$2],[],[mdb_glib_cflags=`$PKG_CONFIG --cflags glib-2.0`],[mdb_glib_cflags=$1])
-    m4_if([$3],[],[mdb_glib_libs=`$PKG_CONFIG --libs glib-2.0`],[mdb_glib_libs=$2])
+    mdb_loclibdir=$1
+    if test "x$mdb_loclibdir" = x
+    then
+        if test "x$platform_win32" = xyes
+	then
+	    mdb_loclibdir=bin
+	else
+	    mdb_loclibdir=lib
+	fi
+    fi
+
+    mdb_glib_cflags=$2
+    if test "x$mdb_glib_cflags" = x
+    then
+	mdb_glib_cflags=`$PKG_CONFIG --cflags glib-2.0`
+    fi
+
+    mdb_glib_libs=$3
+    if test "x$mdb_glib_libs" = x
+    then
+	mdb_glib_libs=`$PKG_CONFIG --libs glib-2.0`
+    fi
 
     # determine if MDBTools should be searched for
     # and use pkg-config if the "yes" option is used
@@ -138,7 +156,7 @@ int main() {
 		    then
 		        AC_MSG_RESULT([found])
 			MDB_CFLAGS=-I${mdbdir}/include
-	    		MDB_LIBS="-L${mdbdir}/lib -lmdb"
+	    		MDB_LIBS="-L${mdbdir}/$mdb_loclibdir -lmdb"
 		        break
   		    else
 		        AC_MSG_RESULT([not found])
@@ -152,10 +170,7 @@ int main() {
 	if test "x$MDB_LIBS" = x
 	then
 	    AC_MSG_NOTICE([MDB backend not used])
-	    AM_CONDITIONAL(MDB,[false])
 	else
-	    AC_DEFINE(HAVE_MDB,[1],[Have MDB])
-	    AM_CONDITIONAL(MDB,[true])
     	    mdbtools_found=yes
 
   	    save_CFLAGS="$CFLAGS"
@@ -197,10 +212,9 @@ int main() {
 	    fi
 	    CFLAGS="$save_CFLAGS"
 	fi
-    else
-        AM_CONDITIONAL(MDB,[false])
     fi
 
+    AM_CONDITIONAL(MDB,[test "$mdbtools_found" = "yes"])
     AC_SUBST(MDB_LIBS)
     AC_SUBST(MDB_CFLAGS)
 ])
diff --git a/m4/mysql.m4 b/m4/mysql.m4
new file mode 100644
index 0000000..0964329
--- /dev/null
+++ b/m4/mysql.m4
@@ -0,0 +1,191 @@
+dnl -*- mode: autoconf -*-
+dnl Copyright 2010 Vivien Malerba
+dnl
+dnl SYNOPSIS
+dnl
+dnl   MYSQL_CHECK([libdirname])
+dnl
+dnl   [libdirname]: defaults to "lib". Can be overridden by the --with-mysql-libdir-name option
+dnl
+dnl DESCRIPTION
+dnl
+dnl   This macro tries to find the Mysql libraries and header files
+dnl
+dnl   It defined two options:
+dnl   --with-mysql=yes/no/<directory>
+dnl   --with-mysql-libdir-name=<dir. name>
+dnl
+dnl   If the 1st option is "yes" then the macro tries to use mysql-config to locate
+dnl   the MySQL package, and if it fails, it tries in several well known directories
+dnl
+dnl   If the 1st option is "no" then the macro does not attempt at locating the
+dnl   mysql package
+dnl
+dnl   If the 1st option is a directory name, then the macro tries to locate the mysql package
+dnl   in the specified directory.
+dnl
+dnl   If the macro has to try to locate the mysql package in one or more directories, it will
+dnl   try to locate the header files in $dir/include and the library files in $dir/lib, unless
+dnl   the second option is used to specify a directory name to be used instead of "lib" (for
+dnl   example lib64).
+dnl
+dnl USED VARIABLES
+dnl
+dnl   $linklibext: contains the library suffix (like ".so"). If not specified ".so" is used.
+dnl   $platform_win32: contains "yes" on Windows platforms. If not specified, assumes "no"
+dnl
+dnl
+dnl DEFINED VARIABLES
+dnl
+dnl   This macro always calls:
+dnl
+dnl    AC_SUBST(MYSQL_LIBS)
+dnl    AC_SUBST(MYSQL_CFLAGS)
+dnl    mysql_found=yes/no
+dnl
+dnl   and if the mysql package is found:
+dnl
+dnl    AM_CONDITIONAL(MYSQL, true)
+dnl
+dnl
+dnl LICENSE
+dnl
+dnl This file is free software; the author(s) gives unlimited
+dnl permission to copy and/or distribute it, with or without
+dnl modifications, as long as this notice is preserved.
+dnl
+
+m4_define([_MYSQL_CHECK_INTERNAL],
+[
+    AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
+    AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
+    AC_BEFORE([LT_INIT],[$0])dnl setup libtool first
+
+    mysql_loclibdir=$1
+    if test "x$mysql_loclibdir" = x
+    then
+        if test "x$platform_win32" = xyes
+	then
+	    mysql_loclibdir=lib/opt
+	else
+	    mysql_loclibdir=lib
+	fi
+    fi
+
+    # determine if Mysql should be searched for
+    # and use mysql_config if the "yes" option is used
+    mysql_found=no
+    try_mysql=true
+    pkgmysql=no
+    MYSQL_LIBS=""
+    mysql_test_dir=""
+    AC_ARG_WITH(mysql,
+              AS_HELP_STRING([--with-mysql[=@<:@yes/no/<directory>@:>@]],
+                             [Locate Mysql files for the MS Access backend (read only)]),[
+			     if test $withval = no
+			     then
+			         try_mysql=false
+			     elif test $withval != yes
+			     then
+			         mysql_test_dir=$withval
+			     fi])
+    AC_ARG_WITH(mysql-libdir-name,
+              AS_HELP_STRING([--with-mysql-libdir-name[=@<:@<dir. name>@:>@]],
+                             [Locate Mysql library file, related to the MYSQL prefix specified from --with-mysql]),
+			     [mysql_loclibdir=$withval])
+
+    # try with the default available mysql_config
+    if test $try_mysql = true -a "x$mysql_test_dir" = x
+    then
+        AC_PATH_PROGS(MYSQL_CONFIG, mysql_config mysql_config5)
+	if test "x$MYSQL_CONFIG" != x
+	then
+	    pkgmysql=yes
+	    MYSQL_CFLAGS=`$MYSQL_CONFIG --cflags`
+	    MYSQL_LIBS=`$MYSQL_CONFIG --libs`
+	else
+	    mysql_test_dir="/usr /usr/local /opt/gnome"
+	fi
+    fi
+
+    # try to locate mysql_config in places in $mysql_test_dir
+    if test $try_mysql = true
+    then
+	if test $pkgmysql = no
+	then
+	    if test "x$linklibext" = x
+	    then
+	        mysql_libext=".so"
+	    else
+	        mysql_libext=".lib"
+	    fi
+	    if test $platform_win32 = yes
+	    then
+	        for d in $mysql_test_dir
+	        do
+	            AC_MSG_CHECKING([checking for mysql files in $d])
+		    if test -a $d/include/mysql.h -a -f $d/$mysql_loclibdir/libmysql$mysql_libext
+		    then
+			save_CFLAGS="$CFLAGS"
+	                CFLAGS="$CFLAGS -I$d/include"
+  	                save_LIBS="$LIBS"
+	                LIBS="$LIBS -L$d/$mysql_loclibdir -lmysql"
+   	                AC_LINK_IFELSE([[
+#include <winsock.h>
+#include <mysql.h>
+int main() {
+    printf("%p", mysql_real_connect);
+    return 0;
+}
+]],
+	                             mysql_found=yes)
+	                CFLAGS="$save_CFLAGS"
+  	                LIBS="$save_LIBS"
+			if test "x$mysql_found" = xyes
+			then
+		            AC_MSG_RESULT([not found])
+			    MYSQL_CFLAGS=-I$d/include
+			    MYSQL_LIBS="-L$d/$mysql_loclibdir -lmysql"
+			    break
+			fi
+			AC_MSG_RESULT([files found but are not useable])
+		    else
+		        AC_MSG_RESULT([not found])
+		    fi
+	        done
+	    else
+	        for d in $mysql_test_dir
+	        do
+	            AC_MSG_NOTICE([checking for mysql_config tool in $d])
+                    AC_PATH_PROGS(MYSQL_CONFIG, mysql_config mysql_config5,,[$d])
+		    if test "x$MYSQL_CONFIG" != x
+		    then
+	    	        pkgmysql=yes
+	    	        MYSQL_CFLAGS=`$MYSQL_CONFIG --cflags`
+	    	        MYSQL_LIBS=`$MYSQL_CONFIG --libs`
+	    	        break;
+		    fi
+	        done
+	    fi
+        fi
+	if test "x$MYSQL_LIBS" = x
+	then
+	    AC_MSG_NOTICE([MYSQL backend not used])
+	else
+    	    mysql_found=yes
+	fi
+    fi
+
+    AM_CONDITIONAL(MYSQL,[test "$mysql_found" = "yes"])
+    AC_SUBST(MYSQL_LIBS)
+    AC_SUBST(MYSQL_CFLAGS)
+])
+
+
+dnl Usage:
+dnl   MYSQL_CHECK([libdirname])
+
+AC_DEFUN([MYSQL_CHECK],
+[
+    _MYSQL_CHECK_INTERNAL([$1])
+])
diff --git a/providers/Makefile.am b/providers/Makefile.am
index c783825..0a378fd 100644
--- a/providers/Makefile.am
+++ b/providers/Makefile.am
@@ -26,10 +26,6 @@ if MSQL
 GDA_MSQL_SERVER=msql
 endif
 
-if ODBC
-GDA_ODBC_SERVER=odbc
-endif
-
 if ORACLE
 GDA_ORACLE_SERVER=oracle
 endif
@@ -83,7 +79,6 @@ SUBDIRS = \
 #	$(GDA_IBMDB2_SERVER) \
 #	$(GDA_FIREBIRD_SERVER) \
 #       $(GDA_MSQL_SERVER) \
-#	$(GDA_ODBC_SERVER) \
 #	$(GDA_SYBASE_SERVER) \
 #	$(GDA_XBASE_SERVER) \
 #	$(GDA_LDAP_SERVER) 
diff --git a/tests/providers/Makefile.am b/tests/providers/Makefile.am
index 61ad899..a3d7fb5 100644
--- a/tests/providers/Makefile.am
+++ b/tests/providers/Makefile.am
@@ -39,11 +39,6 @@ check_PROGRAMS += check_msql
 TESTS += check_msql
 endif
 
-if ODBC
-check_PROGRAMS += check_odbc
-TESTS += check_odbc
-endif
-
 if ORACLE
 check_PROGRAMS += check_oracle
 TESTS += check_oracle



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