From 1de8c41b6c703a6cea8f4a1fc6e9b5d97456272a Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Fri, 2 Aug 2019 15:33:07 +0000 Subject: Allow mariadbclient to be used for check_mysql --- m4/np_mysqlclient.m4 | 28 ++++++++++++++++++++------ nagiosplug_mariadbclient.patch | 45 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 6 deletions(-) create mode 100644 nagiosplug_mariadbclient.patch diff --git a/m4/np_mysqlclient.m4 b/m4/np_mysqlclient.m4 index c2a4d2a7..5099a02b 100644 --- a/m4/np_mysqlclient.m4 +++ b/m4/np_mysqlclient.m4 @@ -53,18 +53,34 @@ AC_DEFUN([np_mysqlclient], _savedcppflags="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $np_mysql_include" - dnl Putting $np_mysql_libs as other libraries ensures that all mysql dependencies are linked in - dnl Although -lmysqlclient is duplicated, it is not a problem - AC_CHECK_LIB([mysqlclient], [mysql_init], [ - with_mysql=$np_mysql_config - AC_DEFINE(HAVE_MYSQLCLIENT, 1, [Defined if mysqlclient is found and can compile]) - ], [with_mysql=no], [$np_mysql_libs]) + np_check_lib_mysqlclient + CPPFLAGS=$_savedcppflags fi fi ]) +dnl Test mysql_init using mysqlclient +AC_DEFUN([np_check_lib_mysqlclient], +[ + dnl Putting $np_mysql_libs as other libraries ensures that all mysql dependencies are linked in + dnl Although -lmysqlclient is duplicated, it is not a problem + AC_CHECK_LIB([mysqlclient], [mysql_init], [ + with_mysql=$np_mysql_config + AC_DEFINE(HAVE_MYSQLCLIENT, 1, [Defined if mysqlclient is found and can compile]) + ], [np_check_lib_mariadbclient], [$np_mysql_libs]) +]) + +dnl Test mysql_init using mariadbclient +AC_DEFUN([np_check_lib_mariadbclient], +[ + AC_CHECK_LIB([mariadbclient], [mysql_init], [ + with_mysql=$np_mysql_config + AC_DEFINE(HAVE_MYSQLCLIENT, 1, [Defined if mariadbclient is found and can compile]) + ], [with_mysql=no], [$np_mysql_libs]) +]) + dnl Will take $1, find last occurrance of -LDIR and add DIR to LD_RUN_PATH AC_DEFUN([np_add_to_runpath], [ diff --git a/nagiosplug_mariadbclient.patch b/nagiosplug_mariadbclient.patch new file mode 100644 index 00000000..52487563 --- /dev/null +++ b/nagiosplug_mariadbclient.patch @@ -0,0 +1,45 @@ +diff --git a/m4/np_mysqlclient.m4 b/m4/np_mysqlclient.m4 +index c2a4d2a7..5099a02b 100644 +--- a/m4/np_mysqlclient.m4 ++++ b/m4/np_mysqlclient.m4 +@@ -53,18 +53,34 @@ AC_DEFUN([np_mysqlclient], + _savedcppflags="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $np_mysql_include" + +- dnl Putting $np_mysql_libs as other libraries ensures that all mysql dependencies are linked in +- dnl Although -lmysqlclient is duplicated, it is not a problem +- AC_CHECK_LIB([mysqlclient], [mysql_init], [ +- with_mysql=$np_mysql_config +- AC_DEFINE(HAVE_MYSQLCLIENT, 1, [Defined if mysqlclient is found and can compile]) +- ], [with_mysql=no], [$np_mysql_libs]) ++ np_check_lib_mysqlclient ++ + CPPFLAGS=$_savedcppflags + + fi + fi + ]) + ++dnl Test mysql_init using mysqlclient ++AC_DEFUN([np_check_lib_mysqlclient], ++[ ++ dnl Putting $np_mysql_libs as other libraries ensures that all mysql dependencies are linked in ++ dnl Although -lmysqlclient is duplicated, it is not a problem ++ AC_CHECK_LIB([mysqlclient], [mysql_init], [ ++ with_mysql=$np_mysql_config ++ AC_DEFINE(HAVE_MYSQLCLIENT, 1, [Defined if mysqlclient is found and can compile]) ++ ], [np_check_lib_mariadbclient], [$np_mysql_libs]) ++]) ++ ++dnl Test mysql_init using mariadbclient ++AC_DEFUN([np_check_lib_mariadbclient], ++[ ++ AC_CHECK_LIB([mariadbclient], [mysql_init], [ ++ with_mysql=$np_mysql_config ++ AC_DEFINE(HAVE_MYSQLCLIENT, 1, [Defined if mariadbclient is found and can compile]) ++ ], [with_mysql=no], [$np_mysql_libs]) ++]) ++ + dnl Will take $1, find last occurrance of -LDIR and add DIR to LD_RUN_PATH + AC_DEFUN([np_add_to_runpath], + [ -- cgit v1.2.3 From 5f4182f5da5ae6151eb960a0458571a88017df89 Mon Sep 17 00:00:00 2001 From: tonvoon Date: Mon, 12 Aug 2019 09:27:51 +0100 Subject: Delete nagiosplug_mariadbclient.patch --- nagiosplug_mariadbclient.patch | 45 ------------------------------------------ 1 file changed, 45 deletions(-) delete mode 100644 nagiosplug_mariadbclient.patch diff --git a/nagiosplug_mariadbclient.patch b/nagiosplug_mariadbclient.patch deleted file mode 100644 index 52487563..00000000 --- a/nagiosplug_mariadbclient.patch +++ /dev/null @@ -1,45 +0,0 @@ -diff --git a/m4/np_mysqlclient.m4 b/m4/np_mysqlclient.m4 -index c2a4d2a7..5099a02b 100644 ---- a/m4/np_mysqlclient.m4 -+++ b/m4/np_mysqlclient.m4 -@@ -53,18 +53,34 @@ AC_DEFUN([np_mysqlclient], - _savedcppflags="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $np_mysql_include" - -- dnl Putting $np_mysql_libs as other libraries ensures that all mysql dependencies are linked in -- dnl Although -lmysqlclient is duplicated, it is not a problem -- AC_CHECK_LIB([mysqlclient], [mysql_init], [ -- with_mysql=$np_mysql_config -- AC_DEFINE(HAVE_MYSQLCLIENT, 1, [Defined if mysqlclient is found and can compile]) -- ], [with_mysql=no], [$np_mysql_libs]) -+ np_check_lib_mysqlclient -+ - CPPFLAGS=$_savedcppflags - - fi - fi - ]) - -+dnl Test mysql_init using mysqlclient -+AC_DEFUN([np_check_lib_mysqlclient], -+[ -+ dnl Putting $np_mysql_libs as other libraries ensures that all mysql dependencies are linked in -+ dnl Although -lmysqlclient is duplicated, it is not a problem -+ AC_CHECK_LIB([mysqlclient], [mysql_init], [ -+ with_mysql=$np_mysql_config -+ AC_DEFINE(HAVE_MYSQLCLIENT, 1, [Defined if mysqlclient is found and can compile]) -+ ], [np_check_lib_mariadbclient], [$np_mysql_libs]) -+]) -+ -+dnl Test mysql_init using mariadbclient -+AC_DEFUN([np_check_lib_mariadbclient], -+[ -+ AC_CHECK_LIB([mariadbclient], [mysql_init], [ -+ with_mysql=$np_mysql_config -+ AC_DEFINE(HAVE_MYSQLCLIENT, 1, [Defined if mariadbclient is found and can compile]) -+ ], [with_mysql=no], [$np_mysql_libs]) -+]) -+ - dnl Will take $1, find last occurrance of -LDIR and add DIR to LD_RUN_PATH - AC_DEFUN([np_add_to_runpath], - [ -- cgit v1.2.3