##### http://autoconf-archive.cryp.to/ax_lib_mysql.html
#
# SYNOPSIS
#
# AX_LIB_MYSQL([MINIMUM-VERSION])
#
# DESCRIPTION
#
# This macro provides tests of availability of MySQL client library
# of particular version or newer.
#
# AX_LIB_MYSQL macro takes only one argument which is optional. If
# there is no required version passed, then macro does not run
# version test.
#
# The --with-mysql option takes one of three possible values:
#
# no - do not check for MySQL client library
#
# yes - do check for MySQL library in standard locations
# (mysql_config should be in the PATH)
#
# path - complete path to mysql_config utility, use this option if
# mysql_config can't be found in the PATH
#
# This macro calls:
#
# AC_SUBST(MYSQL_CFLAGS)
# AC_SUBST(MYSQL_LDFLAGS)
# AC_SUBST(MYSQL_LIBS)
# AC_SUBST(MYSQL_VERSION)
#
# And sets:
#
# HAVE_MYSQL
#
# LAST MODIFICATION
#
# 2006-07-16
#
# COPYLEFT
#
# Copyright (c) 2006 Mateusz Loskot <mateusz@loskot.net>
#
# Copying and distribution of this file, with or without
# 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 function])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#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 mysql options)
AC_DEFINE_UNQUOTED(MYSQL_OPTIONS_ARGS_VOID_CAST, , Define void cast for mysql options args)
found_mysql_options="yes"
AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
])
AC_DEFUN([LIBMARIADB_OPTIONS_TRY],
[
AC_MSG_CHECKING([for MariaDB init options function])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <mysql.h>
]], [[
MYSQL *mysql;
mysql_optionsv(mysql, MYSQL_INIT_COMMAND, (void *)"set @@session.auto_increment_offset=1");
]])],[AC_DEFINE_UNQUOTED(MYSQL_OPTIONS, mysql_optionsv, Define mysql options)
AC_DEFINE_UNQUOTED(MYSQL_OPTIONS_ARGS_VOID_CAST, (void *), Define void cast for mysql options args)
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])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <mysql.h>
]], [[
unsigned int mysql_tls_mode;
MYSQL *mysql;
mysql_tls_mode = SSL_MODE_REQUIRED;
mysql_options(mysql, MYSQL_OPT_SSL_MODE, &mysql_tls_mode);
mysql_tls_mode = SSL_MODE_VERIFY_CA;