summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/ac-macros/plugins.m438
-rw-r--r--libmysqld/Makefile.am14
-rw-r--r--storage/federated/plug.in1
-rw-r--r--storage/heap/plug.in1
-rw-r--r--storage/innobase/plug.in1
-rw-r--r--storage/myisam/plug.in1
-rw-r--r--storage/myisammrg/plug.in1
7 files changed, 52 insertions, 5 deletions
diff --git a/config/ac-macros/plugins.m4 b/config/ac-macros/plugins.m4
index 87f057e696a..0d5a5b46114 100644
--- a/config/ac-macros/plugins.m4
+++ b/config/ac-macros/plugins.m4
@@ -254,6 +254,29 @@ AC_DEFUN([MYSQL_PLUGIN_ACTIONS],[
])
dnl ---------------------------------------------------------------------------
+dnl Macro: MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS
+dnl
+dnl SYNOPSIS
+dnl MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS([name],[file name])
+dnl
+dnl DESCRIPTION
+dnl Some modules in plugins keep dependance on structures
+dnl declared in sql/ (THD class usually)
+dnl That has to be fixed in the future, but until then
+dnl we have to recompile these modules when we want to
+dnl to compile server parts with the different #defines
+dnl Normally it happens when we compile the embedded server
+dnl Thus one should mark such files in his handler using this macro
+dnl (currently only one such a file per plugin is supported)
+dnl
+dnl ---------------------------------------------------------------------------
+
+AC_DEFUN([MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS],[
+ MYSQL_REQUIRE_PLUGIN([$1])
+ m4_define([MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS_]AS_TR_CPP([$1]), [$2])
+])
+
+dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_CONFIGURE_PLUGINS
dnl
dnl SYNOPSIS
@@ -282,6 +305,9 @@ AC_DEFUN([MYSQL_CONFIGURE_PLUGINS],[
AC_SUBST([mysql_pg_dirs])
AC_SUBST([mysql_se_unittest_dirs])
AC_SUBST([mysql_pg_unittest_dirs])
+ AC_SUBST([condition_dependent_plugin_modules])
+ AC_SUBST([condition_dependent_plugin_links])
+ AC_SUBST([condition_dependent_plugin_includes])
])
])
])
@@ -307,6 +333,7 @@ AC_DEFUN([_MYSQL_EMIT_CHECK_PLUGIN],[
[MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),
+ [MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS_]AS_TR_CPP([$1]),
[MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1])
)
])
@@ -318,9 +345,9 @@ AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[
AC_MSG_CHECKING([whether to use ]$3)
mysql_use_plugin_dir=""
m4_ifdef([$10],[
- if test "X[$mysql_plugin_]$2" = Xyes -a \
- "X[$with_plugin_]$2" != Xno -o \
- "X[$with_plugin_]$2" = Xyes; 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
@@ -346,6 +373,11 @@ AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[
])
AC_SUBST([plugin_]$2[_shared_target], "$8")
AC_SUBST([plugin_]$2[_static_target], [""])
+ m4_ifdef([$11],[
+ condition_dependent_plugin_modules="$condition_dependent_plugin_modules m4_bregexp($11, [[^/]+$], [\&])"
+ condition_dependent_plugin_links="$condition_dependent_plugin_links $6/$11"
+ condition_dependent_plugin_includes="$condition_dependent_plugin_includes -I[\$(top_srcdir)]/$6/m4_bregexp($11, [^.+[/$]], [\&])"
+ ])
[with_plugin_]$2=yes
AC_MSG_RESULT([plugin])
m4_ifdef([$6],[
diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
index fe19e08328d..0de37db63e2 100644
--- a/libmysqld/Makefile.am
+++ b/libmysqld/Makefile.am
@@ -32,7 +32,8 @@ INCLUDES= -I$(top_builddir)/include -I$(top_srcdir)/include \
-I$(top_builddir)/include -I$(top_srcdir)/include \
-I$(top_srcdir)/sql -I$(top_srcdir)/sql/examples \
-I$(top_srcdir)/regex \
- $(openssl_includes) @ZLIB_INCLUDES@
+ $(openssl_includes) @ZLIB_INCLUDES@ \
+ @condition_dependent_plugin_includes@
noinst_LIBRARIES = libmysqld_int.a
pkglib_LIBRARIES = libmysqld.a
@@ -77,6 +78,8 @@ libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources)
libmysqld_a_SOURCES=
sqlstoragesources = $(EXTRA_libmysqld_a_SOURCES)
+storagesources = @condition_dependent_plugin_modules@
+storagesourceslinks = @condition_dependent_plugin_links@
# automake misses these
sql_yacc.cc sql_yacc.h: $(top_srcdir)/sql/sql_yacc.yy
@@ -170,12 +173,19 @@ link_sources:
@LN_CP_F@ `find $(srcdir)/../sql -name "$$f"` "$$f"; \
done; \
fi; \
+ if test -n "$(storagesources)" ; \
+ then \
+ rm -f $(storagesources); \
+ for f in $(storagesourceslinks); do \
+ @LN_CP_F@ $(top_srcdir)/$$f . ; \
+ done; \
+ fi; \
rm -f client_settings.h; \
@LN_CP_F@ $(top_srcdir)/libmysql/client_settings.h client_settings.h
clean-local:
- rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlstoragesources) | sed "s;\.lo;.c;g"` \
+ rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlstoragesources) $(storagesources) | sed "s;\.lo;.c;g"` \
$(top_srcdir)/linked_libmysqld_sources; \
rm -f client_settings.h
diff --git a/storage/federated/plug.in b/storage/federated/plug.in
index 81c56cb672f..23b607d699b 100644
--- a/storage/federated/plug.in
+++ b/storage/federated/plug.in
@@ -2,3 +2,4 @@ MYSQL_STORAGE_ENGINE(federated,,[Federated Storage Engine],
[Connects to tables on remote MySQL servers], [max,max-no-ndb])
MYSQL_PLUGIN_STATIC(federated, [libfederated.a])
MYSQL_PLUGIN_DYNAMIC(federated, [ha_federated.la])
+MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(federated, [ha_federated.cc])
diff --git a/storage/heap/plug.in b/storage/heap/plug.in
index 9e744b6ac0d..50f31c60f2b 100644
--- a/storage/heap/plug.in
+++ b/storage/heap/plug.in
@@ -3,4 +3,5 @@ MYSQL_STORAGE_ENGINE(heap,no, [Memory Storage Engine],
MYSQL_PLUGIN_DIRECTORY(heap, [storage/heap])
MYSQL_PLUGIN_STATIC(heap, [libheap.a])
MYSQL_PLUGIN_MANDATORY(heap) dnl Memory tables
+MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(heap, [ha_heap.cc])
diff --git a/storage/innobase/plug.in b/storage/innobase/plug.in
index 028937882b2..9c21a491d9f 100644
--- a/storage/innobase/plug.in
+++ b/storage/innobase/plug.in
@@ -68,4 +68,5 @@ MYSQL_PLUGIN_ACTIONS(innobase, [
storage/innobase/handler/Makefile
storage/innobase/usr/Makefile)
])
+MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(innobase, [handler/ha_innodb.cc])
diff --git a/storage/myisam/plug.in b/storage/myisam/plug.in
index 3160752182d..051ec2d54aa 100644
--- a/storage/myisam/plug.in
+++ b/storage/myisam/plug.in
@@ -3,4 +3,5 @@ MYSQL_STORAGE_ENGINE(myisam,no, [MyISAM Storage Engine],
MYSQL_PLUGIN_DIRECTORY(myisam, [storage/myisam])
MYSQL_PLUGIN_STATIC(myisam, [libmyisam.a])
MYSQL_PLUGIN_MANDATORY(myisam) dnl Default
+MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(myisam, [ha_myisam.cc])
diff --git a/storage/myisammrg/plug.in b/storage/myisammrg/plug.in
index b4b2af8d984..1f94e07d881 100644
--- a/storage/myisammrg/plug.in
+++ b/storage/myisammrg/plug.in
@@ -3,3 +3,4 @@ MYSQL_STORAGE_ENGINE(myisammrg,no,[MyISAM MERGE Engine],
MYSQL_PLUGIN_DIRECTORY(myisammrg,[storage/myisammrg])
MYSQL_PLUGIN_STATIC(myisammrg, [libmyisammrg.a])
MYSQL_PLUGIN_MANDATORY(myisammrg)
+MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(myisammrg, [ha_myisammrg.cc])