- AC_CHECK_HEADERS(mysql/mysql.h,
- [
- AC_DEFINE(HAVE_MYSQL_MYSQL_H, 1, [Define to 1 if you have the <mysql/mysql.h> header file.])
- ], [with_libmysql="no (mysql/mysql.h not found)"])
+ with_mysql_libs=`$with_mysql_config --libs 2>/dev/null`
+ mysql_config_status=$?
+
+ if test $mysql_config_status -ne 0
+ then
+ with_libmysql="no"
+ else
+ AC_CHECK_LIB(mysqlclient, mysql_init,
+ [
+ # We need to do this to have `HAVE_LIBMYSQLCLIENT' defined
+ # but `-lmysqlclient' NOT added to the default LDFLAGS.
+ AC_DEFINE(HAVE_LIBMYSQLCLIENT, 1,
+ [Define to 1 if you have the mysqlclient library.])
+ ],
+ [with_libmysql="no (libmysql not found)"],
+ [$with_mysql_libs])
+ fi