From: Ruben Kerkhof Date: Sat, 1 Aug 2015 16:59:53 +0000 (+0200) Subject: mysql: respect mysql_libs when searching for symbol X-Git-Tag: collectd-5.5.1~52^2~9 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=da929b45f8df16dde909b2b884fcfbd3da7a0829;p=collectd.git 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 --- 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"