summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTon Voon <tonvoon@mac.com>2019-08-02 15:33:07 (GMT)
committerSven Nierlein <sven@nierlein.org>2019-08-12 08:40:42 (GMT)
commit1de8c41b6c703a6cea8f4a1fc6e9b5d97456272a (patch)
treedceaa50951afa0f2e28bf3d85a861962047dca02
parente8325b39c47e6fbf7c8c1e31f9026870d9520af5 (diff)
downloadmonitoring-plugins-1de8c41b6c703a6cea8f4a1fc6e9b5d97456272a.tar.gz
Allow mariadbclient to be used for check_mysql
-rw-r--r--m4/np_mysqlclient.m428
-rw-r--r--nagiosplug_mariadbclient.patch45
2 files changed, 67 insertions, 6 deletions
diff --git a/m4/np_mysqlclient.m4 b/m4/np_mysqlclient.m4
index c2a4d2a..5099a02 100644
--- a/m4/np_mysqlclient.m4
+++ b/m4/np_mysqlclient.m4
@@ -53,18 +53,34 @@ AC_DEFUN([np_mysqlclient],
53 _savedcppflags="$CPPFLAGS" 53 _savedcppflags="$CPPFLAGS"
54 CPPFLAGS="$CPPFLAGS $np_mysql_include" 54 CPPFLAGS="$CPPFLAGS $np_mysql_include"
55 55
56 dnl Putting $np_mysql_libs as other libraries ensures that all mysql dependencies are linked in 56 np_check_lib_mysqlclient
57 dnl Although -lmysqlclient is duplicated, it is not a problem 57
58 AC_CHECK_LIB([mysqlclient], [mysql_init], [
59 with_mysql=$np_mysql_config
60 AC_DEFINE(HAVE_MYSQLCLIENT, 1, [Defined if mysqlclient is found and can compile])
61 ], [with_mysql=no], [$np_mysql_libs])
62 CPPFLAGS=$_savedcppflags 58 CPPFLAGS=$_savedcppflags
63 59
64 fi 60 fi
65 fi 61 fi
66]) 62])
67 63
64dnl Test mysql_init using mysqlclient
65AC_DEFUN([np_check_lib_mysqlclient],
66[
67 dnl Putting $np_mysql_libs as other libraries ensures that all mysql dependencies are linked in
68 dnl Although -lmysqlclient is duplicated, it is not a problem
69 AC_CHECK_LIB([mysqlclient], [mysql_init], [
70 with_mysql=$np_mysql_config
71 AC_DEFINE(HAVE_MYSQLCLIENT, 1, [Defined if mysqlclient is found and can compile])
72 ], [np_check_lib_mariadbclient], [$np_mysql_libs])
73])
74
75dnl Test mysql_init using mariadbclient
76AC_DEFUN([np_check_lib_mariadbclient],
77[
78 AC_CHECK_LIB([mariadbclient], [mysql_init], [
79 with_mysql=$np_mysql_config
80 AC_DEFINE(HAVE_MYSQLCLIENT, 1, [Defined if mariadbclient is found and can compile])
81 ], [with_mysql=no], [$np_mysql_libs])
82])
83
68dnl Will take $1, find last occurrance of -LDIR and add DIR to LD_RUN_PATH 84dnl Will take $1, find last occurrance of -LDIR and add DIR to LD_RUN_PATH
69AC_DEFUN([np_add_to_runpath], 85AC_DEFUN([np_add_to_runpath],
70[ 86[
diff --git a/nagiosplug_mariadbclient.patch b/nagiosplug_mariadbclient.patch
new file mode 100644
index 0000000..5248756
--- /dev/null
+++ b/nagiosplug_mariadbclient.patch
@@ -0,0 +1,45 @@
1diff --git a/m4/np_mysqlclient.m4 b/m4/np_mysqlclient.m4
2index c2a4d2a7..5099a02b 100644
3--- a/m4/np_mysqlclient.m4
4+++ b/m4/np_mysqlclient.m4
5@@ -53,18 +53,34 @@ AC_DEFUN([np_mysqlclient],
6 _savedcppflags="$CPPFLAGS"
7 CPPFLAGS="$CPPFLAGS $np_mysql_include"
8
9- dnl Putting $np_mysql_libs as other libraries ensures that all mysql dependencies are linked in
10- dnl Although -lmysqlclient is duplicated, it is not a problem
11- AC_CHECK_LIB([mysqlclient], [mysql_init], [
12- with_mysql=$np_mysql_config
13- AC_DEFINE(HAVE_MYSQLCLIENT, 1, [Defined if mysqlclient is found and can compile])
14- ], [with_mysql=no], [$np_mysql_libs])
15+ np_check_lib_mysqlclient
16+
17 CPPFLAGS=$_savedcppflags
18
19 fi
20 fi
21 ])
22
23+dnl Test mysql_init using mysqlclient
24+AC_DEFUN([np_check_lib_mysqlclient],
25+[
26+ dnl Putting $np_mysql_libs as other libraries ensures that all mysql dependencies are linked in
27+ dnl Although -lmysqlclient is duplicated, it is not a problem
28+ AC_CHECK_LIB([mysqlclient], [mysql_init], [
29+ with_mysql=$np_mysql_config
30+ AC_DEFINE(HAVE_MYSQLCLIENT, 1, [Defined if mysqlclient is found and can compile])
31+ ], [np_check_lib_mariadbclient], [$np_mysql_libs])
32+])
33+
34+dnl Test mysql_init using mariadbclient
35+AC_DEFUN([np_check_lib_mariadbclient],
36+[
37+ AC_CHECK_LIB([mariadbclient], [mysql_init], [
38+ with_mysql=$np_mysql_config
39+ AC_DEFINE(HAVE_MYSQLCLIENT, 1, [Defined if mariadbclient is found and can compile])
40+ ], [with_mysql=no], [$np_mysql_libs])
41+])
42+
43 dnl Will take $1, find last occurrance of -LDIR and add DIR to LD_RUN_PATH
44 AC_DEFUN([np_add_to_runpath],
45 [