From da929b45f8df16dde909b2b884fcfbd3da7a0829 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sat, 1 Aug 2015 18:59:53 +0200 Subject: [PATCH] mysql: respect mysql_libs when searching for symbol We always looked in libmysqlclient, but this doesn't work for compatible databases such as Percona. Respect the list return by mysql_config --libs_r instead. Fixes #1098 --- configure.ac | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 9fbb7a59..f5acb0a1 100644 --- a/configure.ac +++ b/configure.ac @@ -2621,15 +2621,23 @@ then then with_libmysql="no ($with_mysql_config failed)" else - AC_CHECK_LIB(mysqlclient, mysql_init, + SAVE_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $with_mysql_cflags" + SAVE_LIBS="$LIBS" + LIBS="$with_mysql_libs" + AC_SEARCH_LIBS([mysql_init], + [], [with_libmysql="yes"], [with_libmysql="no (symbol 'mysql_init' not found)"], - [$with_mysql_libs]) + []) - AC_CHECK_LIB(mysqlclient, mysql_get_server_version, + AC_SEARCH_LIBS([mysql_get_server_version], + [], [with_libmysql="yes"], [with_libmysql="no (symbol 'mysql_get_server_version' not found)"], - [$with_mysql_libs]) + []) + CPPFLAGS="$SAVE_CPPFLAGS" + LIBS="$SAVE_LIBS" fi fi if test "x$with_libmysql" = "xyes" -- 2.30.2