From 83583111cadd1a411c6a51c1891e7ca5a4e45223 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Apr 2006 13:49:29 -0700 Subject: WL#3201 " Configure support for server plugins " storage/blackhole/ha_blackhole.h: Rename: sql/ha_blackhole.h -> storage/blackhole/ha_blackhole.h BitKeeper/deleted/.del-storage.m4~24bf2fffdaa328ad: Delete: config/ac-macros/storage.m4 BitKeeper/deleted/.del-ha_archive.m4~a07fac7110b39294: Delete: config/ac-macros/ha_archive.m4 BitKeeper/deleted/.del-ha_blackhole.m4~8ed06eb91f6420ed: Delete: config/ac-macros/ha_blackhole.m4 BitKeeper/deleted/.del-ha_example.m4~1dfb268163297708: Delete: config/ac-macros/ha_example.m4 BitKeeper/deleted/.del-ha_federated.m4~7acddd58286acfd6: Delete: config/ac-macros/ha_federated.m4 BitKeeper/deleted/.del-ha_innodb.m4~6f141fb5b80c1f39: Delete: config/ac-macros/ha_innodb.m4 BitKeeper/deleted/.del-ha_partition.m4~bc57067550be5f89: Delete: config/ac-macros/ha_partition.m4 BitKeeper/deleted/.del-ha_tina.m4~f658506ebbc113ca: Delete: config/ac-macros/ha_tina.m4 BitKeeper/deleted/.del-handlerton.cc.in~377156e7b06067cc: Delete: sql/handlerton.cc.in BitKeeper/deleted/.del-handlerton-win.cc~322a7e59507976df: Delete: sql/handlerton-win.cc BUILD/SETUP.sh: WL#3201 Changes in configure arguments Makefile.am: WL#3201 changes in build subst names config/ac-macros/ha_berkeley.m4: WL#3201 remove unused variable Makefile is always made config/ac-macros/ha_ndbcluster.m4: WL#3201 remove unused variables Split big macro configure.in: WL#3201 out with storage.m4, in with plugins.m4 change how plugins are declared include makefiles, remove handlerton.cc, add sql_builtin.cc include/mysql/plugin.h: WL#3201 support static and dynamic build - MYSQL_DYNAMIC_PLUGIN libmysqld/Makefile.am: WL#3201 Storage engine files still left in sql subdir are not conditionally compiled. Should move them out soon, plugin/Makefile.am: WL#3201 update makefile plugin/fulltext/Makefile.am: WL#3201 update makefile plugin/fulltext/plugin_example.c: WL#3201 change to mysql_declare_plugin macro sql/Makefile.am: WL#3201 Storage engine files still left in sql subdir are not conditionally compiled. Should move them out soon, sql/ha_berkeley.cc: WL#3201 make into a plugin conditionally compile content sql/ha_federated.cc: WL#3201 make into a plugin conditionally compile content sql/ha_heap.cc: WL#3201 make into a plugin sql/ha_innodb.cc: WL#3201 make into a plugin conditionally compile content sql/ha_myisam.cc: WL#3201 make into a plugin sql/ha_myisammrg.cc: WL#3201 make into a plugin sql/ha_ndbcluster.cc: WL#3201 make into a plugin conditionally compile content sql/ha_ndbcluster_binlog.cc: WL#3201 make into a plugin conditionally compile content sql/ha_partition.cc: WL#3201 make into a plugin conditionally compile content sql/handler.cc: WL#3201 Simplify how storage engines are found by db_type (hopefully we can get rid of it soon) Code cleanup sql/handler.h: WL#3201 new DB_TYPE_FIRST_DYNAMIC new func ha_finalize_handlerton() remove ha_register_builtin_plugins() sql/log.cc: WL#3201 make into a plugin sql/mysqld.cc: WL#3201 remove ha_register_builtin_plugins() alter init order so that storage engines are initialized before first use sql/partition_info.cc: WL#3201 conditionally compile content sql/sql_delete.cc: WL#3201 conditionally include ha_innodb.h sql/sql_plugin.cc: WL#3201 All compiled in plugins are in mysqld_builtins[] add funcs for plugin finalization install builtin plugins on initialization sql/sql_show.cc: WL#3201 Fix to use plugin_foreach() sql/sql_yacc.yy: WL#3201 SHOW FULL PLUGIN storage/archive/Makefile.am: WL#3201 setup as plugin makefile storage/archive/ha_archive.cc: WL#3201 Convert into a plugin storage/archive/ha_archive.h: WL#3201 azlib.h now in local dir storage/blackhole/ha_blackhole.cc: WL#3201 convert into a plugin storage/csv/Makefile.am: WL#3201 setup as plugin makefile storage/csv/ha_tina.cc: WL#3201 remove conditional compilation on MYSQL_PLUGIN mysql_declare_plugin macro change storage/example/Makefile.am: WL#3201 fix as new-style plugin makefile storage/example/ha_example.cc: WL#3201 remove conditional compilation on MYSQL_PLUGIN mysql_declare_plugin macro change storage/innobase/Makefile.am: WL#3201 Lets make life easier and reduce innodb into a single library file config/ac-macros/plugins.m4: New BitKeeper file ``config/ac-macros/plugins.m4'' sql/sql_builtin.cc.in: New BitKeeper file ``sql/sql_builtin.cc.in'' storage/blackhole/Makefile.am: New BitKeeper file ``storage/blackhole/Makefile.am'' --- config/ac-macros/plugins.m4 | 603 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 603 insertions(+) create mode 100644 config/ac-macros/plugins.m4 (limited to 'config/ac-macros/plugins.m4') diff --git a/config/ac-macros/plugins.m4 b/config/ac-macros/plugins.m4 new file mode 100644 index 00000000000..5969a85dc14 --- /dev/null +++ b/config/ac-macros/plugins.m4 @@ -0,0 +1,603 @@ +dnl =========================================================================== +dnl Support for plugable mysql server modules +dnl =========================================================================== +dnl +dnl WorkLog#3201 +dnl +dnl Framework for pluggable static and dynamic modules for mysql +dnl +dnl --------------------------------------------------------------------------- +dnl Macro: MYSQL_MODULE +dnl +dnl Syntax: +dnl MYSQL_MODULE([name],[Plugin module name], +dnl [Plugin module description], +dnl [group,group...]) +dnl +dnl What it does: +dnl First declaration for a plugin module (mandatory). +dnl Adds module as member to configuration groups (if specified) +dnl +dnl --------------------------------------------------------------------------- + +AC_DEFUN([MYSQL_MODULE],[ dnl + _MYSQL_MODULE( + [$1], + [__MYSQL_MODULE_]AS_TR_CPP([$1])[__], + m4_default([$2], [$1 plugin]), + m4_default([$3], [plugin for $1]), + m4_default([$4], []), + ) dnl +]) + +AC_DEFUN([_MYSQL_MODULE],[ dnl + m4_ifdef([$2], [ dnl + AC_FATAL([[Duplicate MYSQL_MODULE declaration for ]][$3]) dnl + ],[ dnl + m4_define([$2], [$1]) dnl + _MYSQL_PLUGAPPEND([__mysql_plugin_list__],[$1]) dnl + AC_DEFUN([MYSQL_MODULE_NAME_]AS_TR_CPP([$1]), [$3]) dnl + AC_DEFUN([MYSQL_MODULE_DESC_]AS_TR_CPP([$1]), [$4]) dnl + ifelse([$5], [], [], [ dnl + _MYSQL_PLUGAPPEND_OPTS([$1], $5) dnl + ]) dnl + ]) dnl +]) + + +dnl --------------------------------------------------------------------------- +dnl Macro: MYSQL_STORAGE_ENGINE +dnl +dnl What it does: +dnl Short cut for storage engine declarations +dnl +dnl --------------------------------------------------------------------------- + +AC_DEFUN([MYSQL_STORAGE_ENGINE],[ dnl + MYSQL_MODULE([$1], [$3], [$4], [[$5]]) dnl + MYSQL_MODULE_DEFINE([$1], [WITH_]AS_TR_CPP([$1])[_STORAGE_ENGINE]) dnl + ifelse([$2],[no],[],[ dnl + _MYSQL_LEGACY_STORAGE_ENGINE([$1],m4_default([$2], [$1-storage-engine])) dnl + ]) dnl +]) + +AC_DEFUN([_MYSQL_LEGACY_STORAGE_ENGINE],[ +if test "[${with_]m4_bpatsubst($2, -, _)[+set}]" = set; then + [with_module_]m4_bpatsubst($1, -, _)="[$with_]m4_bpatsubst($2, -, _)" +fi dnl +]) + + +dnl --------------------------------------------------------------------------- +dnl Macro: MYSQL_MODULE_DEFINE +dnl +dnl What it does: +dnl When a plugin module is to be statically linked, define the C macro +dnl +dnl --------------------------------------------------------------------------- + +AC_DEFUN([MYSQL_MODULE_DEFINE],[ dnl + REQUIRE_PLUGIN([$1]) dnl + AC_DEFUN([MYSQL_MODULE_DEFINE_]AS_TR_CPP([$1]), [$2]) dnl +]) + + +dnl --------------------------------------------------------------------------- +dnl Macro: MYSQL_MODULE_DIRECTORY +dnl +dnl What it does: +dnl Adds a directory to the build process +dnl +dnl --------------------------------------------------------------------------- + +AC_DEFUN([MYSQL_MODULE_DIRECTORY],[ dnl + REQUIRE_PLUGIN([$1]) dnl + AC_DEFUN([MYSQL_MODULE_DIRECTORY_]AS_TR_CPP([$1]), [$2]) dnl +]) + + +dnl --------------------------------------------------------------------------- +dnl Macro: MYSQL_MODULE_STATIC +dnl +dnl What it does: +dnl Declare the name for the static library +dnl +dnl --------------------------------------------------------------------------- + +AC_DEFUN([MYSQL_MODULE_STATIC],[ dnl + REQUIRE_PLUGIN([$1]) dnl + AC_DEFUN([MYSQL_MODULE_STATIC_]AS_TR_CPP([$1]), [$2]) dnl +]) + + +dnl --------------------------------------------------------------------------- +dnl Macro: MYSQL_MODULE_DYNAMIC +dnl +dnl What it does: +dnl Declare the name for the shared library +dnl +dnl --------------------------------------------------------------------------- + +AC_DEFUN([MYSQL_MODULE_DYNAMIC],[ dnl + REQUIRE_PLUGIN([$1]) dnl + AC_DEFUN([MYSQL_MODULE_DYNAMIC_]AS_TR_CPP([$1]), [$2]) dnl +]) + + +dnl --------------------------------------------------------------------------- +dnl Macro: MYSQL_MODULE_MANDATORY +dnl +dnl What it does: +dnl Marks the specified plugin as a mandatory module +dnl +dnl --------------------------------------------------------------------------- + +AC_DEFUN([MYSQL_MODULE_MANDATORY],[ dnl + REQUIRE_PLUGIN([$1]) dnl + _MYSQL_MODULE_MANDATORY([$1], + [MYSQL_MODULE_MANDATORY_]AS_TR_CPP([$1]), + [MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]) + ) dnl +]) + +AC_DEFUN([_MYSQL_MODULE_MANDATORY],[ dnl + m4_define([$2], [yes]) dnl + m4_ifdef([$3], [ dnl + AC_WARNING([syntax],[Mandatory plugin $1 has been disabled]) dnl + m4_undefine([$2]) dnl + ]) dnl +]) + + +dnl --------------------------------------------------------------------------- +dnl Macro: MYSQL_MODULE_DISABLED +dnl +dnl What it does: +dnl Marks the specified plugin as a disabled module +dnl +dnl --------------------------------------------------------------------------- + +AC_DEFUN([MYSQL_MODULE_DISABLED],[ dnl + REQUIRE_PLUGIN([$1]) dnl + _MYSQL_MODULE_DISABLED([$1], + [MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]), + [MYSQL_MODULE_MANDATORY_]AS_TR_CPP([$1]) + ) dnl +]) + +AC_DEFUN([_MYSQL_MODULE_DISABLED],[ dnl + m4_define([$2], [yes]) dnl + m4_ifdef([$3], [ dnl + AC_FATAL([attempt to disable mandatory plugin $1]) dnl + m4_undefine([$2]) dnl + ]) dnl +]) + + +dnl --------------------------------------------------------------------------- +dnl Macro: MYSQL_MODULE_DEPENDS +dnl +dnl What it does: +dnl Enables other modules neccessary for this module +dnl Dependency checking is not recursive so if any +dnl required module requires further modules, list them +dnl here too! +dnl +dnl --------------------------------------------------------------------------- + +AC_DEFUN([MYSQL_MODULE_DEPENDS],[ dnl + REQUIRE_PLUGIN([$1]) dnl + ifelse($#, 0, [], $#, 1, [ dnl + AC_FATAL([[bad number of arguments]]) dnl + ], $#, 2, [ dnl + _MYSQL_MODULE_DEPEND([$1],[$2]) dnl + ],[ dnl + _MYSQL_MODULE_DEPEND([$1],[$2]) dnl + MYSQL_MODULE_DEPENDS([$1], m4_shift(m4_shift($@))) dnl + ]) +]) + +AC_DEFUN([_MYSQL_MODULE_DEPEND],[ dnl + REQUIRE_PLUGIN([$2]) dnl + _MYSQL_PLUGAPPEND([__mysql_plugdepends_$1__],[$2]) dnl +]) + + +dnl --------------------------------------------------------------------------- +dnl Macro: MYSQL_MODULE_ACTIONS +dnl +dnl What it does: +dnl Declares additional actions required to configure the module +dnl +dnl --------------------------------------------------------------------------- + +AC_DEFUN([MYSQL_MODULE_ACTIONS],[ dnl + REQUIRE_PLUGIN([$1]) dnl + m4_ifdef([$2],[ dnl + m4_define([MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1]),m4_defn([$2])) dnl + ],[ dnl + AC_DEFUN([MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1]), [$2]) dnl + ]) +]) + + +dnl --------------------------------------------------------------------------- +dnl Macro: MYSQL_CONFIGURE_PLUGINS +dnl +dnl What it does: +dnl Called last, emits all required shell code to configure the modules +dnl +dnl --------------------------------------------------------------------------- + +AC_DEFUN([MYSQL_CONFIGURE_PLUGINS],[ dnl + m4_ifdef([__mysql_plugin_configured__],[ dnl + AC_FATAL([cannot call [MYSQL_CONFIGURE_PLUGINS] multiple times]) dnl + ],[ dnl + m4_define([__mysql_plugin_configured__],[done]) dnl + m4_ifdef([__mysql_plugin_list__],[ dnl + _MYSQL_CHECK_PLUGIN_ARGS([none]) + _MYSQL_CONFIGURE_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) + ]) dnl + ]) dnl +]) + +AC_DEFUN([_MYSQL_CONFIGURE_PLUGINS],[ dnl + ifelse($#, 0, [], $#, 1, [ dnl + _MYSQL_CHECK_PLUGIN([$1]) dnl + ],[ dnl + _MYSQL_CHECK_PLUGIN([$1]) dnl + _MYSQL_CONFIGURE_PLUGINS(m4_shift($@)) dnl + ]) +]) + +AC_DEFUN([_MYSQL_CHECK_PLUGIN],[ dnl + _DO_MYSQL_CHECK_PLUGIN( + [$1], + [$1-plugin], + [MYSQL_MODULE_NAME_]AS_TR_CPP([$1]), + [MYSQL_MODULE_DESC_]AS_TR_CPP([$1]), + [MYSQL_MODULE_DEFINE_]AS_TR_CPP([$1]), + [MYSQL_MODULE_DIRECTORY_]AS_TR_CPP([$1]), + [MYSQL_MODULE_STATIC_]AS_TR_CPP([$1]), + [MYSQL_MODULE_DYNAMIC_]AS_TR_CPP([$1]), + [MYSQL_MODULE_MANDATORY_]AS_TR_CPP([$1]), + [MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]), + [MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1]) + ) dnl +]) + +AC_DEFUN([_DO_MYSQL_CHECK_PLUGIN],[ dnl + m4_ifdef([$5],[ dnl + AH_TEMPLATE($5, [Include ]$4[ into mysqld]) + ]) + AC_MSG_CHECKING([whether to use ]$3) dnl + m4_ifdef([$10],[ + if test "[$mysql_module_]m4_bpatsubst([$1], -, _)" == "yes" -a \ + "[$with_module_]m4_bpatsubst([$1], -, _)" != "no" -o \ + "[$with_module_]m4_bpatsubst([$1], -, _)" == "yes"; then + AC_MSG_ERROR([disabled]) + fi + AC_MSG_RESULT([no]) dnl + ],[ dnl + m4_ifdef([$9],[ + if test "[$with_module_]m4_bpatsubst([$1], -, _)" == "no"; then + AC_MSG_ERROR([cannot disable mandatory module]) + fi + [mysql_module_]m4_bpatsubst([$1], -, _)="yes" dnl + ]) + if test "[$with_module_]m4_bpatsubst([$1], -, _)" != "no"; then + if test "[$mysql_module_]m4_bpatsubst([$1], -, _)" != "yes" -a \ + "[$with_module_]m4_bpatsubst([$1], -, _)" != "yes"; then dnl + m4_ifdef([$8],[ dnl + m4_ifdef([$6],[ + mysql_plugin_dirs="$mysql_plugin_dirs $6" dnl + ]) + AC_SUBST([plugin_]m4_bpatsubst([$1], -, _)[_shared_target], "$8") + AC_SUBST([plugin_]m4_bpatsubst([$1], -, _)[_static_target], [""]) + [with_module_]m4_bpatsubst([$1], -, _)="yes" dnl + ],[ + AC_MSG_RESULT([cannot build dynamically]) + [with_module_]m4_bpatsubst([$1], -, _)="no" dnl + ]) + else dnl + m4_ifdef([$7],[ + ifelse(m4_bregexp($7, [^lib[^.]+\.a$]), -2, [ dnl + m4_ifdef([$6],[ + mysql_plugin_dirs="$mysql_plugin_dirs $6" + mysql_plugin_libs="$mysql_plugin_libs -L[\$(top_builddir)]/$6" dnl + ]) + mysql_plugin_libs="$mysql_plugin_libs dnl +[-l]m4_bregexp($7, [^lib\([^.]+\)], [\1])" dnl + ], m4_bregexp($7, [^\\\$]), 0, [ dnl + m4_ifdef([$6],[ + mysql_plugin_dirs="$mysql_plugin_dirs $6" dnl + ]) + mysql_plugin_libs="$mysql_plugin_libs $7" dnl + ], [ dnl + m4_ifdef([$6],[ + mysql_plugin_dirs="$mysql_plugin_dirs $6" + mysql_plugin_libs="$mysql_plugin_libs \$(top_builddir)/$6/$7" dnl + ],[ + mysql_plugin_libs="$mysql_plugin_libs $7" dnl + ]) dnl + ]) dnl + m4_ifdef([$5],[ + AC_DEFINE($5) dnl + ]) + AC_SUBST([plugin_]m4_bpatsubst([$1], -, _)[_static_target], "$7") + AC_SUBST([plugin_]m4_bpatsubst([$1], -, _)[_shared_target], [""]) dnl + ],[ dnl + m4_ifdef([$6],[ + AC_FATAL([plugin directory specified without library for ]$3) dnl + ],[ dnl + m4_ifdef([$5],[ + AC_DEFINE($5) + AC_SUBST([plugin_]m4_bpatsubst([$1], -, _)[_static_target], ["yes"]) + AC_SUBST([plugin_]m4_bpatsubst([$1], -, _)[_shared_target], [""]) dnl + ]) dnl + ]) dnl + ]) + mysql_plugin_defs="$mysql_plugin_defs, [builtin_]m4_bpatsubst([$2], -, _)" + [with_module_]m4_bpatsubst([$1], -, _)="yes" + fi + else + AC_MSG_RESULT([no]) + fi + + if test "[$with_module_]m4_bpatsubst([$1], -, _)" == "yes"; then + if test "[$plugin_]m4_bpatsubst([$1], -, _)[_static_target]" != ""; then + AC_MSG_RESULT([static]) + elif test "[$plugin_]m4_bpatsubst([$1], -, _)[_shared_target]" != ""; then + AC_MSG_RESULT([plugin]) + else + AC_MSG_ERROR([thats strange]) + fi + $11 + fi dnl + ]) dnl +]) + + + +dnl =========================================================================== +dnl Private helper macros +dnl =========================================================================== + + +AC_DEFUN([REQUIRE_PLUGIN],[ dnl + _REQUIRE_PLUGIN([$1], [__MYSQL_MODULE_]AS_TR_CPP([$1])[__]) dnl +]) + +define([_REQUIRE_PLUGIN],[ dnl + ifdef([$2],[ dnl + ifelse($2, [$1], [], [ dnl + AC_FATAL([[Misspelt MYSQL_MODULE declaration for ]][$1]) dnl + ]) dnl + ],[ dnl + AC_FATAL([[Missing MYSQL_MODULE declaration for ]][$1]) dnl + ]) +]) + + +dnl --------------------------------------------------------------------------- + + +AC_DEFUN([_MYSQL_MODULE_META_CHECK], [ifelse($#, 0, [], $#, 1, dnl +[_MYSQL_CHECK_PLUGIN_META([$1], [__mysql_]m4_bpatsubst($1, -, _)[_plugins__]) dnl +], dnl +[_MYSQL_CHECK_PLUGIN_META([$1], [__mysql_]m4_bpatsubst($1, -, _)[_plugins__]) dnl +_MYSQL_MODULE_META_CHECK(m4_shift($@))]) dnl +]) + +AC_DEFUN([_MYSQL_CHECK_PLUGIN_META], [ + elif test "$mysql_modules" == "[$1]"; then dnl +m4_ifdef([$2], [ + mysql_modules="m4_bpatsubst($2, :, [,])" dnl +],[ + mysql_modules="" dnl +]) dnl +]) + + +dnl --------------------------------------------------------------------------- + + +AC_DEFUN([_MYSQL_PLUGAPPEND],[ dnl + m4_ifdef([$1],[ dnl + m4_define([__plugin_append_tmp__], m4_defn([$1])) dnl + m4_undefine([$1]) dnl + m4_define([$1], __plugin_append_tmp__[:$2]) dnl + m4_undefine([__plugin_append_tmp__]) dnl + ],[ dnl + m4_define([$1], [$2]) dnl + $3 + ]) dnl +]) + +AC_DEFUN([_MYSQL_PLUGAPPEND_OPTS],[ dnl + ifelse($#, 0, [], $#, 1, [ dnl + AC_FATAL([[bad number of args]]) + ], $#, 2, [ dnl + _MYSQL_PLUGAPPEND_OPTONE([$1],[$2]) dnl + ],[ dnl + _MYSQL_PLUGAPPEND_OPTONE([$1],[$2]) dnl + _MYSQL_PLUGAPPEND_OPTS([$1], m4_shift(m4_shift($@))) + ]) +]) + +AC_DEFUN([_MYSQL_PLUGAPPEND_OPTONE],[ dnl + ifelse([$2], [all], [ dnl + AC_FATAL([[protected plugin group: all]]) dnl + ],[ dnl + ifelse([$2], [none], [ dnl + AC_FATAL([[protected plugin group: none]]) dnl + ],[ dnl + _MYSQL_PLUGAPPEND([__mysql_$1_configs__],[$2]) dnl + _MYSQL_PLUGAPPEND([__mysql_]m4_bpatsubst($2, -, _)[_plugins__],[$1], [ dnl + _MYSQL_PLUGAPPEND([__mysql_metaplugin_list__],[$2]) dnl + ]) dnl + ]) dnl + ]) dnl +]) + + +dnl --------------------------------------------------------------------------- + + +AC_DEFUN([MYSQL_LIST_PLUGINS],[ dnl + m4_ifdef([__mysql_plugin_list__],[ dnl + _MYSQL_LIST_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) dnl + ]) dnl +]) + +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 +]) + +AC_DEFUN([MYSQL_SHOW_PLUGIN],[ dnl + _MYSQL_SHOW_PLUGIN( + [$1], + [$1-plugin], + [MYSQL_MODULE_NAME_]AS_TR_CPP([$1]), + [MYSQL_MODULE_DESC_]AS_TR_CPP([$1]), + [MYSQL_MODULE_DEFINE_]AS_TR_CPP([$1]), + [MYSQL_MODULE_DIRECTORY_]AS_TR_CPP([$1]), + [MYSQL_MODULE_STATIC_]AS_TR_CPP([$1]), + [MYSQL_MODULE_DYNAMIC_]AS_TR_CPP([$1]), + [MYSQL_MODULE_MANDATORY_]AS_TR_CPP([$1]), + [MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]), + [MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1]), + __mysql_[$1]_configs__, + ) +]) + +AC_DEFUN([_MYSQL_SHOW_PLUGIN],[ + === Plug-in: $3 === + Module Name: [$1] + Description: $4 + Supports build: _PLUGIN_BUILD_TYPE([$7],[$8]) dnl +m4_ifdef([$12],[ + Configurations: m4_bpatsubst($12, :, [, ])]) dnl +m4_ifdef([$10],[ + Status: disabled], [ dnl +m4_ifdef([$9],[ + Status: mandatory])])]) + +AC_DEFUN([_PLUGIN_BUILD_TYPE], dnl +[m4_ifdef([$1],[ifelse($1,[no],[],[static ]m4_ifdef([$2],[and dnl +]))])[]m4_ifdef([$2],[dynamic],[m4_ifdef([$1],[],[static])])]) + + +dnl --------------------------------------------------------------------------- + + +AC_DEFUN([_MYSQL_MODULE_ARGS_CHECK],[ dnl + ifelse($#, 0, [], $#, 1, [ dnl + _MYSQL_CHECK_PLUGIN_ARG([$1], + [MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]), + [MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1])) dnl + ],[ dnl + _MYSQL_CHECK_PLUGIN_ARG([$1], + [MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]), + [MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1])) dnl + _MYSQL_MODULE_ARGS_CHECK(m4_shift($@)) dnl + ]) dnl +]) + +AC_DEFUN([_MYSQL_CHECK_PLUGIN_ARG],[ dnl +m4_ifdef([$3], [], [AC_DEFUN([$3],[ ])]) + elif test "$plugin" == "[$1]"; then dnl +m4_ifdef([$2],[ + AC_MSG_ERROR([plugin $1 is disabled]) dnl +],[ + [mysql_module_]m4_bpatsubst([$1], -, _)="yes" dnl +]) dnl +]) + +AC_DEFUN([_MYSQL_CHECK_DEPENDENCIES], [ dnl + ifelse($#, 0, [], $#, 1, [ dnl + _MYSQL_CHECK_DEPENDS([$1],[__mysql_plugdepends_$1__]) dnl + ],[ dnl + _MYSQL_CHECK_DEPENDS([$1],[__mysql_plugdepends_$1__]) dnl + _MYSQL_CHECK_DEPENDENCIES(m4_shift($@)) dnl + ]) dnl +]) + +AC_DEFUN([_MYSQL_CHECK_DEPENDS], [ dnl + m4_ifdef([$2], [ + if test "[$mysql_module_]m4_bpatsubst([$1], -, _)" == "yes" -a \ + "[$with_module_]m4_bpatsubst([$1], -, _)" != "no" -o \ + "[$with_module_]m4_bpatsubst([$1], -, _)" == "yes"; then dnl + _MYSQL_GEN_DEPENDS(m4_bpatsubst($2, :, [,])) + fi + ]) dnl +]) + +AC_DEFUN([_MYSQL_GEN_DEPENDS], [ dnl + ifelse($#, 0, [], $#, 1, [ + [mysql_module_]m4_bpatsubst([$1], -, _)="yes" + if test "[$with_module_]m4_bpatsubst([$1], -, _)" == "no"; then + AC_MSG_ERROR([depends upon disabled module $1]) + fi dnl + ],[ + [mysql_module_]m4_bpatsubst([$1], -, _)="yes" + if test "[$with_module_]m4_bpatsubst([$1], -, _)" == "no"; then + AC_MSG_ERROR([depends upon disabled module $1]) + fi dnl + _MYSQL_GEN_DEPENDS(m4_shift($@)) dnl + ]) dnl +]) + + +AC_DEFUN([_MYSQL_CHECK_PLUGIN_ARGS],[ + + AC_ARG_WITH([modules], [ + --with-modules=PLUGIN[[,PLUGIN..]] +m4_text_wrap([Plugin modules to include in mysqld. (default is: $1) +Must be configuration name or a comma seperated list of modules.], +[ ]) +m4_text_wrap([Available configurations are: ] +m4_bpatsubst(m4_ifdef([__mysql_metaplugin_list__], dnl +none:all:__mysql_metaplugin_list__,none:all), :, [ ])[.], +[ ]) +m4_text_wrap([Available plugin modules are: ] dnl +m4_bpatsubst(__mysql_plugin_list__, :, [ ])[.], [ ]) + --without-module-PLUGIN +m4_text_wrap([Disable the named module from being built. Otherwise, +for modules which are not selected for inclusion in mysqld will be +built dynamically (if supported)],[ ])], +[mysql_modules="$withval"], [mysql_modules=['$1']]) + +m4_divert_once([HELP_VAR_END],[ +Description of plugin modules: +m4_indir([MYSQL_LIST_PLUGINS]) +]) + + if test "$mysql_modules" == "all"; then + mysql_modules="m4_bpatsubst(__mysql_plugin_list__, :, [,])" + elif test "$mysql_modules" == "none"; then + mysql_modules="" dnl +m4_ifdef([__mysql_metaplugin_list__],[ dnl +_MYSQL_MODULE_META_CHECK(m4_bpatsubst(__mysql_metaplugin_list__, :, [,])) dnl +]) + fi + + for plugin in `echo $mysql_modules | tr ",.:;" " "`; do + if test "$plugin" == "all" -o "$plugin" == "none"; then + AC_MSG_ERROR([bad module name: $plugin]) dnl +_MYSQL_MODULE_ARGS_CHECK(m4_bpatsubst(__mysql_plugin_list__, :, [,])) + else + AC_MSG_ERROR([unknown plugin module: $plugin]) + fi + done + + _MYSQL_CHECK_DEPENDENCIES(m4_bpatsubst(__mysql_plugin_list__, :, [,])) +]) + + +dnl =========================================================================== -- cgit v1.2.1 From a7dde92351f21c134cfd1ba9af4544bbe46a5577 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 Apr 2006 10:03:15 -0700 Subject: WL#3201 Fixes after first review config/ac-macros/ha_ndbcluster.m4: WL#3201 Undo change config/ac-macros/plugins.m4: WL#3201 Remove unneccesary use of AC_DEFUN fix shell script to be more portable configure.in: WL#3201 Remove use of word "engine" when desribing partition module Undo ndb config files change sql/ha_partition.cc: WL#3201 Remove use of word "engine" when desribing partition module sql/handler.cc: WL#3201 Add comment describing installed_htons array --- config/ac-macros/plugins.m4 | 194 +++++++++++++++++++++++++++++--------------- 1 file changed, 128 insertions(+), 66 deletions(-) (limited to 'config/ac-macros/plugins.m4') diff --git a/config/ac-macros/plugins.m4 b/config/ac-macros/plugins.m4 index 5969a85dc14..20d7e2cc11c 100644 --- a/config/ac-macros/plugins.m4 +++ b/config/ac-macros/plugins.m4 @@ -36,8 +36,8 @@ AC_DEFUN([_MYSQL_MODULE],[ dnl ],[ dnl m4_define([$2], [$1]) dnl _MYSQL_PLUGAPPEND([__mysql_plugin_list__],[$1]) dnl - AC_DEFUN([MYSQL_MODULE_NAME_]AS_TR_CPP([$1]), [$3]) dnl - AC_DEFUN([MYSQL_MODULE_DESC_]AS_TR_CPP([$1]), [$4]) dnl + m4_define([MYSQL_MODULE_NAME_]AS_TR_CPP([$1]), [$3]) dnl + m4_define([MYSQL_MODULE_DESC_]AS_TR_CPP([$1]), [$4]) dnl ifelse([$5], [], [], [ dnl _MYSQL_PLUGAPPEND_OPTS([$1], $5) dnl ]) dnl @@ -78,7 +78,7 @@ dnl --------------------------------------------------------------------------- AC_DEFUN([MYSQL_MODULE_DEFINE],[ dnl REQUIRE_PLUGIN([$1]) dnl - AC_DEFUN([MYSQL_MODULE_DEFINE_]AS_TR_CPP([$1]), [$2]) dnl + m4_define([MYSQL_MODULE_DEFINE_]AS_TR_CPP([$1]), [$2]) dnl ]) @@ -92,7 +92,7 @@ dnl --------------------------------------------------------------------------- AC_DEFUN([MYSQL_MODULE_DIRECTORY],[ dnl REQUIRE_PLUGIN([$1]) dnl - AC_DEFUN([MYSQL_MODULE_DIRECTORY_]AS_TR_CPP([$1]), [$2]) dnl + m4_define([MYSQL_MODULE_DIRECTORY_]AS_TR_CPP([$1]), [$2]) dnl ]) @@ -106,7 +106,7 @@ dnl --------------------------------------------------------------------------- AC_DEFUN([MYSQL_MODULE_STATIC],[ dnl REQUIRE_PLUGIN([$1]) dnl - AC_DEFUN([MYSQL_MODULE_STATIC_]AS_TR_CPP([$1]), [$2]) dnl + m4_define([MYSQL_MODULE_STATIC_]AS_TR_CPP([$1]), [$2]) dnl ]) @@ -120,7 +120,7 @@ dnl --------------------------------------------------------------------------- AC_DEFUN([MYSQL_MODULE_DYNAMIC],[ dnl REQUIRE_PLUGIN([$1]) dnl - AC_DEFUN([MYSQL_MODULE_DYNAMIC_]AS_TR_CPP([$1]), [$2]) dnl + m4_define([MYSQL_MODULE_DYNAMIC_]AS_TR_CPP([$1]), [$2]) dnl ]) @@ -216,7 +216,7 @@ AC_DEFUN([MYSQL_MODULE_ACTIONS],[ dnl m4_ifdef([$2],[ dnl m4_define([MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1]),m4_defn([$2])) dnl ],[ dnl - AC_DEFUN([MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1]), [$2]) dnl + m4_define([MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1]), [$2]) dnl ]) ]) @@ -235,8 +235,9 @@ AC_DEFUN([MYSQL_CONFIGURE_PLUGINS],[ dnl ],[ dnl m4_define([__mysql_plugin_configured__],[done]) dnl m4_ifdef([__mysql_plugin_list__],[ dnl - _MYSQL_CHECK_PLUGIN_ARGS([none]) + _MYSQL_CHECK_PLUGIN_ARGS([$1]) _MYSQL_CONFIGURE_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) + _MYSQL_DO_PLUGIN_ACTIONS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) ]) dnl ]) dnl ]) @@ -272,32 +273,33 @@ AC_DEFUN([_DO_MYSQL_CHECK_PLUGIN],[ dnl ]) AC_MSG_CHECKING([whether to use ]$3) dnl m4_ifdef([$10],[ - if test "[$mysql_module_]m4_bpatsubst([$1], -, _)" == "yes" -a \ - "[$with_module_]m4_bpatsubst([$1], -, _)" != "no" -o \ - "[$with_module_]m4_bpatsubst([$1], -, _)" == "yes"; then + if test "[$mysql_module_]m4_bpatsubst([$1], -, _)" = yes -a \ + "[$with_module_]m4_bpatsubst([$1], -, _)" != no -o \ + "[$with_module_]m4_bpatsubst([$1], -, _)" = yes; then AC_MSG_ERROR([disabled]) fi AC_MSG_RESULT([no]) dnl ],[ dnl m4_ifdef([$9],[ - if test "[$with_module_]m4_bpatsubst([$1], -, _)" == "no"; then + if test "[$with_module_]m4_bpatsubst([$1], -, _)" = no; then AC_MSG_ERROR([cannot disable mandatory module]) fi - [mysql_module_]m4_bpatsubst([$1], -, _)="yes" dnl + [mysql_module_]m4_bpatsubst([$1], -, _)=yes dnl ]) - if test "[$with_module_]m4_bpatsubst([$1], -, _)" != "no"; then - if test "[$mysql_module_]m4_bpatsubst([$1], -, _)" != "yes" -a \ - "[$with_module_]m4_bpatsubst([$1], -, _)" != "yes"; then dnl + if test "[$with_module_]m4_bpatsubst([$1], -, _)" != no; then + if test "[$mysql_module_]m4_bpatsubst([$1], -, _)" != yes -a \ + "[$with_module_]m4_bpatsubst([$1], -, _)" != yes; then dnl m4_ifdef([$8],[ dnl m4_ifdef([$6],[ mysql_plugin_dirs="$mysql_plugin_dirs $6" dnl ]) AC_SUBST([plugin_]m4_bpatsubst([$1], -, _)[_shared_target], "$8") AC_SUBST([plugin_]m4_bpatsubst([$1], -, _)[_static_target], [""]) - [with_module_]m4_bpatsubst([$1], -, _)="yes" dnl + [with_module_]m4_bpatsubst([$1], -, _)=yes + AC_MSG_RESULT([plugin]) dnl ],[ - AC_MSG_RESULT([cannot build dynamically]) - [with_module_]m4_bpatsubst([$1], -, _)="no" dnl + [with_module_]m4_bpatsubst([$1], -, _)=no + AC_MSG_RESULT([no]) dnl ]) else dnl m4_ifdef([$7],[ @@ -338,19 +340,47 @@ AC_DEFUN([_DO_MYSQL_CHECK_PLUGIN],[ dnl ]) dnl ]) mysql_plugin_defs="$mysql_plugin_defs, [builtin_]m4_bpatsubst([$2], -, _)" - [with_module_]m4_bpatsubst([$1], -, _)="yes" + [with_module_]m4_bpatsubst([$1], -, _)=yes + AC_MSG_RESULT([yes]) fi else AC_MSG_RESULT([no]) - fi + fi dnl + ]) dnl +]) - if test "[$with_module_]m4_bpatsubst([$1], -, _)" == "yes"; then - if test "[$plugin_]m4_bpatsubst([$1], -, _)[_static_target]" != ""; then - AC_MSG_RESULT([static]) - elif test "[$plugin_]m4_bpatsubst([$1], -, _)[_shared_target]" != ""; then - AC_MSG_RESULT([plugin]) - else - AC_MSG_ERROR([thats strange]) +AC_DEFUN([_MYSQL_DO_PLUGIN_ACTIONS],[ dnl + ifelse($#, 0, [], $#, 1, [ dnl + _MYSQL_PLUGIN_ACTIONS([$1]) dnl + ],[ dnl + _MYSQL_PLUGIN_ACTIONS([$1]) dnl + _MYSQL_DO_PLUGIN_ACTIONS(m4_shift($@)) dnl + ]) +]) + +AC_DEFUN([_MYSQL_PLUGIN_ACTIONS],[ dnl + _DO_MYSQL_PLUGIN_ACTIONS( + [$1], + [$1-plugin], + [MYSQL_MODULE_NAME_]AS_TR_CPP([$1]), + [MYSQL_MODULE_DESC_]AS_TR_CPP([$1]), + [MYSQL_MODULE_DEFINE_]AS_TR_CPP([$1]), + [MYSQL_MODULE_DIRECTORY_]AS_TR_CPP([$1]), + [MYSQL_MODULE_STATIC_]AS_TR_CPP([$1]), + [MYSQL_MODULE_DYNAMIC_]AS_TR_CPP([$1]), + [MYSQL_MODULE_MANDATORY_]AS_TR_CPP([$1]), + [MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]), + [MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1]) + ) dnl +]) + + +AC_DEFUN([_DO_MYSQL_PLUGIN_ACTIONS],[ dnl + m4_ifdef([$10], [], [ + if test "[$with_module_]m4_bpatsubst([$1], -, _)" = yes; then + if test -z "[$plugin_]m4_bpatsubst([$1], -, _)[_static_target]" -a \ + -z "[$plugin_]m4_bpatsubst([$1], -, _)[_shared_target]"; then + AC_MSG_ERROR([thats strange, $1 failed sanity check]) fi $11 fi dnl @@ -390,12 +420,13 @@ _MYSQL_MODULE_META_CHECK(m4_shift($@))]) dnl ]) AC_DEFUN([_MYSQL_CHECK_PLUGIN_META], [ - elif test "$mysql_modules" == "[$1]"; then dnl + [$1] ) dnl m4_ifdef([$2], [ - mysql_modules="m4_bpatsubst($2, :, [,])" dnl + mysql_modules='m4_bpatsubst($2, :, [ ])' dnl ],[ - mysql_modules="" dnl -]) dnl + mysql_modules='' dnl +]) + ;; dnl ]) @@ -410,7 +441,7 @@ AC_DEFUN([_MYSQL_PLUGAPPEND],[ dnl m4_undefine([__plugin_append_tmp__]) dnl ],[ dnl m4_define([$1], [$2]) dnl - $3 + $3 dnl ]) dnl ]) @@ -510,13 +541,30 @@ AC_DEFUN([_MYSQL_MODULE_ARGS_CHECK],[ dnl ]) AC_DEFUN([_MYSQL_CHECK_PLUGIN_ARG],[ dnl -m4_ifdef([$3], [], [AC_DEFUN([$3],[ ])]) - elif test "$plugin" == "[$1]"; then dnl -m4_ifdef([$2],[ + m4_ifdef([$3], [], [m4_define([$3],[ ])]) + [$1] ) dnl + m4_ifdef([$2],[ AC_MSG_ERROR([plugin $1 is disabled]) dnl -],[ - [mysql_module_]m4_bpatsubst([$1], -, _)="yes" dnl -]) dnl + ],[ + [mysql_module_]m4_bpatsubst([$1], -, _)=yes dnl + ]) + ;; dnl +]) + +AC_DEFUN([_MYSQL_SANE_VARS], [ dnl + ifelse($#, 0, [], $#, 1, [ dnl + _MYSQL_SANEVAR([$1]) dnl + ],[ dnl + _MYSQL_SANEVAR([$1]) dnl + _MYSQL_SANE_VARS(m4_shift($@)) dnl + ]) dnl +]) + +AC_DEFUN([_MYSQL_SANEVAR], [ + test -z "[$mysql_module_]m4_bpatsubst([$1], -, _)" && dnl +[mysql_module_]m4_bpatsubst([$1], -, _)='.' + test -z "[$with_module_]m4_bpatsubst([$1], -, _)" && dnl +[with_module_]m4_bpatsubst([$1], -, _)='.' dnl ]) AC_DEFUN([_MYSQL_CHECK_DEPENDENCIES], [ dnl @@ -530,32 +578,35 @@ AC_DEFUN([_MYSQL_CHECK_DEPENDENCIES], [ dnl AC_DEFUN([_MYSQL_CHECK_DEPENDS], [ dnl m4_ifdef([$2], [ - if test "[$mysql_module_]m4_bpatsubst([$1], -, _)" == "yes" -a \ - "[$with_module_]m4_bpatsubst([$1], -, _)" != "no" -o \ - "[$with_module_]m4_bpatsubst([$1], -, _)" == "yes"; then dnl + if test "[$mysql_module_]m4_bpatsubst([$1], -, _)" = yes -a \ + "[$with_module_]m4_bpatsubst([$1], -, _)" != no -o \ + "[$with_module_]m4_bpatsubst([$1], -, _)" = yes; then dnl _MYSQL_GEN_DEPENDS(m4_bpatsubst($2, :, [,])) - fi + fi dnl ]) dnl ]) AC_DEFUN([_MYSQL_GEN_DEPENDS], [ dnl - ifelse($#, 0, [], $#, 1, [ - [mysql_module_]m4_bpatsubst([$1], -, _)="yes" - if test "[$with_module_]m4_bpatsubst([$1], -, _)" == "no"; then - AC_MSG_ERROR([depends upon disabled module $1]) - fi dnl + ifelse($#, 0, [], $#, 1, [ dnl + _MYSQL_GEN_DEPEND([$1]) dnl + ],[ dnl + _MYSQL_GEN_DEPEND([$1]) dnl + _MYSQL_GEN_DEPENDS(m4_shift($@)) dnl + ]) dnl +]) + +AC_DEFUN([_MYSQL_GEN_DEPEND], [ dnl + m4_ifdef([MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]),[ + AC_MSG_ERROR([depends upon disabled module $1]) dnl ],[ - [mysql_module_]m4_bpatsubst([$1], -, _)="yes" - if test "[$with_module_]m4_bpatsubst([$1], -, _)" == "no"; then + [mysql_module_]m4_bpatsubst([$1], -, _)=yes + if test "[$with_module_]m4_bpatsubst([$1], -, _)" = no; then AC_MSG_ERROR([depends upon disabled module $1]) fi dnl - _MYSQL_GEN_DEPENDS(m4_shift($@)) dnl ]) dnl ]) - AC_DEFUN([_MYSQL_CHECK_PLUGIN_ARGS],[ - AC_ARG_WITH([modules], [ --with-modules=PLUGIN[[,PLUGIN..]] m4_text_wrap([Plugin modules to include in mysqld. (default is: $1) @@ -570,32 +621,43 @@ m4_bpatsubst(__mysql_plugin_list__, :, [ ])[.], [ ]) --without-module-PLUGIN m4_text_wrap([Disable the named module from being built. Otherwise, for modules which are not selected for inclusion in mysqld will be -built dynamically (if supported)],[ ])], -[mysql_modules="$withval"], [mysql_modules=['$1']]) +built dynamically (if supported)],[ ]) +],[mysql_modules="`echo $withval | tr ',.:;*[]' ' '`"], + [mysql_modules=['$1']]) m4_divert_once([HELP_VAR_END],[ Description of plugin modules: m4_indir([MYSQL_LIST_PLUGINS]) ]) - if test "$mysql_modules" == "all"; then - mysql_modules="m4_bpatsubst(__mysql_plugin_list__, :, [,])" - elif test "$mysql_modules" == "none"; then - mysql_modules="" dnl + case "$mysql_modules" in + all ) + mysql_modules='m4_bpatsubst(__mysql_plugin_list__, :, [ ])' + ;; + none ) + mysql_modules='' + ;; dnl m4_ifdef([__mysql_metaplugin_list__],[ dnl _MYSQL_MODULE_META_CHECK(m4_bpatsubst(__mysql_metaplugin_list__, :, [,])) dnl ]) - fi + esac - for plugin in `echo $mysql_modules | tr ",.:;" " "`; do - if test "$plugin" == "all" -o "$plugin" == "none"; then - AC_MSG_ERROR([bad module name: $plugin]) dnl + for plugin in $mysql_modules; do + case "$plugin" in + all ) + AC_MSG_ERROR([bad module name: $plugin]) + ;; + none ) + AC_MSG_ERROR([bad module name: $plugin]) + ;; dnl _MYSQL_MODULE_ARGS_CHECK(m4_bpatsubst(__mysql_plugin_list__, :, [,])) - else + * ) AC_MSG_ERROR([unknown plugin module: $plugin]) - fi + ;; + esac done - + + _MYSQL_SANE_VARS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) _MYSQL_CHECK_DEPENDENCIES(m4_bpatsubst(__mysql_plugin_list__, :, [,])) ]) -- cgit v1.2.1 From f00d16a3325e5c28edfdb5aa9f1c4bf82d1fe1f9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 24 Apr 2006 14:32:45 -0700 Subject: WL#3201 post-merge fixes --- config/ac-macros/plugins.m4 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'config/ac-macros/plugins.m4') diff --git a/config/ac-macros/plugins.m4 b/config/ac-macros/plugins.m4 index 20d7e2cc11c..8ea5aca2595 100644 --- a/config/ac-macros/plugins.m4 +++ b/config/ac-macros/plugins.m4 @@ -238,6 +238,7 @@ AC_DEFUN([MYSQL_CONFIGURE_PLUGINS],[ dnl _MYSQL_CHECK_PLUGIN_ARGS([$1]) _MYSQL_CONFIGURE_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) _MYSQL_DO_PLUGIN_ACTIONS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) + _MYSQL_POST_PLUGIN_FIXUP() ]) dnl ]) dnl ]) @@ -661,5 +662,22 @@ _MYSQL_MODULE_ARGS_CHECK(m4_bpatsubst(__mysql_plugin_list__, :, [,])) _MYSQL_CHECK_DEPENDENCIES(m4_bpatsubst(__mysql_plugin_list__, :, [,])) ]) +AC_DEFUN([_MYSQL_POST_PLUGIN_FIXUP],[ + for plugdir in $mysql_plugin_dirs; do + case "$plugdir" in + storage/* ) + mysql_se_dirs="$mysql_se_dirs `echo $plugdir | sed -e 's@^storage/@@'`" + ;; + plugin/* ) + mysql_pg_dirs="$mysql_pg_dirs `echo $plugdir | sed -e 's@^plugin/@@'`" + ;; + *) + AC_MSG_ERROR([don't know how to handle plugin dir $plugdir]) + ;; + esac + done + AC_SUBST(mysql_se_dirs) + AC_SUBST(mysql_pg_dirs) +]) dnl =========================================================================== -- cgit v1.2.1 From 2eff96e63127e846d210ba94b8b3fcdfe9d6e5e6 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 29 Apr 2006 09:33:34 -0700 Subject: make distcheck and cosmetic fixes --- config/ac-macros/plugins.m4 | 583 ++++++++++++++++++++++---------------------- 1 file changed, 296 insertions(+), 287 deletions(-) (limited to 'config/ac-macros/plugins.m4') diff --git a/config/ac-macros/plugins.m4 b/config/ac-macros/plugins.m4 index 8ea5aca2595..51f83e19e5f 100644 --- a/config/ac-macros/plugins.m4 +++ b/config/ac-macros/plugins.m4 @@ -20,28 +20,28 @@ dnl Adds module as member to configuration groups (if specified) dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_MODULE],[ dnl +AC_DEFUN([MYSQL_MODULE],[ _MYSQL_MODULE( [$1], [__MYSQL_MODULE_]AS_TR_CPP([$1])[__], m4_default([$2], [$1 plugin]), m4_default([$3], [plugin for $1]), m4_default([$4], []), - ) dnl + ) ]) -AC_DEFUN([_MYSQL_MODULE],[ dnl - m4_ifdef([$2], [ dnl - AC_FATAL([[Duplicate MYSQL_MODULE declaration for ]][$3]) dnl +AC_DEFUN([_MYSQL_MODULE],[ + m4_ifdef([$2], [ + AC_FATAL([[Duplicate MYSQL_MODULE declaration for ]][$3]) ],[ dnl - m4_define([$2], [$1]) dnl - _MYSQL_PLUGAPPEND([__mysql_plugin_list__],[$1]) dnl - m4_define([MYSQL_MODULE_NAME_]AS_TR_CPP([$1]), [$3]) dnl - m4_define([MYSQL_MODULE_DESC_]AS_TR_CPP([$1]), [$4]) dnl - ifelse([$5], [], [], [ dnl - _MYSQL_PLUGAPPEND_OPTS([$1], $5) dnl - ]) dnl - ]) dnl + m4_define([$2], [$1]) + _MYSQL_PLUGAPPEND([__mysql_plugin_list__],[$1]) + m4_define([MYSQL_MODULE_NAME_]AS_TR_CPP([$1]), [$3]) + m4_define([MYSQL_MODULE_DESC_]AS_TR_CPP([$1]), [$4]) + ifelse([$5], [], [], [ + _MYSQL_PLUGAPPEND_OPTS([$1], $5) + ]) + ]) ]) @@ -53,18 +53,18 @@ dnl Short cut for storage engine declarations dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_STORAGE_ENGINE],[ dnl - MYSQL_MODULE([$1], [$3], [$4], [[$5]]) dnl - MYSQL_MODULE_DEFINE([$1], [WITH_]AS_TR_CPP([$1])[_STORAGE_ENGINE]) dnl - ifelse([$2],[no],[],[ dnl - _MYSQL_LEGACY_STORAGE_ENGINE([$1],m4_default([$2], [$1-storage-engine])) dnl - ]) dnl +AC_DEFUN([MYSQL_STORAGE_ENGINE],[ + MYSQL_MODULE([$1], [$3], [$4], [[$5]]) + MYSQL_MODULE_DEFINE([$1], [WITH_]AS_TR_CPP([$1])[_STORAGE_ENGINE]) + ifelse([$2],[no],[],[ + _MYSQL_LEGACY_STORAGE_ENGINE([$1],m4_default([$2], [$1-storage-engine])) + ]) ]) AC_DEFUN([_MYSQL_LEGACY_STORAGE_ENGINE],[ if test "[${with_]m4_bpatsubst($2, -, _)[+set}]" = set; then [with_module_]m4_bpatsubst($1, -, _)="[$with_]m4_bpatsubst($2, -, _)" -fi dnl +fi ]) @@ -76,9 +76,9 @@ dnl When a plugin module is to be statically linked, define the C macro dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_MODULE_DEFINE],[ dnl - REQUIRE_PLUGIN([$1]) dnl - m4_define([MYSQL_MODULE_DEFINE_]AS_TR_CPP([$1]), [$2]) dnl +AC_DEFUN([MYSQL_MODULE_DEFINE],[ + REQUIRE_PLUGIN([$1]) + m4_define([MYSQL_MODULE_DEFINE_]AS_TR_CPP([$1]), [$2]) ]) @@ -90,9 +90,9 @@ dnl Adds a directory to the build process dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_MODULE_DIRECTORY],[ dnl - REQUIRE_PLUGIN([$1]) dnl - m4_define([MYSQL_MODULE_DIRECTORY_]AS_TR_CPP([$1]), [$2]) dnl +AC_DEFUN([MYSQL_MODULE_DIRECTORY],[ + REQUIRE_PLUGIN([$1]) + m4_define([MYSQL_MODULE_DIRECTORY_]AS_TR_CPP([$1]), [$2]) ]) @@ -104,9 +104,9 @@ dnl Declare the name for the static library dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_MODULE_STATIC],[ dnl - REQUIRE_PLUGIN([$1]) dnl - m4_define([MYSQL_MODULE_STATIC_]AS_TR_CPP([$1]), [$2]) dnl +AC_DEFUN([MYSQL_MODULE_STATIC],[ + REQUIRE_PLUGIN([$1]) + m4_define([MYSQL_MODULE_STATIC_]AS_TR_CPP([$1]), [$2]) ]) @@ -118,9 +118,9 @@ dnl Declare the name for the shared library dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_MODULE_DYNAMIC],[ dnl - REQUIRE_PLUGIN([$1]) dnl - m4_define([MYSQL_MODULE_DYNAMIC_]AS_TR_CPP([$1]), [$2]) dnl +AC_DEFUN([MYSQL_MODULE_DYNAMIC],[ + REQUIRE_PLUGIN([$1]) + m4_define([MYSQL_MODULE_DYNAMIC_]AS_TR_CPP([$1]), [$2]) ]) @@ -132,20 +132,20 @@ dnl Marks the specified plugin as a mandatory module dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_MODULE_MANDATORY],[ dnl - REQUIRE_PLUGIN([$1]) dnl +AC_DEFUN([MYSQL_MODULE_MANDATORY],[ + REQUIRE_PLUGIN([$1]) _MYSQL_MODULE_MANDATORY([$1], [MYSQL_MODULE_MANDATORY_]AS_TR_CPP([$1]), [MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]) - ) dnl + ) ]) -AC_DEFUN([_MYSQL_MODULE_MANDATORY],[ dnl - m4_define([$2], [yes]) dnl - m4_ifdef([$3], [ dnl - AC_WARNING([syntax],[Mandatory plugin $1 has been disabled]) dnl - m4_undefine([$2]) dnl - ]) dnl +AC_DEFUN([_MYSQL_MODULE_MANDATORY],[ + m4_define([$2], [yes]) + m4_ifdef([$3], [ + AC_WARNING([syntax],[Mandatory plugin $1 has been disabled]) + m4_undefine([$2]) + ]) ]) @@ -157,20 +157,20 @@ dnl Marks the specified plugin as a disabled module dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_MODULE_DISABLED],[ dnl - REQUIRE_PLUGIN([$1]) dnl +AC_DEFUN([MYSQL_MODULE_DISABLED],[ + REQUIRE_PLUGIN([$1]) _MYSQL_MODULE_DISABLED([$1], [MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]), [MYSQL_MODULE_MANDATORY_]AS_TR_CPP([$1]) - ) dnl + ) ]) -AC_DEFUN([_MYSQL_MODULE_DISABLED],[ dnl - m4_define([$2], [yes]) dnl - m4_ifdef([$3], [ dnl - AC_FATAL([attempt to disable mandatory plugin $1]) dnl - m4_undefine([$2]) dnl - ]) dnl +AC_DEFUN([_MYSQL_MODULE_DISABLED],[ + m4_define([$2], [yes]) + m4_ifdef([$3], [ + AC_FATAL([attempt to disable mandatory plugin $1]) + m4_undefine([$2]) + ]) ]) @@ -185,21 +185,21 @@ dnl here too! dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_MODULE_DEPENDS],[ dnl - REQUIRE_PLUGIN([$1]) dnl - ifelse($#, 0, [], $#, 1, [ dnl - AC_FATAL([[bad number of arguments]]) dnl - ], $#, 2, [ dnl - _MYSQL_MODULE_DEPEND([$1],[$2]) dnl - ],[ dnl - _MYSQL_MODULE_DEPEND([$1],[$2]) dnl - MYSQL_MODULE_DEPENDS([$1], m4_shift(m4_shift($@))) dnl +AC_DEFUN([MYSQL_MODULE_DEPENDS],[ + REQUIRE_PLUGIN([$1]) + ifelse($#, 0, [], $#, 1, [ + AC_FATAL([[bad number of arguments]]) + ], $#, 2, [ + _MYSQL_MODULE_DEPEND([$1],[$2]) + ],[ + _MYSQL_MODULE_DEPEND([$1],[$2]) + MYSQL_MODULE_DEPENDS([$1], m4_shift(m4_shift($@))) ]) ]) -AC_DEFUN([_MYSQL_MODULE_DEPEND],[ dnl - REQUIRE_PLUGIN([$2]) dnl - _MYSQL_PLUGAPPEND([__mysql_plugdepends_$1__],[$2]) dnl +AC_DEFUN([_MYSQL_MODULE_DEPEND],[ + REQUIRE_PLUGIN([$2]) + _MYSQL_PLUGAPPEND([__mysql_plugdepends_$1__],[$2]) ]) @@ -211,12 +211,12 @@ dnl Declares additional actions required to configure the module dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_MODULE_ACTIONS],[ dnl - REQUIRE_PLUGIN([$1]) dnl - m4_ifdef([$2],[ dnl - m4_define([MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1]),m4_defn([$2])) dnl - ],[ dnl - m4_define([MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1]), [$2]) dnl +AC_DEFUN([MYSQL_MODULE_ACTIONS],[ + REQUIRE_PLUGIN([$1]) + m4_ifdef([$2],[ + m4_define([MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1]),m4_defn([$2])) + ],[ + m4_define([MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1]), [$2]) ]) ]) @@ -229,33 +229,33 @@ dnl Called last, emits all required shell code to configure the modules dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_CONFIGURE_PLUGINS],[ dnl - m4_ifdef([__mysql_plugin_configured__],[ dnl - AC_FATAL([cannot call [MYSQL_CONFIGURE_PLUGINS] multiple times]) dnl - ],[ dnl - m4_define([__mysql_plugin_configured__],[done]) dnl - m4_ifdef([__mysql_plugin_list__],[ dnl +AC_DEFUN([MYSQL_CONFIGURE_PLUGINS],[ + m4_ifdef([__mysql_plugin_configured__],[ + AC_FATAL([cannot call [MYSQL_CONFIGURE_PLUGINS] multiple times]) + ],[ + m4_define([__mysql_plugin_configured__],[done]) + m4_ifdef([__mysql_plugin_list__],[ _MYSQL_CHECK_PLUGIN_ARGS([$1]) _MYSQL_CONFIGURE_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) _MYSQL_DO_PLUGIN_ACTIONS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) _MYSQL_POST_PLUGIN_FIXUP() - ]) dnl - ]) dnl + ]) + ]) ]) -AC_DEFUN([_MYSQL_CONFIGURE_PLUGINS],[ dnl - ifelse($#, 0, [], $#, 1, [ dnl - _MYSQL_CHECK_PLUGIN([$1]) dnl - ],[ dnl - _MYSQL_CHECK_PLUGIN([$1]) dnl - _MYSQL_CONFIGURE_PLUGINS(m4_shift($@)) dnl +AC_DEFUN([_MYSQL_CONFIGURE_PLUGINS],[ + ifelse($#, 0, [], $#, 1, [ + _MYSQL_CHECK_PLUGIN([$1]) + ],[ + _MYSQL_CHECK_PLUGIN([$1]) + _MYSQL_CONFIGURE_PLUGINS(m4_shift($@)) ]) ]) -AC_DEFUN([_MYSQL_CHECK_PLUGIN],[ dnl +AC_DEFUN([_MYSQL_CHECK_PLUGIN],[ _DO_MYSQL_CHECK_PLUGIN( [$1], - [$1-plugin], + m4_bpatsubst([$1], -, _), [MYSQL_MODULE_NAME_]AS_TR_CPP([$1]), [MYSQL_MODULE_DESC_]AS_TR_CPP([$1]), [MYSQL_MODULE_DEFINE_]AS_TR_CPP([$1]), @@ -265,104 +265,111 @@ AC_DEFUN([_MYSQL_CHECK_PLUGIN],[ dnl [MYSQL_MODULE_MANDATORY_]AS_TR_CPP([$1]), [MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]), [MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1]) - ) dnl + ) ]) -AC_DEFUN([_DO_MYSQL_CHECK_PLUGIN],[ dnl - m4_ifdef([$5],[ dnl +AC_DEFUN([_DO_MYSQL_CHECK_PLUGIN],[ + m4_ifdef([$5],[ AH_TEMPLATE($5, [Include ]$4[ into mysqld]) ]) - AC_MSG_CHECKING([whether to use ]$3) dnl + AC_MSG_CHECKING([whether to use ]$3) m4_ifdef([$10],[ - if test "[$mysql_module_]m4_bpatsubst([$1], -, _)" = yes -a \ - "[$with_module_]m4_bpatsubst([$1], -, _)" != no -o \ - "[$with_module_]m4_bpatsubst([$1], -, _)" = yes; then + if test "[$mysql_module_]$2" = yes -a \ + "[$with_module_]$2" != no -o \ + "[$with_module_]$2" = yes; then AC_MSG_ERROR([disabled]) fi - AC_MSG_RESULT([no]) dnl - ],[ dnl + AC_MSG_RESULT([no]) + ],[ m4_ifdef([$9],[ - if test "[$with_module_]m4_bpatsubst([$1], -, _)" = no; then + if test "[$with_module_]$2" = no; then AC_MSG_ERROR([cannot disable mandatory module]) fi - [mysql_module_]m4_bpatsubst([$1], -, _)=yes dnl + [mysql_module_]$2=yes ]) - if test "[$with_module_]m4_bpatsubst([$1], -, _)" != no; then - if test "[$mysql_module_]m4_bpatsubst([$1], -, _)" != yes -a \ - "[$with_module_]m4_bpatsubst([$1], -, _)" != yes; then dnl - m4_ifdef([$8],[ dnl + if test "[$with_module_]$2" = no; then + AC_MSG_RESULT([no]) + else + if test "[$mysql_module_]$2" != yes -a \ + "[$with_module_]$2" != yes; then + m4_ifdef([$8],[ + m4_ifdef([$6],[ + if test -d "$srcdir/$6" ; then + mysql_plugin_dirs="$mysql_plugin_dirs $6" + ]) + AC_SUBST([plugin_]$2[_shared_target], "$8") + AC_SUBST([plugin_]$2[_static_target], [""]) + [with_module_]$2=yes + AC_MSG_RESULT([plugin]) m4_ifdef([$6],[ - mysql_plugin_dirs="$mysql_plugin_dirs $6" dnl + else + [mysql_module_]$2=no + AC_MSG_RESULT([no]) + fi ]) - AC_SUBST([plugin_]m4_bpatsubst([$1], -, _)[_shared_target], "$8") - AC_SUBST([plugin_]m4_bpatsubst([$1], -, _)[_static_target], [""]) - [with_module_]m4_bpatsubst([$1], -, _)=yes - AC_MSG_RESULT([plugin]) dnl ],[ - [with_module_]m4_bpatsubst([$1], -, _)=no - AC_MSG_RESULT([no]) dnl + [with_module_]$2=no + AC_MSG_RESULT([no]) ]) - else dnl + else m4_ifdef([$7],[ - ifelse(m4_bregexp($7, [^lib[^.]+\.a$]), -2, [ dnl + ifelse(m4_bregexp($7, [^lib[^.]+\.a$]), -2, [ m4_ifdef([$6],[ mysql_plugin_dirs="$mysql_plugin_dirs $6" - mysql_plugin_libs="$mysql_plugin_libs -L[\$(top_builddir)]/$6" dnl + mysql_plugin_libs="$mysql_plugin_libs -L[\$(top_builddir)]/$6" ]) - mysql_plugin_libs="$mysql_plugin_libs dnl -[-l]m4_bregexp($7, [^lib\([^.]+\)], [\1])" dnl - ], m4_bregexp($7, [^\\\$]), 0, [ dnl + mysql_plugin_libs="$mysql_plugin_libs +[-l]m4_bregexp($7, [^lib\([^.]+\)], [\1])" + ], m4_bregexp($7, [^\\\$]), 0, [ m4_ifdef([$6],[ - mysql_plugin_dirs="$mysql_plugin_dirs $6" dnl + mysql_plugin_dirs="$mysql_plugin_dirs $6" ]) - mysql_plugin_libs="$mysql_plugin_libs $7" dnl - ], [ dnl + mysql_plugin_libs="$mysql_plugin_libs $7" + ], [ m4_ifdef([$6],[ mysql_plugin_dirs="$mysql_plugin_dirs $6" - mysql_plugin_libs="$mysql_plugin_libs \$(top_builddir)/$6/$7" dnl + mysql_plugin_libs="$mysql_plugin_libs \$(top_builddir)/$6/$7" ],[ - mysql_plugin_libs="$mysql_plugin_libs $7" dnl - ]) dnl - ]) dnl + mysql_plugin_libs="$mysql_plugin_libs $7" + ]) + ]) m4_ifdef([$5],[ - AC_DEFINE($5) dnl + AC_DEFINE($5) ]) - AC_SUBST([plugin_]m4_bpatsubst([$1], -, _)[_static_target], "$7") - AC_SUBST([plugin_]m4_bpatsubst([$1], -, _)[_shared_target], [""]) dnl - ],[ dnl + AC_SUBST([plugin_]$2[_static_target], "$7") + AC_SUBST([plugin_]$2[_shared_target], [""]) + ],[ m4_ifdef([$6],[ - AC_FATAL([plugin directory specified without library for ]$3) dnl - ],[ dnl + AC_FATAL([plugin directory specified without library for ]$3) + ],[ m4_ifdef([$5],[ AC_DEFINE($5) - AC_SUBST([plugin_]m4_bpatsubst([$1], -, _)[_static_target], ["yes"]) - AC_SUBST([plugin_]m4_bpatsubst([$1], -, _)[_shared_target], [""]) dnl - ]) dnl - ]) dnl + AC_SUBST([plugin_]$2[_static_target], ["yes"]) + AC_SUBST([plugin_]$2[_shared_target], [""]) + ]) + ]) ]) - mysql_plugin_defs="$mysql_plugin_defs, [builtin_]m4_bpatsubst([$2], -, _)" - [with_module_]m4_bpatsubst([$1], -, _)=yes + mysql_plugin_defs="$mysql_plugin_defs, [builtin_]$2[_plugin]" + [with_module_]$2=yes AC_MSG_RESULT([yes]) fi - else - AC_MSG_RESULT([no]) - fi dnl - ]) dnl + fi + ]) ]) -AC_DEFUN([_MYSQL_DO_PLUGIN_ACTIONS],[ dnl - ifelse($#, 0, [], $#, 1, [ dnl - _MYSQL_PLUGIN_ACTIONS([$1]) dnl - ],[ dnl - _MYSQL_PLUGIN_ACTIONS([$1]) dnl - _MYSQL_DO_PLUGIN_ACTIONS(m4_shift($@)) dnl +AC_DEFUN([_MYSQL_DO_PLUGIN_ACTIONS],[ + ifelse($#, 0, [], $#, 1, [ + _MYSQL_PLUGIN_ACTIONS([$1]) + ],[ + _MYSQL_PLUGIN_ACTIONS([$1]) + _MYSQL_DO_PLUGIN_ACTIONS(m4_shift($@)) ]) ]) -AC_DEFUN([_MYSQL_PLUGIN_ACTIONS],[ dnl +AC_DEFUN([_MYSQL_PLUGIN_ACTIONS],[ _DO_MYSQL_PLUGIN_ACTIONS( [$1], - [$1-plugin], + m4_bpatsubst([$1], -, _), [MYSQL_MODULE_NAME_]AS_TR_CPP([$1]), [MYSQL_MODULE_DESC_]AS_TR_CPP([$1]), [MYSQL_MODULE_DEFINE_]AS_TR_CPP([$1]), @@ -372,20 +379,20 @@ AC_DEFUN([_MYSQL_PLUGIN_ACTIONS],[ dnl [MYSQL_MODULE_MANDATORY_]AS_TR_CPP([$1]), [MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]), [MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1]) - ) dnl + ) ]) -AC_DEFUN([_DO_MYSQL_PLUGIN_ACTIONS],[ dnl +AC_DEFUN([_DO_MYSQL_PLUGIN_ACTIONS],[ m4_ifdef([$10], [], [ - if test "[$with_module_]m4_bpatsubst([$1], -, _)" = yes; then - if test -z "[$plugin_]m4_bpatsubst([$1], -, _)[_static_target]" -a \ - -z "[$plugin_]m4_bpatsubst([$1], -, _)[_shared_target]"; then - AC_MSG_ERROR([thats strange, $1 failed sanity check]) + if test "[$with_module_]$2" = yes; then + if test -z "[$plugin_]$2[_static_target]" -a \ + -z "[$plugin_]$2[_shared_target]"; then + AC_MSG_ERROR([that's strange, $1 failed sanity check]) fi $11 - fi dnl - ]) dnl + fi + ]) ]) @@ -395,17 +402,17 @@ dnl Private helper macros dnl =========================================================================== -AC_DEFUN([REQUIRE_PLUGIN],[ dnl - _REQUIRE_PLUGIN([$1], [__MYSQL_MODULE_]AS_TR_CPP([$1])[__]) dnl +AC_DEFUN([REQUIRE_PLUGIN],[ + _REQUIRE_PLUGIN([$1], [__MYSQL_MODULE_]AS_TR_CPP([$1])[__]) ]) -define([_REQUIRE_PLUGIN],[ dnl - ifdef([$2],[ dnl - ifelse($2, [$1], [], [ dnl - AC_FATAL([[Misspelt MYSQL_MODULE declaration for ]][$1]) dnl - ]) dnl - ],[ dnl - AC_FATAL([[Missing MYSQL_MODULE declaration for ]][$1]) dnl +define([_REQUIRE_PLUGIN],[ + ifdef([$2],[ + ifelse($2, [$1], [], [ + AC_FATAL([[Misspelt MYSQL_MODULE declaration for ]][$1]) + ]) + ],[ + AC_FATAL([[Missing MYSQL_MODULE declaration for ]][$1]) ]) ]) @@ -413,85 +420,85 @@ define([_REQUIRE_PLUGIN],[ dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([_MYSQL_MODULE_META_CHECK], [ifelse($#, 0, [], $#, 1, dnl -[_MYSQL_CHECK_PLUGIN_META([$1], [__mysql_]m4_bpatsubst($1, -, _)[_plugins__]) dnl -], dnl -[_MYSQL_CHECK_PLUGIN_META([$1], [__mysql_]m4_bpatsubst($1, -, _)[_plugins__]) dnl -_MYSQL_MODULE_META_CHECK(m4_shift($@))]) dnl +AC_DEFUN([_MYSQL_MODULE_META_CHECK], [ifelse($#, 0, [], $#, 1, +[_MYSQL_CHECK_PLUGIN_META([$1], [__mysql_]m4_bpatsubst($1, -, _)[_plugins__]) +], +[_MYSQL_CHECK_PLUGIN_META([$1], [__mysql_]m4_bpatsubst($1, -, _)[_plugins__]) +_MYSQL_MODULE_META_CHECK(m4_shift($@))]) ]) AC_DEFUN([_MYSQL_CHECK_PLUGIN_META], [ - [$1] ) dnl + [$1] ) m4_ifdef([$2], [ - mysql_modules='m4_bpatsubst($2, :, [ ])' dnl + mysql_modules='m4_bpatsubst($2, :, [ ])' ],[ - mysql_modules='' dnl + mysql_modules='' ]) - ;; dnl + ;; ]) dnl --------------------------------------------------------------------------- -AC_DEFUN([_MYSQL_PLUGAPPEND],[ dnl - m4_ifdef([$1],[ dnl - m4_define([__plugin_append_tmp__], m4_defn([$1])) dnl - m4_undefine([$1]) dnl - m4_define([$1], __plugin_append_tmp__[:$2]) dnl - m4_undefine([__plugin_append_tmp__]) dnl - ],[ dnl - m4_define([$1], [$2]) dnl - $3 dnl - ]) dnl +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 + ]) ]) -AC_DEFUN([_MYSQL_PLUGAPPEND_OPTS],[ dnl - ifelse($#, 0, [], $#, 1, [ dnl +AC_DEFUN([_MYSQL_PLUGAPPEND_OPTS],[ + ifelse($#, 0, [], $#, 1, [ AC_FATAL([[bad number of args]]) - ], $#, 2, [ dnl - _MYSQL_PLUGAPPEND_OPTONE([$1],[$2]) dnl - ],[ dnl - _MYSQL_PLUGAPPEND_OPTONE([$1],[$2]) dnl + ], $#, 2, [ + _MYSQL_PLUGAPPEND_OPTONE([$1],[$2]) + ],[ + _MYSQL_PLUGAPPEND_OPTONE([$1],[$2]) _MYSQL_PLUGAPPEND_OPTS([$1], m4_shift(m4_shift($@))) ]) ]) -AC_DEFUN([_MYSQL_PLUGAPPEND_OPTONE],[ dnl - ifelse([$2], [all], [ dnl - AC_FATAL([[protected plugin group: all]]) dnl - ],[ dnl - ifelse([$2], [none], [ dnl - AC_FATAL([[protected plugin group: none]]) dnl - ],[ dnl - _MYSQL_PLUGAPPEND([__mysql_$1_configs__],[$2]) dnl - _MYSQL_PLUGAPPEND([__mysql_]m4_bpatsubst($2, -, _)[_plugins__],[$1], [ dnl - _MYSQL_PLUGAPPEND([__mysql_metaplugin_list__],[$2]) dnl - ]) dnl - ]) dnl - ]) dnl +AC_DEFUN([_MYSQL_PLUGAPPEND_OPTONE],[ + ifelse([$2], [all], [ + AC_FATAL([[protected plugin group: all]]) + ],[ + ifelse([$2], [none], [ + AC_FATAL([[protected plugin group: none]]) + ],[ + _MYSQL_PLUGAPPEND([__mysql_$1_configs__],[$2]) + _MYSQL_PLUGAPPEND([__mysql_]m4_bpatsubst($2, -, _)[_plugins__],[$1], [ + _MYSQL_PLUGAPPEND([__mysql_metaplugin_list__],[$2]) + ]) + ]) + ]) ]) dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_LIST_PLUGINS],[ dnl - m4_ifdef([__mysql_plugin_list__],[ dnl - _MYSQL_LIST_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) dnl - ]) dnl +AC_DEFUN([MYSQL_LIST_PLUGINS],[dnl + m4_ifdef([__mysql_plugin_list__],[dnl + _MYSQL_LIST_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))dnl + ])dnl ]) -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 +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 ]) -AC_DEFUN([MYSQL_SHOW_PLUGIN],[ dnl +AC_DEFUN([MYSQL_SHOW_PLUGIN],[ _MYSQL_SHOW_PLUGIN( [$1], [$1-plugin], @@ -508,19 +515,20 @@ AC_DEFUN([MYSQL_SHOW_PLUGIN],[ dnl ) ]) -AC_DEFUN([_MYSQL_SHOW_PLUGIN],[ - === Plug-in: $3 === +AC_DEFUN([_MYSQL_SHOW_PLUGIN],[dnl + === Plugin: $3 === Module Name: [$1] Description: $4 - Supports build: _PLUGIN_BUILD_TYPE([$7],[$8]) dnl + Supports build: _PLUGIN_BUILD_TYPE([$7],[$8])[]dnl m4_ifdef([$12],[ - Configurations: m4_bpatsubst($12, :, [, ])]) dnl + Configurations: m4_bpatsubst($12, :, [, ])])[]dnl m4_ifdef([$10],[ - Status: disabled], [ dnl + Status: disabled])[]dnl m4_ifdef([$9],[ - Status: mandatory])])]) + Status: mandatory])[]dnl +]) -AC_DEFUN([_PLUGIN_BUILD_TYPE], dnl +AC_DEFUN([_PLUGIN_BUILD_TYPE], [m4_ifdef([$1],[ifelse($1,[no],[],[static ]m4_ifdef([$2],[and dnl ]))])[]m4_ifdef([$2],[dynamic],[m4_ifdef([$1],[],[static])])]) @@ -528,108 +536,107 @@ AC_DEFUN([_PLUGIN_BUILD_TYPE], dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([_MYSQL_MODULE_ARGS_CHECK],[ dnl - ifelse($#, 0, [], $#, 1, [ dnl +AC_DEFUN([_MYSQL_MODULE_ARGS_CHECK],[ + ifelse($#, 0, [], $#, 1, [ _MYSQL_CHECK_PLUGIN_ARG([$1], [MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]), - [MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1])) dnl - ],[ dnl + [MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1])) + ],[ _MYSQL_CHECK_PLUGIN_ARG([$1], [MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]), - [MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1])) dnl - _MYSQL_MODULE_ARGS_CHECK(m4_shift($@)) dnl - ]) dnl + [MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1])) + _MYSQL_MODULE_ARGS_CHECK(m4_shift($@)) + ]) ]) -AC_DEFUN([_MYSQL_CHECK_PLUGIN_ARG],[ dnl +AC_DEFUN([_MYSQL_CHECK_PLUGIN_ARG],[ m4_ifdef([$3], [], [m4_define([$3],[ ])]) - [$1] ) dnl + [$1] ) m4_ifdef([$2],[ - AC_MSG_ERROR([plugin $1 is disabled]) dnl + AC_MSG_ERROR([plugin $1 is disabled]) ],[ - [mysql_module_]m4_bpatsubst([$1], -, _)=yes dnl + [mysql_module_]m4_bpatsubst([$1], -, _)=yes ]) - ;; dnl + ;; ]) -AC_DEFUN([_MYSQL_SANE_VARS], [ dnl - ifelse($#, 0, [], $#, 1, [ dnl - _MYSQL_SANEVAR([$1]) dnl - ],[ dnl - _MYSQL_SANEVAR([$1]) dnl - _MYSQL_SANE_VARS(m4_shift($@)) dnl - ]) dnl +AC_DEFUN([_MYSQL_SANE_VARS], [ + ifelse($#, 0, [], $#, 1, [ + _MYSQL_SANEVAR([$1]) + ],[ + _MYSQL_SANEVAR([$1]) + _MYSQL_SANE_VARS(m4_shift($@)) + ]) ]) AC_DEFUN([_MYSQL_SANEVAR], [ - test -z "[$mysql_module_]m4_bpatsubst([$1], -, _)" && dnl + test -z "[$mysql_module_]m4_bpatsubst([$1], -, _)" && [mysql_module_]m4_bpatsubst([$1], -, _)='.' - test -z "[$with_module_]m4_bpatsubst([$1], -, _)" && dnl -[with_module_]m4_bpatsubst([$1], -, _)='.' dnl + test -z "[$with_module_]m4_bpatsubst([$1], -, _)" && +[with_module_]m4_bpatsubst([$1], -, _)='.' ]) -AC_DEFUN([_MYSQL_CHECK_DEPENDENCIES], [ dnl - ifelse($#, 0, [], $#, 1, [ dnl - _MYSQL_CHECK_DEPENDS([$1],[__mysql_plugdepends_$1__]) dnl - ],[ dnl - _MYSQL_CHECK_DEPENDS([$1],[__mysql_plugdepends_$1__]) dnl - _MYSQL_CHECK_DEPENDENCIES(m4_shift($@)) dnl - ]) dnl +AC_DEFUN([_MYSQL_CHECK_DEPENDENCIES], [ + ifelse($#, 0, [], $#, 1, [ + _MYSQL_CHECK_DEPENDS([$1],[__mysql_plugdepends_$1__]) + ],[ + _MYSQL_CHECK_DEPENDS([$1],[__mysql_plugdepends_$1__]) + _MYSQL_CHECK_DEPENDENCIES(m4_shift($@)) + ]) ]) -AC_DEFUN([_MYSQL_CHECK_DEPENDS], [ dnl +AC_DEFUN([_MYSQL_CHECK_DEPENDS], [ m4_ifdef([$2], [ if test "[$mysql_module_]m4_bpatsubst([$1], -, _)" = yes -a \ "[$with_module_]m4_bpatsubst([$1], -, _)" != no -o \ - "[$with_module_]m4_bpatsubst([$1], -, _)" = yes; then dnl + "[$with_module_]m4_bpatsubst([$1], -, _)" = yes; then _MYSQL_GEN_DEPENDS(m4_bpatsubst($2, :, [,])) - fi dnl - ]) dnl + fi + ]) ]) -AC_DEFUN([_MYSQL_GEN_DEPENDS], [ dnl - ifelse($#, 0, [], $#, 1, [ dnl - _MYSQL_GEN_DEPEND([$1]) dnl - ],[ dnl - _MYSQL_GEN_DEPEND([$1]) dnl - _MYSQL_GEN_DEPENDS(m4_shift($@)) dnl - ]) dnl +AC_DEFUN([_MYSQL_GEN_DEPENDS], [ + ifelse($#, 0, [], $#, 1, [ + _MYSQL_GEN_DEPEND([$1]) + ],[ + _MYSQL_GEN_DEPEND([$1]) + _MYSQL_GEN_DEPENDS(m4_shift($@)) + ]) ]) -AC_DEFUN([_MYSQL_GEN_DEPEND], [ dnl +AC_DEFUN([_MYSQL_GEN_DEPEND], [ m4_ifdef([MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]),[ - AC_MSG_ERROR([depends upon disabled module $1]) dnl + AC_MSG_ERROR([depends upon disabled module $1]) ],[ [mysql_module_]m4_bpatsubst([$1], -, _)=yes if test "[$with_module_]m4_bpatsubst([$1], -, _)" = no; then AC_MSG_ERROR([depends upon disabled module $1]) - fi dnl - ]) dnl + fi + ]) ]) AC_DEFUN([_MYSQL_CHECK_PLUGIN_ARGS],[ - AC_ARG_WITH([modules], [ - --with-modules=PLUGIN[[,PLUGIN..]] -m4_text_wrap([Plugin modules to include in mysqld. (default is: $1) -Must be configuration name or a comma seperated list of modules.], -[ ]) -m4_text_wrap([Available configurations are: ] -m4_bpatsubst(m4_ifdef([__mysql_metaplugin_list__], dnl -none:all:__mysql_metaplugin_list__,none:all), :, [ ])[.], -[ ]) -m4_text_wrap([Available plugin modules are: ] dnl -m4_bpatsubst(__mysql_plugin_list__, :, [ ])[.], [ ]) - --without-module-PLUGIN -m4_text_wrap([Disable the named module from being built. Otherwise, -for modules which are not selected for inclusion in mysqld will be -built dynamically (if supported)],[ ]) -],[mysql_modules="`echo $withval | tr ',.:;*[]' ' '`"], - [mysql_modules=['$1']]) + AC_ARG_WITH([modules], +AS_HELP_STRING([--with-modules=PLUGIN[[[[[,PLUGIN..]]]]]], + [Plugin modules to include in mysqld. (default is: $1) Must be a + configuration name or a comma separated list of modules.]) +AS_HELP_STRING([],[Available configurations are:] dnl +m4_bpatsubst([none:all]m4_ifdef([__mysql_metaplugin_list__], +__mysql_metaplugin_list__), :, [ ])[.]) +AS_HELP_STRING([],[Available plugin modules are:] dnl +m4_bpatsubst(__mysql_plugin_list__, :, [ ])[.]) +AS_HELP_STRING([--without-module-PLUGIN], + [Disable the named module from being built. Otherwise, for + modules which are not selected for inclusion in mysqld will be + built dynamically (if supported)]) +AS_HELP_STRING([--with-module-PLUGIN], + [Forces the named module to be linked into mysqld statically.]), + [mysql_modules="`echo $withval | tr ',.:;*[]' ' '`"], + [mysql_modules=['$1']]) m4_divert_once([HELP_VAR_END],[ Description of plugin modules: -m4_indir([MYSQL_LIST_PLUGINS]) -]) +MYSQL_LIST_PLUGINS]) case "$mysql_modules" in all ) @@ -637,20 +644,17 @@ m4_indir([MYSQL_LIST_PLUGINS]) ;; none ) mysql_modules='' - ;; dnl -m4_ifdef([__mysql_metaplugin_list__],[ dnl -_MYSQL_MODULE_META_CHECK(m4_bpatsubst(__mysql_metaplugin_list__, :, [,])) dnl + ;; +m4_ifdef([__mysql_metaplugin_list__],[ +_MYSQL_MODULE_META_CHECK(m4_bpatsubst(__mysql_metaplugin_list__, :, [,])) ]) esac for plugin in $mysql_modules; do case "$plugin" in - all ) + all | none ) AC_MSG_ERROR([bad module name: $plugin]) ;; - none ) - AC_MSG_ERROR([bad module name: $plugin]) - ;; dnl _MYSQL_MODULE_ARGS_CHECK(m4_bpatsubst(__mysql_plugin_list__, :, [,])) * ) AC_MSG_ERROR([unknown plugin module: $plugin]) @@ -675,6 +679,11 @@ AC_DEFUN([_MYSQL_POST_PLUGIN_FIXUP],[ AC_MSG_ERROR([don't know how to handle plugin dir $plugdir]) ;; esac + if test -f "$srcdir/$plugdir/configure" ; then + other_configures="$other_configures $plugdir/configure" + else + ac_config_files="$ac_config_files $plugdir/Makefile" + fi done AC_SUBST(mysql_se_dirs) AC_SUBST(mysql_pg_dirs) -- cgit v1.2.1 From 3d35b05a0cb35e873ca4ecf595e4524809281634 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 30 Apr 2006 15:52:30 -0400 Subject: fixes Makefile.am: plugin/ must be built before sql/ config/ac-macros/plugins.m4: simplifications, style fixes BitKeeper/etc/ignore: Added compile libmysqld/sql_builtin.cc sql/sql_builtin.cc to the ignore list plugin/Makefile.am: restore comment plugin/fulltext/Makefile.am: revert sql/sql_show.cc: revert --- config/ac-macros/plugins.m4 | 80 ++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 41 deletions(-) (limited to 'config/ac-macros/plugins.m4') diff --git a/config/ac-macros/plugins.m4 b/config/ac-macros/plugins.m4 index 51f83e19e5f..19b951ea467 100644 --- a/config/ac-macros/plugins.m4 +++ b/config/ac-macros/plugins.m4 @@ -32,8 +32,8 @@ AC_DEFUN([MYSQL_MODULE],[ AC_DEFUN([_MYSQL_MODULE],[ m4_ifdef([$2], [ - AC_FATAL([[Duplicate MYSQL_MODULE declaration for ]][$3]) - ],[ dnl + AC_FATAL([Duplicate MYSQL_MODULE declaration for $3]) + ],[ m4_define([$2], [$1]) _MYSQL_PLUGAPPEND([__mysql_plugin_list__],[$1]) m4_define([MYSQL_MODULE_NAME_]AS_TR_CPP([$1]), [$3]) @@ -57,13 +57,14 @@ AC_DEFUN([MYSQL_STORAGE_ENGINE],[ MYSQL_MODULE([$1], [$3], [$4], [[$5]]) MYSQL_MODULE_DEFINE([$1], [WITH_]AS_TR_CPP([$1])[_STORAGE_ENGINE]) ifelse([$2],[no],[],[ - _MYSQL_LEGACY_STORAGE_ENGINE([$1],m4_default([$2], [$1-storage-engine])) + _MYSQL_LEGACY_STORAGE_ENGINE( + m4_bpatsubst(m4_default([$2], [$1-storage-engine]), -, _)) ]) ]) AC_DEFUN([_MYSQL_LEGACY_STORAGE_ENGINE],[ -if test "[${with_]m4_bpatsubst($2, -, _)[+set}]" = set; then - [with_module_]m4_bpatsubst($1, -, _)="[$with_]m4_bpatsubst($2, -, _)" +if test "[${with_]$1[+set}]" = set; then + [with_module_]$1="[$with_]$1" fi ]) @@ -188,7 +189,7 @@ dnl --------------------------------------------------------------------------- AC_DEFUN([MYSQL_MODULE_DEPENDS],[ REQUIRE_PLUGIN([$1]) ifelse($#, 0, [], $#, 1, [ - AC_FATAL([[bad number of arguments]]) + AC_FATAL([bad number of arguments]) ], $#, 2, [ _MYSQL_MODULE_DEPEND([$1],[$2]) ],[ @@ -238,7 +239,8 @@ AC_DEFUN([MYSQL_CONFIGURE_PLUGINS],[ _MYSQL_CHECK_PLUGIN_ARGS([$1]) _MYSQL_CONFIGURE_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) _MYSQL_DO_PLUGIN_ACTIONS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) - _MYSQL_POST_PLUGIN_FIXUP() + AC_SUBST([mysql_se_dirs]) + AC_SUBST([mysql_pg_dirs]) ]) ]) ]) @@ -273,16 +275,19 @@ AC_DEFUN([_DO_MYSQL_CHECK_PLUGIN],[ AH_TEMPLATE($5, [Include ]$4[ into mysqld]) ]) AC_MSG_CHECKING([whether to use ]$3) + mysql_use_plugin_dir="" m4_ifdef([$10],[ if test "[$mysql_module_]$2" = yes -a \ "[$with_module_]$2" != no -o \ "[$with_module_]$2" = yes; then + AC_MSG_RESULT([error]) AC_MSG_ERROR([disabled]) fi AC_MSG_RESULT([no]) ],[ m4_ifdef([$9],[ if test "[$with_module_]$2" = no; then + AC_MSG_RESULT([error]) AC_MSG_ERROR([cannot disable mandatory module]) fi [mysql_module_]$2=yes @@ -295,7 +300,7 @@ AC_DEFUN([_DO_MYSQL_CHECK_PLUGIN],[ m4_ifdef([$8],[ m4_ifdef([$6],[ if test -d "$srcdir/$6" ; then - mysql_plugin_dirs="$mysql_plugin_dirs $6" + mysql_use_plugin_dir="$6" ]) AC_SUBST([plugin_]$2[_shared_target], "$8") AC_SUBST([plugin_]$2[_static_target], [""]) @@ -315,19 +320,19 @@ AC_DEFUN([_DO_MYSQL_CHECK_PLUGIN],[ m4_ifdef([$7],[ ifelse(m4_bregexp($7, [^lib[^.]+\.a$]), -2, [ m4_ifdef([$6],[ - mysql_plugin_dirs="$mysql_plugin_dirs $6" + mysql_use_plugin_dir="$6" mysql_plugin_libs="$mysql_plugin_libs -L[\$(top_builddir)]/$6" ]) mysql_plugin_libs="$mysql_plugin_libs [-l]m4_bregexp($7, [^lib\([^.]+\)], [\1])" ], m4_bregexp($7, [^\\\$]), 0, [ m4_ifdef([$6],[ - mysql_plugin_dirs="$mysql_plugin_dirs $6" + mysql_use_plugin_dir="$6" ]) mysql_plugin_libs="$mysql_plugin_libs $7" ], [ m4_ifdef([$6],[ - mysql_plugin_dirs="$mysql_plugin_dirs $6" + mysql_use_plugin_dir="$6" mysql_plugin_libs="$mysql_plugin_libs \$(top_builddir)/$6/$7" ],[ mysql_plugin_libs="$mysql_plugin_libs $7" @@ -340,7 +345,8 @@ AC_DEFUN([_DO_MYSQL_CHECK_PLUGIN],[ AC_SUBST([plugin_]$2[_shared_target], [""]) ],[ m4_ifdef([$6],[ - AC_FATAL([plugin directory specified without library for ]$3) + AC_MSG_RESULT([error]) + AC_MSG_ERROR([Plugin $1 does not support static linking]) ],[ m4_ifdef([$5],[ AC_DEFINE($5) @@ -353,6 +359,21 @@ AC_DEFUN([_DO_MYSQL_CHECK_PLUGIN],[ [with_module_]$2=yes AC_MSG_RESULT([yes]) fi + m4_ifdef([$6],[ + if test -n "$mysql_use_plugin_dir" ; then + mysql_plugin_dirs="$mysql_plugin_dirs $6" + if test -f "$srcdir/$6/configure" ; then + other_configures="$other_configures $6/configure" + else + AC_CONFIG_FILES($6/Makefile) + fi + ifelse(m4_substr($6, 0, 8), [storage/], + [mysql_se_dirs="$mysql_se_dirs ]m4_substr($6, 8)", + m4_substr($6, 0, 7), [plugin/], + [mysql_pg_dirs="$mysql_pg_dirs ]m4_substr($6, 7)", + [AC_FATAL([don't know how to handle plugin dir ]$6)]) + fi + ]) fi ]) ]) @@ -409,10 +430,10 @@ AC_DEFUN([REQUIRE_PLUGIN],[ define([_REQUIRE_PLUGIN],[ ifdef([$2],[ ifelse($2, [$1], [], [ - AC_FATAL([[Misspelt MYSQL_MODULE declaration for ]][$1]) + AC_FATAL([Misspelt MYSQL_MODULE declaration for $1]) ]) ],[ - AC_FATAL([[Missing MYSQL_MODULE declaration for ]][$1]) + AC_FATAL([Missing MYSQL_MODULE declaration for $1]) ]) ]) @@ -455,7 +476,7 @@ AC_DEFUN([_MYSQL_PLUGAPPEND],[ AC_DEFUN([_MYSQL_PLUGAPPEND_OPTS],[ ifelse($#, 0, [], $#, 1, [ - AC_FATAL([[bad number of args]]) + AC_FATAL([bad number of args]) ], $#, 2, [ _MYSQL_PLUGAPPEND_OPTONE([$1],[$2]) ],[ @@ -466,10 +487,10 @@ AC_DEFUN([_MYSQL_PLUGAPPEND_OPTS],[ AC_DEFUN([_MYSQL_PLUGAPPEND_OPTONE],[ ifelse([$2], [all], [ - AC_FATAL([[protected plugin group: all]]) + AC_FATAL([protected plugin group: all]) ],[ ifelse([$2], [none], [ - AC_FATAL([[protected plugin group: none]]) + AC_FATAL([protected plugin group: none]) ],[ _MYSQL_PLUGAPPEND([__mysql_$1_configs__],[$2]) _MYSQL_PLUGAPPEND([__mysql_]m4_bpatsubst($2, -, _)[_plugins__],[$1], [ @@ -516,7 +537,7 @@ AC_DEFUN([MYSQL_SHOW_PLUGIN],[ ]) AC_DEFUN([_MYSQL_SHOW_PLUGIN],[dnl - === Plugin: $3 === + === $3 === Module Name: [$1] Description: $4 Supports build: _PLUGIN_BUILD_TYPE([$7],[$8])[]dnl @@ -666,27 +687,4 @@ _MYSQL_MODULE_ARGS_CHECK(m4_bpatsubst(__mysql_plugin_list__, :, [,])) _MYSQL_CHECK_DEPENDENCIES(m4_bpatsubst(__mysql_plugin_list__, :, [,])) ]) -AC_DEFUN([_MYSQL_POST_PLUGIN_FIXUP],[ - for plugdir in $mysql_plugin_dirs; do - case "$plugdir" in - storage/* ) - mysql_se_dirs="$mysql_se_dirs `echo $plugdir | sed -e 's@^storage/@@'`" - ;; - plugin/* ) - mysql_pg_dirs="$mysql_pg_dirs `echo $plugdir | sed -e 's@^plugin/@@'`" - ;; - *) - AC_MSG_ERROR([don't know how to handle plugin dir $plugdir]) - ;; - esac - if test -f "$srcdir/$plugdir/configure" ; then - other_configures="$other_configures $plugdir/configure" - else - ac_config_files="$ac_config_files $plugdir/Makefile" - fi - done - AC_SUBST(mysql_se_dirs) - AC_SUBST(mysql_pg_dirs) -]) - dnl =========================================================================== -- cgit v1.2.1 From fa15fbf34738550527b6b102960b7d9750fd959d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 May 2006 21:33:09 -0700 Subject: WL#3201 post-review fixups end plugin/module naming schizophrenia fixup shell code and m4 macro comments cmakelists.txt included in EXTRA_DIST BUILD/SETUP.sh: change module -> plugin config/ac-macros/plugins.m4: change module -> plugin rename some macros fixup comments alter shell code to use similar 'test "X$var" = Xfoo"' which autoconf generates configure.in: change module -> plugin move plugin mandatory declarations near rest of plugin declaration storage/archive/Makefile.am: cmakelists.txt needed in EXTRA_DIST storage/blackhole/Makefile.am: cmakelists.txt needed in EXTRA_DIST storage/csv/Makefile.am: cmakelists.txt needed in EXTRA_DIST storage/example/Makefile.am: cmakelists.txt needed in EXTRA_DIST --- config/ac-macros/plugins.m4 | 551 +++++++++++++++++++++++--------------------- 1 file changed, 288 insertions(+), 263 deletions(-) (limited to 'config/ac-macros/plugins.m4') diff --git a/config/ac-macros/plugins.m4 b/config/ac-macros/plugins.m4 index 19b951ea467..0ca952c4354 100644 --- a/config/ac-macros/plugins.m4 +++ b/config/ac-macros/plugins.m4 @@ -1,45 +1,45 @@ dnl =========================================================================== -dnl Support for plugable mysql server modules +dnl Support for mysql server plugins dnl =========================================================================== dnl dnl WorkLog#3201 dnl -dnl Framework for pluggable static and dynamic modules for mysql +dnl Framework for pluggable static and dynamic plugins for mysql dnl dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_MODULE +dnl Macro: MYSQL_PLUGIN dnl -dnl Syntax: -dnl MYSQL_MODULE([name],[Plugin module name], -dnl [Plugin module description], +dnl SYNOPSIS +dnl MYSQL_PLUGIN([name],[Plugin name], +dnl [Plugin description], dnl [group,group...]) dnl -dnl What it does: -dnl First declaration for a plugin module (mandatory). -dnl Adds module as member to configuration groups (if specified) +dnl DESCRIPTION +dnl First declaration for a plugin (mandatory). +dnl Adds plugin as member to configuration groups (if specified) dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_MODULE],[ - _MYSQL_MODULE( +AC_DEFUN([MYSQL_PLUGIN],[ + _MYSQL_PLUGIN( [$1], - [__MYSQL_MODULE_]AS_TR_CPP([$1])[__], + [__MYSQL_PLUGIN_]AS_TR_CPP([$1])[__], m4_default([$2], [$1 plugin]), m4_default([$3], [plugin for $1]), m4_default([$4], []), ) ]) -AC_DEFUN([_MYSQL_MODULE],[ +AC_DEFUN([_MYSQL_PLUGIN],[ m4_ifdef([$2], [ - AC_FATAL([Duplicate MYSQL_MODULE declaration for $3]) + AC_FATAL([Duplicate MYSQL_PLUGIN declaration for $3]) ],[ m4_define([$2], [$1]) _MYSQL_PLUGAPPEND([__mysql_plugin_list__],[$1]) - m4_define([MYSQL_MODULE_NAME_]AS_TR_CPP([$1]), [$3]) - m4_define([MYSQL_MODULE_DESC_]AS_TR_CPP([$1]), [$4]) + m4_define([MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]), [$3]) + m4_define([MYSQL_PLUGIN_DESC_]AS_TR_CPP([$1]), [$4]) ifelse([$5], [], [], [ - _MYSQL_PLUGAPPEND_OPTS([$1], $5) + _MYSQL_PLUGAPPEND_META([$1], $5) ]) ]) ]) @@ -48,14 +48,18 @@ AC_DEFUN([_MYSQL_MODULE],[ dnl --------------------------------------------------------------------------- dnl Macro: MYSQL_STORAGE_ENGINE dnl -dnl What it does: +dnl SYNOPSIS +dnl MYSQL_STORAGE_ENGINE([name],[legacy-option],[Storage engine name], +dnl [Storage engine description],[group,group...]) +dnl +dnl DESCRIPTION dnl Short cut for storage engine declarations dnl dnl --------------------------------------------------------------------------- AC_DEFUN([MYSQL_STORAGE_ENGINE],[ - MYSQL_MODULE([$1], [$3], [$4], [[$5]]) - MYSQL_MODULE_DEFINE([$1], [WITH_]AS_TR_CPP([$1])[_STORAGE_ENGINE]) + MYSQL_PLUGIN([$1], [$3], [$4], [[$5]]) + MYSQL_PLUGIN_DEFINE([$1], [WITH_]AS_TR_CPP([$1])[_STORAGE_ENGINE]) ifelse([$2],[no],[],[ _MYSQL_LEGACY_STORAGE_ENGINE( m4_bpatsubst(m4_default([$2], [$1-storage-engine]), -, _)) @@ -64,109 +68,127 @@ AC_DEFUN([MYSQL_STORAGE_ENGINE],[ AC_DEFUN([_MYSQL_LEGACY_STORAGE_ENGINE],[ if test "[${with_]$1[+set}]" = set; then - [with_module_]$1="[$with_]$1" + [with_plugin_]$1="[$with_]$1" fi ]) dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_MODULE_DEFINE +dnl Macro: MYSQL_PLUGIN_DEFINE +dnl +dnl SYNOPSIS +dnl MYSQL_PLUGIN_DEFILE([name],[MYSQL_CPP_DEFINE]) dnl -dnl What it does: -dnl When a plugin module is to be statically linked, define the C macro +dnl DESCRIPTION +dnl When a plugin is to be statically linked, define the C macro dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_MODULE_DEFINE],[ - REQUIRE_PLUGIN([$1]) - m4_define([MYSQL_MODULE_DEFINE_]AS_TR_CPP([$1]), [$2]) +AC_DEFUN([MYSQL_PLUGIN_DEFINE],[ + MYSQL_REQUIRE_PLUGIN([$1]) + m4_define([MYSQL_PLUGIN_DEFINE_]AS_TR_CPP([$1]), [$2]) ]) dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_MODULE_DIRECTORY +dnl Macro: MYSQL_PLUGIN_DIRECTORY dnl -dnl What it does: +dnl SYNOPSIS +dnl MYSQL_PLUGIN_DIRECTORY([name],[plugin/dir]) +dnl +dnl DESCRIPTION dnl Adds a directory to the build process dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_MODULE_DIRECTORY],[ - REQUIRE_PLUGIN([$1]) - m4_define([MYSQL_MODULE_DIRECTORY_]AS_TR_CPP([$1]), [$2]) +AC_DEFUN([MYSQL_PLUGIN_DIRECTORY],[ + MYSQL_REQUIRE_PLUGIN([$1]) + m4_define([MYSQL_PLUGIN_DIRECTORY_]AS_TR_CPP([$1]), [$2]) ]) dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_MODULE_STATIC +dnl Macro: MYSQL_PLUGIN_STATIC +dnl +dnl SYNOPSIS +dnl MYSQL_PLUGIN_STATIC([name],[libmyplugin.a]) dnl -dnl What it does: +dnl DESCRIPTION dnl Declare the name for the static library dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_MODULE_STATIC],[ - REQUIRE_PLUGIN([$1]) - m4_define([MYSQL_MODULE_STATIC_]AS_TR_CPP([$1]), [$2]) +AC_DEFUN([MYSQL_PLUGIN_STATIC],[ + MYSQL_REQUIRE_PLUGIN([$1]) + m4_define([MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]), [$2]) ]) dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_MODULE_DYNAMIC +dnl Macro: MYSQL_PLUGIN_DYNAMIC dnl -dnl What it does: +dnl SYNOPSIS +dnl MYSQL_PLUGIN_DYNAMIC([name],[myplugin.la]) +dnl +dnl DESCRIPTION dnl Declare the name for the shared library dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_MODULE_DYNAMIC],[ - REQUIRE_PLUGIN([$1]) - m4_define([MYSQL_MODULE_DYNAMIC_]AS_TR_CPP([$1]), [$2]) +AC_DEFUN([MYSQL_PLUGIN_DYNAMIC],[ + MYSQL_REQUIRE_PLUGIN([$1]) + m4_define([MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]), [$2]) ]) dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_MODULE_MANDATORY +dnl Macro: MYSQL_PLUGIN_MANDATORY +dnl +dnl SYNOPSIS +dnl MYSQL_PLUGIN_MANDATORY([name]) dnl -dnl What it does: -dnl Marks the specified plugin as a mandatory module +dnl DESCRIPTION +dnl Marks the specified plugin as a mandatory plugin dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_MODULE_MANDATORY],[ - REQUIRE_PLUGIN([$1]) - _MYSQL_MODULE_MANDATORY([$1], - [MYSQL_MODULE_MANDATORY_]AS_TR_CPP([$1]), - [MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]) +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]) ) ]) -AC_DEFUN([_MYSQL_MODULE_MANDATORY],[ +AC_DEFUN([_MYSQL_PLUGIN_MANDATORY],[ m4_define([$2], [yes]) m4_ifdef([$3], [ - AC_WARNING([syntax],[Mandatory plugin $1 has been disabled]) + AC_FATAL([mandatory plugin $1 has been disabled]) m4_undefine([$2]) ]) ]) dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_MODULE_DISABLED +dnl Macro: MYSQL_PLUGIN_DISABLED dnl -dnl What it does: -dnl Marks the specified plugin as a disabled module +dnl SYNOPSIS +dnl MYSQL_PLUGIN_DISABLED([name]) +dnl +dnl DESCRIPTION +dnl Marks the specified plugin as a disabled plugin dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_MODULE_DISABLED],[ - REQUIRE_PLUGIN([$1]) - _MYSQL_MODULE_DISABLED([$1], - [MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]), - [MYSQL_MODULE_MANDATORY_]AS_TR_CPP([$1]) +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]) ) ]) -AC_DEFUN([_MYSQL_MODULE_DISABLED],[ +AC_DEFUN([_MYSQL_PLUGIN_DISABLED],[ m4_define([$2], [yes]) m4_ifdef([$3], [ AC_FATAL([attempt to disable mandatory plugin $1]) @@ -176,48 +198,54 @@ AC_DEFUN([_MYSQL_MODULE_DISABLED],[ dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_MODULE_DEPENDS +dnl Macro: MYSQL_PLUGIN_DEPENDS +dnl +dnl SYNOPSIS +dnl MYSQL_PLUGIN_DEPENDS([name],[prereq,prereq...]) dnl -dnl What it does: -dnl Enables other modules neccessary for this module +dnl DESCRIPTION +dnl Enables other plugins neccessary for the named plugin dnl Dependency checking is not recursive so if any -dnl required module requires further modules, list them +dnl required plugin requires further plugins, list them dnl here too! dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_MODULE_DEPENDS],[ - REQUIRE_PLUGIN([$1]) - ifelse($#, 0, [], $#, 1, [ +AC_DEFUN([MYSQL_PLUGIN_DEPENDS],[ + MYSQL_REQUIRE_PLUGIN([$1]) + ifelse($#, 2, [ + _MYSQL_PLUGIN_DEPEND([$1], $2) + ], [ AC_FATAL([bad number of arguments]) - ], $#, 2, [ - _MYSQL_MODULE_DEPEND([$1],[$2]) - ],[ - _MYSQL_MODULE_DEPEND([$1],[$2]) - MYSQL_MODULE_DEPENDS([$1], m4_shift(m4_shift($@))) ]) ]) -AC_DEFUN([_MYSQL_MODULE_DEPEND],[ - REQUIRE_PLUGIN([$2]) - _MYSQL_PLUGAPPEND([__mysql_plugdepends_$1__],[$2]) +AC_DEFUN([_MYSQL_PLUGIN_DEPEND],[ + ifelse($#, 1, [], [$#:$2], [2:], [ + MYSQL_REQUIRE_PLUGIN([$2]) + _MYSQL_PLUGAPPEND([__mysql_plugdepends_$1__],[$2]) + _MYSQL_PLUGIN_DEPEND([$1], m4_shift(m4_shift($@))) + ]) ]) dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_MODULE_ACTIONS +dnl Macro: MYSQL_PLUGIN_ACTIONS +dnl +dnl SYNOPSIS +dnl MYSQL_PLUGIN_ACTIONS([name],[PLUGIN_CONFIGURE_STUFF]) dnl -dnl What it does: -dnl Declares additional actions required to configure the module +dnl DESCRIPTION +dnl Declares additional autoconf actions required to configure the plugin dnl dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_MODULE_ACTIONS],[ - REQUIRE_PLUGIN([$1]) +AC_DEFUN([MYSQL_PLUGIN_ACTIONS],[ + MYSQL_REQUIRE_PLUGIN([$1]) m4_ifdef([$2],[ - m4_define([MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1]),m4_defn([$2])) + m4_define([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]),m4_defn([$2])) ],[ - m4_define([MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1]), [$2]) + m4_define([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]), [$2]) ]) ]) @@ -225,20 +253,24 @@ AC_DEFUN([MYSQL_MODULE_ACTIONS],[ dnl --------------------------------------------------------------------------- dnl Macro: MYSQL_CONFIGURE_PLUGINS dnl -dnl What it does: -dnl Called last, emits all required shell code to configure the modules +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 dnl dnl --------------------------------------------------------------------------- AC_DEFUN([MYSQL_CONFIGURE_PLUGINS],[ m4_ifdef([__mysql_plugin_configured__],[ - AC_FATAL([cannot call [MYSQL_CONFIGURE_PLUGINS] multiple times]) + AC_FATAL([cannot use [MYSQL_CONFIGURE_PLUGINS] multiple times]) ],[ m4_define([__mysql_plugin_configured__],[done]) m4_ifdef([__mysql_plugin_list__],[ _MYSQL_CHECK_PLUGIN_ARGS([$1]) _MYSQL_CONFIGURE_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) - _MYSQL_DO_PLUGIN_ACTIONS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) + _MYSQL_EMIT_PLUGIN_ACTIONS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) AC_SUBST([mysql_se_dirs]) AC_SUBST([mysql_pg_dirs]) ]) @@ -247,56 +279,56 @@ AC_DEFUN([MYSQL_CONFIGURE_PLUGINS],[ AC_DEFUN([_MYSQL_CONFIGURE_PLUGINS],[ ifelse($#, 0, [], $#, 1, [ - _MYSQL_CHECK_PLUGIN([$1]) + _MYSQL_EMIT_CHECK_PLUGIN([$1]) ],[ - _MYSQL_CHECK_PLUGIN([$1]) + _MYSQL_EMIT_CHECK_PLUGIN([$1]) _MYSQL_CONFIGURE_PLUGINS(m4_shift($@)) ]) ]) -AC_DEFUN([_MYSQL_CHECK_PLUGIN],[ - _DO_MYSQL_CHECK_PLUGIN( +AC_DEFUN([_MYSQL_EMIT_CHECK_PLUGIN],[ + __MYSQL_EMIT_CHECK_PLUGIN( [$1], m4_bpatsubst([$1], -, _), - [MYSQL_MODULE_NAME_]AS_TR_CPP([$1]), - [MYSQL_MODULE_DESC_]AS_TR_CPP([$1]), - [MYSQL_MODULE_DEFINE_]AS_TR_CPP([$1]), - [MYSQL_MODULE_DIRECTORY_]AS_TR_CPP([$1]), - [MYSQL_MODULE_STATIC_]AS_TR_CPP([$1]), - [MYSQL_MODULE_DYNAMIC_]AS_TR_CPP([$1]), - [MYSQL_MODULE_MANDATORY_]AS_TR_CPP([$1]), - [MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]), - [MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1]) + [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]) ) ]) -AC_DEFUN([_DO_MYSQL_CHECK_PLUGIN],[ +AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[ m4_ifdef([$5],[ AH_TEMPLATE($5, [Include ]$4[ into mysqld]) ]) AC_MSG_CHECKING([whether to use ]$3) mysql_use_plugin_dir="" m4_ifdef([$10],[ - if test "[$mysql_module_]$2" = yes -a \ - "[$with_module_]$2" != no -o \ - "[$with_module_]$2" = yes; then + if test "X[$mysql_plugin_]$2" = Xyes -a \ + "X[$with_plugin_]$2" != Xno -o \ + "X[$with_plugin_]$2" = Xyes; then AC_MSG_RESULT([error]) AC_MSG_ERROR([disabled]) fi AC_MSG_RESULT([no]) ],[ m4_ifdef([$9],[ - if test "[$with_module_]$2" = no; then + if test "X[$with_plugin_]$2" = Xno; then AC_MSG_RESULT([error]) - AC_MSG_ERROR([cannot disable mandatory module]) + AC_MSG_ERROR([cannot disable mandatory plugin]) fi - [mysql_module_]$2=yes + [mysql_plugin_]$2=yes ]) - if test "[$with_module_]$2" = no; then + if test "X[$with_plugin_]$2" = Xno; then AC_MSG_RESULT([no]) else - if test "[$mysql_module_]$2" != yes -a \ - "[$with_module_]$2" != yes; then + if test "X[$mysql_plugin_]$2" != Xyes -a \ + "X[$with_plugin_]$2" != Xyes; then m4_ifdef([$8],[ m4_ifdef([$6],[ if test -d "$srcdir/$6" ; then @@ -304,16 +336,16 @@ AC_DEFUN([_DO_MYSQL_CHECK_PLUGIN],[ ]) AC_SUBST([plugin_]$2[_shared_target], "$8") AC_SUBST([plugin_]$2[_static_target], [""]) - [with_module_]$2=yes + [with_plugin_]$2=yes AC_MSG_RESULT([plugin]) m4_ifdef([$6],[ else - [mysql_module_]$2=no + [mysql_plugin_]$2=no AC_MSG_RESULT([no]) fi ]) ],[ - [with_module_]$2=no + [with_plugin_]$2=no AC_MSG_RESULT([no]) ]) else @@ -356,7 +388,7 @@ AC_DEFUN([_DO_MYSQL_CHECK_PLUGIN],[ ]) ]) mysql_plugin_defs="$mysql_plugin_defs, [builtin_]$2[_plugin]" - [with_module_]$2=yes + [with_plugin_]$2=yes AC_MSG_RESULT([yes]) fi m4_ifdef([$6],[ @@ -378,40 +410,33 @@ AC_DEFUN([_DO_MYSQL_CHECK_PLUGIN],[ ]) ]) -AC_DEFUN([_MYSQL_DO_PLUGIN_ACTIONS],[ +AC_DEFUN([_MYSQL_EMIT_PLUGIN_ACTIONS],[ ifelse($#, 0, [], $#, 1, [ - _MYSQL_PLUGIN_ACTIONS([$1]) + _MYSQL_EMIT_PLUGIN_ACTION([$1]) ],[ - _MYSQL_PLUGIN_ACTIONS([$1]) - _MYSQL_DO_PLUGIN_ACTIONS(m4_shift($@)) + _MYSQL_EMIT_PLUGIN_ACTION([$1]) + _MYSQL_EMIT_PLUGIN_ACTIONS(m4_shift($@)) ]) ]) -AC_DEFUN([_MYSQL_PLUGIN_ACTIONS],[ - _DO_MYSQL_PLUGIN_ACTIONS( +AC_DEFUN([_MYSQL_EMIT_PLUGIN_ACTION],[ + __MYSQL_EMIT_PLUGIN_ACTION( [$1], m4_bpatsubst([$1], -, _), - [MYSQL_MODULE_NAME_]AS_TR_CPP([$1]), - [MYSQL_MODULE_DESC_]AS_TR_CPP([$1]), - [MYSQL_MODULE_DEFINE_]AS_TR_CPP([$1]), - [MYSQL_MODULE_DIRECTORY_]AS_TR_CPP([$1]), - [MYSQL_MODULE_STATIC_]AS_TR_CPP([$1]), - [MYSQL_MODULE_DYNAMIC_]AS_TR_CPP([$1]), - [MYSQL_MODULE_MANDATORY_]AS_TR_CPP([$1]), - [MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]), - [MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1]) + [MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]), + [MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]) ) ]) -AC_DEFUN([_DO_MYSQL_PLUGIN_ACTIONS],[ - m4_ifdef([$10], [], [ - if test "[$with_module_]$2" = yes; then - if test -z "[$plugin_]$2[_static_target]" -a \ - -z "[$plugin_]$2[_shared_target]"; then +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 AC_MSG_ERROR([that's strange, $1 failed sanity check]) fi - $11 + $4 fi ]) ]) @@ -423,17 +448,23 @@ dnl Private helper macros dnl =========================================================================== -AC_DEFUN([REQUIRE_PLUGIN],[ - _REQUIRE_PLUGIN([$1], [__MYSQL_MODULE_]AS_TR_CPP([$1])[__]) +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])[__]) ]) -define([_REQUIRE_PLUGIN],[ +define([_MYSQL_REQUIRE_PLUGIN],[ ifdef([$2],[ ifelse($2, [$1], [], [ - AC_FATAL([Misspelt MYSQL_MODULE declaration for $1]) + AC_FATAL([Misspelt MYSQL_PLUGIN declaration for $1]) ]) ],[ - AC_FATAL([Missing MYSQL_MODULE declaration for $1]) + AC_FATAL([Missing MYSQL_PLUGIN declaration for $1]) ]) ]) @@ -441,19 +472,25 @@ define([_REQUIRE_PLUGIN],[ dnl --------------------------------------------------------------------------- -AC_DEFUN([_MYSQL_MODULE_META_CHECK], [ifelse($#, 0, [], $#, 1, -[_MYSQL_CHECK_PLUGIN_META([$1], [__mysql_]m4_bpatsubst($1, -, _)[_plugins__]) +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__]) ], -[_MYSQL_CHECK_PLUGIN_META([$1], [__mysql_]m4_bpatsubst($1, -, _)[_plugins__]) -_MYSQL_MODULE_META_CHECK(m4_shift($@))]) +[_MYSQL_EMIT_METAPLUGIN([$1], [__mysql_]m4_bpatsubst($1, -, _)[_plugins__]) +_MYSQL_EMIT_METAPLUGINS(m4_shift($@))]) ]) -AC_DEFUN([_MYSQL_CHECK_PLUGIN_META], [ +AC_DEFUN([_MYSQL_EMIT_METAPLUGIN], [ [$1] ) m4_ifdef([$2], [ - mysql_modules='m4_bpatsubst($2, :, [ ])' + mysql_plugins='m4_bpatsubst($2, :, [ ])' ],[ - mysql_modules='' + mysql_plugins='' ]) ;; ]) @@ -462,6 +499,12 @@ m4_ifdef([$2], [ dnl --------------------------------------------------------------------------- +dnl SYNOPSIS +dnl _MYSQL_PLUGAPPEND([name],[to-append]) +dnl +dnl DESCRIPTION +dnl Helper macro for appending to colon-delimited lists + AC_DEFUN([_MYSQL_PLUGAPPEND],[ m4_ifdef([$1],[ m4_define([__plugin_append_tmp__], m4_defn([$1])) @@ -474,29 +517,24 @@ AC_DEFUN([_MYSQL_PLUGAPPEND],[ ]) ]) -AC_DEFUN([_MYSQL_PLUGAPPEND_OPTS],[ - ifelse($#, 0, [], $#, 1, [ - AC_FATAL([bad number of args]) - ], $#, 2, [ - _MYSQL_PLUGAPPEND_OPTONE([$1],[$2]) - ],[ - _MYSQL_PLUGAPPEND_OPTONE([$1],[$2]) - _MYSQL_PLUGAPPEND_OPTS([$1], m4_shift(m4_shift($@))) - ]) -]) -AC_DEFUN([_MYSQL_PLUGAPPEND_OPTONE],[ - ifelse([$2], [all], [ +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], [ AC_FATAL([protected plugin group: all]) + ], [$2], [none], [ + AC_FATAL([protected plugin group: none]) ],[ - ifelse([$2], [none], [ - AC_FATAL([protected plugin group: none]) - ],[ - _MYSQL_PLUGAPPEND([__mysql_$1_configs__],[$2]) - _MYSQL_PLUGAPPEND([__mysql_]m4_bpatsubst($2, -, _)[_plugins__],[$1], [ - _MYSQL_PLUGAPPEND([__mysql_metaplugin_list__],[$2]) - ]) + _MYSQL_PLUGAPPEND([__mysql_$1_configs__],[$2]) + _MYSQL_PLUGAPPEND([__mysql_]m4_bpatsubst($2, -, _)[_plugins__],[$1], [ + _MYSQL_PLUGAPPEND([__mysql_metaplugin_list__],[$2]) ]) + _MYSQL_PLUGAPPEND_META([$1], m4_shift(m4_shift($@))) ]) ]) @@ -504,6 +542,12 @@ AC_DEFUN([_MYSQL_PLUGAPPEND_OPTONE],[ dnl --------------------------------------------------------------------------- +dnl SYNOPSIS +dnl MYSQL_LIST_PLUGINS +dnl +dnl DESCRIPTION +dnl Emits formatted list of declared plugins + AC_DEFUN([MYSQL_LIST_PLUGINS],[dnl m4_ifdef([__mysql_plugin_list__],[dnl _MYSQL_LIST_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))dnl @@ -523,22 +567,22 @@ AC_DEFUN([MYSQL_SHOW_PLUGIN],[ _MYSQL_SHOW_PLUGIN( [$1], [$1-plugin], - [MYSQL_MODULE_NAME_]AS_TR_CPP([$1]), - [MYSQL_MODULE_DESC_]AS_TR_CPP([$1]), - [MYSQL_MODULE_DEFINE_]AS_TR_CPP([$1]), - [MYSQL_MODULE_DIRECTORY_]AS_TR_CPP([$1]), - [MYSQL_MODULE_STATIC_]AS_TR_CPP([$1]), - [MYSQL_MODULE_DYNAMIC_]AS_TR_CPP([$1]), - [MYSQL_MODULE_MANDATORY_]AS_TR_CPP([$1]), - [MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]), - [MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1]), + [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]), __mysql_[$1]_configs__, ) ]) AC_DEFUN([_MYSQL_SHOW_PLUGIN],[dnl === $3 === - Module Name: [$1] + Plugin Name: [$1] Description: $4 Supports build: _PLUGIN_BUILD_TYPE([$7],[$8])[]dnl m4_ifdef([$12],[ @@ -557,134 +601,115 @@ AC_DEFUN([_PLUGIN_BUILD_TYPE], dnl --------------------------------------------------------------------------- -AC_DEFUN([_MYSQL_MODULE_ARGS_CHECK],[ - ifelse($#, 0, [], $#, 1, [ - _MYSQL_CHECK_PLUGIN_ARG([$1], - [MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]), - [MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1])) - ],[ - _MYSQL_CHECK_PLUGIN_ARG([$1], - [MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]), - [MYSQL_MODULE_ACTIONS_]AS_TR_CPP([$1])) - _MYSQL_MODULE_ARGS_CHECK(m4_shift($@)) - ]) -]) - -AC_DEFUN([_MYSQL_CHECK_PLUGIN_ARG],[ - m4_ifdef([$3], [], [m4_define([$3],[ ])]) +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]),[ ]) + ]) [$1] ) - m4_ifdef([$2],[ + m4_ifdef([MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),[ AC_MSG_ERROR([plugin $1 is disabled]) - ],[ - [mysql_module_]m4_bpatsubst([$1], -, _)=yes - ]) + ],[ + [mysql_plugin_]m4_bpatsubst([$1], -, _)=yes + ]) ;; -]) - -AC_DEFUN([_MYSQL_SANE_VARS], [ - ifelse($#, 0, [], $#, 1, [ - _MYSQL_SANEVAR([$1]) - ],[ - _MYSQL_SANEVAR([$1]) - _MYSQL_SANE_VARS(m4_shift($@)) + _MYSQL_EMIT_PLUGINS(m4_shift($@)) ]) ]) -AC_DEFUN([_MYSQL_SANEVAR], [ - test -z "[$mysql_module_]m4_bpatsubst([$1], -, _)" && -[mysql_module_]m4_bpatsubst([$1], -, _)='.' - test -z "[$with_module_]m4_bpatsubst([$1], -, _)" && -[with_module_]m4_bpatsubst([$1], -, _)='.' -]) - -AC_DEFUN([_MYSQL_CHECK_DEPENDENCIES], [ - ifelse($#, 0, [], $#, 1, [ - _MYSQL_CHECK_DEPENDS([$1],[__mysql_plugdepends_$1__]) - ],[ - _MYSQL_CHECK_DEPENDS([$1],[__mysql_plugdepends_$1__]) - _MYSQL_CHECK_DEPENDENCIES(m4_shift($@)) +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($@)) ]) ]) -AC_DEFUN([_MYSQL_CHECK_DEPENDS], [ +AC_DEFUN([_MYSQL_EMIT_CHECK_DEPENDS], [ m4_ifdef([$2], [ - if test "[$mysql_module_]m4_bpatsubst([$1], -, _)" = yes -a \ - "[$with_module_]m4_bpatsubst([$1], -, _)" != no -o \ - "[$with_module_]m4_bpatsubst([$1], -, _)" = yes; then - _MYSQL_GEN_DEPENDS(m4_bpatsubst($2, :, [,])) + 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, :, [,])) fi ]) ]) -AC_DEFUN([_MYSQL_GEN_DEPENDS], [ - ifelse($#, 0, [], $#, 1, [ - _MYSQL_GEN_DEPEND([$1]) - ],[ - _MYSQL_GEN_DEPEND([$1]) - _MYSQL_GEN_DEPENDS(m4_shift($@)) +AC_DEFUN([_MYSQL_EMIT_PLUGIN_DEPENDENCIES], [ + ifelse($#, 0, [], [ + 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($@)) ]) ]) -AC_DEFUN([_MYSQL_GEN_DEPEND], [ - m4_ifdef([MYSQL_MODULE_DISABLED_]AS_TR_CPP([$1]),[ - AC_MSG_ERROR([depends upon disabled module $1]) - ],[ - [mysql_module_]m4_bpatsubst([$1], -, _)=yes - if test "[$with_module_]m4_bpatsubst([$1], -, _)" = no; then - AC_MSG_ERROR([depends upon disabled module $1]) - fi - ]) -]) +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 AC_DEFUN([_MYSQL_CHECK_PLUGIN_ARGS],[ - AC_ARG_WITH([modules], -AS_HELP_STRING([--with-modules=PLUGIN[[[[[,PLUGIN..]]]]]], - [Plugin modules to include in mysqld. (default is: $1) Must be a - configuration name or a comma separated list of modules.]) -AS_HELP_STRING([],[Available configurations are:] dnl -m4_bpatsubst([none:all]m4_ifdef([__mysql_metaplugin_list__], -__mysql_metaplugin_list__), :, [ ])[.]) -AS_HELP_STRING([],[Available plugin modules are:] dnl + __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 m4_bpatsubst(__mysql_plugin_list__, :, [ ])[.]) -AS_HELP_STRING([--without-module-PLUGIN], - [Disable the named module from being built. Otherwise, for - modules which are not selected for inclusion in mysqld will be +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 built dynamically (if supported)]) -AS_HELP_STRING([--with-module-PLUGIN], - [Forces the named module to be linked into mysqld statically.]), - [mysql_modules="`echo $withval | tr ',.:;*[]' ' '`"], - [mysql_modules=['$1']]) +AS_HELP_STRING([--with-plugin-PLUGIN], + [Forces the named plugin to be linked into mysqld statically.]), + [mysql_plugins="`echo $withval | tr ',.:;*[]' ' '`"], + [mysql_plugins=['$1']]) m4_divert_once([HELP_VAR_END],[ -Description of plugin modules: +Description of plugins: MYSQL_LIST_PLUGINS]) - case "$mysql_modules" in + case "$mysql_plugins" in all ) - mysql_modules='m4_bpatsubst(__mysql_plugin_list__, :, [ ])' + mysql_plugins='m4_bpatsubst(__mysql_plugin_list__, :, [ ])' ;; none ) - mysql_modules='' + mysql_plugins='' ;; m4_ifdef([__mysql_metaplugin_list__],[ -_MYSQL_MODULE_META_CHECK(m4_bpatsubst(__mysql_metaplugin_list__, :, [,])) +_MYSQL_EMIT_METAPLUGINS(m4_bpatsubst(__mysql_metaplugin_list__, :, [,])) ]) esac - for plugin in $mysql_modules; do + for plugin in $mysql_plugins; do case "$plugin" in all | none ) - AC_MSG_ERROR([bad module name: $plugin]) + AC_MSG_ERROR([bad plugin name: $plugin]) ;; -_MYSQL_MODULE_ARGS_CHECK(m4_bpatsubst(__mysql_plugin_list__, :, [,])) +_MYSQL_EMIT_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) * ) - AC_MSG_ERROR([unknown plugin module: $plugin]) + AC_MSG_ERROR([unknown plugin: $plugin]) ;; esac done - _MYSQL_SANE_VARS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) - _MYSQL_CHECK_DEPENDENCIES(m4_bpatsubst(__mysql_plugin_list__, :, [,])) + _MYSQL_EMIT_PLUGIN_DEPENDS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) ]) dnl =========================================================================== -- cgit v1.2.1