Commit 5dfa313e 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 f458a4c9
...@@ -169,6 +169,7 @@ MYSQL_CHECK_SSL() ...@@ -169,6 +169,7 @@ MYSQL_CHECK_SSL()
MYSQL_CHECK_READLINE() MYSQL_CHECK_READLINE()
IF(NOT WITHOUT_SERVER) IF(NOT WITHOUT_SERVER)
SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "")
# Add storage engines and plugins. # Add storage engines and plugins.
CONFIGURE_PLUGINS() CONFIGURE_PLUGINS()
ENDIF() ENDIF()
...@@ -219,7 +220,8 @@ CONFIGURE_FILE(config.h.cmake ${CMAKE_BINARY_DIR}/include/my_config.h) ...@@ -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(config.h.cmake ${CMAKE_BINARY_DIR}/include/config.h)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
${CMAKE_BINARY_DIR}/include/mysql_version.h ) ${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 # Packaging
IF(WIN32) IF(WIN32)
......
EXTRA_DIST = \ EXTRA_DIST = \
cat.cmake \ cmake_parse_arguments.cmake
configurable_file_content.in \ configurable_file_content.in \
check_minimal_version.cmake \ check_minimal_version.cmake \
create_initial_db.cmake.in \ create_initial_db.cmake.in \
......
...@@ -53,11 +53,11 @@ ...@@ -53,11 +53,11 @@
GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) 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 IF(WIN32 OR CYGWIN OR APPLE OR WITH_PIC OR DISABLE_SHARED OR NOT CMAKE_SHARED_LIBRARY_C_FLAGS)
AND CMAKE_SHARED_LIBRARY_C_FLAGS)
SET(_SKIP_PIC 1) SET(_SKIP_PIC 1)
ENDIF() ENDIF()
INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
# CREATE_EXPORT_FILE (VAR target api_functions) # CREATE_EXPORT_FILE (VAR target api_functions)
# Internal macro, used to create source file for shared libraries that # Internal macro, used to create source file for shared libraries that
# otherwise consists entirely of "convenience" libraries. On Windows, # otherwise consists entirely of "convenience" libraries. On Windows,
...@@ -108,38 +108,6 @@ MACRO(ADD_CONVENIENCE_LIBRARY) ...@@ -108,38 +108,6 @@ MACRO(ADD_CONVENIENCE_LIBRARY)
ENDMACRO() 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 # Write content to file, using CONFIGURE_FILE
# The advantage compared to FILE(WRITE) is that timestamp # The advantage compared to FILE(WRITE) is that timestamp
# does not change if file already has the same content # does not change if file already has the same content
...@@ -289,3 +257,10 @@ MACRO(MERGE_LIBRARIES) ...@@ -289,3 +257,10 @@ MACRO(MERGE_LIBRARIES)
ENDIF() ENDIF()
ENDMACRO() 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 @@ ...@@ -13,15 +13,27 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # 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: GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
# plugin - storage engine name. INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
# variable BUILD_TYPE should be set to "STATIC" or "DYNAMIC"
# Remarks: # MYSQL_ADD_PLUGIN(plugin_name source1...sourceN
# ${PLUGIN}_SOURCES variable containing source files to produce the # [STORAGE_ENGINE]
# library must set before calling this macro # [MANDATORY|DEFAULT]
# [STATIC_ONLY|DYNAMIC_ONLY]
MACRO(MYSQL_PLUGIN plugin) # [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 # Add common include directories
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/sql
...@@ -29,24 +41,26 @@ MACRO(MYSQL_PLUGIN plugin) ...@@ -29,24 +41,26 @@ MACRO(MYSQL_PLUGIN plugin)
${SSL_INCLUDE_DIRS} ${SSL_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIR}) ${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(TOUPPER ${plugin} plugin)
STRING(TOLOWER ${plugin} target) STRING(TOLOWER ${plugin} target)
IF(NOT ${plugin}_PLUGIN_STATIC AND NOT ${plugin}_PLUGIN_DYNAMIC) # Figure out whether to build plugin
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()
IF(WITH_PLUGIN_${plugin}) IF(WITH_PLUGIN_${plugin})
SET(WITH_${plugin} 1) SET(WITH_${plugin} 1)
ENDIF() ENDIF()
IF(WITH_${plugin}_STORAGE_ENGINE OR WITH_{$plugin} OR WITH_ALL IF(WITH_${plugin}_STORAGE_ENGINE
OR WITH_MAX AND NOT WITHOUT_${plugin}_STORAGE_ENGINE AND NOT OR WITH_{$plugin}
WITHOUT_${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) SET(WITH_${plugin} 1)
ELSEIF(WITHOUT_${plugin}_STORAGE_ENGINE OR WITH_NONE OR ${plugin}_DISABLED) ELSEIF(WITHOUT_${plugin}_STORAGE_ENGINE OR WITH_NONE OR ${plugin}_DISABLED)
SET(WITHOUT_${plugin} 1) SET(WITHOUT_${plugin} 1)
...@@ -54,65 +68,64 @@ MACRO(MYSQL_PLUGIN plugin) ...@@ -54,65 +68,64 @@ MACRO(MYSQL_PLUGIN plugin)
SET(WITH_${plugin} 0) SET(WITH_${plugin} 0)
ENDIF() ENDIF()
IF(${plugin}_PLUGIN_MANDATORY)
IF(ARG_MANDATORY)
SET(WITH_${plugin} 1) SET(WITH_${plugin} 1)
ENDIF() 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)
ENDIF()
IF(STORAGE_ENGINE) IF(ARG_STORAGE_ENGINE)
SET(with_var "WITH_${plugin}_STORAGE_ENGINE" ) SET(with_var "WITH_${plugin}_STORAGE_ENGINE" )
ELSE() ELSE()
SET(with_var "WITH_${plugin}") SET(with_var "WITH_${plugin}")
ENDIF() ENDIF()
IF(NOT ARG_DEPENDENCIES)
IF (WITH_${plugin} AND ${plugin}_PLUGIN_STATIC) SET(ARG_DEPENDENCIES)
ADD_DEFINITIONS(-DMYSQL_SERVER) ENDIF()
#Create static library. # Build either static library or module
ADD_LIBRARY(${target} ${${plugin}_SOURCES}) 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}) DTRACE_INSTRUMENT(${target})
ADD_DEPENDENCIES(${target} GenError) ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
IF(WITH_EMBEDDED_SERVER AND NOT ${plugin}_PLUGIN_DYNAMIC) IF(WITH_EMBEDDED_SERVER)
# Recompile couple of plugins for embedded # Embedded library should contain PIC code and be linkable
ADD_LIBRARY(${target}_embedded ${${plugin}_SOURCES}) # 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) DTRACE_INSTRUMENT(${target}_embedded)
IF(ARG_RECOMPILE_FOR_EMBEDDED)
SET_TARGET_PROPERTIES(${target}_embedded SET_TARGET_PROPERTIES(${target}_embedded
PROPERTIES COMPILE_DEFINITIONS "EMBEDDED_LIBRARY") PROPERTIES COMPILE_DEFINITIONS "MYSQL_SERVER;EMBEDDED_LIBRARY")
ENDIF()
ADD_DEPENDENCIES(${target}_embedded GenError) ADD_DEPENDENCIES(${target}_embedded GenError)
ENDIF() ENDIF()
IF(${plugin}_LIBS)
TARGET_LINK_LIBRARIES(${target} ${${plugin}_LIBS})
ENDIF() ENDIF()
IF(ARG_STATIC_OUTPUT_NAME)
SET_TARGET_PROPERTIES(${target} PROPERTIES SET_TARGET_PROPERTIES(${target} PROPERTIES
OUTPUT_NAME "${${plugin}_PLUGIN_STATIC}") OUTPUT_NAME ${ARG_STATIC_OUTPUT_NAME})
ENDIF()
# Update mysqld dependencies # Update mysqld dependencies
SET (MYSQLD_STATIC_PLUGIN_LIBS ${MYSQLD_STATIC_PLUGIN_LIBS} 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" SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_${target}_plugin"
PARENT_SCOPE) PARENT_SCOPE)
IF(ARG_STORAGE_ENGINE)
SET(${with_var} ON CACHE BOOL "Link ${plugin} statically to the server" SET(${with_var} ON CACHE BOOL "Link ${plugin} statically to the server"
FORCE) 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() ENDIF()
ELSEIF(NOT WITHOUT_${plugin} AND NOT ARG_STATIC_ONLY AND NOT WITHOUT_DYNAMIC_PLUGINS)
ADD_LIBRARY(${target} MODULE ${SOURCES})
DTRACE_INSTRUMENT(${target}) DTRACE_INSTRUMENT(${target})
SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX "") SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX ""
COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN")
TARGET_LINK_LIBRARIES (${target} mysqlservices) TARGET_LINK_LIBRARIES (${target} mysqlservices)
# Plugin uses symbols defined in mysqld executable. # Plugin uses symbols defined in mysqld executable.
# Some operating systems like Windows and OSX and are pretty strict about # Some operating systems like Windows and OSX and are pretty strict about
# unresolved symbols. Others are less strict and allow unresolved symbols # unresolved symbols. Others are less strict and allow unresolved symbols
...@@ -121,41 +134,26 @@ MACRO(MYSQL_PLUGIN plugin) ...@@ -121,41 +134,26 @@ MACRO(MYSQL_PLUGIN plugin)
# Thus we skip TARGET_LINK_LIBRARIES on Linux, as it would only generate # Thus we skip TARGET_LINK_LIBRARIES on Linux, as it would only generate
# an additional dependency. # an additional dependency.
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux") IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
TARGET_LINK_LIBRARIES (${target} mysqld) TARGET_LINK_LIBRARIES (${target} mysqld ${ARG_LINK_LIBRARIES})
ENDIF() ENDIF()
ADD_DEPENDENCIES(${target} GenError) ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
IF(${plugin}_PLUGIN_DYNAMIC) IF(NOT ARG_MODULE_OUTPUT_NAME)
SET_TARGET_PROPERTIES(${target} PROPERTIES IF(ARG_STORAGE_ENGINE)
OUTPUT_NAME "${${plugin}_PLUGIN_DYNAMIC}") SET(ARG_MODULE_OUTPUT_NAME "ha_${target}")
ELSE()
SET(ARG_MODULE_OUTPUT_NAME "${target}")
ENDIF() 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)
ENDIF() ENDIF()
SET_TARGET_PROPERTIES(${target} PROPERTIES
OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}")
# Install dynamic library # Install dynamic library
SET(INSTALL_LOCATION lib/plugin) SET(INSTALL_LOCATION lib/plugin)
INSTALL(TARGETS ${target} DESTINATION ${INSTALL_LOCATION}) INSTALL(TARGETS ${target} DESTINATION ${INSTALL_LOCATION})
INSTALL_DEBUG_SYMBOLS(${target}) 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() ENDIF()
ENDMACRO() ENDMACRO()
MACRO (MYSQL_STORAGE_ENGINE engine)
SET(STORAGE_ENGINE 1)
MYSQL_PLUGIN(${engine})
ENDMACRO()
# Add all CMake projects under storage and plugin # Add all CMake projects under storage and plugin
# subdirectories, configure sql_builtins.cc # subdirectories, configure sql_builtins.cc
...@@ -167,12 +165,4 @@ MACRO(CONFIGURE_PLUGINS) ...@@ -167,12 +165,4 @@ MACRO(CONFIGURE_PLUGINS)
ADD_SUBDIRECTORY(${dir}) ADD_SUBDIRECTORY(${dir})
ENDIF() ENDIF()
ENDFOREACH() 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() ENDMACRO()
...@@ -30,5 +30,6 @@ SET(YASSL_SOURCES src/buffer.cpp src/cert_wrapper.cpp src/crypto_wrapper.cpp sr ...@@ -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/log.cpp src/socket_wrapper.cpp src/ssl.cpp src/timer.cpp src/yassl_error.cpp
src/yassl_imp.cpp src/yassl_int.cpp) src/yassl_imp.cpp src/yassl_int.cpp)
ADD_CONVENIENCE_LIBRARY(yassl ${YASSL_SOURCES}) 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 ...@@ -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/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) include/random.hpp include/ripemd.hpp include/rsa.hpp include/sha.hpp)
ADD_CONVENIENCE_LIBRARY(taocrypt ${TAOCRYPT_SOURCES}) ADD_CONVENIENCE_LIBRARY(taocrypt ${TAOCRYPT_SOURCES})
RESTRICT_SYMBOL_EXPORTS(taocrypt)
...@@ -1873,18 +1873,10 @@ sub environment_setup { ...@@ -1873,18 +1873,10 @@ sub environment_setup {
# Add the path where mysqld will find semisync plugins # Add the path where mysqld will find semisync plugins
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
if (!$opt_embedded_server) { 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) if ($lib_semisync_master_plugin && $lib_semisync_slave_plugin)
{ {
......
...@@ -13,6 +13,4 @@ ...@@ -13,6 +13,4 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
SET(DAEMON_EXAMPLE_PLUGIN_DYNAMIC daemon_example) MYSQL_ADD_PLUGIN(DAEMON_EXAMPLE daemon_example.cc MODULE_ONLY)
SET(DAEMON_EXAMPLE_SOURCES daemon_example.cc)
MYSQL_PLUGIN(DAEMON_EXAMPLE)
...@@ -13,6 +13,5 @@ ...@@ -13,6 +13,5 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
SET(FTEXAMPLE_PLUGIN_DYNAMIC mypluglib)
SET(FTEXAMPLE_SOURCES plugin_example.c) MYSQL_ADD_PLUGIN(FTEXAMPLE plugin_example.c MODULE_ONLY MODULE_OUTPUT_NAME mypluglib)
MYSQL_PLUGIN(FTEXAMPLE)
...@@ -13,20 +13,13 @@ ...@@ -13,20 +13,13 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02 # 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 SET(SEMISYNC_MASTER_SOURCES semisync.cc semisync_master.cc semisync_master_plugin.cc
semisync.h semisync_master.h) semisync.h semisync_master.h)
SET(SEMISYNC_MASTER_PLUGIN_DYNAMIC ${LIBPREFIX}semisync_master) MYSQL_ADD_PLUGIN(semisync_master ${SEMISYNC_MASTER_SOURCES} MODULE_ONLY MODULE_OUTPUT_NAME "semisync_master")
MYSQL_PLUGIN(SEMISYNC_MASTER)
SET(SEMISYNC_SLAVE_SOURCES semisync.cc semisync_slave.cc semisync_slave_plugin.cc SET(SEMISYNC_SLAVE_SOURCES semisync.cc semisync_slave.cc semisync_slave_plugin.cc semisync.h semisync_slave.h )
semisync.h semisync_slave.h ) MYSQL_ADD_PLUGIN(semisync_slave ${SEMISYNC_MASTER_SOURCES} MODULE_ONLY MODULE_OUTPUT_NAME "semisync_slave")
SET(SEMISYNC_SLAVE_PLUGIN_DYNAMIC ${LIBPREFIX}semisync_slave)
MYSQL_PLUGIN(SEMISYNC_SLAVE)
...@@ -48,7 +48,6 @@ SET (SQL_SOURCE ...@@ -48,7 +48,6 @@ SET (SQL_SOURCE
../sql-common/client.c derror.cc des_key_file.cc ../sql-common/client.c derror.cc des_key_file.cc
discover.cc ../libmysql/errmsg.c field.cc field_conv.cc discover.cc ../libmysql/errmsg.c field.cc field_conv.cc
filesort.cc gstream.cc filesort.cc gstream.cc
ha_partition.cc
handler.cc hash_filo.cc hash_filo.h sql_plugin_services.h handler.cc hash_filo.cc hash_filo.h sql_plugin_services.h
hostname.cc init.cc item.cc item_buff.cc item_cmpfunc.cc hostname.cc init.cc item.cc item_buff.cc item_cmpfunc.cc
item_create.cc item_func.cc item_geofunc.cc item_row.cc item_create.cc item_func.cc item_geofunc.cc item_row.cc
...@@ -84,8 +83,9 @@ SET (SQL_SOURCE ...@@ -84,8 +83,9 @@ SET (SQL_SOURCE
${GEN_SOURCES} ${GEN_SOURCES}
${MYSYS_LIBWRAP_SOURCE}) ${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) IF(WIN32)
SET(SQL_SOURCE ${SQL_SOURCE} nt_servc.cc nt_servc.h) SET(SQL_SOURCE ${SQL_SOURCE} nt_servc.cc nt_servc.h)
ENDIF() ENDIF()
...@@ -113,7 +113,7 @@ IF(NOT WITHOUT_DYNAMIC_PLUGINS) ...@@ -113,7 +113,7 @@ IF(NOT WITHOUT_DYNAMIC_PLUGINS)
# incremental appears to crash from time to time,if used with /DEF option # 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") 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) GET_TARGET_PROPERTY(LOC ${CORELIB} LOCATION)
FILE(TO_NATIVE_PATH ${LOC} LOC) FILE(TO_NATIVE_PATH ${LOC} LOC)
SET (LIB_LOCATIONS ${LIB_LOCATIONS} ${LOC}) SET (LIB_LOCATIONS ${LIB_LOCATIONS} ${LOC})
...@@ -129,7 +129,8 @@ ENDIF() ...@@ -129,7 +129,8 @@ ENDIF()
SET_TARGET_PROPERTIES(mysqld PROPERTIES ENABLE_EXPORTS TRUE) SET_TARGET_PROPERTIES(mysqld PROPERTIES ENABLE_EXPORTS TRUE)
SET_TARGET_PROPERTIES(mysqld PROPERTIES OUTPUT_NAME mysqld${MYSQLD_EXE_SUFFIX}) 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(TARGETS mysqld DESTINATION bin)
INSTALL_DEBUG_SYMBOLS(mysqld) INSTALL_DEBUG_SYMBOLS(mysqld)
......
...@@ -13,14 +13,7 @@ ...@@ -13,14 +13,7 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # 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) SET(ARCHIVE_SOURCES azio.c ha_archive.cc ha_archive.h)
MYSQL_STORAGE_ENGINE(ARCHIVE) MYSQL_ADD_PLUGIN(archive ${ARCHIVE_SOURCES} STORAGE_ENGINE LINK_LIBRARIES ${ZLIB_LIBRARY})
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()
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # 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) 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") ...@@ -17,4 +17,4 @@ SET(CSV_PLUGIN_STATIC "csv")
SET(CSV_PLUGIN_MANDATORY TRUE) SET(CSV_PLUGIN_MANDATORY TRUE)
SET(CSV_SOURCES ha_tina.cc ha_tina.h transparent_file.cc transparent_file.h) SET(CSV_SOURCES ha_tina.cc ha_tina.h transparent_file.cc transparent_file.h)
MYSQL_STORAGE_ENGINE(CSV) MYSQL_ADD_PLUGIN(csv ${CSV_SOURCES} STORAGE_ENGINE MANDATORY)
\ No newline at end of file
...@@ -15,4 +15,4 @@ ...@@ -15,4 +15,4 @@
SET(EXAMPLE_PLUGIN_DYNAMIC "ha_example") SET(EXAMPLE_PLUGIN_DYNAMIC "ha_example")
SET(EXAMPLE_SOURCES ha_example.cc) 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) ...@@ -21,4 +21,4 @@ IF(NOT WITH_FEDERATED AND NOT WITH_FEDERATED_STORAGE_ENGINE)
# mysqld and are optimized away by the linker. # mysqld and are optimized away by the linker.
SET(FEDERATED_SOURCES ${FEDERATED_SOURCES} ${CMAKE_SOURCE_DIR}/mysys/string.c) SET(FEDERATED_SOURCES ${FEDERATED_SOURCES} ${CMAKE_SOURCE_DIR}/mysys/string.c)
ENDIF() 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 ...@@ -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_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_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) 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 ...@@ -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_collationSupport.cc db2i_errors.cc db2i_constraints.cc
db2i_rir.cc db2i_sqlStatementStream.cc db2i_ioBuffers.cc db2i_myconv.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) ENDIF(HAVE_PASE_ENVIRONMENT)
...@@ -42,6 +42,7 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS") ...@@ -42,6 +42,7 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
CHECK_FUNCTION_EXISTS(atomic_add_long HAVE_ATOMIC_ADD_LONG) CHECK_FUNCTION_EXISTS(atomic_add_long HAVE_ATOMIC_ADD_LONG)
IF(HAVE_ATOMIC_CAS_ULONG AND HAVE_ATOMIC_CAS_32 AND IF(HAVE_ATOMIC_CAS_ULONG AND HAVE_ATOMIC_CAS_32 AND
HAVE_ATOMIC_CAS_64 AND HAVE_ATOMIC_ADD_LONG) HAVE_ATOMIC_CAS_64 AND HAVE_ATOMIC_ADD_LONG)
SET(HAVE_SOLARIS_ATOMICS 1) SET(HAVE_SOLARIS_ATOMICS 1)
ENDIF() ENDIF()
ENDIF() ENDIF()
...@@ -176,15 +177,6 @@ IF(WITH_INNODB) ...@@ -176,15 +177,6 @@ IF(WITH_INNODB)
SET(WITH_INNOBASE_STORAGE_ENGINE TRUE) SET(WITH_INNOBASE_STORAGE_ENGINE TRUE)
ENDIF() 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. #The plugin's CMakeLists.txt still needs to work with previous versions of MySQL.
IF(EXISTS ${SOURCE_DIR}/storage/mysql_storage_engine.cmake) IF(EXISTS ${SOURCE_DIR}/storage/mysql_storage_engine.cmake)
...@@ -207,5 +199,7 @@ ELSEIF (MYSQL_VERSION_ID LESS "50137") ...@@ -207,5 +199,7 @@ ELSEIF (MYSQL_VERSION_ID LESS "50137")
ELSE() ELSE()
# New plugin support, cross-platform , name for shared library # New plugin support, cross-platform , name for shared library
# is given in INNOBASE_PLUGIN_STATIC and INNOBASE_PLUGIN_DYNAMIC # 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() ENDIF()
...@@ -28,7 +28,10 @@ SET(MYISAM_SOURCES ft_boolean_search.c ft_nlq_search.c ft_parser.c ft_static.c ...@@ -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 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) 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) ADD_EXECUTABLE(myisam_ftdump myisam_ftdump.c)
TARGET_LINK_LIBRARIES(myisam_ftdump myisam mysys) 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 ...@@ -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_rprev.c myrg_rrnd.c myrg_rsame.c myrg_static.c myrg_update.c
myrg_write.c myrg_records.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. ...@@ -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 inffixed.h inflate.c inflate.h inftrees.c inftrees.h trees.c trees.h uncompr.c zconf.h zlib.h
zutil.c zutil.h) zutil.c zutil.h)
ADD_CONVENIENCE_LIBRARY(zlib ${ZLIB_SOURCES}) 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