summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2010-11-17 13:24:20 +0100
committerunknown <knielsen@knielsen-hq.org>2010-11-17 13:24:20 +0100
commit0de9a4ababac1e7f510558dfd0bece894cf7e69c (patch)
treefbc0d0d24e490121b420145ac1f42970bfd0ea43 /storage
parent7a28f61ded763f4778b5f595115a0b1fde2372a8 (diff)
downloadmariadb-git-0de9a4ababac1e7f510558dfd0bece894cf7e69c.tar.gz
MWL#74: Shared libmysqld.so library.
Switch makefiles to use libtool to build libmysqld.so, as well as all its dependencies. The previous MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS() declaration is removed, as it does not work well with a libtool build. Instead, plugins that need it can specify an alternate object in MYSQL_PLUGIN_STATIC() that will be used for embedded library. The plugin must then take care itself of compiling the special object for embedded, rebuilding the source files previously listed in MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS() with @plugin_embedded_defs@ in CFLAGS/CXXFLAGS. The extra target @XXX_embedded_static_target@ is available for the special object, this will be empty when --without-embedded-server. All in-tree plugins are changed to build their static targets with libtool. Additional plugins that want to work with libmysqld.so will need to be similarly modified to build with libtool (or otherwise provide an -fPIC object). Dynamically loaded plugins are not affected. The old libraries like libmysys.a, libmyisam.a and similar libraries, which were installed by `make install` though this is of little use, are still built and installed to not break package scripts etc. that expect them. These libraries are kept static to avoid introducing new .so dependencies. The patch also fixes a handfull of duplicate symbol linker errors, where we included some object twice during linking; these for one reason or another did not produce errors before but caused problems on some platforms with this patch (eg. Mac OS X linker is more strict for shared objects). This patch only does what is necessary to build libmysqld.so. There are some more cleanups that are possible now that we are using libtool more fully, which could done in subsequent patches (though we may not bother as we are switching from autotools to CMake anyway): - In libmysql_r/, we should be able to just link libmysys.la etc, instead of symlinking and re-compiling sources into the directory. - In libmysql/, we can similarly avoid symlinking and recompiling sources if we instead build a libmysys_nothread.la library with appropriate CFLAGS and link that. - In sql/, we can build a separate target libmysql_int.la with appropriate CFLAGS for embedded and use that in libmysqld/ instead of symlinking sources. - libmysys.a, libmyisam.a and similar libraries could be installed as .so also to save on code size; or alternatively could be not installed at all. client/Makefile.am: Updated for using libtool config/ac-macros/plugins.m4: Replace MUSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS with mechanism for plugins to specify alternate object for embedded. configure.in: Fix linking duplicate objects related to THREAD_LOBJECTS. dbug/Makefile.am: Updated for using libtool extra/Makefile.am: Fix relative paths. libmysqld/Makefile.am: Build libmysqld.la using libtool libmysqld/examples/Makefile.am: Updated to use libtool mysys/Makefile.am: Updated to use libtool. Fix linking duplicate objects related to THREAD_LOBJECTS. mysys/my_uuid.c: Fix conflicting global mutex name by making it static. regex/Makefile.am: Updated to use libtool sql/Makefile.am: Updated to use libtool sql/item_func.cc: Fix conflicting mutex name. sql/mysql_priv.h: Fix conflicting mutex name sql/mysqld.cc: Fix conflicting mutex name. Add missing call of my_uuid_end(). storage/archive/Makefile.am: Updated to use libtool storage/archive/plug.in: Updated to use libtool storage/blackhole/Makefile.am: Updated to use libtool storage/blackhole/plug.in: Updated to use libtool storage/csv/Makefile.am: Updated to use libtool storage/csv/plug.in: Updated to use libtool storage/example/Makefile.am: Updated to use libtool storage/federated/Makefile.am: Updated to use libtool storage/federated/plug.in: Updated to use libtool storage/federatedx/Makefile.am: Updated to use libtool storage/federatedx/plug.in: Updated to use libtool storage/heap/Makefile.am: Updated to use libtool storage/heap/plug.in: Updated to use libtool storage/innobase/Makefile.am: Updated to use libtool storage/innobase/plug.in.disabled: Updated to use libtool storage/innodb_plugin/Makefile.am: Updated to use libtool storage/maria/CMakeLists.txt: Fix linking duplicate object in maria_dump_log, causes failure on Mac OS X storage/maria/Makefile.am: Updated to use libtool Fix linking duplicate object in maria_dump_log, causes link failure on Mac OS X storage/maria/ma_loghandler.c: Move maria_dump_log code to separate file to fix duplicate object link failures. storage/maria/ma_loghandler.h: Move maria_dump_log code to separate file to fix duplicate object link failures. storage/maria/maria_dump_log.c: Move maria_dump_log code to separate file to fix duplicate object link failures. storage/maria/plug.in: Updated to use libtool storage/myisam/Makefile.am: Updated to use libtool storage/myisam/plug.in: Updated to use libtool storage/myisammrg/Makefile.am: Updated to use libtool storage/myisammrg/plug.in: Updated to use libtool storage/pbxt/plug.in: Updated to use libtool storage/pbxt/src/Makefile.am: Updated to use libtool storage/xtradb/Makefile.am: Updated to use libtool storage/xtradb/plug.in: Updated to use libtool strings/Makefile.am: Updated to use libtool unittest/unit.pl: Don't attempt to run libtool internal files as unit tests. vio/Makefile.am: Updated to use libtool
Diffstat (limited to 'storage')
-rw-r--r--storage/archive/Makefile.am11
-rw-r--r--storage/archive/plug.in2
-rw-r--r--storage/blackhole/Makefile.am9
-rw-r--r--storage/blackhole/plug.in2
-rw-r--r--storage/csv/Makefile.am9
-rw-r--r--storage/csv/plug.in2
-rw-r--r--storage/example/Makefile.am10
-rw-r--r--storage/federated/Makefile.am13
-rw-r--r--storage/federated/plug.in3
-rw-r--r--storage/federatedx/Makefile.am21
-rw-r--r--storage/federatedx/plug.in3
-rw-r--r--storage/heap/Makefile.am20
-rw-r--r--storage/heap/plug.in3
-rw-r--r--storage/innobase/Makefile.am11
-rw-r--r--storage/innobase/plug.in.disabled2
-rw-r--r--storage/innodb_plugin/Makefile.am13
-rw-r--r--storage/maria/CMakeLists.txt3
-rw-r--r--storage/maria/Makefile.am26
-rw-r--r--storage/maria/ma_loghandler.c268
-rw-r--r--storage/maria/ma_loghandler.h24
-rw-r--r--storage/maria/maria_dump_log.c190
-rw-r--r--storage/maria/plug.in3
-rw-r--r--storage/myisam/Makefile.am20
-rw-r--r--storage/myisam/plug.in3
-rw-r--r--storage/myisammrg/Makefile.am16
-rw-r--r--storage/myisammrg/plug.in3
-rw-r--r--storage/pbxt/plug.in3
-rw-r--r--storage/pbxt/src/Makefile.am28
-rw-r--r--storage/xtradb/Makefile.am13
-rw-r--r--storage/xtradb/plug.in2
30 files changed, 406 insertions, 330 deletions
diff --git a/storage/archive/Makefile.am b/storage/archive/Makefile.am
index 254c95bf68b..1dbe101c2d6 100644
--- a/storage/archive/Makefile.am
+++ b/storage/archive/Makefile.am
@@ -33,7 +33,7 @@ DEFS = @DEFS@
noinst_HEADERS = ha_archive.h azlib.h
noinst_PROGRAMS = archive_test archive_reader
-EXTRA_LTLIBRARIES = ha_archive.la
+EXTRA_LTLIBRARIES = libarchive.la ha_archive.la
pkgplugin_LTLIBRARIES = @plugin_archive_shared_target@
ha_archive_la_LDFLAGS = -module -rpath $(pkgplugindir)
ha_archive_la_CXXFLAGS= -shared $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
@@ -41,11 +41,10 @@ ha_archive_la_CFLAGS = -shared $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_archive_la_SOURCES = ha_archive.cc azio.c
-EXTRA_LIBRARIES = libarchive.a
-noinst_LIBRARIES = @plugin_archive_static_target@
-libarchive_a_CXXFLAGS = $(AM_CXXFLAGS)
-libarchive_a_CFLAGS = $(AM_CFLAGS)
-libarchive_a_SOURCES = ha_archive.cc azio.c
+noinst_LTLIBRARIES = @plugin_archive_static_target@
+libarchive_la_CXXFLAGS = $(AM_CXXFLAGS)
+libarchive_la_CFLAGS = $(AM_CFLAGS)
+libarchive_la_SOURCES = ha_archive.cc azio.c
archive_test_SOURCES = archive_test.c azio.c
diff --git a/storage/archive/plug.in b/storage/archive/plug.in
index 52131b12e6b..d19c29414e3 100644
--- a/storage/archive/plug.in
+++ b/storage/archive/plug.in
@@ -1,4 +1,4 @@
MYSQL_STORAGE_ENGINE(archive,, [Archive Storage Engine],
[Archive Storage Engine], [max,max-no-ndb])
-MYSQL_PLUGIN_STATIC(archive, [libarchive.a])
+MYSQL_PLUGIN_STATIC(archive, [libarchive.la])
MYSQL_PLUGIN_DYNAMIC(archive, [ha_archive.la])
diff --git a/storage/blackhole/Makefile.am b/storage/blackhole/Makefile.am
index 148746a9336..6665898cae7 100644
--- a/storage/blackhole/Makefile.am
+++ b/storage/blackhole/Makefile.am
@@ -32,17 +32,16 @@ DEFS = @DEFS@
noinst_HEADERS = ha_blackhole.h
-EXTRA_LTLIBRARIES = ha_blackhole.la
+EXTRA_LTLIBRARIES = libblackhole.la ha_blackhole.la
pkgplugin_LTLIBRARIES = @plugin_blackhole_shared_target@
ha_blackhole_la_LDFLAGS=-module -rpath $(pkgplugindir)
ha_blackhole_la_CXXFLAGS=-shared $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_blackhole_la_SOURCES=ha_blackhole.cc
-EXTRA_LIBRARIES = libblackhole.a
-noinst_LIBRARIES = @plugin_blackhole_static_target@
-libblackhole_a_CXXFLAGS=$(AM_CXXFLAGS)
-libblackhole_a_SOURCES= ha_blackhole.cc
+noinst_LTLIBRARIES = @plugin_blackhole_static_target@
+libblackhole_la_CXXFLAGS=$(AM_CXXFLAGS)
+libblackhole_la_SOURCES= ha_blackhole.cc
EXTRA_DIST = CMakeLists.txt plug.in
diff --git a/storage/blackhole/plug.in b/storage/blackhole/plug.in
index 725db0facba..2f3b120fa5d 100644
--- a/storage/blackhole/plug.in
+++ b/storage/blackhole/plug.in
@@ -1,6 +1,6 @@
MYSQL_STORAGE_ENGINE(blackhole,,[Blackhole Storage Engine],
[Basic Write-only Read-never tables], [max,max-no-ndb])
MYSQL_PLUGIN_DIRECTORY(blackhole, [storage/blackhole])
-MYSQL_PLUGIN_STATIC(blackhole, [libblackhole.a])
+MYSQL_PLUGIN_STATIC(blackhole, [libblackhole.la])
MYSQL_PLUGIN_DYNAMIC(blackhole, [ha_blackhole.la])
diff --git a/storage/csv/Makefile.am b/storage/csv/Makefile.am
index 75ad9062984..c711e4020fc 100644
--- a/storage/csv/Makefile.am
+++ b/storage/csv/Makefile.am
@@ -29,16 +29,15 @@ LDADD =
DEFS = @DEFS@
noinst_HEADERS = ha_tina.h transparent_file.h
-EXTRA_LTLIBRARIES = ha_csv.la
+EXTRA_LTLIBRARIES = libcsv.la ha_csv.la
pkglib_LTLIBRARIES = @plugin_csv_shared_target@
ha_csv_la_LDFLAGS = -module -rpath $(MYSQLLIBdir)
ha_csv_la_CXXFLAGS = -shared $(AM_CXXFLAGS) -DMYSQL_PLUGIN
ha_csv_la_SOURCES = transparent_file.cc ha_tina.cc
-EXTRA_LIBRARIES = libcsv.a
-noinst_LIBRARIES = @plugin_csv_static_target@
-libcsv_a_CXXFLAGS = $(AM_CXXFLAGS)
-libcsv_a_SOURCES = transparent_file.cc ha_tina.cc
+noinst_LTLIBRARIES = @plugin_csv_static_target@
+libcsv_la_CXXFLAGS = $(AM_CXXFLAGS)
+libcsv_la_SOURCES = transparent_file.cc ha_tina.cc
EXTRA_DIST = CMakeLists.txt plug.in
# Don't update the files from bitkeeper
diff --git a/storage/csv/plug.in b/storage/csv/plug.in
index bbc69680fcd..4ff32959fa2 100644
--- a/storage/csv/plug.in
+++ b/storage/csv/plug.in
@@ -1,5 +1,5 @@
MYSQL_STORAGE_ENGINE(csv,, [CSV Storage Engine],
[Stores tables in text CSV format])
MYSQL_PLUGIN_DIRECTORY(csv, [storage/csv])
-MYSQL_PLUGIN_STATIC(csv, [libcsv.a])
+MYSQL_PLUGIN_STATIC(csv, [libcsv.la])
MYSQL_PLUGIN_MANDATORY(csv) dnl Used for logging
diff --git a/storage/example/Makefile.am b/storage/example/Makefile.am
index 158b58a2e4c..da80f518d13 100644
--- a/storage/example/Makefile.am
+++ b/storage/example/Makefile.am
@@ -32,16 +32,16 @@ DEFS = @DEFS@
noinst_HEADERS = ha_example.h
-EXTRA_LTLIBRARIES = ha_example.la
+EXTRA_LTLIBRARIES = libexample.la ha_example.la
pkgplugin_LTLIBRARIES = @plugin_example_shared_target@
ha_example_la_LDFLAGS = -module -rpath $(pkgplugindir)
ha_example_la_CXXFLAGS= -shared $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_example_la_SOURCES = ha_example.cc
-EXTRA_LIBRARIES = libexample.a
-noinst_LIBRARIES = @plugin_example_static_target@
-libexample_a_CXXFLAGS = $(AM_CXXFLAGS)
-libexample_a_SOURCES= ha_example.cc
+
+noinst_LTLIBRARIES = @plugin_example_static_target@
+libexample_la_CXXFLAGS = $(AM_CXXFLAGS)
+libexample_la_SOURCES= ha_example.cc
EXTRA_DIST = CMakeLists.txt plug.in
diff --git a/storage/federated/Makefile.am b/storage/federated/Makefile.am
index 414fb5b7d5f..290fb789a82 100644
--- a/storage/federated/Makefile.am
+++ b/storage/federated/Makefile.am
@@ -30,7 +30,7 @@ DEFS = @DEFS@
noinst_HEADERS = ha_federated.h
-EXTRA_LTLIBRARIES = ha_federated.la
+EXTRA_LTLIBRARIES = libfederated.la libfederated_embedded.la ha_federated.la
pkgplugin_LTLIBRARIES = @plugin_federated_shared_target@
ha_federated_la_LDFLAGS = -module -rpath $(pkgplugindir)
ha_federated_la_CXXFLAGS= -shared $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
@@ -38,10 +38,13 @@ ha_federated_la_CFLAGS = -shared $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_federated_la_SOURCES = ha_federated.cc $(top_srcdir)/mysys/string.c
-EXTRA_LIBRARIES = libfederated.a
-noinst_LIBRARIES = @plugin_federated_static_target@
-libfederated_a_CXXFLAGS = $(AM_CXXFLAGS)
-libfederated_a_SOURCES= ha_federated.cc
+noinst_LTLIBRARIES = @plugin_federated_static_target@ @plugin_federated_embedded_static_target@
+libfederated_la_CXXFLAGS = $(AM_CXXFLAGS)
+libfederated_la_SOURCES= ha_federated.cc
+
+libfederated_embedded_la_CXXFLAGS = $(AM_CXXFLAGS) @plugin_embedded_defs@
+libfederated_embedded_la_CFLAGS = $(AM_CFLAGS) @plugin_embedded_defs@
+libfederated_embedded_la_SOURCES= ha_federated.cc
EXTRA_DIST = CMakeLists.txt plug.in
diff --git a/storage/federated/plug.in b/storage/federated/plug.in
index 714888b2ebf..3db4a35de08 100644
--- a/storage/federated/plug.in
+++ b/storage/federated/plug.in
@@ -1,5 +1,4 @@
MYSQL_STORAGE_ENGINE(federated,,[Federated Storage Engine],
[Connects to tables on remote MySQL servers], [])
-MYSQL_PLUGIN_STATIC(federated, [libfederated.a])
+MYSQL_PLUGIN_STATIC(federated, [libfederated.la], [libfederated_embedded.la])
MYSQL_PLUGIN_DYNAMIC(federated, [ha_federated.la])
-MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(federated, [ha_federated.cc])
diff --git a/storage/federatedx/Makefile.am b/storage/federatedx/Makefile.am
index 1e76ac15266..d642ec2bb5d 100644
--- a/storage/federatedx/Makefile.am
+++ b/storage/federatedx/Makefile.am
@@ -17,20 +17,31 @@ DEFS = @DEFS@
noinst_HEADERS = ha_federatedx.h federatedx_probes.h
-EXTRA_LTLIBRARIES = ha_federatedx.la
+EXTRA_LTLIBRARIES = libfederatedx.la libfederatedx_common.la libfederatedx_embedded.la ha_federatedx.la
pkgplugin_LTLIBRARIES = @plugin_federatedx_shared_target@
ha_federatedx_la_LDFLAGS = -module -rpath $(pkgplugindir)
ha_federatedx_la_CXXFLAGS= -shared $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
ha_federatedx_la_CFLAGS = -shared $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-EXTRA_LIBRARIES = libfederatedx.a
-noinst_LIBRARIES = @plugin_federatedx_static_target@
-libfederatedx_a_CXXFLAGS = $(AM_CXXFLAGS)
-libfederatedx_a_SOURCES= ha_federatedx.cc federatedx_txn.cc \
+noinst_LTLIBRARIES = @plugin_federatedx_static_target@ @plugin_federatedx_embedded_static_target@
+libfederatedx_common_la_CXXFLAGS = $(AM_CXXFLAGS)
+libfederatedx_common_la_CFLAGS = $(AM_CFLAGS)
+libfederatedx_common_la_SOURCES= federatedx_txn.cc \
federatedx_io.cc federatedx_io_null.cc \
federatedx_io_mysql.cc
+libfederatedx_la_CXXFLAGS = $(AM_CFLAGS)
+libfederatedx_la_CFLAGS = $(AM_CFLAGS)
+libfederatedx_la_LIBADD = libfederatedx_common.la
+libfederatedx_la_SOURCES= ha_federatedx.cc
+
+libfederatedx_embedded_la_CXXFLAGS = $(AM_CFLAGS) @plugin_embedded_defs@
+libfederatedx_embedded_la_CFLAGS = $(AM_CFLAGS) @plugin_embedded_defs@
+libfederatedx_embedded_la_LDFLAGS = $(AM_LDFLAGS)
+libfederatedx_embedded_la_LIBADD = libfederatedx_common.la
+libfederatedx_embedded_la_SOURCES= ha_federatedx.cc
+
EXTRA_DIST = CMakeLists.txt plug.in ha_federatedx.h \
federatedx_probes.h
diff --git a/storage/federatedx/plug.in b/storage/federatedx/plug.in
index 95afe270f4c..4a8a88e7280 100644
--- a/storage/federatedx/plug.in
+++ b/storage/federatedx/plug.in
@@ -1,5 +1,4 @@
MYSQL_STORAGE_ENGINE(federatedx,,[FederatedX Storage Engine],
[FederatedX Storage Engine], [max,max-no-ndb])
MYSQL_PLUGIN_DYNAMIC(federatedx, [ha_federatedx.la])
-MYSQL_PLUGIN_STATIC(federatedx, [libfederatedx.a])
-MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(federatedx, [ha_federatedx.cc])
+MYSQL_PLUGIN_STATIC(federatedx, [libfederatedx.la], [libfederatedx_embedded.la])
diff --git a/storage/heap/Makefile.am b/storage/heap/Makefile.am
index ec1445dea67..c896442728a 100644
--- a/storage/heap/Makefile.am
+++ b/storage/heap/Makefile.am
@@ -27,8 +27,11 @@ LDADD =
DEFS = @DEFS@
pkglib_LIBRARIES = libheap.a
+noinst_LTLIBRARIES = libheap.la libheap_s.la \
+ @plugin_heap_embedded_static_target@
+EXTRA_LTLIBRARIES = libheap_embedded.la
+
noinst_PROGRAMS = hp_test1 hp_test2
-noinst_LIBRARIES = libheap.a
hp_test1_LDFLAGS = @NOINST_LDFLAGS@
hp_test1_LDADD = libheap.a \
$(top_builddir)/mysys/libmysys.a \
@@ -40,14 +43,25 @@ hp_test2_LDADD = libheap.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/strings/libmystrings.a
noinst_HEADERS = heapdef.h ha_heap.h
-libheap_a_SOURCES = hp_open.c hp_extra.c hp_close.c hp_panic.c hp_info.c \
+libheap_la_SOURCES = hp_open.c hp_extra.c hp_close.c hp_panic.c hp_info.c \
hp_rrnd.c hp_scan.c hp_update.c hp_write.c hp_delete.c \
hp_rsame.c hp_create.c hp_rename.c hp_rfirst.c \
hp_rnext.c hp_rlast.c hp_rprev.c hp_clear.c \
hp_rkey.c hp_block.c \
- ha_heap.cc \
hp_hash.c _check.c _rectest.c hp_static.c
+libheap_s_la_SOURCES = ha_heap.cc
+libheap_s_la_CFLAGS = $(AM_CFLAGS)
+libheap_s_la_CXXFLAGS = $(AM_CXXFLAGS)
+libheap_s_la_LIBADD = libheap.la
+libheap_embedded_la_SOURCES = ha_heap.cc
+libheap_embedded_la_LIBADD = libheap.la
+libheap_embedded_la_CXXFLAGS = @plugin_embedded_defs@
+
+libheap_a_SOURCES=
+libheap.a: libheap.la
+ $(CP) .libs/libheap.a $@
+
EXTRA_DIST = CMakeLists.txt plug.in
diff --git a/storage/heap/plug.in b/storage/heap/plug.in
index 50f31c60f2b..92ec01d3c88 100644
--- a/storage/heap/plug.in
+++ b/storage/heap/plug.in
@@ -1,7 +1,6 @@
MYSQL_STORAGE_ENGINE(heap,no, [Memory Storage Engine],
[Volatile memory based tables])
MYSQL_PLUGIN_DIRECTORY(heap, [storage/heap])
-MYSQL_PLUGIN_STATIC(heap, [libheap.a])
+MYSQL_PLUGIN_STATIC(heap, [libheap_s.la], [libheap_embedded.la])
MYSQL_PLUGIN_MANDATORY(heap) dnl Memory tables
-MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(heap, [ha_heap.cc])
diff --git a/storage/innobase/Makefile.am b/storage/innobase/Makefile.am
index 29ba83c0668..c2bbb98e73d 100644
--- a/storage/innobase/Makefile.am
+++ b/storage/innobase/Makefile.am
@@ -122,9 +122,8 @@ noinst_HEADERS= include/btr0btr.h include/btr0btr.ic \
include/ut0list.ic include/ut0wqueue.h \
include/ha_prototypes.h handler/ha_innodb.h
-EXTRA_LIBRARIES= libinnobase.a
-noinst_LIBRARIES= @plugin_innobase_static_target@
-libinnobase_a_SOURCES= btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c \
+noinst_LTLIBRARIES= @plugin_innobase_static_target@
+libinnobase_la_SOURCES= btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c \
btr/btr0sea.c buf/buf0buf.c buf/buf0flu.c \
buf/buf0lru.c buf/buf0rea.c data/data0data.c \
data/data0type.c dict/dict0boot.c \
@@ -156,10 +155,10 @@ libinnobase_a_SOURCES= btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c \
ut/ut0ut.c ut/ut0vec.c ut/ut0wqueue.c \
handler/ha_innodb.cc
-libinnobase_a_CXXFLAGS= $(AM_CXXFLAGS)
-libinnobase_a_CFLAGS= $(AM_CFLAGS)
+libinnobase_la_CXXFLAGS= $(AM_CXXFLAGS)
+libinnobase_la_CFLAGS= $(AM_CFLAGS)
-EXTRA_LTLIBRARIES= ha_innodb.la
+EXTRA_LTLIBRARIES= libinnobase.la ha_innodb.la
pkgplugin_LTLIBRARIES= @plugin_innobase_shared_target@
ha_innodb_la_LDFLAGS= -module -rpath $(pkgplugindir)
diff --git a/storage/innobase/plug.in.disabled b/storage/innobase/plug.in.disabled
index de7302dd6cc..b18950b9c7a 100644
--- a/storage/innobase/plug.in.disabled
+++ b/storage/innobase/plug.in.disabled
@@ -1,7 +1,7 @@
MYSQL_STORAGE_ENGINE(innobase, innodb, [InnoDB Storage Engine],
[Transactional Tables using InnoDB], [max,max-no-ndb])
MYSQL_PLUGIN_DIRECTORY(innobase, [storage/innobase])
-MYSQL_PLUGIN_STATIC(innobase, [libinnobase.a])
+MYSQL_PLUGIN_STATIC(innobase, [libinnobase.la])
MYSQL_PLUGIN_DYNAMIC(innobase, [ha_innodb.la])
MYSQL_PLUGIN_ACTIONS(innobase, [
AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"])
diff --git a/storage/innodb_plugin/Makefile.am b/storage/innodb_plugin/Makefile.am
index 0d2c194a3f2..1b02b4eceb8 100644
--- a/storage/innodb_plugin/Makefile.am
+++ b/storage/innodb_plugin/Makefile.am
@@ -228,9 +228,8 @@ noinst_HEADERS= \
include/ut0wqueue.h \
mem/mem0dbg.c
-EXTRA_LIBRARIES= libinnobase.a
-noinst_LIBRARIES= @plugin_innodb_plugin_static_target@
-libinnobase_a_SOURCES= \
+noinst_LTLIBRARIES= @plugin_innodb_plugin_static_target@
+libinnobase_la_SOURCES= \
btr/btr0btr.c \
btr/btr0cur.c \
btr/btr0pcur.c \
@@ -325,16 +324,16 @@ libinnobase_a_SOURCES= \
ut/ut0vec.c \
ut/ut0wqueue.c
-libinnobase_a_CXXFLAGS= $(AM_CXXFLAGS)
-libinnobase_a_CFLAGS= $(AM_CFLAGS)
+libinnobase_la_CXXFLAGS= $(AM_CXXFLAGS)
+libinnobase_la_CFLAGS= $(AM_CFLAGS)
-EXTRA_LTLIBRARIES= ha_innodb_plugin.la
+EXTRA_LTLIBRARIES= libinnobase.la ha_innodb_plugin.la
pkgplugin_LTLIBRARIES= @plugin_innodb_plugin_shared_target@
ha_innodb_plugin_la_LDFLAGS= -module -rpath $(pkgplugindir)
ha_innodb_plugin_la_CXXFLAGS= -shared $(AM_CXXFLAGS) $(INNODB_DYNAMIC_CFLAGS)
ha_innodb_plugin_la_CFLAGS= -shared $(AM_CFLAGS) $(INNODB_DYNAMIC_CFLAGS)
-ha_innodb_plugin_la_SOURCES= $(libinnobase_a_SOURCES)
+ha_innodb_plugin_la_SOURCES= $(libinnobase_la_SOURCES)
EXTRA_DIST= CMakeLists.txt plug.in \
pars/make_bison.sh pars/make_flex.sh \
diff --git a/storage/maria/CMakeLists.txt b/storage/maria/CMakeLists.txt
index 22e0211f052..fe6570d9c03 100644
--- a/storage/maria/CMakeLists.txt
+++ b/storage/maria/CMakeLists.txt
@@ -65,9 +65,8 @@ TARGET_LINK_LIBRARIES(maria_read_log maria myisam mysys dbug strings zlib wsock3
ADD_EXECUTABLE(maria_pack maria_pack.c)
TARGET_LINK_LIBRARIES(maria_pack maria myisam mysys dbug strings zlib wsock32)
-ADD_EXECUTABLE(maria_dump_log ma_loghandler.c unittest/ma_loghandler_examples.c)
+ADD_EXECUTABLE(maria_dump_log maria_dump_log.c unittest/ma_loghandler_examples.c)
TARGET_LINK_LIBRARIES(maria_dump_log maria myisam mysys dbug strings zlib wsock32)
-SET_TARGET_PROPERTIES(maria_dump_log PROPERTIES COMPILE_FLAGS "-DMARIA_DUMP_LOG")
ADD_EXECUTABLE(ma_test1 ma_test1.c)
TARGET_LINK_LIBRARIES(ma_test1 maria myisam mysys dbug strings zlib wsock32)
diff --git a/storage/maria/Makefile.am b/storage/maria/Makefile.am
index d38abe01bdc..5e78614f0ca 100644
--- a/storage/maria/Makefile.am
+++ b/storage/maria/Makefile.am
@@ -34,6 +34,9 @@ EXTRA_DIST = ma_test_all.sh ma_test_all.res ma_test_big.sh \
ma_ft_stem.c CMakeLists.txt plug.in ma_test_recovery
pkgdata_DATA =
pkglib_LIBRARIES = libmaria.a
+noinst_LTLIBRARIES = libmaria.la libmaria_s.la \
+ @plugin_maria_embedded_static_target@
+EXTRA_LTLIBRARIES = libmaria_embedded.la
bin_PROGRAMS = maria_chk maria_pack maria_ftdump maria_read_log \
maria_dump_log
maria_chk_DEPENDENCIES= $(LIBRARIES)
@@ -58,13 +61,12 @@ maria_read_log_LDADD= @CLIENT_EXTRA_LDFLAGS@ libmaria.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
maria_dump_log_DEPENDENCIES=$(LIBRARIES) ma_loghandler.c
-maria_dump_log_LDADD= @CLIENT_EXTRA_LDFLAGS@ libmaria.a \
+maria_dump_log_LDADD= @CLIENT_EXTRA_LDFLAGS@ libmaria.la \
$(top_builddir)/storage/myisam/libmyisam.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-maria_dump_log_SOURCES= ma_loghandler.c unittest/ma_loghandler_examples.c
-maria_dump_log_CPPFLAGS= -DMARIA_DUMP_LOG
+maria_dump_log_SOURCES= maria_dump_log.c unittest/ma_loghandler_examples.c
noinst_PROGRAMS = ma_test1 ma_test2 ma_test3 ma_rt_test ma_sp_test
noinst_HEADERS = maria_def.h ma_rt_index.h ma_rt_key.h ma_rt_mbr.h \
ma_sp_defs.h ma_fulltext.h ma_ftdefs.h ma_ft_test1.h \
@@ -112,7 +114,7 @@ ma_sp_test_LDADD= @CLIENT_EXTRA_LDFLAGS@ libmaria.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-libmaria_a_SOURCES = ma_init.c ma_open.c ma_extra.c ma_info.c ma_rkey.c \
+libmaria_la_SOURCES = ma_init.c ma_open.c ma_extra.c ma_info.c ma_rkey.c \
ma_rnext.c ma_rnext_same.c \
ma_search.c ma_page.c ma_key_recover.c ma_key.c \
ma_locking.c ma_state.c \
@@ -134,8 +136,20 @@ libmaria_a_SOURCES = ma_init.c ma_open.c ma_extra.c ma_info.c ma_rkey.c \
ma_sp_key.c ma_control_file.c ma_loghandler.c \
ma_pagecache.c ma_pagecaches.c \
ma_checkpoint.c ma_recovery.c ma_commit.c \
- ma_pagecrc.c ma_recovery_util.c \
- ha_maria.cc
+ ma_pagecrc.c ma_recovery_util.c
+
+libmaria_s_la_SOURCES = ha_maria.cc
+libmaria_s_la_CXXFLAGS = $(AM_CXXFLAGS)
+libmaria_s_la_LIBADD = libmaria.la
+libmaria_embedded_la_SOURCES = ha_maria.cc
+libmaria_embedded_la_LIBADD = libmaria.la
+libmaria_embedded_la_CXXFLAGS = $(AM_CXXFLAGS) @plugin_embedded_defs@
+
+libmaria_a_SOURCES=
+libmaria.a: libmaria.la
+ $(CP) .libs/libmaria.a $@
+
+
CLEANFILES = test?.MA? FT?.MA? isam.log ma_test_all ma_rt_test.MA? sp_test.MA? maria_log_control maria_log.0000*
SUFFIXES = .sh
diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c
index 1cc4140081a..423cd2f0dd7 100644
--- a/storage/maria/ma_loghandler.c
+++ b/storage/maria/ma_loghandler.c
@@ -1086,34 +1086,14 @@ static my_bool translog_max_lsn_to_header(File file, LSN lsn)
/*
- Information from transaction log file header
-*/
-
-typedef struct st_loghandler_file_info
-{
- /*
- LSN_IMPOSSIBLE for current file (not finished file).
- Maximum LSN of the record which parts stored in the
- file.
- */
- LSN max_lsn;
- ulonglong timestamp; /* Time stamp */
- ulong maria_version; /* Version of maria loghandler */
- ulong mysql_version; /* Version of mysql server */
- ulong server_id; /* Server ID */
- ulong page_size; /* Loghandler page size */
- ulong file_number; /* Number of the file (from the file header) */
-} LOGHANDLER_FILE_INFO;
-
-/*
@brief Extract hander file information from loghandler file page
@param desc header information descriptor to be filled with information
@param page_buff buffer with the page content
*/
-static void translog_interpret_file_header(LOGHANDLER_FILE_INFO *desc,
- uchar *page_buff)
+void translog_interpret_file_header(LOGHANDLER_FILE_INFO *desc,
+ uchar *page_buff)
{
uchar *ptr;
@@ -3400,7 +3380,7 @@ my_bool translog_walk_filenames(const char *directory,
@brief Fills table of dependence length of page header from page flags
*/
-static void translog_fill_overhead_table()
+void translog_fill_overhead_table()
{
uint i;
for (i= 0; i < TRANSLOG_FLAGS_NUM; i++)
@@ -8322,156 +8302,6 @@ void translog_set_file_size(uint32 size)
/**
- Write debug information to log if we EXTRA_DEBUG is enabled
-*/
-
-my_bool translog_log_debug_info(TRN *trn __attribute__((unused)),
- enum translog_debug_info_type type
- __attribute__((unused)),
- uchar *info __attribute__((unused)),
- size_t length __attribute__((unused)))
-{
-#ifdef EXTRA_DEBUG
- LEX_CUSTRING log_array[TRANSLOG_INTERNAL_PARTS + 2];
- uchar debug_type;
- LSN lsn;
-
- if (!trn)
- {
- /*
- We can't log the current transaction because we don't have
- an active transaction. Use a temporary transaction object instead
- */
- trn= &dummy_transaction_object;
- }
- debug_type= (uchar) type;
- log_array[TRANSLOG_INTERNAL_PARTS + 0].str= &debug_type;
- log_array[TRANSLOG_INTERNAL_PARTS + 0].length= 1;
- log_array[TRANSLOG_INTERNAL_PARTS + 1].str= info;
- log_array[TRANSLOG_INTERNAL_PARTS + 1].length= length;
- return translog_write_record(&lsn, LOGREC_DEBUG_INFO,
- trn, NULL,
- (translog_size_t) (1+ length),
- sizeof(log_array)/sizeof(log_array[0]),
- log_array, NULL, NULL);
-#else
- return 0;
-#endif
-}
-
-
-#ifdef MARIA_DUMP_LOG
-#include <my_getopt.h>
-extern void translog_example_table_init();
-static const char *load_default_groups[]= { "maria_dump_log",0 };
-static void get_options(int *argc,char * * *argv);
-#ifndef DBUG_OFF
-#if defined(__WIN__)
-const char *default_dbug_option= "d:t:i:O,\\maria_dump_log.trace";
-#else
-const char *default_dbug_option= "d:t:i:o,/tmp/maria_dump_log.trace";
-#endif
-#endif
-static ulonglong opt_offset;
-static ulong opt_pages;
-static const char *opt_file= NULL;
-static File handler= -1;
-static my_bool opt_unit= 0;
-static struct my_option my_long_options[] =
-{
-#ifdef IMPLTMENTED
- {"body", 'b',
- "Print chunk body dump",
- (uchar **) &opt_body, (uchar **) &opt_body, 0,
- GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-#endif
-#ifndef DBUG_OFF
- {"debug", '#', "Output debug log. Often the argument is 'd:t:o,filename'.",
- 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
-#endif
- {"file", 'f', "Path to file which will be read",
- (uchar**) &opt_file, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"help", '?', "Display this help and exit.",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- { "offset", 'o', "Start reading log from this offset",
- (uchar**) &opt_offset, (uchar**) &opt_offset,
- 0, GET_ULL, REQUIRED_ARG, 0, 0, ~(longlong) 0, 0, 0, 0 },
- { "pages", 'n', "Number of pages to read",
- (uchar**) &opt_pages, (uchar**) &opt_pages, 0,
- GET_ULONG, REQUIRED_ARG, (long) ~(ulong) 0,
- (long) 1, (long) ~(ulong) 0, (long) 0,
- (long) 1, 0},
- {"unit-test", 'U',
- "Use unit test record table (for logs created by unittests",
- (uchar **) &opt_unit, (uchar **) &opt_unit, 0,
- GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"version", 'V', "Print version and exit.",
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
- { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
-};
-
-
-static void print_version(void)
-{
- VOID(printf("%s Ver 1.0 for %s on %s\n",
- my_progname_short, SYSTEM_TYPE, MACHINE_TYPE));
- NETWARE_SET_SCREEN_MODE(1);
-}
-
-
-static void usage(void)
-{
- print_version();
- puts("Copyright (C) 2008 MySQL AB");
- puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,");
- puts("and you are welcome to modify and redistribute it under the GPL license\n");
-
- puts("Dump content of maria log pages.");
- VOID(printf("\nUsage: %s -f file OPTIONS\n", my_progname_short));
- my_print_help(my_long_options);
- print_defaults("my", load_default_groups);
- my_print_variables(my_long_options);
-}
-
-
-static my_bool
-get_one_option(int optid __attribute__((unused)),
- const struct my_option *opt __attribute__((unused)),
- char *argument __attribute__((unused)))
-{
- switch (optid) {
- case '?':
- usage();
- exit(0);
- case 'V':
- print_version();
- exit(0);
-#ifndef DBUG_OFF
- case '#':
- DBUG_SET_INITIAL(argument ? argument : default_dbug_option);
- break;
-#endif
- }
- return 0;
-}
-
-
-static void get_options(int *argc,char ***argv)
-{
- int ho_error;
-
- if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
- exit(ho_error);
-
- if (opt_file == NULL)
- {
- usage();
- exit(1);
- }
-}
-
-
-/**
@brief Dump information about file header page.
*/
@@ -8655,7 +8485,7 @@ static uchar *dump_chunk(uchar *buffer, uchar *ptr)
@brief Dump information about page with data.
*/
-static void dump_datapage(uchar *buffer)
+static void dump_datapage(uchar *buffer, File handler)
{
uchar *ptr;
ulong offset;
@@ -8736,79 +8566,51 @@ static void dump_datapage(uchar *buffer)
@brief Dump information about page.
*/
-static void dump_page(uchar *buffer)
+void dump_page(uchar *buffer, File handler)
{
- printf("Page by offset %llu (0x%llx)\n", opt_offset, opt_offset);
if (strncmp((char*)maria_trans_file_magic, (char*)buffer,
sizeof(maria_trans_file_magic)) == 0)
{
dump_header_page(buffer);
}
- dump_datapage(buffer);
+ dump_datapage(buffer, handler);
}
/**
- @brief maria_dump_log main function.
+ Write debug information to log if we EXTRA_DEBUG is enabled
*/
-int main(int argc, char **argv)
+my_bool translog_log_debug_info(TRN *trn __attribute__((unused)),
+ enum translog_debug_info_type type
+ __attribute__((unused)),
+ uchar *info __attribute__((unused)),
+ size_t length __attribute__((unused)))
{
- char **default_argv;
- uchar buffer[TRANSLOG_PAGE_SIZE];
- MY_INIT(argv[0]);
-
- load_defaults("my", load_default_groups, &argc, &argv);
- default_argv= argv;
- get_options(&argc, &argv);
-
- if (opt_unit)
- translog_example_table_init();
- else
- translog_table_init();
- translog_fill_overhead_table();
-
- maria_data_root= (char *)".";
+#ifdef EXTRA_DEBUG
+ LEX_CUSTRING log_array[TRANSLOG_INTERNAL_PARTS + 2];
+ uchar debug_type;
+ LSN lsn;
- if ((handler= my_open(opt_file, O_RDONLY, MYF(MY_WME))) < 0)
- {
- fprintf(stderr, "Can't open file: '%s' errno: %d\n",
- opt_file, my_errno);
- goto err;
- }
- if (my_seek(handler, opt_offset, SEEK_SET, MYF(MY_WME)) !=
- opt_offset)
- {
- fprintf(stderr, "Can't set position %lld file: '%s' errno: %d\n",
- opt_offset, opt_file, my_errno);
- goto err;
- }
- for (;
- opt_pages;
- opt_offset+= TRANSLOG_PAGE_SIZE, opt_pages--)
+ if (!trn)
{
- if (my_pread(handler, buffer, TRANSLOG_PAGE_SIZE, opt_offset,
- MYF(MY_NABP)))
- {
- if (my_errno == HA_ERR_FILE_TOO_SHORT)
- goto end;
- fprintf(stderr, "Can't read page at position %lld file: '%s' "
- "errno: %d\n", opt_offset, opt_file, my_errno);
- goto err;
- }
- dump_page(buffer);
+ /*
+ We can't log the current transaction because we don't have
+ an active transaction. Use a temporary transaction object instead
+ */
+ trn= &dummy_transaction_object;
}
-
-end:
- my_close(handler, MYF(0));
- free_defaults(default_argv);
- exit(0);
- return 0; /* No compiler warning */
-
-err:
- my_close(handler, MYF(0));
- fprintf(stderr, "%s: FAILED\n", my_progname_short);
- free_defaults(default_argv);
- exit(1);
-}
+ debug_type= (uchar) type;
+ log_array[TRANSLOG_INTERNAL_PARTS + 0].str= &debug_type;
+ log_array[TRANSLOG_INTERNAL_PARTS + 0].length= 1;
+ log_array[TRANSLOG_INTERNAL_PARTS + 1].str= info;
+ log_array[TRANSLOG_INTERNAL_PARTS + 1].length= length;
+ return translog_write_record(&lsn, LOGREC_DEBUG_INFO,
+ trn, NULL,
+ (translog_size_t) (1+ length),
+ sizeof(log_array)/sizeof(log_array[0]),
+ log_array, NULL, NULL);
+#else
+ return 0;
#endif
+}
diff --git a/storage/maria/ma_loghandler.h b/storage/maria/ma_loghandler.h
index 1040d07997a..c22d361d142 100644
--- a/storage/maria/ma_loghandler.h
+++ b/storage/maria/ma_loghandler.h
@@ -358,6 +358,7 @@ translog_assign_id_to_share_from_recovery(struct st_maria_share *share,
extern my_bool translog_walk_filenames(const char *directory,
my_bool (*callback)(const char *,
const char *));
+extern void dump_page(uchar *buffer, File handler);
extern my_bool translog_log_debug_info(TRN *trn,
enum translog_debug_info_type type,
uchar *info, size_t length);
@@ -376,8 +377,31 @@ extern enum enum_translog_status translog_status;
ma_loghandler_for_recovery.h ?
*/
+/*
+ Information from transaction log file header
+*/
+
+typedef struct st_loghandler_file_info
+{
+ /*
+ LSN_IMPOSSIBLE for current file (not finished file).
+ Maximum LSN of the record which parts stored in the
+ file.
+ */
+ LSN max_lsn;
+ ulonglong timestamp; /* Time stamp */
+ ulong maria_version; /* Version of maria loghandler */
+ ulong mysql_version; /* Version of mysql server */
+ ulong server_id; /* Server ID */
+ ulong page_size; /* Loghandler page size */
+ ulong file_number; /* Number of the file (from the file header) */
+} LOGHANDLER_FILE_INFO;
+
#define SHARE_ID_MAX 65535 /* array's size */
+extern void translog_fill_overhead_table();
+extern void translog_interpret_file_header(LOGHANDLER_FILE_INFO *desc,
+ uchar *page_buff);
extern LSN translog_first_lsn_in_log();
extern LSN translog_first_theoretical_lsn();
extern LSN translog_next_LSN(TRANSLOG_ADDRESS addr, TRANSLOG_ADDRESS horizon);
diff --git a/storage/maria/maria_dump_log.c b/storage/maria/maria_dump_log.c
new file mode 100644
index 00000000000..bc7ec566462
--- /dev/null
+++ b/storage/maria/maria_dump_log.c
@@ -0,0 +1,190 @@
+/* Copyright (C) 2007 MySQL AB & Sanja Belkin
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include "maria_def.h"
+#include <my_getopt.h>
+extern void translog_example_table_init();
+static const char *load_default_groups[]= { "maria_dump_log",0 };
+static void get_options(int *argc,char * * *argv);
+#ifndef DBUG_OFF
+#if defined(__WIN__)
+const char *default_dbug_option= "d:t:i:O,\\maria_dump_log.trace";
+#else
+const char *default_dbug_option= "d:t:i:o,/tmp/maria_dump_log.trace";
+#endif
+#endif
+static ulonglong opt_offset;
+static ulong opt_pages;
+static const char *opt_file= NULL;
+static File handler= -1;
+static my_bool opt_unit= 0;
+static struct my_option my_long_options[] =
+{
+#ifdef IMPLTMENTED
+ {"body", 'b',
+ "Print chunk body dump",
+ (uchar **) &opt_body, (uchar **) &opt_body, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+#endif
+#ifndef DBUG_OFF
+ {"debug", '#', "Output debug log. Often the argument is 'd:t:o,filename'.",
+ 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+#endif
+ {"file", 'f', "Path to file which will be read",
+ (uchar**) &opt_file, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"help", '?', "Display this help and exit.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ { "offset", 'o', "Start reading log from this offset",
+ (uchar**) &opt_offset, (uchar**) &opt_offset,
+ 0, GET_ULL, REQUIRED_ARG, 0, 0, ~(longlong) 0, 0, 0, 0 },
+ { "pages", 'n', "Number of pages to read",
+ (uchar**) &opt_pages, (uchar**) &opt_pages, 0,
+ GET_ULONG, REQUIRED_ARG, (long) ~(ulong) 0,
+ (long) 1, (long) ~(ulong) 0, (long) 0,
+ (long) 1, 0},
+ {"unit-test", 'U',
+ "Use unit test record table (for logs created by unittests",
+ (uchar **) &opt_unit, (uchar **) &opt_unit, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"version", 'V', "Print version and exit.",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
+};
+
+
+static void print_version(void)
+{
+ VOID(printf("%s Ver 1.0 for %s on %s\n",
+ my_progname_short, SYSTEM_TYPE, MACHINE_TYPE));
+ NETWARE_SET_SCREEN_MODE(1);
+}
+
+
+static void usage(void)
+{
+ print_version();
+ puts("Copyright (C) 2008 MySQL AB");
+ puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,");
+ puts("and you are welcome to modify and redistribute it under the GPL license\n");
+
+ puts("Dump content of maria log pages.");
+ VOID(printf("\nUsage: %s -f file OPTIONS\n", my_progname_short));
+ my_print_help(my_long_options);
+ print_defaults("my", load_default_groups);
+ my_print_variables(my_long_options);
+}
+
+
+static my_bool
+get_one_option(int optid __attribute__((unused)),
+ const struct my_option *opt __attribute__((unused)),
+ char *argument __attribute__((unused)))
+{
+ switch (optid) {
+ case '?':
+ usage();
+ exit(0);
+ case 'V':
+ print_version();
+ exit(0);
+#ifndef DBUG_OFF
+ case '#':
+ DBUG_SET_INITIAL(argument ? argument : default_dbug_option);
+ break;
+#endif
+ }
+ return 0;
+}
+
+
+static void get_options(int *argc,char ***argv)
+{
+ int ho_error;
+
+ if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
+ exit(ho_error);
+
+ if (opt_file == NULL)
+ {
+ usage();
+ exit(1);
+ }
+}
+
+
+/**
+ @brief maria_dump_log main function.
+*/
+
+int main(int argc, char **argv)
+{
+ char **default_argv;
+ uchar buffer[TRANSLOG_PAGE_SIZE];
+ MY_INIT(argv[0]);
+
+ load_defaults("my", load_default_groups, &argc, &argv);
+ default_argv= argv;
+ get_options(&argc, &argv);
+
+ if (opt_unit)
+ translog_example_table_init();
+ else
+ translog_table_init();
+ translog_fill_overhead_table();
+
+ maria_data_root= (char *)".";
+
+ if ((handler= my_open(opt_file, O_RDONLY, MYF(MY_WME))) < 0)
+ {
+ fprintf(stderr, "Can't open file: '%s' errno: %d\n",
+ opt_file, my_errno);
+ goto err;
+ }
+ if (my_seek(handler, opt_offset, SEEK_SET, MYF(MY_WME)) !=
+ opt_offset)
+ {
+ fprintf(stderr, "Can't set position %lld file: '%s' errno: %d\n",
+ opt_offset, opt_file, my_errno);
+ goto err;
+ }
+ for (;
+ opt_pages;
+ opt_offset+= TRANSLOG_PAGE_SIZE, opt_pages--)
+ {
+ if (my_pread(handler, buffer, TRANSLOG_PAGE_SIZE, opt_offset,
+ MYF(MY_NABP)))
+ {
+ if (my_errno == HA_ERR_FILE_TOO_SHORT)
+ goto end;
+ fprintf(stderr, "Can't read page at position %lld file: '%s' "
+ "errno: %d\n", opt_offset, opt_file, my_errno);
+ goto err;
+ }
+ printf("Page by offset %llu (0x%llx)\n", opt_offset, opt_offset);
+ dump_page(buffer, handler);
+ }
+
+end:
+ my_close(handler, MYF(0));
+ free_defaults(default_argv);
+ exit(0);
+ return 0; /* No compiler warning */
+
+err:
+ my_close(handler, MYF(0));
+ fprintf(stderr, "%s: FAILED\n", my_progname_short);
+ free_defaults(default_argv);
+ exit(1);
+}
diff --git a/storage/maria/plug.in b/storage/maria/plug.in
index 686c8361a87..bdf1ca7a5bf 100644
--- a/storage/maria/plug.in
+++ b/storage/maria/plug.in
@@ -1,10 +1,9 @@
MYSQL_STORAGE_ENGINE(maria,, [Maria Storage Engine],
[Crash-safe tables with MyISAM heritage], [default,max,max-no-ndb])
MYSQL_PLUGIN_DIRECTORY(maria, [storage/maria])
-MYSQL_PLUGIN_STATIC(maria, [libmaria.a])
+MYSQL_PLUGIN_STATIC(maria, [libmaria_s.la], [libmaria_embedded.la])
# Maria will probably go first into max builds, not all builds,
# so we don't declare it mandatory.
-MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(maria, [ha_maria.cc])
MYSQL_PLUGIN_ACTIONS(maria, [
# AC_CONFIG_FILES(storage/maria/unittest/Makefile)
diff --git a/storage/myisam/Makefile.am b/storage/myisam/Makefile.am
index ea942672856..8f3d51c4886 100644
--- a/storage/myisam/Makefile.am
+++ b/storage/myisam/Makefile.am
@@ -31,6 +31,10 @@ EXTRA_DIST = mi_test_all.sh mi_test_all.res ft_stem.c CMakeLists.txt plug.in
pkgdata_DATA =
pkglib_LIBRARIES = libmyisam.a
+noinst_LTLIBRARIES = libmyisam.la libmyisam_s.la \
+ @plugin_myisam_embedded_static_target@
+EXTRA_LTLIBRARIES = libmyisam_embedded.la
+
bin_PROGRAMS = myisamchk myisamlog myisampack myisam_ftdump
myisamchk_DEPENDENCIES= $(LIBRARIES)
myisamchk_LDADD= @CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
@@ -83,7 +87,8 @@ sp_test_LDADD = @CLIENT_EXTRA_LDFLAGS@ libmyisam.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-libmyisam_a_SOURCES = mi_open.c mi_extra.c mi_info.c mi_rkey.c \
+
+libmyisam_la_SOURCES = mi_open.c mi_extra.c mi_info.c mi_rkey.c \
mi_rnext.c mi_rnext_same.c \
mi_search.c mi_page.c mi_key.c mi_locking.c \
mi_rrnd.c mi_scan.c mi_cache.c \
@@ -98,8 +103,19 @@ libmyisam_a_SOURCES = mi_open.c mi_extra.c mi_info.c mi_rkey.c \
mi_keycache.c mi_preload.c \
ft_parser.c ft_stopwords.c ft_static.c \
ft_update.c ft_boolean_search.c ft_nlq_search.c \
- sort.c ha_myisam.cc ft_myisam.c \
+ sort.c ft_myisam.c \
rt_index.c rt_key.c rt_mbr.c rt_split.c sp_key.c
+libmyisam_s_la_SOURCES = ha_myisam.cc
+libmyisam_s_la_CXXFLAGS = $(AM_CXXFLAGS)
+libmyisam_s_la_LIBADD = libmyisam.la
+libmyisam_embedded_la_SOURCES = ha_myisam.cc
+libmyisam_embedded_la_CXXFLAGS = $(AM_CXXFLAGS) @plugin_embedded_defs@
+libmyisam_embedded_la_LIBADD = libmyisam.la
+
+libmyisam_a_SOURCES=
+libmyisam.a: libmyisam.la
+ $(CP) .libs/libmyisam.a $@
+
CLEANFILES = test?.MY? FT?.MY? isam.log mi_test_all rt_test.MY? sp_test.MY?
# Move to automake rules ?
diff --git a/storage/myisam/plug.in b/storage/myisam/plug.in
index e92b5e56d7f..95b29336493 100644
--- a/storage/myisam/plug.in
+++ b/storage/myisam/plug.in
@@ -1,7 +1,6 @@
dnl MYSQL_STORAGE_ENGINE(myisam,no, [MyISAM Storage Engine],
dnl [Traditional non-transactional MySQL tables])
dnl MYSQL_PLUGIN_DIRECTORY(myisam, [storage/myisam])
-dnl MYSQL_PLUGIN_STATIC(myisam, [libmyisam.a])
+dnl MYSQL_PLUGIN_STATIC(myisam, [libmyisam_s.la], [libmyisam_embedded.la])
dnl MYSQL_PLUGIN_MANDATORY(myisam) dnl Default
-dnl MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(myisam, [ha_myisam.cc])
diff --git a/storage/myisammrg/Makefile.am b/storage/myisammrg/Makefile.am
index 1ca51bc9d03..66fd2402646 100644
--- a/storage/myisammrg/Makefile.am
+++ b/storage/myisammrg/Makefile.am
@@ -27,16 +27,26 @@ LDADD =
DEFS = @DEFS@
pkglib_LIBRARIES = libmyisammrg.a
+noinst_LTLIBRARIES = libmyisammrg.la libmyisammrg_s.la \
+ @plugin_myisammrg_embedded_static_target@
+EXTRA_LTLIBRARIES = libmyisammrg_embedded.la
noinst_HEADERS = myrg_def.h ha_myisammrg.h
-noinst_LIBRARIES = libmyisammrg.a
-libmyisammrg_a_SOURCES = myrg_open.c myrg_extra.c myrg_info.c myrg_locking.c \
+libmyisammrg_la_SOURCES = myrg_open.c myrg_extra.c myrg_info.c myrg_locking.c \
myrg_rrnd.c myrg_update.c myrg_delete.c myrg_rsame.c \
myrg_panic.c myrg_close.c myrg_create.c myrg_static.c \
myrg_rkey.c myrg_rfirst.c myrg_rlast.c myrg_rnext.c \
myrg_rprev.c myrg_queue.c myrg_write.c myrg_range.c \
- ha_myisammrg.cc \
myrg_rnext_same.c myrg_records.c
+libmyisammrg_s_la_SOURCES = ha_myisammrg.cc
+libmyisammrg_s_la_CXXFLAGS = $(AM_CXXFLAGS)
+libmyisammrg_s_la_LIBADD = libmyisammrg.la
+libmyisammrg_embedded_la_SOURCES = ha_myisammrg.cc
+libmyisammrg_embedded_la_CXXFLAGS = $(AM_CXXFLAGS) @plugin_embedded_defs@
+libmyisammrg_embedded_la_LIBADD = libmyisammrg.la
+libmyisammrg_a_SOURCES=
+libmyisammrg.a: libmyisammrg.la
+ $(CP) .libs/libmyisammrg.a $@
EXTRA_DIST = CMakeLists.txt plug.in
diff --git a/storage/myisammrg/plug.in b/storage/myisammrg/plug.in
index 1f94e07d881..a2654373fba 100644
--- a/storage/myisammrg/plug.in
+++ b/storage/myisammrg/plug.in
@@ -1,6 +1,5 @@
MYSQL_STORAGE_ENGINE(myisammrg,no,[MyISAM MERGE Engine],
[Merge multiple MySQL tables into one])
MYSQL_PLUGIN_DIRECTORY(myisammrg,[storage/myisammrg])
-MYSQL_PLUGIN_STATIC(myisammrg, [libmyisammrg.a])
+MYSQL_PLUGIN_STATIC(myisammrg, [libmyisammrg_s.la], [libmyisammrg_embedded.la])
MYSQL_PLUGIN_MANDATORY(myisammrg)
-MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(myisammrg, [ha_myisammrg.cc])
diff --git a/storage/pbxt/plug.in b/storage/pbxt/plug.in
index 02c5d8adcbe..c0dc06d9702 100644
--- a/storage/pbxt/plug.in
+++ b/storage/pbxt/plug.in
@@ -1,8 +1,7 @@
MYSQL_STORAGE_ENGINE(pbxt,no, [PBXT Storage Engine],
[MVCC-based transactional engine], [max,max-no-ndb])
MYSQL_PLUGIN_DIRECTORY(pbxt, [storage/pbxt])
-MYSQL_PLUGIN_STATIC(pbxt, [src/libpbxt.a])
+MYSQL_PLUGIN_STATIC(pbxt, [src/libpbxt_s.la], [src/libpbxt_s_embedded.la])
MYSQL_PLUGIN_ACTIONS(pbxt, [
# AC_CONFIG_FILES(storage/pbxt/src/Makefile)
])
-MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(pbxt, [[src/ha_pbxt.cc],[src/myxt_xt.cc],[src/discover_xt.cc]])
diff --git a/storage/pbxt/src/Makefile.am b/storage/pbxt/src/Makefile.am
index fc4c4ef8f1e..4c5467d24d0 100644
--- a/storage/pbxt/src/Makefile.am
+++ b/storage/pbxt/src/Makefile.am
@@ -26,25 +26,31 @@ noinst_HEADERS = bsearch_xt.h cache_xt.h ccutils_xt.h database_xt.h \
pbms.h xt_config.h xt_defs.h xt_errno.h locklist_xt.h
EXTRA_LTLIBRARIES = libpbxt.la
-libpbxt_la_SOURCES = bsearch_xt.cc cache_xt.cc ccutils_xt.cc database_xt.cc \
+non_mysql_internal_sources = bsearch_xt.cc cache_xt.cc ccutils_xt.cc database_xt.cc \
datadic_xt.cc datalog_xt.cc filesys_xt.cc hashtab_xt.cc \
- ha_pbxt.cc heap_xt.cc index_xt.cc linklist_xt.cc \
- memory_xt.cc myxt_xt.cc pthread_xt.cc restart_xt.cc \
+ heap_xt.cc index_xt.cc linklist_xt.cc \
+ memory_xt.cc pthread_xt.cc restart_xt.cc \
sortedlist_xt.cc strutil_xt.cc \
tabcache_xt.cc table_xt.cc trace_xt.cc thread_xt.cc \
- systab_xt.cc ha_xtsys.cc discover_xt.cc backup_xt.cc \
+ systab_xt.cc ha_xtsys.cc backup_xt.cc \
util_xt.cc xaction_xt.cc xactlog_xt.cc lock_xt.cc locklist_xt.cc
-
-libpbxt_la_LDFLAGS = -module
+mysql_internal_sources = ha_pbxt.cc myxt_xt.cc discover_xt.cc
+libpbxt_la_SOURCES = $(non_mysql_internal_sources) $(mysql_internal_sources)
# These are the warning Drizzle uses:
# DRIZZLE_WARNINGS = -W -Wall -Wextra -pedantic -Wundef -Wredundant-decls -Wno-strict-aliasing -Wno-long-long -Wno-unused-parameter
-libpbxt_la_CXXFLAGS = $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-libpbxt_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN -std=c99
+libpbxt_la_CXXFLAGS = -shared $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
+libpbxt_la_CFLAGS = -shared $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN -std=c99
+libpbxt_la_LDFLAGS = -module
+
+noinst_LTLIBRARIES = libpbxt_s.la libpbxt_s_embedded.la libpbxt_s_common.la
-EXTRA_LIBRARIES = libpbxt.a
-noinst_LIBRARIES = libpbxt.a
-libpbxt_a_SOURCES = $(libpbxt_la_SOURCES)
+libpbxt_s_common_la_SOURCES = $(non_mysql_internal_sources)
+libpbxt_s_la_SOURCES = $(mysql_internal_sources)
+libpbxt_s_la_LIBADD = libpbxt_s_common.la
+libpbxt_s_embedded_la_SOURCES = $(mysql_internal_sources)
+libpbxt_s_embedded_la_CXXFLAGS = $(AM_CXXFLAGS) @plugin_embedded_defs@
+libpbxt_s_embedded_la_LIBADD = libpbxt_s_common.la
EXTRA_DIST = pbms_enabled.cc win_inttypes.h
diff --git a/storage/xtradb/Makefile.am b/storage/xtradb/Makefile.am
index 7dffdacbcf1..abc24b0e1a4 100644
--- a/storage/xtradb/Makefile.am
+++ b/storage/xtradb/Makefile.am
@@ -229,9 +229,8 @@ noinst_HEADERS= \
handler/innodb_patch_info.h \
mem/mem0dbg.c
-EXTRA_LIBRARIES= libxtradb.a
-noinst_LIBRARIES= @plugin_xtradb_static_target@
-libxtradb_a_SOURCES= \
+noinst_LTLIBRARIES= @plugin_xtradb_static_target@
+libxtradb_la_SOURCES= \
btr/btr0btr.c \
btr/btr0cur.c \
btr/btr0pcur.c \
@@ -326,16 +325,16 @@ libxtradb_a_SOURCES= \
ut/ut0vec.c \
ut/ut0wqueue.c
-libxtradb_a_CXXFLAGS= $(AM_CXXFLAGS)
-libxtradb_a_CFLAGS= $(AM_CFLAGS)
+libxtradb_la_CXXFLAGS= $(AM_CXXFLAGS)
+libxtradb_la_CFLAGS= $(AM_CFLAGS)
-EXTRA_LTLIBRARIES= ha_xtradb.la
+EXTRA_LTLIBRARIES= libxtradb.la ha_xtradb.la
pkgplugin_LTLIBRARIES= @plugin_xtradb_shared_target@
ha_xtradb_la_LDFLAGS= -module -rpath $(pkgplugindir)
ha_xtradb_la_CXXFLAGS= -shared $(AM_CXXFLAGS) $(INNODB_DYNAMIC_CFLAGS)
ha_xtradb_la_CFLAGS= -shared $(AM_CFLAGS) $(INNODB_DYNAMIC_CFLAGS)
-ha_xtradb_la_SOURCES= $(libxtradb_a_SOURCES)
+ha_xtradb_la_SOURCES= $(libxtradb_la_SOURCES)
EXTRA_DIST= CMakeLists.txt plug.in \
pars/make_bison.sh pars/make_flex.sh \
diff --git a/storage/xtradb/plug.in b/storage/xtradb/plug.in
index 37c895fb520..67f25755762 100644
--- a/storage/xtradb/plug.in
+++ b/storage/xtradb/plug.in
@@ -17,7 +17,7 @@
MYSQL_STORAGE_ENGINE(xtradb, xtradb, [XtraDB Storage Engine],
[XtraDB - a drop-in replacement for InnoDB], [max,max-no-ndb])
MYSQL_PLUGIN_DIRECTORY(xtradb, [storage/xtradb])
-MYSQL_PLUGIN_STATIC(xtradb, [libxtradb.a])
+MYSQL_PLUGIN_STATIC(xtradb, [libxtradb.la])
MYSQL_PLUGIN_DYNAMIC(xtradb, [ha_xtradb.la])
MYSQL_PLUGIN_ACTIONS(xtradb, [
with_plugin_innobase=$with_plugin_xtradb # for legacy code in configure.in