Commit 71d54af5 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

- Introduce MYSQL_ADD_PLUGIN that replaces MYSQL_STORAGE_ENGINE

- Fix semisync library prefix (remove lib on Unixes)
- restrict exported symbols from zlib and yassl (fvisibility=hidden)
parent 351be29e
......@@ -169,6 +169,7 @@ MYSQL_CHECK_SSL()
MYSQL_CHECK_READLINE()
IF(NOT WITHOUT_SERVER)
SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "")
# Add storage engines and plugins.
CONFIGURE_PLUGINS()
ENDIF()
......@@ -219,7 +220,8 @@ CONFIGURE_FILE(config.h.cmake ${CMAKE_BINARY_DIR}/include/my_config.h)
CONFIGURE_FILE(config.h.cmake ${CMAKE_BINARY_DIR}/include/config.h)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
${CMAKE_BINARY_DIR}/include/mysql_version.h )
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc.in
${CMAKE_BINARY_DIR}/sql/sql_builtin.cc)
# Packaging
IF(WIN32)
......
EXTRA_DIST = \
cat.cmake \
cmake_parse_arguments.cmake
configurable_file_content.in \
check_minimal_version.cmake \
create_initial_db.cmake.in \
......
......@@ -53,11 +53,11 @@
GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
IF(NOT WIN32 AND NOT CYGWIN AND NOT APPLE AND NOT WITH_PIC AND NOT DISABLE_SHARED
AND CMAKE_SHARED_LIBRARY_C_FLAGS)
IF(WIN32 OR CYGWIN OR APPLE OR WITH_PIC OR DISABLE_SHARED OR NOT CMAKE_SHARED_LIBRARY_C_FLAGS)
SET(_SKIP_PIC 1)
ENDIF()
INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
# CREATE_EXPORT_FILE (VAR target api_functions)
# Internal macro, used to create source file for shared libraries that
# otherwise consists entirely of "convenience" libraries. On Windows,
......@@ -108,38 +108,6 @@ MACRO(ADD_CONVENIENCE_LIBRARY)
ENDMACRO()
# Handy macro to parse macro arguments
MACRO(CMAKE_PARSE_ARGUMENTS prefix arg_names option_names)
SET(DEFAULT_ARGS)
FOREACH(arg_name ${arg_names})
SET(${prefix}_${arg_name})
ENDFOREACH(arg_name)
FOREACH(option ${option_names})
SET(${prefix}_${option} FALSE)
ENDFOREACH(option)
SET(current_arg_name DEFAULT_ARGS)
SET(current_arg_list)
FOREACH(arg ${ARGN})
SET(larg_names ${arg_names})
LIST(FIND larg_names "${arg}" is_arg_name)
IF (is_arg_name GREATER -1)
SET(${prefix}_${current_arg_name} ${current_arg_list})
SET(current_arg_name ${arg})
SET(current_arg_list)
ELSE (is_arg_name GREATER -1)
SET(loption_names ${option_names})
LIST(FIND loption_names "${arg}" is_option)
IF (is_option GREATER -1)
SET(${prefix}_${arg} TRUE)
ELSE (is_option GREATER -1)
SET(current_arg_list ${current_arg_list} ${arg})
ENDIF (is_option GREATER -1)
ENDIF (is_arg_name GREATER -1)
ENDFOREACH(arg)
SET(${prefix}_${current_arg_name} ${current_arg_list})
ENDMACRO()
# Write content to file, using CONFIGURE_FILE
# The advantage compared to FILE(WRITE) is that timestamp
# does not change if file already has the same content
......@@ -289,3 +257,10 @@ MACRO(MERGE_LIBRARIES)
ENDIF()
ENDMACRO()
MACRO(RESTRICT_SYMBOL_EXPORTS target)
IF(CMAKE_COMPILER_IS_GNUCXX AND UNIX)
GET_TARGET_PROPERTY(COMPILE_FLAGS ${target} COMPILE_FLAGS)
SET_TARGET_PROPERTIES(${target} PROPERTIES
COMPILE_FLAGS "${COMPILE_FLAGS} -fvisibility=hidden")
ENDIF()
ENDMACRO()
......@@ -13,15 +13,27 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Creates a project to build plugin either as static or shared library
# Parameters:
# plugin - storage engine name.
# variable BUILD_TYPE should be set to "STATIC" or "DYNAMIC"
# Remarks:
# ${PLUGIN}_SOURCES variable containing source files to produce the
# library must set before calling this macro
MACRO(MYSQL_PLUGIN plugin)
GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
# MYSQL_ADD_PLUGIN(plugin_name source1...sourceN
# [STORAGE_ENGINE]
# [MANDATORY|DEFAULT]
# [STATIC_ONLY|DYNAMIC_ONLY]
# [MODULE_OUTPUT_NAME module_name]
# [STATIC_OUTPUT_NAME static_name]
# [RECOMPILE_FOR_EMBEDDED]
# [LINK_LIBRARIES lib1...libN]
# [DEPENDENCIES target1...targetN]
MACRO(MYSQL_ADD_PLUGIN)
CMAKE_PARSE_ARGUMENTS(ARG
"LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME"
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED"
${ARGN}
)
# Add common include directories
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/sql
......@@ -29,90 +41,91 @@ MACRO(MYSQL_PLUGIN plugin)
${SSL_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIR})
LIST(GET ARG_DEFAULT_ARGS 0 plugin)
SET(SOURCES ${ARG_DEFAULT_ARGS})
LIST(REMOVE_AT SOURCES 0)
STRING(TOUPPER ${plugin} plugin)
STRING(TOLOWER ${plugin} target)
IF(NOT ${plugin}_PLUGIN_STATIC AND NOT ${plugin}_PLUGIN_DYNAMIC)
MESSAGE(FATAL_ERROR
"Neither ${plugin}_PLUGIN_STATIC nor ${plugin}_PLUGIN_DYNAMIC is defined.
Please set at least one of these variables to the name of the output
library in CMakeLists.txt prior to calling MYSQL_PLUGIN"
)
ENDIF()
# Figure out whether to build plugin
IF(WITH_PLUGIN_${plugin})
SET(WITH_${plugin} 1)
ENDIF()
IF(WITH_${plugin}_STORAGE_ENGINE OR WITH_{$plugin} OR WITH_ALL
OR WITH_MAX AND NOT WITHOUT_${plugin}_STORAGE_ENGINE AND NOT
WITHOUT_${plugin})
IF(WITH_${plugin}_STORAGE_ENGINE
OR WITH_{$plugin}
OR WITH_ALL
OR WITH_MAX
OR ARG_DEFAULT
AND NOT WITHOUT_${plugin}_STORAGE_ENGINE
AND NOT WITHOUT_${plugin}
AND NOT ARG_MODULE_ONLY)
SET(WITH_${plugin} 1)
ELSEIF(WITHOUT_${plugin}_STORAGE_ENGINE OR WITH_NONE OR ${plugin}_DISABLED)
SET(WITHOUT_${plugin} 1)
SET(WITH_${plugin}_STORAGE_ENGINE 0)
SET(WITH_${plugin} 0)
ENDIF()
IF(${plugin}_PLUGIN_MANDATORY)
SET(WITH_${plugin} 1)
ENDIF()
IF(${plugin} MATCHES NDBCLUSTER AND WITH_MAX_NO_NDB)
SET(WITH_${plugin} 0)
SET(WITH_${plugin}_STORAGE_ENGINE 0)
SET(WITHOUT_${plugin} 1)
SET(WITHOUT_${plugin}_STORAGE_ENGINE 0)
IF(ARG_MANDATORY)
SET(WITH_${plugin} 1)
ENDIF()
IF(STORAGE_ENGINE)
SET(with_var "WITH_${plugin}_STORAGE_ENGINE" )
IF(ARG_STORAGE_ENGINE)
SET(with_var "WITH_${plugin}_STORAGE_ENGINE" )
ELSE()
SET(with_var "WITH_${plugin}")
SET(with_var "WITH_${plugin}")
ENDIF()
IF (WITH_${plugin} AND ${plugin}_PLUGIN_STATIC)
ADD_DEFINITIONS(-DMYSQL_SERVER)
#Create static library.
ADD_LIBRARY(${target} ${${plugin}_SOURCES})
DTRACE_INSTRUMENT(${target})
ADD_DEPENDENCIES(${target} GenError)
IF(WITH_EMBEDDED_SERVER AND NOT ${plugin}_PLUGIN_DYNAMIC)
# Recompile couple of plugins for embedded
ADD_LIBRARY(${target}_embedded ${${plugin}_SOURCES})
DTRACE_INSTRUMENT(${target}_embedded)
SET_TARGET_PROPERTIES(${target}_embedded
PROPERTIES COMPILE_DEFINITIONS "EMBEDDED_LIBRARY")
ADD_DEPENDENCIES(${target}_embedded GenError)
ENDIF()
IF(${plugin}_LIBS)
TARGET_LINK_LIBRARIES(${target} ${${plugin}_LIBS})
IF(NOT ARG_DEPENDENCIES)
SET(ARG_DEPENDENCIES)
ENDIF()
# Build either static library or module
IF (WITH_${plugin} AND NOT ARG_MODULE_ONLY)
ADD_LIBRARY(${target} STATIC ${SOURCES})
SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITONS "MYSQL_SERVER")
DTRACE_INSTRUMENT(${target})
ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
IF(WITH_EMBEDDED_SERVER)
# Embedded library should contain PIC code and be linkable
# to shared libraries (on systems that need PIC)
IF(ARG_RECOMPILE_FOR_EMBEDDED OR NOT _SKIP_PIC)
# Recompile some plugins for embedded
ADD_CONVENIENCE_LIBRARY(${target}_embedded ${SOURCES})
DTRACE_INSTRUMENT(${target}_embedded)
IF(ARG_RECOMPILE_FOR_EMBEDDED)
SET_TARGET_PROPERTIES(${target}_embedded
PROPERTIES COMPILE_DEFINITIONS "MYSQL_SERVER;EMBEDDED_LIBRARY")
ENDIF()
ADD_DEPENDENCIES(${target}_embedded GenError)
ENDIF()
ENDIF()
SET_TARGET_PROPERTIES(${target} PROPERTIES
OUTPUT_NAME "${${plugin}_PLUGIN_STATIC}")
IF(ARG_STATIC_OUTPUT_NAME)
SET_TARGET_PROPERTIES(${target} PROPERTIES
OUTPUT_NAME ${ARG_STATIC_OUTPUT_NAME})
ENDIF()
# Update mysqld dependencies
SET (MYSQLD_STATIC_PLUGIN_LIBS ${MYSQLD_STATIC_PLUGIN_LIBS}
${target} PARENT_SCOPE)
${target} CACHE INTERNAL "")
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_${target}_plugin"
PARENT_SCOPE)
SET(${with_var} ON CACHE BOOL "Link ${plugin} statically to the server"
FORCE)
ELSEIF(NOT WITHOUT_${plugin} AND ${plugin}_PLUGIN_DYNAMIC
AND NOT WITHOUT_DYNAMIC_PLUGINS)
# Create a shared module.
ADD_DEFINITIONS(-DMYSQL_DYNAMIC_PLUGIN)
ADD_LIBRARY(${target} MODULE ${${plugin}_SOURCES})
IF(${plugin}_LIBS)
TARGET_LINK_LIBRARIES(${target} ${${plugin}_LIBS})
ENDIF()
DTRACE_INSTRUMENT(${target})
SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX "")
PARENT_SCOPE)
IF(ARG_STORAGE_ENGINE)
SET(${with_var} ON CACHE BOOL "Link ${plugin} statically to the server"
FORCE)
ENDIF()
ELSEIF(NOT WITHOUT_${plugin} AND NOT ARG_STATIC_ONLY AND NOT WITHOUT_DYNAMIC_PLUGINS)
ADD_LIBRARY(${target} MODULE ${SOURCES})
DTRACE_INSTRUMENT(${target})
SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX ""
COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN")
TARGET_LINK_LIBRARIES (${target} mysqlservices)
# Plugin uses symbols defined in mysqld executable.
# Some operating systems like Windows and OSX and are pretty strict about
# unresolved symbols. Others are less strict and allow unresolved symbols
......@@ -121,41 +134,26 @@ MACRO(MYSQL_PLUGIN plugin)
# Thus we skip TARGET_LINK_LIBRARIES on Linux, as it would only generate
# an additional dependency.
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
TARGET_LINK_LIBRARIES (${target} mysqld)
ENDIF()
ADD_DEPENDENCIES(${target} GenError)
IF(${plugin}_PLUGIN_DYNAMIC)
SET_TARGET_PROPERTIES(${target} PROPERTIES
OUTPUT_NAME "${${plugin}_PLUGIN_DYNAMIC}")
TARGET_LINK_LIBRARIES (${target} mysqld ${ARG_LINK_LIBRARIES})
ENDIF()
# Update cache "WITH" variable for plugins that support static linking
IF(${plugin}_PLUGIN_STATIC)
SET(${with_var} OFF CACHE BOOL "Link ${plugin} statically to the server"
FORCE)
ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
IF(NOT ARG_MODULE_OUTPUT_NAME)
IF(ARG_STORAGE_ENGINE)
SET(ARG_MODULE_OUTPUT_NAME "ha_${target}")
ELSE()
SET(ARG_MODULE_OUTPUT_NAME "${target}")
ENDIF()
ENDIF()
SET_TARGET_PROPERTIES(${target} PROPERTIES
OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}")
# Install dynamic library
SET(INSTALL_LOCATION lib/plugin)
INSTALL(TARGETS ${target} DESTINATION ${INSTALL_LOCATION})
INSTALL_DEBUG_SYMBOLS(${target})
ELSE()
IF(STORAGE_ENGINE)
SET(without_var "WITHOUT_${plugin}_STORAGE_ENGINE")
ELSE()
SET(without_var "WITHOUT_${plugin}")
ENDIF()
SET(${without_var} ON CACHE BOOL "Link ${plugin} statically to the server"
FORCE)
MARK_AS_ADVANCED(${without_var})
ENDIF()
ENDMACRO()
MACRO (MYSQL_STORAGE_ENGINE engine)
SET(STORAGE_ENGINE 1)
MYSQL_PLUGIN(${engine})
ENDMACRO()
# Add all CMake projects under storage and plugin
# subdirectories, configure sql_builtins.cc
......@@ -167,12 +165,4 @@ MACRO(CONFIGURE_PLUGINS)
ADD_SUBDIRECTORY(${dir})
ENDIF()
ENDFOREACH()
# Special handling for partition(not really pluggable)
IF(NOT WITHOUT_PARTITION_STORAGE_ENGINE)
SET (WITH_PARTITION_STORAGE_ENGINE 1)
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_partition_plugin")
ENDIF(NOT WITHOUT_PARTITION_STORAGE_ENGINE)
ADD_DEFINITIONS(${STORAGE_ENGINE_DEFS})
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc.in
${CMAKE_BINARY_DIR}/sql/sql_builtin.cc)
ENDMACRO()
......@@ -30,5 +30,6 @@ SET(YASSL_SOURCES src/buffer.cpp src/cert_wrapper.cpp src/crypto_wrapper.cpp sr
src/log.cpp src/socket_wrapper.cpp src/ssl.cpp src/timer.cpp src/yassl_error.cpp
src/yassl_imp.cpp src/yassl_int.cpp)
ADD_CONVENIENCE_LIBRARY(yassl ${YASSL_SOURCES})
RESTRICT_SYMBOL_EXPORTS(yassl)
......@@ -27,4 +27,5 @@ SET(TAOCRYPT_SOURCES src/aes.cpp src/aestables.cpp src/algebra.cpp src/arc4.cpp
include/md2.hpp include/md5.hpp include/misc.hpp include/modarith.hpp include/modes.hpp
include/random.hpp include/ripemd.hpp include/rsa.hpp include/sha.hpp)
ADD_CONVENIENCE_LIBRARY(taocrypt ${TAOCRYPT_SOURCES})
RESTRICT_SYMBOL_EXPORTS(taocrypt)
......@@ -1873,18 +1873,10 @@ sub environment_setup {
# Add the path where mysqld will find semisync plugins
# --------------------------------------------------------------------------
if (!$opt_embedded_server) {
my $semisync_lib_prefix;
if (IS_WINDOWS)
{
$semisync_lib_prefix = "";
}
else
{
$semisync_lib_prefix= "lib";
}
my ($lib_semisync_master_plugin) = find_plugin($semisync_lib_prefix."semisync_master", "plugin/semisync");
my ($lib_semisync_slave_plugin) = find_plugin($semisync_lib_prefix."semisync_slave", "plugin/semisync");
my ($lib_semisync_master_plugin) = find_plugin("semisync_master", "plugin/semisync");
my ($lib_semisync_slave_plugin) = find_plugin("semisync_slave", "plugin/semisync");
if ($lib_semisync_master_plugin && $lib_semisync_slave_plugin)
{
......
......@@ -13,6 +13,4 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
SET(DAEMON_EXAMPLE_PLUGIN_DYNAMIC daemon_example)
SET(DAEMON_EXAMPLE_SOURCES daemon_example.cc)
MYSQL_PLUGIN(DAEMON_EXAMPLE)
MYSQL_ADD_PLUGIN(DAEMON_EXAMPLE daemon_example.cc MODULE_ONLY)
......@@ -13,6 +13,5 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
SET(FTEXAMPLE_PLUGIN_DYNAMIC mypluglib)
SET(FTEXAMPLE_SOURCES plugin_example.c)
MYSQL_PLUGIN(FTEXAMPLE)
MYSQL_ADD_PLUGIN(FTEXAMPLE plugin_example.c MODULE_ONLY MODULE_OUTPUT_NAME mypluglib)
......@@ -13,20 +13,13 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02
IF(WIN32)
SET(LIBPREFIX "")
ELSE()
SET(LIBPREFIX "lib")
ENDIF()
SET(SEMISYNC_MASTER_SOURCES semisync.cc semisync_master.cc semisync_master_plugin.cc
semisync.h semisync_master.h)
SET(SEMISYNC_MASTER_PLUGIN_DYNAMIC ${LIBPREFIX}semisync_master)
MYSQL_PLUGIN(SEMISYNC_MASTER)
MYSQL_ADD_PLUGIN(semisync_master ${SEMISYNC_MASTER_SOURCES} MODULE_ONLY MODULE_OUTPUT_NAME "semisync_master")
SET(SEMISYNC_SLAVE_SOURCES semisync.cc semisync_slave.cc semisync_slave_plugin.cc
semisync.h semisync_slave.h )
SET(SEMISYNC_SLAVE_PLUGIN_DYNAMIC ${LIBPREFIX}semisync_slave)
MYSQL_PLUGIN(SEMISYNC_SLAVE)
SET(SEMISYNC_SLAVE_SOURCES semisync.cc semisync_slave.cc semisync_slave_plugin.cc semisync.h semisync_slave.h )
MYSQL_ADD_PLUGIN(semisync_slave ${SEMISYNC_MASTER_SOURCES} MODULE_ONLY MODULE_OUTPUT_NAME "semisync_slave")
......@@ -48,7 +48,6 @@ SET (SQL_SOURCE
../sql-common/client.c derror.cc des_key_file.cc
discover.cc ../libmysql/errmsg.c field.cc field_conv.cc
filesort.cc gstream.cc
ha_partition.cc
handler.cc hash_filo.cc hash_filo.h sql_plugin_services.h
hostname.cc init.cc item.cc item_buff.cc item_cmpfunc.cc
item_create.cc item_func.cc item_geofunc.cc item_row.cc
......@@ -81,11 +80,12 @@ SET (SQL_SOURCE
sql_connect.cc scheduler.cc
sql_profile.cc event_parse_data.cc
sql_signal.cc rpl_handler.cc
${GEN_SOURCES}
${GEN_SOURCES}
${MYSYS_LIBWRAP_SOURCE})
MYSQL_ADD_PLUGIN(partition ha_partition.cc STORAGE_ENGINE DEFAULT STATIC_ONLY)
SET (MYSQLD_CORE_LIBS mysys ${ZLIB_LIBRARY} ${SSL_LIBRARIES} vio regex )
IF(WIN32)
SET(SQL_SOURCE ${SQL_SOURCE} nt_servc.cc nt_servc.h)
ENDIF()
......@@ -113,7 +113,7 @@ IF(NOT WITHOUT_DYNAMIC_PLUGINS)
# incremental appears to crash from time to time,if used with /DEF option
SET_TARGET_PROPERTIES(mysqld PROPERTIES LINK_FLAGS "/DEF:mysqld.def /INCREMENTAL:NO")
FOREACH (CORELIB ${MYSQLD_CORE_LIBS} dbug strings)
FOREACH (CORELIB sql mysys dbug strings)
GET_TARGET_PROPERTY(LOC ${CORELIB} LOCATION)
FILE(TO_NATIVE_PATH ${LOC} LOC)
SET (LIB_LOCATIONS ${LIB_LOCATIONS} ${LOC})
......@@ -129,7 +129,8 @@ ENDIF()
SET_TARGET_PROPERTIES(mysqld PROPERTIES ENABLE_EXPORTS TRUE)
SET_TARGET_PROPERTIES(mysqld PROPERTIES OUTPUT_NAME mysqld${MYSQLD_EXE_SUFFIX})
TARGET_LINK_LIBRARIES(mysqld ${MYSQLD_STATIC_PLUGIN_LIBS} ${MYSQLD_CORE_LIBS} ${LIBWRAP_LIBRARY})
TARGET_LINK_LIBRARIES(mysqld ${MYSQLD_STATIC_PLUGIN_LIBS} sql mysys dbug strings vio regex ${MYSQLD_CORE_LIBS}
${LIBWRAP_LIBRARY} ${ZLIB_LIBRARY} ${SSL_LIBRARIES})
INSTALL(TARGETS mysqld DESTINATION bin)
INSTALL_DEBUG_SYMBOLS(mysqld)
......
......@@ -13,14 +13,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
SET(ARCHIVE_PLUGIN_STATIC "archive")
SET(ARCHIVE_PLUGIN_DYNAMIC "ha_archive")
SET(ARCHIVE_SOURCES azio.c ha_archive.cc ha_archive.h)
MYSQL_STORAGE_ENGINE(ARCHIVE)
IF(NOT WITH_ARCHIVE_STORAGE_ENGINE AND NOT WITHOUT_ARCHIVE_STORAGE_ENGINE
AND NOT WITH_ZLIB STREQUAL "bundled")
TARGET_LINK_LIBRARIES(archive ${ZLIB_LIBRARY})
ENDIF()
MYSQL_ADD_PLUGIN(archive ${ARCHIVE_SOURCES} STORAGE_ENGINE LINK_LIBRARIES ${ZLIB_LIBRARY})
......@@ -13,8 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
SET(BLACKHOLE_PLUGIN_STATIC "blackhole")
SET(BLACKHOLE_PLUGIN_DYNAMIC "ha_blackhole")
SET(BLACKHOLE_SOURCES ha_blackhole.cc ha_blackhole.h)
MYSQL_STORAGE_ENGINE(BLACKHOLE)
MYSQL_ADD_PLUGIN(BLACKHOLE ${BLACKHOLE_SOURCES} STORAGE_ENGINE)
......@@ -17,4 +17,4 @@ SET(CSV_PLUGIN_STATIC "csv")
SET(CSV_PLUGIN_MANDATORY TRUE)
SET(CSV_SOURCES ha_tina.cc ha_tina.h transparent_file.cc transparent_file.h)
MYSQL_STORAGE_ENGINE(CSV)
\ No newline at end of file
MYSQL_ADD_PLUGIN(csv ${CSV_SOURCES} STORAGE_ENGINE MANDATORY)
......@@ -15,4 +15,4 @@
SET(EXAMPLE_PLUGIN_DYNAMIC "ha_example")
SET(EXAMPLE_SOURCES ha_example.cc)
MYSQL_STORAGE_ENGINE(EXAMPLE)
MYSQL_ADD_PLUGIN(example ${EXAMPLE_SOURCES} STORAGE_ENGINE)
......@@ -21,4 +21,4 @@ IF(NOT WITH_FEDERATED AND NOT WITH_FEDERATED_STORAGE_ENGINE)
# mysqld and are optimized away by the linker.
SET(FEDERATED_SOURCES ${FEDERATED_SOURCES} ${CMAKE_SOURCE_DIR}/mysys/string.c)
ENDIF()
MYSQL_STORAGE_ENGINE(FEDERATED)
MYSQL_ADD_PLUGIN(federated ${FEDERATED_SOURCES} STORAGE_ENGINE)
......@@ -21,4 +21,5 @@ SET(HEAP_SOURCES _check.c _rectest.c hp_block.c hp_clear.c hp_close.c hp_create
hp_delete.c hp_extra.c hp_hash.c hp_info.c hp_open.c hp_panic.c
hp_rename.c hp_rfirst.c hp_rkey.c hp_rlast.c hp_rnext.c hp_rprev.c
hp_rrnd.c hp_rsame.c hp_scan.c hp_static.c hp_update.c hp_write.c)
MYSQL_STORAGE_ENGINE(HEAP)
MYSQL_ADD_PLUGIN(heap ${HEAP_SOURCES} STORAGE_ENGINE MANDATORY RECOMPILE_FOR_EMBEDDED)
......@@ -34,7 +34,7 @@ SET (IBMDB2I_SOURCES ha_ibmdb2i.cc db2i_ileBridge.cc db2i_conversion.cc
db2i_collationSupport.cc db2i_errors.cc db2i_constraints.cc
db2i_rir.cc db2i_sqlStatementStream.cc db2i_ioBuffers.cc db2i_myconv.cc)
SET(IBMDB2I_LIBS iconv)
MYSQL_STORAGE_ENGINE(IBMDB2I)
MYSQL_ADD_PLUGIN(ibmdb2i ${IBMDB2I_SOURCES} STORAGE_ENGINE LINK_LIBRARIES iconv)
ENDIF(HAVE_PASE_ENVIRONMENT)
......@@ -42,7 +42,8 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
CHECK_FUNCTION_EXISTS(atomic_add_long HAVE_ATOMIC_ADD_LONG)
IF(HAVE_ATOMIC_CAS_ULONG AND HAVE_ATOMIC_CAS_32 AND
HAVE_ATOMIC_CAS_64 AND HAVE_ATOMIC_ADD_LONG)
SET(HAVE_SOLARIS_ATOMICS 1)
SET(HAVE_SOLARIS_ATOMICS 1)
ENDIF()
ENDIF()
......@@ -67,7 +68,7 @@ IF(NOT HAVE_ATOMIC_PTHREAD_T_GCC AND HAVE_SOLARIS_ATOMICS)
int main()
{
pthread_t x = 0;
return(0);
return(0);
}" HAVE_ATOMIC_PTHREAD_T_SOLARIS
)
IF(HAVE_ATOMIC_PTHREAD_T_SOLARIS)
......@@ -88,7 +89,7 @@ IF(NOT CMAKE_CROSSCOMPILING)
# http://bugs.opensolaris.org/bugdatabase/printableBug.do?bug_id=6478684
CHECK_C_SOURCE_RUNS("
int main()
{
{
__asm__ __volatile__ (\"pause\");
return 0;
}" IB_HAVE_PAUSE_INSTRUCTION)
......@@ -176,15 +177,6 @@ IF(WITH_INNODB)
SET(WITH_INNOBASE_STORAGE_ENGINE TRUE)
ENDIF()
SET(INNOBASE_PLUGIN_STATIC "innobase")
SET(INNOBASE_PLUGIN_DYNAMIC "ha_innodb")
# Innobase depends on zlib. If server links with system
# zlib shared library, and innobase builds as shared library,
# innobase need to link with it too, to avoid unresolved symbols.
IF(ZLIB_FOUND AND NOT WITH_ZLIB STREQUAL "bundled")
SET(INNOBASE_LIBS ${ZLIB_LIBRARY})
ENDIF()
#The plugin's CMakeLists.txt still needs to work with previous versions of MySQL.
IF(EXISTS ${SOURCE_DIR}/storage/mysql_storage_engine.cmake)
......@@ -207,5 +199,7 @@ ELSEIF (MYSQL_VERSION_ID LESS "50137")
ELSE()
# New plugin support, cross-platform , name for shared library
# is given in INNOBASE_PLUGIN_STATIC and INNOBASE_PLUGIN_DYNAMIC
MYSQL_STORAGE_ENGINE(INNOBASE)
MYSQL_ADD_PLUGIN(INNOBASE ${INNOBASE_SOURCES} STORAGE_ENGINE
MODULE_OUTPUT_NAME ha_innodb
LINK_LIBRARIES ${ZLIB_LIBRARY})
ENDIF()
......@@ -28,7 +28,10 @@ SET(MYISAM_SOURCES ft_boolean_search.c ft_nlq_search.c ft_parser.c ft_static.c
mi_unique.c mi_update.c mi_write.c rt_index.c rt_key.c rt_mbr.c
rt_split.c sort.c sp_key.c ft_eval.h myisamdef.h rt_index.h mi_rkey.c)
MYSQL_STORAGE_ENGINE(MYISAM)
MYSQL_ADD_PLUGIN(myisam ${MYISAM_SOURCES}
STORAGE_ENGINE
MANDATORY
RECOMPILE_FOR_EMBEDDED)
ADD_EXECUTABLE(myisam_ftdump myisam_ftdump.c)
TARGET_LINK_LIBRARIES(myisam_ftdump myisam mysys)
......
......@@ -23,4 +23,4 @@ SET(MYISAMMRG_SOURCES myrg_close.c myrg_create.c myrg_delete.c myrg_extra.c myr
myrg_rprev.c myrg_rrnd.c myrg_rsame.c myrg_static.c myrg_update.c
myrg_write.c myrg_records.c)
MYSQL_STORAGE_ENGINE(MYISAMMRG)
MYSQL_ADD_PLUGIN(MYISAMMRG ${MYISAMMRG_SOURCES} STORAGE_ENGINE MANDATORY RECOMPILE_FOR_EMBEDDED)
......@@ -22,4 +22,5 @@ SET(ZLIB_SOURCES adler32.c compress.c crc32.c crc32.h deflate.c deflate.h gzio.
inffixed.h inflate.c inflate.h inftrees.c inftrees.h trees.c trees.h uncompr.c zconf.h zlib.h
zutil.c zutil.h)
ADD_CONVENIENCE_LIBRARY(zlib ${ZLIB_SOURCES})
RESTRICT_SYMBOL_EXPORTS(zlib)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment