summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6df04cb)
raw | patch | inline | side by side (parent: 6df04cb)
author | Sebastian Harl <sh@tokkee.org> | |
Sat, 1 Nov 2008 10:28:30 +0000 (11:28 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sat, 1 Nov 2008 10:28:30 +0000 (11:28 +0100) |
Up to now, only mysql/mysql.h has been checked for. However, mysql_config
--cflags usually adds the complete path to mysql.h to the include flags. In
most setups, mysql/mysql.h can be found in the search path as well (usually
the header is available in something like /usr/include/mysql/mysql.h) so this
issue has not been found so far. However, if that's not the case, the build
will fail.
Thanks to Dusty Doris <collectd@dusty.name> for reporting this.
--cflags usually adds the complete path to mysql.h to the include flags. In
most setups, mysql/mysql.h can be found in the search path as well (usually
the header is available in something like /usr/include/mysql/mysql.h) so this
issue has not been found so far. However, if that's not the case, the build
will fail.
Thanks to Dusty Doris <collectd@dusty.name> for reporting this.
configure.in | patch | blob | history | |
src/mysql.c | patch | blob | history |
diff --git a/configure.in b/configure.in
index bc4d3213b3bde7f5cd4ce5cecf3ba597ac1c9618..6fd080a667dc13ba339166be7320536ecbd6f514 100644 (file)
--- a/configure.in
+++ b/configure.in
if test $mysql_config_status -ne 0
then
- with_libmysql="no"
+ with_libmysql="no ($with_mysql_config failed)"
else
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $with_mysql_cflags"
- AC_CHECK_HEADERS(mysql/mysql.h, [], [with_libmysql="no (mysql/mysql.h not found)"], [])
+ have_mysql_h="no"
+ have_mysql_mysql_h="no"
+ AC_CHECK_HEADERS(mysql.h, [have_mysql_h="yes"])
+
+ if test "x$have_mysql_h" = "xno"
+ then
+ AC_CHECK_HEADERS(mysql/mysql.h, [have_mysql_mysql_h="yes"])
+ fi
+
+ if test "x$have_mysql_h$have_mysql_mysql_h" = "xnono"
+ then
+ with_libmysql="no (mysql.h not found)"
+ fi
CPPFLAGS="$SAVE_CPPFLAGS"
fi
if test $mysql_config_status -ne 0
then
- with_libmysql="no"
+ with_libmysql="no ($with_mysql_config failed)"
else
AC_CHECK_LIB(mysqlclient, mysql_init,
[with_libmysql="yes"],
diff --git a/src/mysql.c b/src/mysql.c
index aa585d6554eb88ddedffb8f38f5286b386deeba6..30557f61bd0e7e662bf37eac10194327a763327f 100644 (file)
--- a/src/mysql.c
+++ b/src/mysql.c
#include "plugin.h"
#include "configfile.h"
-#ifdef HAVE_MYSQL_MYSQL_H
+#ifdef HAVE_MYSQL_H
+#include <mysql.h>
+#elif defined(HAVE_MYSQL_MYSQL_H)
#include <mysql/mysql.h>
#endif