From bcff4f2e3520eaf170c282ba03d38ba6a4fa95cf Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 11 Feb 2013 14:23:16 +0100 Subject: initial import --- m4/ac_mysql.m4 | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 m4/ac_mysql.m4 (limited to 'm4') diff --git a/m4/ac_mysql.m4 b/m4/ac_mysql.m4 new file mode 100644 index 0000000..7a3d484 --- /dev/null +++ b/m4/ac_mysql.m4 @@ -0,0 +1,102 @@ +dnl --------------------------------------------------------------------------- +dnl Macro: MYSQL_SRC_TEST +dnl --------------------------------------------------------------------------- + +dir_resolve() dnl {{{ +{ + pwd=`pwd` + cd "$1" 2>/dev/null || cd "${pwd}/${1}" 2>/dev/null + if test "$?" = "0" + then + echo `pwd -P` + else + echo "$1" + fi +} +dnl }}} + +AC_DEFUN([MYSQL_SRC_TEST], [ + AC_MSG_CHECKING(for mysql source code) + AC_ARG_WITH(mysql, + [AS_HELP_STRING([--with-mysql=PATH], [MySQL src directory required to build.])], + [ + ac_mysql_source_dir=`readlink -e "$withval"` + HEADERS="include/my_dir.h include/mysql/plugin.h include/mysql.h include/mysql_version.h include/config.h include/my_config.h" + for file in $HEADERS + do + if ! test -r "$ac_mysql_source_dir/$file" + then + AC_MSG_ERROR([Failed to find required header file $ac_mysql_source_dir/$file, check the path and make sure you've run './configure .... && cd include && make' in MySQL 5.1 sources dir or 'cmake . && make' in MySQL 5.5 sources dir.]) + fi + done + AC_DEFINE([MYSQL_SRC], [1], [Source directory for MySQL]) + MYSQL_INC="-I$ac_mysql_source_dir/sql -I$ac_mysql_source_dir/include -I$ac_mysql_source_dir/regex -I$ac_mysql_source_dir" + AC_MSG_RESULT(["$ac_mysql_source_dir"]) + ], + [ + AC_MSG_ERROR(["No mysql source provided. Please specify --with-mysql=!"]) + ] + ) +]) + +dnl --------------------------------------------------------------------------- +dnl Macro: MYSQL_PLUGIN_DIR_TEST +dnl --------------------------------------------------------------------------- + +AC_DEFUN([MYSQL_PLUGIN_DIR_TEST], [ + AC_MSG_CHECKING([for mysql plugin dir]) + ac_mysql_plugin_dir= + AC_ARG_WITH([mysql-plugindir], + [AS_HELP_STRING([--with-mysql-plugindir=PATH], [MySQL plugin directory where plugin is to be copied to])], + [ + ac_mysql_plugin_dir=`readlink -e "$withval"` + if test -d "$ac_mysql_plugin_dir" + then + MYSQL_PLUGIN_DIR="$ac_mysql_plugin_dir" + AC_MSG_RESULT([yes: Using $ac_mysql_plugin_dir]) + else + AC_MSG_ERROR([invalid MySQL plugin directory : $ac_mysql_plugin_dir]) + fi + ], + [ + ac_mysql_plugin_dir="/usr/lib/mysql/plugin" + MYSQL_PLUGIN_DIR="$ac_mysql_plugin_dir" + AC_MSG_RESULT([--with-mysql-plugindir was not set. Using $ac_mysql_plugin_dir]) + ] + ) +]) + +dnl --------------------------------------------------------------------------- +dnl Macro: MYSQL_LIB_SERVICES : 5.5 services lib to add to linker +dnl --------------------------------------------------------------------------- + +dnl AC_DEFUN([MYSQL_LIB_SERVICES_TEST], [ +dnl AC_MSG_CHECKING([for mysql libmysqlservices]) +dnl ac_mysql_libservices= +dnl AC_ARG_WITH([mysql-libservices], +dnl [AS_HELP_STRING([--with-mysql-libservices=PATH], [MySQL libmysqlservices.a location (relevant for 5.5 only)])], +dnl [ +dnl ac_mysql_libservices=`readlink -e "$withval"` +dnl if test -f "$ac_mysql_libservices" +dnl then +dnl MYSQL_LIBSERVICES="$ac_mysql_libservices" +dnl AC_MSG_RESULT([yes: Using $ac_mysql_libservices]) +dnl else +dnl AC_MSG_ERROR([invalid MySQL libmysqlservices : $ac_mysql_libservices]) +dnl fi +dnl ], +dnl [ +dnl if test -f "$ac_mysql_source_dir/VERSION" +dnl then +dnl source "$ac_mysql_source_dir/VERSION" +dnl if test "$MYSQL_VERSION_MAJOR.$MYSQL_VERSION_MINOR" = "5.5" +dnl then +dnl AC_MSG_ERROR([no mysql-libservices. Required for MySQL 5.5]) +dnl fi +dnl fi +dnl ac_mysql_libservices="" +dnl MYSQL_LIBSERVICES="$ac_mysql_libservices" +dnl AC_MSG_RESULT([--with-mysql-libservices was not set.]) +dnl ] +dnl ) +dnl ]) -- cgit v1.2.3