--- libgda-5.2.2-orig/m4/mysql.m4	2013-10-19 14:35:27.000000000 +0200
+++ libgda-5.2.2/m4/mysql.m4	2014-08-17 18:12:40.293683300 +0200
@@ -124,12 +124,12 @@
 	        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
+		    if test -a $d/include/mariadb/mysql.h -a -f $d/$mysql_loclibdir/libmariadb.dll.a
 		    then
 			save_CFLAGS="$CFLAGS"
-	                CFLAGS="$CFLAGS -I$d/include"
+	                CFLAGS="$CFLAGS -I$d/include/mariadb"
   	                save_LIBS="$LIBS"
-	                LIBS="$LIBS -L$d/$mysql_loclibdir -lmysql"
+	                LIBS="$LIBS -L$d/$mysql_loclibdir -lmariadb"
    	                AC_LINK_IFELSE([AC_LANG_SOURCE([
 #include <winsock.h>
 #include <mysql.h>
@@ -144,8 +144,8 @@
 			if test "x$mysql_found" = xyes
 			then
 		            AC_MSG_RESULT([found])
-			    MYSQL_CFLAGS=-I$d/include
-			    MYSQL_LIBS="-L$d/$mysql_loclibdir -lmysql"
+			    MYSQL_CFLAGS=-I$d/include/mariadb
+			    MYSQL_LIBS="-L$d/$mysql_loclibdir -lmariadb"
 			    break
 			fi
 			AC_MSG_RESULT([files found but are not useable])
