diff options
author | Artjoms Rimdjonoks <artjoms.rimdjonoks@zabbix.com> | 2020-04-15 12:28:23 +0300 |
---|---|---|
committer | Artjoms Rimdjonoks <artjoms.rimdjonoks@zabbix.com> | 2020-04-15 12:28:23 +0300 |
commit | 88fffded495f04f27c813d91e7f663ccdabb852d (patch) | |
tree | 1df5e00a55a2df685cdade1e5a13d4f8b4e5b35f /m4 | |
parent | 299c959126c905f9345ee800869211fd00627f93 (diff) |
.......PS. [ZBX-15484] setup increment variables in options instead of zbx_execute
Diffstat (limited to 'm4')
-rw-r--r-- | m4/ax_lib_mysql.m4 | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/m4/ax_lib_mysql.m4 b/m4/ax_lib_mysql.m4 index 344fc7bade3..808eb8f708b 100644 --- a/m4/ax_lib_mysql.m4 +++ b/m4/ax_lib_mysql.m4 @@ -46,6 +46,42 @@ # modification, are permitted in any medium without royalty provided # the copyright notice and this notice are preserved. +AC_DEFUN([LIBMYSQL_OPTIONS_TRY], +[ + AC_MSG_CHECKING([for MySQL init options]) + AC_TRY_LINK( +[ +#include <mysql.h> +], +[ + MYSQL *mysql; + + mysql_options(mysql, MYSQL_INIT_COMMAND, "set @@session.auto_increment_offset=1"); +], + AC_DEFINE_UNQUOTED([MYSQL_OPTIONS],[mysql_options], [Define to mysql_options if it is MySQL library]) + found_mysql_options="yes" + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no)) +]) + +AC_DEFUN([LIBMARIADB_OPTIONS_TRY], +[ + AC_MSG_CHECKING([for MariaDB init options]) + AC_TRY_LINK( +[ +#include <mysql.h> +], +[ + MYSQL *mysql; + + mysql_optionsv(mysql, MYSQL_INIT_COMMAND, "set @@session.auto_increment_offset=1"); +], + AC_DEFINE_UNQUOTED([MYSQL_OPTIONS],[mysql_optionsv], [Define to mysql_optionsv if it is MariaDB library]) + found_mariadb_options="yes" + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no)) +]) + AC_DEFUN([LIBMYSQL_TLS_TRY_LINK], [ AC_MSG_CHECKING([for TLS support in MySQL library]) @@ -204,6 +240,15 @@ AC_DEFUN([AX_LIB_MYSQL], LIBMARIADB_TLS_TRY_LINK([no]) fi + LIBMARIADB_OPTIONS_TRY([no]) + if test "$found_mariadb_options" != "yes"; then + LIBMYSQL_OPTIONS_TRY([no]) + if test "$found_mysql_options" != "yes"; then + AC_MSG_RESULT([no]) + AC_MSG_ERROR([Could not find the options function for mysql init]) + fi + fi + LDFLAGS="${_save_mysql_ldflags}" CFLAGS="${_save_mysql_cflags}" LIBS="${_save_mysql_libs}" |