2006-04-13 22:49:29 +02:00
|
|
|
dnl ===========================================================================
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl Support for mysql server plugins
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl ===========================================================================
|
|
|
|
dnl
|
|
|
|
dnl WorkLog#3201
|
|
|
|
dnl
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl Framework for pluggable static and dynamic plugins for mysql
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl
|
|
|
|
dnl ---------------------------------------------------------------------------
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl Macro: MYSQL_PLUGIN
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl SYNOPSIS
|
|
|
|
dnl MYSQL_PLUGIN([name],[Plugin name],
|
|
|
|
dnl [Plugin description],
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl [group,group...])
|
|
|
|
dnl
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl DESCRIPTION
|
|
|
|
dnl First declaration for a plugin (mandatory).
|
|
|
|
dnl Adds plugin as member to configuration groups (if specified)
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl
|
|
|
|
dnl ---------------------------------------------------------------------------
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([MYSQL_PLUGIN],[
|
|
|
|
_MYSQL_PLUGIN(
|
2006-04-13 22:49:29 +02:00
|
|
|
[$1],
|
2006-05-02 06:33:09 +02:00
|
|
|
[__MYSQL_PLUGIN_]AS_TR_CPP([$1])[__],
|
2006-04-13 22:49:29 +02:00
|
|
|
m4_default([$2], [$1 plugin]),
|
|
|
|
m4_default([$3], [plugin for $1]),
|
|
|
|
m4_default([$4], []),
|
2006-04-29 18:33:34 +02:00
|
|
|
)
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([_MYSQL_PLUGIN],[
|
2006-04-29 18:33:34 +02:00
|
|
|
m4_ifdef([$2], [
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_FATAL([Duplicate MYSQL_PLUGIN declaration for $3])
|
2006-04-30 21:52:30 +02:00
|
|
|
],[
|
2006-04-29 18:33:34 +02:00
|
|
|
m4_define([$2], [$1])
|
|
|
|
_MYSQL_PLUGAPPEND([__mysql_plugin_list__],[$1])
|
2006-05-02 06:33:09 +02:00
|
|
|
m4_define([MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]), [$3])
|
|
|
|
m4_define([MYSQL_PLUGIN_DESC_]AS_TR_CPP([$1]), [$4])
|
2006-05-02 13:11:00 +02:00
|
|
|
_MYSQL_PLUGAPPEND_META([$1], $5)
|
2006-05-06 13:43:18 +02:00
|
|
|
ifelse(m4_bregexp(__mysql_include__,[/plug\.in$]),-1,[],[
|
|
|
|
MYSQL_PLUGIN_DIRECTORY([$1],
|
|
|
|
m4_bregexp(__mysql_include__,[^\(.*\)/plug\.in$],[\1]))
|
|
|
|
])
|
2006-04-29 18:33:34 +02:00
|
|
|
])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
dnl ---------------------------------------------------------------------------
|
|
|
|
dnl Macro: MYSQL_STORAGE_ENGINE
|
|
|
|
dnl
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl SYNOPSIS
|
|
|
|
dnl MYSQL_STORAGE_ENGINE([name],[legacy-option],[Storage engine name],
|
|
|
|
dnl [Storage engine description],[group,group...])
|
|
|
|
dnl
|
|
|
|
dnl DESCRIPTION
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl Short cut for storage engine declarations
|
|
|
|
dnl
|
|
|
|
dnl ---------------------------------------------------------------------------
|
|
|
|
|
2006-04-29 18:33:34 +02:00
|
|
|
AC_DEFUN([MYSQL_STORAGE_ENGINE],[
|
2006-05-02 06:33:09 +02:00
|
|
|
MYSQL_PLUGIN([$1], [$3], [$4], [[$5]])
|
|
|
|
MYSQL_PLUGIN_DEFINE([$1], [WITH_]AS_TR_CPP([$1])[_STORAGE_ENGINE])
|
2006-04-29 18:33:34 +02:00
|
|
|
ifelse([$2],[no],[],[
|
2006-04-30 21:52:30 +02:00
|
|
|
_MYSQL_LEGACY_STORAGE_ENGINE(
|
2006-05-04 00:58:15 +02:00
|
|
|
m4_bpatsubst([$1], -, _),
|
2006-04-30 21:52:30 +02:00
|
|
|
m4_bpatsubst(m4_default([$2], [$1-storage-engine]), -, _))
|
2006-04-29 18:33:34 +02:00
|
|
|
])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
AC_DEFUN([_MYSQL_LEGACY_STORAGE_ENGINE],[
|
2006-05-04 00:58:15 +02:00
|
|
|
if test "[${with_]$2[+set}]" = set; then
|
|
|
|
[with_plugin_]$1="[$with_]$2"
|
2006-04-29 18:33:34 +02:00
|
|
|
fi
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
dnl ---------------------------------------------------------------------------
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl Macro: MYSQL_PLUGIN_DEFINE
|
|
|
|
dnl
|
|
|
|
dnl SYNOPSIS
|
2006-05-03 15:46:19 +02:00
|
|
|
dnl MYSQL_PLUGIN_DEFINE([name],[MYSQL_CPP_DEFINE])
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl DESCRIPTION
|
|
|
|
dnl When a plugin is to be statically linked, define the C macro
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl
|
|
|
|
dnl ---------------------------------------------------------------------------
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([MYSQL_PLUGIN_DEFINE],[
|
|
|
|
MYSQL_REQUIRE_PLUGIN([$1])
|
|
|
|
m4_define([MYSQL_PLUGIN_DEFINE_]AS_TR_CPP([$1]), [$2])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
dnl ---------------------------------------------------------------------------
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl Macro: MYSQL_PLUGIN_DIRECTORY
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl SYNOPSIS
|
|
|
|
dnl MYSQL_PLUGIN_DIRECTORY([name],[plugin/dir])
|
|
|
|
dnl
|
|
|
|
dnl DESCRIPTION
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl Adds a directory to the build process
|
2006-05-03 15:46:19 +02:00
|
|
|
dnl if it contains 'configure' it will be picked up automatically
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl
|
|
|
|
dnl ---------------------------------------------------------------------------
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([MYSQL_PLUGIN_DIRECTORY],[
|
|
|
|
MYSQL_REQUIRE_PLUGIN([$1])
|
|
|
|
m4_define([MYSQL_PLUGIN_DIRECTORY_]AS_TR_CPP([$1]), [$2])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
dnl ---------------------------------------------------------------------------
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl Macro: MYSQL_PLUGIN_STATIC
|
|
|
|
dnl
|
|
|
|
dnl SYNOPSIS
|
|
|
|
dnl MYSQL_PLUGIN_STATIC([name],[libmyplugin.a])
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl DESCRIPTION
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl Declare the name for the static library
|
|
|
|
dnl
|
|
|
|
dnl ---------------------------------------------------------------------------
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([MYSQL_PLUGIN_STATIC],[
|
|
|
|
MYSQL_REQUIRE_PLUGIN([$1])
|
|
|
|
m4_define([MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]), [$2])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
dnl ---------------------------------------------------------------------------
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl Macro: MYSQL_PLUGIN_DYNAMIC
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl SYNOPSIS
|
|
|
|
dnl MYSQL_PLUGIN_DYNAMIC([name],[myplugin.la])
|
|
|
|
dnl
|
|
|
|
dnl DESCRIPTION
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl Declare the name for the shared library
|
|
|
|
dnl
|
|
|
|
dnl ---------------------------------------------------------------------------
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([MYSQL_PLUGIN_DYNAMIC],[
|
|
|
|
MYSQL_REQUIRE_PLUGIN([$1])
|
|
|
|
m4_define([MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]), [$2])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
dnl ---------------------------------------------------------------------------
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl Macro: MYSQL_PLUGIN_MANDATORY
|
|
|
|
dnl
|
|
|
|
dnl SYNOPSIS
|
|
|
|
dnl MYSQL_PLUGIN_MANDATORY([name])
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl DESCRIPTION
|
|
|
|
dnl Marks the specified plugin as a mandatory plugin
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl
|
|
|
|
dnl ---------------------------------------------------------------------------
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([MYSQL_PLUGIN_MANDATORY],[
|
|
|
|
MYSQL_REQUIRE_PLUGIN([$1])
|
|
|
|
_MYSQL_PLUGIN_MANDATORY([$1],
|
|
|
|
[MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1]),
|
|
|
|
[MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1])
|
2006-04-29 18:33:34 +02:00
|
|
|
)
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([_MYSQL_PLUGIN_MANDATORY],[
|
2006-04-29 18:33:34 +02:00
|
|
|
m4_define([$2], [yes])
|
|
|
|
m4_ifdef([$3], [
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_FATAL([mandatory plugin $1 has been disabled])
|
2006-04-29 18:33:34 +02:00
|
|
|
m4_undefine([$2])
|
|
|
|
])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
dnl ---------------------------------------------------------------------------
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl Macro: MYSQL_PLUGIN_DISABLED
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl SYNOPSIS
|
|
|
|
dnl MYSQL_PLUGIN_DISABLED([name])
|
|
|
|
dnl
|
|
|
|
dnl DESCRIPTION
|
|
|
|
dnl Marks the specified plugin as a disabled plugin
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl
|
|
|
|
dnl ---------------------------------------------------------------------------
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([MYSQL_PLUGIN_DISABLED],[
|
|
|
|
MYSQL_REQUIRE_PLUGIN([$1])
|
|
|
|
_MYSQL_PLUGIN_DISABLED([$1],
|
|
|
|
[MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
|
|
|
|
[MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1])
|
2006-04-29 18:33:34 +02:00
|
|
|
)
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([_MYSQL_PLUGIN_DISABLED],[
|
2006-04-29 18:33:34 +02:00
|
|
|
m4_define([$2], [yes])
|
|
|
|
m4_ifdef([$3], [
|
|
|
|
AC_FATAL([attempt to disable mandatory plugin $1])
|
|
|
|
m4_undefine([$2])
|
|
|
|
])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
dnl ---------------------------------------------------------------------------
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl Macro: MYSQL_PLUGIN_DEPENDS
|
|
|
|
dnl
|
|
|
|
dnl SYNOPSIS
|
|
|
|
dnl MYSQL_PLUGIN_DEPENDS([name],[prereq,prereq...])
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl DESCRIPTION
|
|
|
|
dnl Enables other plugins neccessary for the named plugin
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl Dependency checking is not recursive so if any
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl required plugin requires further plugins, list them
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl here too!
|
|
|
|
dnl
|
|
|
|
dnl ---------------------------------------------------------------------------
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([MYSQL_PLUGIN_DEPENDS],[
|
|
|
|
MYSQL_REQUIRE_PLUGIN([$1])
|
|
|
|
ifelse($#, 2, [
|
|
|
|
_MYSQL_PLUGIN_DEPEND([$1], $2)
|
|
|
|
], [
|
2006-04-30 21:52:30 +02:00
|
|
|
AC_FATAL([bad number of arguments])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([_MYSQL_PLUGIN_DEPEND],[
|
2006-05-03 15:46:19 +02:00
|
|
|
ifelse($#, 1, [], [$#:$2], [2:], [], [
|
2006-05-02 06:33:09 +02:00
|
|
|
MYSQL_REQUIRE_PLUGIN([$2])
|
|
|
|
_MYSQL_PLUGAPPEND([__mysql_plugdepends_$1__],[$2])
|
|
|
|
_MYSQL_PLUGIN_DEPEND([$1], m4_shift(m4_shift($@)))
|
|
|
|
])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
dnl ---------------------------------------------------------------------------
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl Macro: MYSQL_PLUGIN_ACTIONS
|
|
|
|
dnl
|
|
|
|
dnl SYNOPSIS
|
|
|
|
dnl MYSQL_PLUGIN_ACTIONS([name],[PLUGIN_CONFIGURE_STUFF])
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl DESCRIPTION
|
|
|
|
dnl Declares additional autoconf actions required to configure the plugin
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl
|
|
|
|
dnl ---------------------------------------------------------------------------
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([MYSQL_PLUGIN_ACTIONS],[
|
|
|
|
MYSQL_REQUIRE_PLUGIN([$1])
|
2006-04-29 18:33:34 +02:00
|
|
|
m4_ifdef([$2],[
|
2006-05-02 06:33:09 +02:00
|
|
|
m4_define([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]),m4_defn([$2]))
|
2006-04-29 18:33:34 +02:00
|
|
|
],[
|
2006-05-02 06:33:09 +02:00
|
|
|
m4_define([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]), [$2])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2006-10-18 14:03:37 +02:00
|
|
|
dnl ---------------------------------------------------------------------------
|
|
|
|
dnl Macro: MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS
|
|
|
|
dnl
|
|
|
|
dnl SYNOPSIS
|
|
|
|
dnl MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS([name],[file name])
|
|
|
|
dnl
|
|
|
|
dnl DESCRIPTION
|
|
|
|
dnl Some modules in plugins keep dependance on structures
|
|
|
|
dnl declared in sql/ (THD class usually)
|
|
|
|
dnl That has to be fixed in the future, but until then
|
|
|
|
dnl we have to recompile these modules when we want to
|
|
|
|
dnl to compile server parts with the different #defines
|
|
|
|
dnl Normally it happens when we compile the embedded server
|
|
|
|
dnl Thus one should mark such files in his handler using this macro
|
|
|
|
dnl (currently only one such a file per plugin is supported)
|
|
|
|
dnl
|
|
|
|
dnl ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
AC_DEFUN([MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS],[
|
|
|
|
MYSQL_REQUIRE_PLUGIN([$1])
|
|
|
|
m4_define([MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS_]AS_TR_CPP([$1]), [$2])
|
|
|
|
])
|
|
|
|
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl ---------------------------------------------------------------------------
|
|
|
|
dnl Macro: MYSQL_CONFIGURE_PLUGINS
|
|
|
|
dnl
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl SYNOPSIS
|
|
|
|
dnl MYSQL_PLUGIN_DEPENDS([name,name...])
|
|
|
|
dnl
|
|
|
|
dnl DESCRIPTION
|
|
|
|
dnl Used last, emits all required shell code to configure the plugins
|
|
|
|
dnl Argument is a list of default plugins or meta-plugin
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl
|
|
|
|
dnl ---------------------------------------------------------------------------
|
|
|
|
|
2006-04-29 18:33:34 +02:00
|
|
|
AC_DEFUN([MYSQL_CONFIGURE_PLUGINS],[
|
|
|
|
m4_ifdef([__mysql_plugin_configured__],[
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_FATAL([cannot use [MYSQL_CONFIGURE_PLUGINS] multiple times])
|
2006-04-29 18:33:34 +02:00
|
|
|
],[
|
|
|
|
m4_define([__mysql_plugin_configured__],[done])
|
2006-05-04 23:14:56 +02:00
|
|
|
_MYSQL_INCLUDE_LIST(
|
|
|
|
m4_bpatsubst(m4_esyscmd([ls plugin/*/plug.in storage/*/plug.in 2>/dev/null]),
|
|
|
|
[[
|
|
|
|
]],[,]))
|
2006-04-29 18:33:34 +02:00
|
|
|
m4_ifdef([__mysql_plugin_list__],[
|
2006-04-20 19:03:15 +02:00
|
|
|
_MYSQL_CHECK_PLUGIN_ARGS([$1])
|
2006-04-13 22:49:29 +02:00
|
|
|
_MYSQL_CONFIGURE_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
|
2006-05-02 06:33:09 +02:00
|
|
|
_MYSQL_EMIT_PLUGIN_ACTIONS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
|
2006-04-30 21:52:30 +02:00
|
|
|
AC_SUBST([mysql_se_dirs])
|
2009-02-15 03:18:30 +01:00
|
|
|
AC_SUBST([mysql_se_distdirs])
|
2006-04-30 21:52:30 +02:00
|
|
|
AC_SUBST([mysql_pg_dirs])
|
2009-02-15 03:18:30 +01:00
|
|
|
AC_SUBST([mysql_pg_distdirs])
|
2006-09-15 15:15:24 +02:00
|
|
|
AC_SUBST([mysql_se_unittest_dirs])
|
|
|
|
AC_SUBST([mysql_pg_unittest_dirs])
|
2006-10-18 14:03:37 +02:00
|
|
|
AC_SUBST([condition_dependent_plugin_modules])
|
2006-12-28 06:42:04 +01:00
|
|
|
AC_SUBST([condition_dependent_plugin_objects])
|
2006-10-18 14:03:37 +02:00
|
|
|
AC_SUBST([condition_dependent_plugin_links])
|
|
|
|
AC_SUBST([condition_dependent_plugin_includes])
|
2006-04-29 18:33:34 +02:00
|
|
|
])
|
|
|
|
])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
2006-04-29 18:33:34 +02:00
|
|
|
AC_DEFUN([_MYSQL_CONFIGURE_PLUGINS],[
|
|
|
|
ifelse($#, 0, [], $#, 1, [
|
2006-05-02 06:33:09 +02:00
|
|
|
_MYSQL_EMIT_CHECK_PLUGIN([$1])
|
2006-04-29 18:33:34 +02:00
|
|
|
],[
|
2006-05-02 06:33:09 +02:00
|
|
|
_MYSQL_EMIT_CHECK_PLUGIN([$1])
|
2006-04-29 18:33:34 +02:00
|
|
|
_MYSQL_CONFIGURE_PLUGINS(m4_shift($@))
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([_MYSQL_EMIT_CHECK_PLUGIN],[
|
|
|
|
__MYSQL_EMIT_CHECK_PLUGIN(
|
2006-04-13 22:49:29 +02:00
|
|
|
[$1],
|
2006-04-29 18:33:34 +02:00
|
|
|
m4_bpatsubst([$1], -, _),
|
2006-05-02 06:33:09 +02:00
|
|
|
[MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]),
|
|
|
|
[MYSQL_PLUGIN_DESC_]AS_TR_CPP([$1]),
|
|
|
|
[MYSQL_PLUGIN_DEFINE_]AS_TR_CPP([$1]),
|
|
|
|
[MYSQL_PLUGIN_DIRECTORY_]AS_TR_CPP([$1]),
|
|
|
|
[MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]),
|
|
|
|
[MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]),
|
|
|
|
[MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1]),
|
|
|
|
[MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
|
2006-10-18 14:03:37 +02:00
|
|
|
[MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS_]AS_TR_CPP([$1]),
|
2006-05-02 06:33:09 +02:00
|
|
|
[MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1])
|
2006-04-29 18:33:34 +02:00
|
|
|
)
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[
|
2006-04-29 18:33:34 +02:00
|
|
|
m4_ifdef([$5],[
|
2006-04-13 22:49:29 +02:00
|
|
|
AH_TEMPLATE($5, [Include ]$4[ into mysqld])
|
|
|
|
])
|
2006-04-29 18:33:34 +02:00
|
|
|
AC_MSG_CHECKING([whether to use ]$3)
|
2006-04-30 21:52:30 +02:00
|
|
|
mysql_use_plugin_dir=""
|
2006-04-13 22:49:29 +02:00
|
|
|
m4_ifdef([$10],[
|
2006-10-18 15:48:38 +02:00
|
|
|
if test "X[$mysql_plugin_]$2" = Xyes -a \
|
|
|
|
"X[$with_plugin_]$2" != Xno -o \
|
|
|
|
"X[$with_plugin_]$2" = Xyes; then
|
2006-04-30 21:52:30 +02:00
|
|
|
AC_MSG_RESULT([error])
|
2006-04-13 22:49:29 +02:00
|
|
|
AC_MSG_ERROR([disabled])
|
|
|
|
fi
|
2006-04-29 18:33:34 +02:00
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
],[
|
2009-02-15 03:18:30 +01:00
|
|
|
|
|
|
|
# Plugin is not disabled, determine if it should be built,
|
|
|
|
# or only distributed
|
|
|
|
|
|
|
|
m4_ifdef([$6], [
|
|
|
|
if test ! -d "$srcdir/$6"; then
|
|
|
|
# Plugin directory was removed after autoconf was run; treat
|
|
|
|
# this as a disabled plugin
|
|
|
|
if test "X[$with_plugin_]$2" = Xyes; then
|
|
|
|
AC_MSG_RESULT([error])
|
|
|
|
AC_MSG_ERROR([disabled])
|
|
|
|
fi
|
|
|
|
|
|
|
|
# The result message will be printed below
|
|
|
|
[with_plugin_]$2=no
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
2006-04-13 22:49:29 +02:00
|
|
|
m4_ifdef([$9],[
|
2006-05-02 06:33:09 +02:00
|
|
|
if test "X[$with_plugin_]$2" = Xno; then
|
2006-04-30 21:52:30 +02:00
|
|
|
AC_MSG_RESULT([error])
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_MSG_ERROR([cannot disable mandatory plugin])
|
2006-04-13 22:49:29 +02:00
|
|
|
fi
|
2006-05-02 06:33:09 +02:00
|
|
|
[mysql_plugin_]$2=yes
|
2007-10-26 06:19:28 +02:00
|
|
|
],[
|
|
|
|
case "$with_mysqld_ldflags " in
|
|
|
|
*"-all-static "*)
|
|
|
|
# No need to build shared plugins when mysqld is linked with
|
|
|
|
# -all-static as it won't be able to load them.
|
|
|
|
if test "X[$mysql_plugin_]$2" != Xyes -a \
|
|
|
|
"X[$with_plugin_]$2" != Xyes; then
|
|
|
|
[with_plugin_]$2=no
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
2009-02-15 03:18:30 +01:00
|
|
|
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
if test "X[$with_plugin_]$2" = Xno; then
|
2006-04-29 18:33:34 +02:00
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
else
|
2006-05-02 21:04:20 +02:00
|
|
|
m4_ifdef([$8],m4_ifdef([$7],[],[[with_plugin_]$2='']))
|
2006-05-02 06:33:09 +02:00
|
|
|
if test "X[$mysql_plugin_]$2" != Xyes -a \
|
|
|
|
"X[$with_plugin_]$2" != Xyes; then
|
2006-04-29 18:33:34 +02:00
|
|
|
m4_ifdef([$8],[
|
|
|
|
m4_ifdef([$6],[
|
|
|
|
if test -d "$srcdir/$6" ; then
|
2006-04-30 21:52:30 +02:00
|
|
|
mysql_use_plugin_dir="$6"
|
2006-04-29 18:33:34 +02:00
|
|
|
])
|
|
|
|
AC_SUBST([plugin_]$2[_shared_target], "$8")
|
|
|
|
AC_SUBST([plugin_]$2[_static_target], [""])
|
2006-05-02 06:33:09 +02:00
|
|
|
[with_plugin_]$2=yes
|
2006-04-29 18:33:34 +02:00
|
|
|
AC_MSG_RESULT([plugin])
|
2006-04-13 22:49:29 +02:00
|
|
|
m4_ifdef([$6],[
|
2006-04-29 18:33:34 +02:00
|
|
|
else
|
2006-05-02 06:33:09 +02:00
|
|
|
[mysql_plugin_]$2=no
|
2006-04-29 18:33:34 +02:00
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
],[
|
2006-05-02 06:33:09 +02:00
|
|
|
[with_plugin_]$2=no
|
2006-04-29 18:33:34 +02:00
|
|
|
AC_MSG_RESULT([no])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
2006-04-29 18:33:34 +02:00
|
|
|
else
|
2006-04-13 22:49:29 +02:00
|
|
|
m4_ifdef([$7],[
|
2006-04-29 18:33:34 +02:00
|
|
|
ifelse(m4_bregexp($7, [^lib[^.]+\.a$]), -2, [
|
2006-05-02 13:11:00 +02:00
|
|
|
dnl change above "-2" to "0" to enable this section
|
|
|
|
dnl Although this is "pretty", it breaks libmysqld build
|
2006-04-13 22:49:29 +02:00
|
|
|
m4_ifdef([$6],[
|
2006-04-30 21:52:30 +02:00
|
|
|
mysql_use_plugin_dir="$6"
|
2006-04-29 18:33:34 +02:00
|
|
|
mysql_plugin_libs="$mysql_plugin_libs -L[\$(top_builddir)]/$6"
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
2006-05-02 13:11:00 +02:00
|
|
|
mysql_plugin_libs="$mysql_plugin_libs dnl
|
2006-04-29 18:33:34 +02:00
|
|
|
[-l]m4_bregexp($7, [^lib\([^.]+\)], [\1])"
|
|
|
|
], m4_bregexp($7, [^\\\$]), 0, [
|
2006-04-13 22:49:29 +02:00
|
|
|
m4_ifdef([$6],[
|
2006-04-30 21:52:30 +02:00
|
|
|
mysql_use_plugin_dir="$6"
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
2006-04-29 18:33:34 +02:00
|
|
|
mysql_plugin_libs="$mysql_plugin_libs $7"
|
|
|
|
], [
|
2006-04-13 22:49:29 +02:00
|
|
|
m4_ifdef([$6],[
|
2006-04-30 21:52:30 +02:00
|
|
|
mysql_use_plugin_dir="$6"
|
2006-04-29 18:33:34 +02:00
|
|
|
mysql_plugin_libs="$mysql_plugin_libs \$(top_builddir)/$6/$7"
|
2006-04-13 22:49:29 +02:00
|
|
|
],[
|
2006-04-29 18:33:34 +02:00
|
|
|
mysql_plugin_libs="$mysql_plugin_libs $7"
|
|
|
|
])
|
|
|
|
])
|
2006-04-13 22:49:29 +02:00
|
|
|
m4_ifdef([$5],[
|
2006-04-29 18:33:34 +02:00
|
|
|
AC_DEFINE($5)
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
2006-04-29 18:33:34 +02:00
|
|
|
AC_SUBST([plugin_]$2[_static_target], "$7")
|
|
|
|
AC_SUBST([plugin_]$2[_shared_target], [""])
|
|
|
|
],[
|
2006-04-13 22:49:29 +02:00
|
|
|
m4_ifdef([$6],[
|
2006-04-30 21:52:30 +02:00
|
|
|
AC_MSG_RESULT([error])
|
|
|
|
AC_MSG_ERROR([Plugin $1 does not support static linking])
|
2006-04-29 18:33:34 +02:00
|
|
|
],[
|
2006-04-13 22:49:29 +02:00
|
|
|
m4_ifdef([$5],[
|
|
|
|
AC_DEFINE($5)
|
2006-04-29 18:33:34 +02:00
|
|
|
AC_SUBST([plugin_]$2[_static_target], ["yes"])
|
|
|
|
AC_SUBST([plugin_]$2[_shared_target], [""])
|
|
|
|
])
|
|
|
|
])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
2006-04-29 18:33:34 +02:00
|
|
|
mysql_plugin_defs="$mysql_plugin_defs, [builtin_]$2[_plugin]"
|
2006-05-02 06:33:09 +02:00
|
|
|
[with_plugin_]$2=yes
|
2006-04-20 19:03:15 +02:00
|
|
|
AC_MSG_RESULT([yes])
|
2006-10-19 13:39:24 +02:00
|
|
|
m4_ifdef([$11],[
|
|
|
|
condition_dependent_plugin_modules="$condition_dependent_plugin_modules m4_bregexp($11, [[^/]+$], [\&])"
|
2006-12-28 06:42:04 +01:00
|
|
|
condition_dependent_plugin_objects="$condition_dependent_plugin_objects m4_bregexp($11, [[^/]+\.], [\&o])"
|
2006-10-19 13:39:24 +02:00
|
|
|
condition_dependent_plugin_links="$condition_dependent_plugin_links $6/$11"
|
|
|
|
condition_dependent_plugin_includes="$condition_dependent_plugin_includes -I[\$(top_srcdir)]/$6/m4_bregexp($11, [^.+[/$]], [\&])"
|
|
|
|
])
|
2006-04-13 22:49:29 +02:00
|
|
|
fi
|
2006-04-29 18:33:34 +02:00
|
|
|
fi
|
2009-02-15 03:18:30 +01:00
|
|
|
|
|
|
|
m4_ifdef([$6], [
|
|
|
|
if test -d "$srcdir/$6"; then
|
|
|
|
# Even if we don't build a plugin, we bundle its source into the dist
|
|
|
|
# file. So its Makefile (and Makefiles for any subdirs) must be
|
|
|
|
# generated for 'make dist' to work.
|
Bug #43614: make distcheck failure (ndb/Makefile is made, but not subdirs of ndb)
There are some recursive targets that automake generates which reference
DIST_SUBDIRS. It's critical, then, for such subdirs to exist even if they
won't be built as part of SUBDIRS.
During a VPATH build, it is the configure script which creates the subdirs
(when it processes the AC_CONFIG_FILES() for each subdir's Makefile). If
autoconf doesn't create a subdir's Makefile, then the recursive make will fail
when it is unable to cd into that subdir.
This isn't a problem in non-VPATH builds, because the subdirs are all present
in the source tarball. So the problem only shows up during 'make distcheck',
which does a VPATH build.
The fix is to look, when configure is being created by autoconf, for any
plugin subdirectories. These are the dynamic subdirectories which need to be
handled specially. It's enough to tell autoconf to generate a Makefile for
any Makefile.am found in the plugin directory - all plugin subdirectories
using automake (i.e., listed in the plugin's DIST_SUBDIRS) will have a
Makefile.am.
This is done by calling 'find'. This means that 'find' must be in the PATH on
the host that is running autoconf. 'find' is NOT needed when calling
configure, so it is not an additional dependency for the user.
Finally, ha_ndbcluster.m4 had called AC_CONFIG_FILES() on all those subdir
Makefiles, but only when the plugin was actually being built. So it didn't
work in the case that NDB was not being built. All of those Makefiles have to
be removed from this static list, since the plugin machinery is now adding
them automatically. autoconf fails if a file is duplicated in
AC_CONFIG_FILES().
2009-03-13 12:13:55 +01:00
|
|
|
m4_syscmd([test -f "]$6[/configure"])
|
2009-02-15 03:18:30 +01:00
|
|
|
ifelse(m4_sysval, 0,
|
|
|
|
[AC_CONFIG_SUBDIRS($6)],
|
Bug #43614: make distcheck failure (ndb/Makefile is made, but not subdirs of ndb)
There are some recursive targets that automake generates which reference
DIST_SUBDIRS. It's critical, then, for such subdirs to exist even if they
won't be built as part of SUBDIRS.
During a VPATH build, it is the configure script which creates the subdirs
(when it processes the AC_CONFIG_FILES() for each subdir's Makefile). If
autoconf doesn't create a subdir's Makefile, then the recursive make will fail
when it is unable to cd into that subdir.
This isn't a problem in non-VPATH builds, because the subdirs are all present
in the source tarball. So the problem only shows up during 'make distcheck',
which does a VPATH build.
The fix is to look, when configure is being created by autoconf, for any
plugin subdirectories. These are the dynamic subdirectories which need to be
handled specially. It's enough to tell autoconf to generate a Makefile for
any Makefile.am found in the plugin directory - all plugin subdirectories
using automake (i.e., listed in the plugin's DIST_SUBDIRS) will have a
Makefile.am.
This is done by calling 'find'. This means that 'find' must be in the PATH on
the host that is running autoconf. 'find' is NOT needed when calling
configure, so it is not an additional dependency for the user.
Finally, ha_ndbcluster.m4 had called AC_CONFIG_FILES() on all those subdir
Makefiles, but only when the plugin was actually being built. So it didn't
work in the case that NDB was not being built. All of those Makefiles have to
be removed from this static list, since the plugin machinery is now adding
them automatically. autoconf fails if a file is duplicated in
AC_CONFIG_FILES().
2009-03-13 12:13:55 +01:00
|
|
|
[
|
|
|
|
# autoconf doesn't provide an automatic way to configure DIST_SUBDIRS of
|
|
|
|
# a subdir; for our purposes, it's enough to just check for existing
|
|
|
|
# Makefile.am files and add them in here
|
|
|
|
dnl
|
|
|
|
dnl Warning, don't try to quote the m4_esyscmd() macro, it doesn't
|
|
|
|
dnl work. Quoting here is tricky.
|
|
|
|
dnl
|
|
|
|
dnl The $FIND or $SED variable can be set by the user when calling autoconf itself
|
|
|
|
dnl to if they need to pass a specific path. This is *NOT* used when calling
|
|
|
|
dnl running configure!
|
|
|
|
dnl
|
|
|
|
AC_CONFIG_FILES(m4_esyscmd([${FIND-find} "]$6[" -name Makefile.am -print | ${SED-sed} 's,\.am$,,']))
|
|
|
|
]
|
2009-02-15 03:18:30 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
ifelse(
|
|
|
|
m4_substr($6, 0, 8), [storage/], [
|
|
|
|
mysql_se_distdirs="$mysql_se_distdirs m4_substr($6, 8)"
|
|
|
|
if test -n "$mysql_use_plugin_dir" ; then
|
|
|
|
mysql_se_dirs="$mysql_se_dirs m4_substr($6, 8)"
|
|
|
|
mysql_se_unittest_dirs="$mysql_se_unittest_dirs ../$6"
|
|
|
|
fi],
|
|
|
|
|
|
|
|
m4_substr($6, 0, 7), [plugin/], [
|
|
|
|
mysql_pg_distdirs="$mysql_pg_distdirs m4_substr($6, 7)"
|
|
|
|
if test -n "$mysql_use_plugin_dir" ; then
|
|
|
|
mysql_pg_dirs="$mysql_pg_dirs m4_substr($6, 7)"
|
|
|
|
mysql_pg_unittest_dirs="$mysql_pg_unittest_dirs ../$6"
|
|
|
|
fi],
|
|
|
|
[AC_FATAL([don't know how to handle plugin dir ]$6)])
|
|
|
|
fi
|
|
|
|
])
|
2006-04-29 18:33:34 +02:00
|
|
|
])
|
2006-04-20 19:03:15 +02:00
|
|
|
])
|
2006-04-13 22:49:29 +02:00
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([_MYSQL_EMIT_PLUGIN_ACTIONS],[
|
2006-04-29 18:33:34 +02:00
|
|
|
ifelse($#, 0, [], $#, 1, [
|
2006-05-02 06:33:09 +02:00
|
|
|
_MYSQL_EMIT_PLUGIN_ACTION([$1])
|
2006-04-29 18:33:34 +02:00
|
|
|
],[
|
2006-05-02 06:33:09 +02:00
|
|
|
_MYSQL_EMIT_PLUGIN_ACTION([$1])
|
|
|
|
_MYSQL_EMIT_PLUGIN_ACTIONS(m4_shift($@))
|
2006-04-20 19:03:15 +02:00
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([_MYSQL_EMIT_PLUGIN_ACTION],[
|
|
|
|
__MYSQL_EMIT_PLUGIN_ACTION(
|
2006-04-20 19:03:15 +02:00
|
|
|
[$1],
|
2006-04-29 18:33:34 +02:00
|
|
|
m4_bpatsubst([$1], -, _),
|
2006-05-02 06:33:09 +02:00
|
|
|
[MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
|
|
|
|
[MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1])
|
2006-04-29 18:33:34 +02:00
|
|
|
)
|
2006-04-20 19:03:15 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([__MYSQL_EMIT_PLUGIN_ACTION],[
|
|
|
|
m4_ifdef([$3], [], [
|
|
|
|
if test "X[$with_plugin_]$2" = Xyes; then
|
|
|
|
if test "X[$plugin_]$2[_static_target]" = X -a \
|
|
|
|
"X[$plugin_]$2[_shared_target]" = X; then
|
2006-04-29 18:33:34 +02:00
|
|
|
AC_MSG_ERROR([that's strange, $1 failed sanity check])
|
2006-04-13 22:49:29 +02:00
|
|
|
fi
|
2006-05-02 06:33:09 +02:00
|
|
|
$4
|
2006-04-29 18:33:34 +02:00
|
|
|
fi
|
|
|
|
])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dnl ===========================================================================
|
|
|
|
dnl Private helper macros
|
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl SYNOPSIS
|
|
|
|
dnl MYSQL_REQUIRE_PLUGIN([name])
|
|
|
|
dnl
|
|
|
|
dnl DESCRIPTION
|
|
|
|
dnl Checks that the specified plugin does exist
|
|
|
|
|
|
|
|
AC_DEFUN([MYSQL_REQUIRE_PLUGIN],[
|
|
|
|
_MYSQL_REQUIRE_PLUGIN([$1], [__MYSQL_PLUGIN_]AS_TR_CPP([$1])[__])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
define([_MYSQL_REQUIRE_PLUGIN],[
|
2006-04-29 18:33:34 +02:00
|
|
|
ifdef([$2],[
|
|
|
|
ifelse($2, [$1], [], [
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_FATAL([Misspelt MYSQL_PLUGIN declaration for $1])
|
2006-04-29 18:33:34 +02:00
|
|
|
])
|
|
|
|
],[
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_FATAL([Missing MYSQL_PLUGIN declaration for $1])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
dnl ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl SYNOPSIS
|
|
|
|
dnl _MYSQL_EMIT_METAPLUGINS([name,name...])
|
|
|
|
dnl
|
|
|
|
dnl DESCRIPTION
|
|
|
|
dnl Emits shell code for metaplugins
|
|
|
|
|
|
|
|
AC_DEFUN([_MYSQL_EMIT_METAPLUGINS], [ifelse($#, 0, [], $#, 1,
|
|
|
|
[_MYSQL_EMIT_METAPLUGIN([$1], [__mysql_]m4_bpatsubst($1, -, _)[_plugins__])
|
2006-04-29 18:33:34 +02:00
|
|
|
],
|
2006-05-02 06:33:09 +02:00
|
|
|
[_MYSQL_EMIT_METAPLUGIN([$1], [__mysql_]m4_bpatsubst($1, -, _)[_plugins__])
|
|
|
|
_MYSQL_EMIT_METAPLUGINS(m4_shift($@))])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([_MYSQL_EMIT_METAPLUGIN], [
|
2006-04-29 18:33:34 +02:00
|
|
|
[$1] )
|
2006-04-13 22:49:29 +02:00
|
|
|
m4_ifdef([$2], [
|
2006-05-02 06:33:09 +02:00
|
|
|
mysql_plugins='m4_bpatsubst($2, :, [ ])'
|
2006-04-13 22:49:29 +02:00
|
|
|
],[
|
2006-05-02 06:33:09 +02:00
|
|
|
mysql_plugins=''
|
2006-04-20 19:03:15 +02:00
|
|
|
])
|
2006-04-29 18:33:34 +02:00
|
|
|
;;
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
dnl ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl SYNOPSIS
|
|
|
|
dnl _MYSQL_PLUGAPPEND([name],[to-append])
|
|
|
|
dnl
|
|
|
|
dnl DESCRIPTION
|
|
|
|
dnl Helper macro for appending to colon-delimited lists
|
2006-05-02 21:04:20 +02:00
|
|
|
dnl Optinal 3rd argument is for actions only required when defining
|
|
|
|
dnl macro named for the first time.
|
2006-05-02 06:33:09 +02:00
|
|
|
|
2006-04-29 18:33:34 +02:00
|
|
|
AC_DEFUN([_MYSQL_PLUGAPPEND],[
|
|
|
|
m4_ifdef([$1],[
|
|
|
|
m4_define([__plugin_append_tmp__], m4_defn([$1]))
|
|
|
|
m4_undefine([$1])
|
|
|
|
m4_define([$1], __plugin_append_tmp__[:$2])
|
|
|
|
m4_undefine([__plugin_append_tmp__])
|
|
|
|
],[
|
|
|
|
m4_define([$1], [$2])
|
|
|
|
$3
|
|
|
|
])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl SYNOPSIS
|
|
|
|
dnl _MYSQL_PLUGAPPEND_META([name],[meta,meta...])
|
|
|
|
dnl
|
|
|
|
dnl DESCRIPTION
|
|
|
|
dnl Helper macro for adding plugins to meta plugins
|
|
|
|
|
|
|
|
AC_DEFUN([_MYSQL_PLUGAPPEND_META],[
|
|
|
|
ifelse($#, 1, [], [$#:$2], [2:], [], [$2], [all], [
|
2006-04-30 21:52:30 +02:00
|
|
|
AC_FATAL([protected plugin group: all])
|
2006-05-02 06:33:09 +02:00
|
|
|
], [$2], [none], [
|
|
|
|
AC_FATAL([protected plugin group: none])
|
2006-04-29 18:33:34 +02:00
|
|
|
],[
|
2006-05-02 06:33:09 +02:00
|
|
|
_MYSQL_PLUGAPPEND([__mysql_$1_configs__],[$2])
|
|
|
|
_MYSQL_PLUGAPPEND([__mysql_]m4_bpatsubst($2, -, _)[_plugins__],[$1], [
|
|
|
|
_MYSQL_PLUGAPPEND([__mysql_metaplugin_list__],[$2])
|
2006-04-29 18:33:34 +02:00
|
|
|
])
|
2006-05-02 06:33:09 +02:00
|
|
|
_MYSQL_PLUGAPPEND_META([$1], m4_shift(m4_shift($@)))
|
2006-04-29 18:33:34 +02:00
|
|
|
])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
dnl ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl SYNOPSIS
|
|
|
|
dnl MYSQL_LIST_PLUGINS
|
|
|
|
dnl
|
|
|
|
dnl DESCRIPTION
|
|
|
|
dnl Emits formatted list of declared plugins
|
|
|
|
|
2006-04-29 18:33:34 +02:00
|
|
|
AC_DEFUN([MYSQL_LIST_PLUGINS],[dnl
|
|
|
|
m4_ifdef([__mysql_plugin_list__],[dnl
|
|
|
|
_MYSQL_LIST_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))dnl
|
|
|
|
])dnl
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
2006-04-29 18:33:34 +02:00
|
|
|
AC_DEFUN([_MYSQL_LIST_PLUGINS],[dnl
|
|
|
|
ifelse($#, 0, [], $#, 1, [dnl
|
|
|
|
MYSQL_SHOW_PLUGIN([$1])dnl
|
|
|
|
],[dnl
|
|
|
|
MYSQL_SHOW_PLUGIN([$1])dnl
|
|
|
|
_MYSQL_LIST_PLUGINS(m4_shift($@))dnl
|
|
|
|
])dnl
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
2006-04-29 18:33:34 +02:00
|
|
|
AC_DEFUN([MYSQL_SHOW_PLUGIN],[
|
2006-04-13 22:49:29 +02:00
|
|
|
_MYSQL_SHOW_PLUGIN(
|
|
|
|
[$1],
|
|
|
|
[$1-plugin],
|
2006-05-02 06:33:09 +02:00
|
|
|
[MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]),
|
|
|
|
[MYSQL_PLUGIN_DESC_]AS_TR_CPP([$1]),
|
|
|
|
[MYSQL_PLUGIN_DEFINE_]AS_TR_CPP([$1]),
|
|
|
|
[MYSQL_PLUGIN_DIRECTORY_]AS_TR_CPP([$1]),
|
|
|
|
[MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]),
|
|
|
|
[MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]),
|
|
|
|
[MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1]),
|
|
|
|
[MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
|
|
|
|
[MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]),
|
2006-04-13 22:49:29 +02:00
|
|
|
__mysql_[$1]_configs__,
|
|
|
|
)
|
|
|
|
])
|
|
|
|
|
2006-04-29 18:33:34 +02:00
|
|
|
AC_DEFUN([_MYSQL_SHOW_PLUGIN],[dnl
|
2006-04-30 21:52:30 +02:00
|
|
|
=== $3 ===
|
2006-05-02 06:33:09 +02:00
|
|
|
Plugin Name: [$1]
|
2006-04-13 22:49:29 +02:00
|
|
|
Description: $4
|
2006-04-29 18:33:34 +02:00
|
|
|
Supports build: _PLUGIN_BUILD_TYPE([$7],[$8])[]dnl
|
2006-04-13 22:49:29 +02:00
|
|
|
m4_ifdef([$12],[
|
2006-04-29 18:33:34 +02:00
|
|
|
Configurations: m4_bpatsubst($12, :, [, ])])[]dnl
|
2006-04-13 22:49:29 +02:00
|
|
|
m4_ifdef([$10],[
|
2006-04-29 18:33:34 +02:00
|
|
|
Status: disabled])[]dnl
|
2006-04-13 22:49:29 +02:00
|
|
|
m4_ifdef([$9],[
|
2006-04-29 18:33:34 +02:00
|
|
|
Status: mandatory])[]dnl
|
|
|
|
])
|
2006-04-13 22:49:29 +02:00
|
|
|
|
2006-04-29 18:33:34 +02:00
|
|
|
AC_DEFUN([_PLUGIN_BUILD_TYPE],
|
2006-05-02 21:04:20 +02:00
|
|
|
[m4_ifdef([$1],[static ]m4_ifdef([$2],[and dnl
|
|
|
|
]))[]m4_ifdef([$2],[dynamic],[m4_ifdef([$1],[],[static])])])
|
2006-04-13 22:49:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
dnl ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([_MYSQL_EMIT_PLUGINS],[
|
|
|
|
ifelse($#, 0, [], [$#:$1], [1:], [], [
|
|
|
|
m4_ifdef([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]), [], [
|
|
|
|
m4_define([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]),[ ])
|
|
|
|
])
|
2006-04-29 18:33:34 +02:00
|
|
|
[$1] )
|
2006-05-02 06:33:09 +02:00
|
|
|
m4_ifdef([MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),[
|
2006-04-29 18:33:34 +02:00
|
|
|
AC_MSG_ERROR([plugin $1 is disabled])
|
2006-05-02 06:33:09 +02:00
|
|
|
],[
|
2006-05-02 21:04:20 +02:00
|
|
|
_MYSQL_EMIT_PLUGIN_ENABLE([$1], m4_bpatsubst([$1], -, _),
|
|
|
|
[MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]),
|
|
|
|
[MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]),
|
|
|
|
[MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]))
|
2006-05-02 06:33:09 +02:00
|
|
|
])
|
2006-04-29 18:33:34 +02:00
|
|
|
;;
|
2006-05-02 06:33:09 +02:00
|
|
|
_MYSQL_EMIT_PLUGINS(m4_shift($@))
|
2006-04-29 18:33:34 +02:00
|
|
|
])
|
2006-04-20 19:03:15 +02:00
|
|
|
])
|
|
|
|
|
2006-05-02 21:04:20 +02:00
|
|
|
AC_DEFUN([_MYSQL_EMIT_PLUGIN_ENABLE],[
|
|
|
|
m4_ifdef([$5],m4_ifdef([$4],[
|
|
|
|
[mysql_plugin_]$2=yes
|
|
|
|
],[
|
|
|
|
AC_MSG_WARN([$3 can only be built as a plugin])
|
|
|
|
]),[
|
|
|
|
[mysql_plugin_]$2=yes
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([_MYSQL_EMIT_PLUGIN_DEPENDS], [
|
|
|
|
ifelse($#, 0, [], [$#:$1], [1:], [], [
|
|
|
|
_MYSQL_EMIT_CHECK_DEPENDS(m4_bpatsubst([$1], -, _),
|
|
|
|
[__mysql_plugdepends_$1__])
|
|
|
|
_MYSQL_EMIT_PLUGIN_DEPENDS(m4_shift($@))
|
2006-04-29 18:33:34 +02:00
|
|
|
])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([_MYSQL_EMIT_CHECK_DEPENDS], [
|
2006-04-13 22:49:29 +02:00
|
|
|
m4_ifdef([$2], [
|
2006-05-02 06:33:09 +02:00
|
|
|
if test "X[$mysql_plugin_]$1" = Xyes -a \
|
|
|
|
"X[$with_plugin_]$1" != Xno -o \
|
|
|
|
"X[$with_plugin_]$1" = Xyes; then
|
|
|
|
_MYSQL_EMIT_PLUGIN_DEPENDENCIES(m4_bpatsubst($2, :, [,]))
|
2006-04-29 18:33:34 +02:00
|
|
|
fi
|
|
|
|
])
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_DEFUN([_MYSQL_EMIT_PLUGIN_DEPENDENCIES], [
|
2006-05-03 15:46:19 +02:00
|
|
|
ifelse([$1], [], [], [
|
2006-05-02 06:33:09 +02:00
|
|
|
m4_ifdef([MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),[
|
|
|
|
AC_MSG_ERROR([depends upon disabled plugin $1])
|
|
|
|
],[
|
|
|
|
[mysql_plugin_]m4_bpatsubst([$1], -, _)=yes
|
|
|
|
if test "X[$with_plugin_]m4_bpatsubst([$1], -, _)" = Xno; then
|
|
|
|
AC_MSG_ERROR([depends upon disabled plugin $1])
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
_MYSQL_EMIT_PLUGIN_DEPENDENCIES(m4_shift($@))
|
2006-04-29 18:33:34 +02:00
|
|
|
])
|
2006-04-20 19:03:15 +02:00
|
|
|
])
|
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
dnl SYNOPSIS
|
|
|
|
dnl _MYSQL_CHECK_PLUGIN_ARGS([plugin],[plugin]...)
|
|
|
|
dnl
|
|
|
|
dnl DESCRIPTION
|
|
|
|
dnl Emits shell script for checking configure arguments
|
|
|
|
dnl Arguments to this macro is default value for selected plugins
|
2006-04-13 22:49:29 +02:00
|
|
|
|
|
|
|
AC_DEFUN([_MYSQL_CHECK_PLUGIN_ARGS],[
|
2006-05-02 06:33:09 +02:00
|
|
|
__MYSQL_CHECK_PLUGIN_ARGS(m4_default([$1], [none]))
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_DEFUN([__MYSQL_CHECK_PLUGIN_ARGS],[
|
|
|
|
AC_ARG_WITH([plugins],
|
|
|
|
AS_HELP_STRING([--with-plugins=PLUGIN[[[[[,PLUGIN..]]]]]],
|
|
|
|
[Plugins to include in mysqld. (default is: $1) Must be a
|
|
|
|
configuration name or a comma separated list of plugins.])
|
|
|
|
AS_HELP_STRING([],
|
|
|
|
[Available configurations are:] dnl
|
|
|
|
m4_bpatsubst([none:]m4_ifdef([__mysql_metaplugin_list__],
|
|
|
|
__mysql_metaplugin_list__:)[all], :, [ ])[.])
|
|
|
|
AS_HELP_STRING([],
|
|
|
|
[Available plugins are:] dnl
|
2006-04-29 18:33:34 +02:00
|
|
|
m4_bpatsubst(__mysql_plugin_list__, :, [ ])[.])
|
2006-05-02 06:33:09 +02:00
|
|
|
AS_HELP_STRING([--without-plugin-PLUGIN],
|
|
|
|
[Disable the named plugin from being built. Otherwise, for
|
|
|
|
plugins which are not selected for inclusion in mysqld will be
|
2006-04-29 18:33:34 +02:00
|
|
|
built dynamically (if supported)])
|
2006-05-02 06:33:09 +02:00
|
|
|
AS_HELP_STRING([--with-plugin-PLUGIN],
|
|
|
|
[Forces the named plugin to be linked into mysqld statically.]),
|
|
|
|
[mysql_plugins="`echo $withval | tr ',.:;*[]' ' '`"],
|
|
|
|
[mysql_plugins=['$1']])
|
2006-04-13 22:49:29 +02:00
|
|
|
|
|
|
|
m4_divert_once([HELP_VAR_END],[
|
2006-05-02 06:33:09 +02:00
|
|
|
Description of plugins:
|
2006-04-29 18:33:34 +02:00
|
|
|
MYSQL_LIST_PLUGINS])
|
2006-04-13 22:49:29 +02:00
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
case "$mysql_plugins" in
|
2006-04-20 19:03:15 +02:00
|
|
|
all )
|
2006-05-02 06:33:09 +02:00
|
|
|
mysql_plugins='m4_bpatsubst(__mysql_plugin_list__, :, [ ])'
|
2006-04-20 19:03:15 +02:00
|
|
|
;;
|
|
|
|
none )
|
2006-05-02 06:33:09 +02:00
|
|
|
mysql_plugins=''
|
2006-04-29 18:33:34 +02:00
|
|
|
;;
|
|
|
|
m4_ifdef([__mysql_metaplugin_list__],[
|
2006-05-02 06:33:09 +02:00
|
|
|
_MYSQL_EMIT_METAPLUGINS(m4_bpatsubst(__mysql_metaplugin_list__, :, [,]))
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
2006-04-20 19:03:15 +02:00
|
|
|
esac
|
2006-04-13 22:49:29 +02:00
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
for plugin in $mysql_plugins; do
|
2006-04-20 19:03:15 +02:00
|
|
|
case "$plugin" in
|
2006-04-29 18:33:34 +02:00
|
|
|
all | none )
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_MSG_ERROR([bad plugin name: $plugin])
|
2006-04-20 19:03:15 +02:00
|
|
|
;;
|
2006-05-02 06:33:09 +02:00
|
|
|
_MYSQL_EMIT_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
|
2006-04-20 19:03:15 +02:00
|
|
|
* )
|
2006-05-02 06:33:09 +02:00
|
|
|
AC_MSG_ERROR([unknown plugin: $plugin])
|
2006-04-20 19:03:15 +02:00
|
|
|
;;
|
|
|
|
esac
|
2006-04-13 22:49:29 +02:00
|
|
|
done
|
2006-04-20 19:03:15 +02:00
|
|
|
|
2006-05-02 06:33:09 +02:00
|
|
|
_MYSQL_EMIT_PLUGIN_DEPENDS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
|
2006-04-13 22:49:29 +02:00
|
|
|
])
|
|
|
|
|
2006-05-04 23:14:56 +02:00
|
|
|
dnl ---------------------------------------------------------------------------
|
|
|
|
dnl Macro: _MYSQL_INCLUDE_LIST
|
|
|
|
dnl
|
|
|
|
dnl SYNOPSIS
|
|
|
|
dnl _MYSQL_INCLUDE_LIST([filename,filename...])
|
|
|
|
dnl
|
|
|
|
dnl DESCRIPTION
|
|
|
|
dnl includes all files from the list
|
|
|
|
dnl
|
|
|
|
dnl ---------------------------------------------------------------------------
|
|
|
|
AC_DEFUN([_MYSQL_INCLUDE_LIST],[
|
|
|
|
ifelse([$1], [], [], [
|
2006-05-06 13:43:18 +02:00
|
|
|
m4_define([__mysql_include__],[$1])
|
2006-05-10 19:57:58 +02:00
|
|
|
dnl We have to use builtin(), because sinclude would generate an error
|
2006-05-10 17:27:38 +02:00
|
|
|
dnl "file $1 does not exists" in aclocal-1.8 - which is a bug, clearly
|
|
|
|
dnl violating m4 specs, and which is fixed in aclocal-1.9
|
|
|
|
builtin([include],$1)
|
2006-05-06 13:43:18 +02:00
|
|
|
m4_undefine([__mysql_include__])
|
2006-05-04 23:14:56 +02:00
|
|
|
_MYSQL_INCLUDE_LIST(m4_shift($@))
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2006-04-13 22:49:29 +02:00
|
|
|
dnl ===========================================================================
|