Commit 630b0b87 authored by Sergei Golubchik's avatar Sergei Golubchik

support for plugins on windows

CMakeLists.txt:
  1. add -DSAFEMALLOC -DSAFE_MUTEX in the top-level CMakeLists.txt
     don't force plugins to copy-paste these lines in their CMakeLists.txt
  2.1 search plugin/* for plugins (not only storage/*),
  2.2 recognize MYSQL_PLUGIN (not only MYSQL_STORAGE_ENGINE),
  2.3 extract library names from the plug.in (don't force library names to
      be ha_<engine>.dll and <engine>.lib)
include/mysql/plugin.h:
  define MYSQL_PLUGIN_EXPORT appropriately
  (backport from 5.5)
libmysqld/CMakeLists.txt:
  remove unnecessary workaround
plugin/fulltext/CMakeLists.txt:
  build fulltext example plugin on windows
storage/maria/CMakeLists.txt:
  The library is called libmaria_s.lib, not maria.lib
storage/maria/unittest/CMakeLists.txt:
  The library is called libmaria_s.lib, not maria.lib
storage/myisam/CMakeLists.txt:
  The library is called libmyisam_s.lib, not myisam.lib
storage/mysql_storage_engine.cmake:
  introduce MYSQL_PLUGIN macro.
  don't force library names to be ha_<engine>.dll and <engine>.lib
storage/xtradb/CMakeLists.txt:
  remove a condition from include
win/README:
  don't use deprecated syntax
win/configure-mariadb.sh:
  don't use deprecated syntax
win/configure.js:
  1. support MYSQL_PLUGIN in addition to MYSQL_STORAGE_ENGINE.
  2. support plugin/* in addition to storage/*
parent f3523559
......@@ -1952,3 +1952,8 @@ scripts/convert-debug-for-diff
client/strings_def.h
libmysql/strings_def.h
libmysql_r/strings_def.h
CPackConfig.cmake
CPackSourceConfig.cmake
win/nmake_cache.txt
*.manifest
*.resource.txt
......@@ -172,6 +172,9 @@ ENDIF(ENABLED_DEBUG_SYNC)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
# in some places we use DBUG_OFF
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DDBUG_OFF")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDBUG_OFF")
......@@ -313,16 +316,15 @@ IF(WITHOUT_DYNAMIC_PLUGINS)
MESSAGE("Dynamic plugins are disabled.")
ENDIF(WITHOUT_DYNAMIC_PLUGINS)
FILE(GLOB STORAGE_SUBDIRS storage/*)
FILE(GLOB STORAGE_SUBDIRS storage/* plugin/*)
FOREACH(SUBDIR ${STORAGE_SUBDIRS})
FILE(RELATIVE_PATH DIRNAME ${PROJECT_SOURCE_DIR}/storage ${SUBDIR})
IF (EXISTS ${SUBDIR}/CMakeLists.txt)
# Check MYSQL_STORAGE_ENGINE macro is present
FILE(STRINGS ${SUBDIR}/CMakeLists.txt HAVE_STORAGE_ENGINE REGEX MYSQL_STORAGE_ENGINE)
FILE(STRINGS ${SUBDIR}/CMakeLists.txt HAVE_STORAGE_ENGINE REGEX "MYSQL_(STORAGE_ENGINE|PLUGIN)")
IF(HAVE_STORAGE_ENGINE)
# Extract name of engine from HAVE_STORAGE_ENGINE
STRING(REGEX REPLACE ".*MYSQL_STORAGE_ENGINE\\((.*\)\\).*"
"\\1" ENGINE_NAME ${HAVE_STORAGE_ENGINE})
STRING(REGEX REPLACE ".*MYSQL_(STORAGE_ENGINE|PLUGIN)\\((.*\)\\).*"
"\\2" ENGINE_NAME ${HAVE_STORAGE_ENGINE})
STRING(TOUPPER ${ENGINE_NAME} ENGINE)
STRING(TOLOWER ${ENGINE_NAME} ENGINE_LOWER)
......@@ -331,21 +333,23 @@ FOREACH(SUBDIR ${STORAGE_SUBDIRS})
# build as shared library (dynamic).
IF(EXISTS ${SUBDIR}/plug.in)
FILE(READ ${SUBDIR}/plug.in PLUGIN_FILE_CONTENT)
STRING (REGEX MATCH "MYSQL_PLUGIN_DYNAMIC" MYSQL_PLUGIN_DYNAMIC ${PLUGIN_FILE_CONTENT})
IF (PLUGIN_FILE_CONTENT MATCHES "MYSQL_PLUGIN_DYNAMIC\\(${ENGINE_LOWER}")
STRING (REGEX REPLACE
".*MYSQL_PLUGIN_DYNAMIC\\(${ENGINE_LOWER},[ \\t]*\\[?([a-zA-Z0-9_]+/)*([a-zA-Z0-9_]+).*"
"\\2" MYSQL_PLUGIN_DYNAMIC ${PLUGIN_FILE_CONTENT})
ELSE (PLUGIN_FILE_CONTENT MATCHES "MYSQL_PLUGIN_DYNAMIC\\(${ENGINE_LOWER}")
SET (MYSQL_PLUGIN_DYNAMIC "")
ENDIF(PLUGIN_FILE_CONTENT MATCHES "MYSQL_PLUGIN_DYNAMIC\\(${ENGINE_LOWER}")
IF (PLUGIN_FILE_CONTENT MATCHES "MYSQL_PLUGIN_STATIC\\(${ENGINE_LOWER}")
STRING (REGEX REPLACE
".*MYSQL_PLUGIN_STATIC\\(${ENGINE_LOWER},[ \\t]*\\[?([a-zA-Z0-9_]+/)*([a-zA-Z0-9_]+).*"
"\\2"
MYSQL_PLUGIN_STATIC ${PLUGIN_FILE_CONTENT})
ELSE (PLUGIN_FILE_CONTENT MATCHES "MYSQL_PLUGIN_STATIC\\(${ENGINE_LOWER}")
SET (MYSQL_PLUGIN_STATIC "")
ENDIF(PLUGIN_FILE_CONTENT MATCHES "MYSQL_PLUGIN_STATIC\\(${ENGINE_LOWER}")
STRING (REGEX MATCH "MYSQL_PLUGIN_MANDATORY" MYSQL_PLUGIN_MANDATORY ${PLUGIN_FILE_CONTENT})
STRING (REGEX MATCH "MYSQL_PLUGIN_STATIC" MYSQL_PLUGIN_STATIC ${PLUGIN_FILE_CONTENT})
#
# XTRADB is located in storage/xtradb, but it says everywhere it is 'innobase' (e.g.
# it declares 'builtin_innobase_plugin', not builtin_xtradb_plugin).
# Extract the intended plugin name from MYSQL_STORAGE_ENGINE definition and use it
# where appropriate.
STRING (REGEX MATCH "MYSQL_STORAGE_ENGINE.[a-z]*" PLUGIN_NAME ${PLUGIN_FILE_CONTENT})
STRING (REGEX REPLACE "MYSQL_STORAGE_ENGINE.(.*)" "\\1" PLUGIN_NAME ${PLUGIN_NAME})
# Also remember this "xtradb"/"innobase" name discrepancy for libmysqld/CMakeLists.txt:
SET (plugin_dir_${PLUGIN_NAME} ${DIRNAME})
IF(MYSQL_PLUGIN_MANDATORY)
SET(WITH_${ENGINE}_STORAGE_ENGINE TRUE)
ENDIF(MYSQL_PLUGIN_MANDATORY)
......@@ -359,15 +363,17 @@ FOREACH(SUBDIR ${STORAGE_SUBDIRS})
ENDIF(WITH_${ENGINE}_STORAGE_ENGINE AND MYSQL_PLUGIN_STATIC)
IF (ENGINE_BUILD_TYPE STREQUAL "STATIC")
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_${PLUGIN_NAME}_plugin")
SET (MYSQLD_STATIC_ENGINE_LIBS ${MYSQLD_STATIC_ENGINE_LIBS} ${PLUGIN_NAME})
SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_${ENGINE_LOWER}_plugin")
SET (MYSQLD_STATIC_ENGINE_LIBS ${MYSQLD_STATIC_ENGINE_LIBS} ${MYSQL_PLUGIN_STATIC})
SET (MYSQLD_STATIC_ENGINES ${MYSQLD_STATIC_ENGINES} ${ENGINE})
SET (STORAGE_ENGINE_DEFS "${STORAGE_ENGINE_DEFS} -DWITH_${ENGINE}_STORAGE_ENGINE")
SET (WITH_${ENGINE}_STORAGE_ENGINE TRUE)
SET (${ENGINE}_DIR ${DIRNAME})
SET (${ENGINE}_DIR ${SUBDIR})
ENDIF (ENGINE_BUILD_TYPE STREQUAL "STATIC")
ENDIF(EXISTS ${SUBDIR}/plug.in)
IF(NOT ENGINE_BUILD_TYPE STREQUAL "NONE")
SET (${ENGINE}_LIB ${MYSQL_PLUGIN_${ENGINE_BUILD_TYPE}})
LIST(APPEND ${ENGINE_BUILD_TYPE}_ENGINE_DIRECTORIES ${SUBDIR})
ENDIF(NOT ENGINE_BUILD_TYPE STREQUAL "NONE")
......
......@@ -16,13 +16,27 @@
#ifndef _my_plugin_h
#define _my_plugin_h
/*
On Windows, exports from DLL need to be declared
*/
#if (defined(_WIN32) && defined(MYSQL_DYNAMIC_PLUGIN))
#define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport)
#else
Also, plugin needs to be declared as extern "C" because MSVC
unlike other compilers, uses C++ mangling for variables not only
for functions.
*/
#if defined(_MSC_VER)
#if defined(MYSQL_DYNAMIC_PLUGIN)
#ifdef __cplusplus
#define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport)
#else
#define MYSQL_PLUGIN_EXPORT __declspec(dllexport)
#endif
#else /* MYSQL_DYNAMIC_PLUGIN */
#ifdef __cplusplus
#define MYSQL_PLUGIN_EXPORT extern "C"
#else
#define MYSQL_PLUGIN_EXPORT
#endif
#endif /*MYSQL_DYNAMIC_PLUGIN */
#else /*_MSC_VER */
#define MYSQL_PLUGIN_EXPORT
#endif
......
......@@ -85,15 +85,13 @@ FOREACH(rpath ${VIO_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../vio/${rpath})
ENDFOREACH(rpath)
FOREACH (ENGINE_LIB ${MYSQLD_STATIC_ENGINE_LIBS})
INCLUDE(${CMAKE_SOURCE_DIR}/storage/${plugin_dir_${ENGINE_LIB}}/CMakeLists.txt)
STRING(TOUPPER ${ENGINE_LIB} ENGINE_LIB_UPPER)
SET(ENGINE_DIR ${${ENGINE_LIB_UPPER}_DIR})
INCLUDE(${CMAKE_SOURCE_DIR}/storage/${ENGINE_DIR}/CMakeLists.txt)
FOREACH(rpath ${${ENGINE_LIB_UPPER}_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ${CMAKE_SOURCE_DIR}/storage/${ENGINE_DIR}/${rpath})
SET (ENGINE_BUILD_TYPE "STATIC")
FOREACH (ENGINE ${MYSQLD_STATIC_ENGINES})
INCLUDE(${${ENGINE}_DIR}/CMakeLists.txt)
FOREACH(rpath ${${ENGINE}_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ${${ENGINE}_DIR}/${rpath})
ENDFOREACH(rpath)
ENDFOREACH(ENGINE_LIB)
ENDFOREACH(ENGINE)
SET(SOURCE_SUBLIBS FALSE)
......@@ -160,16 +158,15 @@ IF(MSVC AND CMAKE_SIZEOF_VOID_P MATCHES 8)
ENDIF()
# Add any additional libraries requested by engine(s)
FOREACH (ENGINE_LIB ${MYSQLD_STATIC_ENGINE_LIBS})
STRING(TOUPPER ${ENGINE_LIB} ENGINE_LIB_UPPER)
IF(${ENGINE_LIB_UPPER}_LIBS)
TARGET_LINK_LIBRARIES(mysqlserver ${${ENGINE_LIB_UPPER}_LIBS})
ENDIF(${ENGINE_LIB_UPPER}_LIBS)
ENDFOREACH(ENGINE_LIB)
FOREACH (ENGINE ${MYSQLD_STATIC_ENGINES})
IF(${ENGINE}_LIBS)
TARGET_LINK_LIBRARIES(mysqlserver ${${ENGINE}_LIBS})
ENDIF(${ENGINE}_LIBS)
ENDFOREACH(ENGINE)
ADD_LIBRARY(libmysqld SHARED cmake_dummy.c libmysqld.def)
ADD_DEPENDENCIES(libmysqld mysqlserver)
TARGET_LINK_LIBRARIES(libmysqld mysqlserver wsock32)
TARGET_LINK_LIBRARIES(libmysqld mysqlserver wsock32 iphlpapi)
INSTALL(TARGETS mysqlserver DESTINATION Embedded/static COMPONENT embedded)
......
INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
SET(FTEXAMPLE_SOURCES plugin_example.c)
MYSQL_PLUGIN(FTEXAMPLE)
......@@ -48,37 +48,37 @@ SET(MARIA_SOURCES ma_init.c ma_open.c ma_extra.c ma_info.c ma_rkey.c
MYSQL_STORAGE_ENGINE(MARIA)
IF(NOT SOURCE_SUBLIBS)
ADD_DEPENDENCIES(maria GenError)
ADD_DEPENDENCIES(libmaria_s GenError)
ADD_EXECUTABLE(maria_ftdump maria_ftdump.c)
TARGET_LINK_LIBRARIES(maria_ftdump maria myisam mysys dbug strings zlib wsock32)
TARGET_LINK_LIBRARIES(maria_ftdump libmaria_s libmyisam_s mysys dbug strings zlib wsock32)
ADD_EXECUTABLE(maria_chk maria_chk.c)
TARGET_LINK_LIBRARIES(maria_chk maria myisam mysys dbug strings zlib wsock32)
TARGET_LINK_LIBRARIES(maria_chk libmaria_s libmyisam_s mysys dbug strings zlib wsock32)
ADD_EXECUTABLE(maria_read_log maria_read_log.c)
TARGET_LINK_LIBRARIES(maria_read_log maria myisam mysys dbug strings zlib wsock32)
TARGET_LINK_LIBRARIES(maria_read_log libmaria_s libmyisam_s mysys dbug strings zlib wsock32)
ADD_EXECUTABLE(maria_pack maria_pack.c)
TARGET_LINK_LIBRARIES(maria_pack maria myisam mysys dbug strings zlib wsock32)
TARGET_LINK_LIBRARIES(maria_pack libmaria_s libmyisam_s mysys dbug strings zlib wsock32)
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)
TARGET_LINK_LIBRARIES(maria_dump_log libmaria_s libmyisam_s mysys dbug strings zlib wsock32)
ADD_EXECUTABLE(ma_test1 ma_test1.c)
TARGET_LINK_LIBRARIES(ma_test1 maria myisam mysys dbug strings zlib wsock32)
TARGET_LINK_LIBRARIES(ma_test1 libmaria_s libmyisam_s mysys dbug strings zlib wsock32)
ADD_EXECUTABLE(ma_test2 ma_test2.c)
TARGET_LINK_LIBRARIES(ma_test2 maria myisam mysys dbug strings zlib wsock32)
TARGET_LINK_LIBRARIES(ma_test2 libmaria_s libmyisam_s mysys dbug strings zlib wsock32)
ADD_EXECUTABLE(ma_test3 ma_test3.c)
TARGET_LINK_LIBRARIES(ma_test3 maria myisam mysys dbug strings zlib wsock32)
TARGET_LINK_LIBRARIES(ma_test3 libmaria_s libmyisam_s mysys dbug strings zlib wsock32)
ADD_EXECUTABLE(ma_rt_test ma_rt_test.c)
TARGET_LINK_LIBRARIES(ma_rt_test maria myisam mysys dbug strings zlib wsock32)
TARGET_LINK_LIBRARIES(ma_rt_test libmaria_s libmyisam_s mysys dbug strings zlib wsock32)
ADD_EXECUTABLE(ma_sp_test ma_sp_test.c)
TARGET_LINK_LIBRARIES(ma_sp_test maria myisam mysys dbug strings zlib wsock32)
TARGET_LINK_LIBRARIES(ma_sp_test libmaria_s libmyisam_s mysys dbug strings zlib wsock32)
IF(EMBED_MANIFESTS)
MYSQL_EMBED_MANIFEST("maria_ftdump" "asInvoker")
......
......@@ -13,10 +13,9 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/unittest/mytap)
LINK_LIBRARIES(maria myisam mytap mysys dbug strings wsock32 zlib)
LINK_LIBRARIES(libmaria_s libmyisam_s mytap mysys dbug strings wsock32 zlib)
ADD_EXECUTABLE(ma_control_file-t ma_control_file-t.c)
ADD_EXECUTABLE(trnman-t trnman-t.c)
......
......@@ -32,31 +32,31 @@ MYSQL_STORAGE_ENGINE(MYISAM)
IF(NOT SOURCE_SUBLIBS)
ADD_EXECUTABLE(myisam_ftdump myisam_ftdump.c)
TARGET_LINK_LIBRARIES(myisam_ftdump myisam mysys debug dbug strings zlib wsock32)
TARGET_LINK_LIBRARIES(myisam_ftdump libmyisam_s mysys debug dbug strings zlib wsock32)
ADD_EXECUTABLE(myisamchk myisamchk.c)
TARGET_LINK_LIBRARIES(myisamchk myisam mysys debug dbug strings zlib wsock32)
TARGET_LINK_LIBRARIES(myisamchk libmyisam_s mysys debug dbug strings zlib wsock32)
ADD_EXECUTABLE(myisamlog myisamlog.c)
TARGET_LINK_LIBRARIES(myisamlog myisam mysys debug dbug strings zlib wsock32)
TARGET_LINK_LIBRARIES(myisamlog libmyisam_s mysys debug dbug strings zlib wsock32)
ADD_EXECUTABLE(myisampack myisampack.c)
TARGET_LINK_LIBRARIES(myisampack myisam mysys debug dbug strings zlib wsock32)
TARGET_LINK_LIBRARIES(myisampack libmyisam_s mysys debug dbug strings zlib wsock32)
ADD_EXECUTABLE(mi_test1 mi_test1.c)
TARGET_LINK_LIBRARIES(mi_test1 myisam mysys debug dbug strings zlib wsock32)
TARGET_LINK_LIBRARIES(mi_test1 libmyisam_s mysys debug dbug strings zlib wsock32)
ADD_EXECUTABLE(mi_test2 mi_test2.c)
TARGET_LINK_LIBRARIES(mi_test2 myisam mysys debug dbug strings zlib wsock32)
TARGET_LINK_LIBRARIES(mi_test2 libmyisam_s mysys debug dbug strings zlib wsock32)
ADD_EXECUTABLE(mi_test3 mi_test3.c)
TARGET_LINK_LIBRARIES(mi_test3 myisam mysys debug dbug strings zlib wsock32)
TARGET_LINK_LIBRARIES(mi_test3 libmyisam_s mysys debug dbug strings zlib wsock32)
ADD_EXECUTABLE(sp_test sp_test.c)
TARGET_LINK_LIBRARIES(sp_test myisam mysys debug dbug strings zlib wsock32)
TARGET_LINK_LIBRARIES(sp_test libmyisam_s mysys debug dbug strings zlib wsock32)
ADD_EXECUTABLE(rt_test rt_test.c)
TARGET_LINK_LIBRARIES(rt_test myisam mysys debug dbug strings zlib wsock32)
TARGET_LINK_LIBRARIES(rt_test libmyisam_s mysys debug dbug strings zlib wsock32)
SET_TARGET_PROPERTIES(myisamchk myisampack PROPERTIES LINK_FLAGS "setargv.obj")
......
......@@ -10,37 +10,40 @@
# ${engine}_LIBS variable containing extra libraries to link with may be set
MACRO(MYSQL_STORAGE_ENGINE engine)
MACRO(MYSQL_PLUGIN engine)
IF(NOT SOURCE_SUBLIBS)
# Add common include directories
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
STRING(TOUPPER ${engine} engine)
STRING(TOLOWER ${engine} libname)
IF(${ENGINE_BUILD_TYPE} STREQUAL "STATIC")
ADD_DEFINITIONS(-DWITH_${engine}_STORAGE_ENGINE -DMYSQL_SERVER)
#Create static library. The name of the library is <storage_engine>.lib
ADD_LIBRARY(${libname} ${${engine}_SOURCES})
ADD_DEPENDENCIES(${libname} GenError)
ADD_LIBRARY(${${engine}_LIB} ${${engine}_SOURCES})
ADD_DEPENDENCIES(${${engine}_LIB} GenError)
IF(${engine}_LIBS)
TARGET_LINK_LIBRARIES(${libname} ${${engine}_LIBS})
TARGET_LINK_LIBRARIES(${${engine}_LIB} ${${engine}_LIBS})
ENDIF(${engine}_LIBS)
MESSAGE("build ${engine} as static library")
MESSAGE("build ${engine} as static library (${${engine}_LIB}.lib)")
ELSEIF(${ENGINE_BUILD_TYPE} STREQUAL "DYNAMIC")
ADD_DEFINITIONS(-DMYSQL_DYNAMIC_PLUGIN)
#Create a DLL.The name of the dll is ha_<storage_engine>.dll
#The dll is linked to the mysqld executable
SET(dyn_libname ha_${libname})
ADD_LIBRARY(${dyn_libname} SHARED ${${engine}_SOURCES})
TARGET_LINK_LIBRARIES (${dyn_libname} mysqld)
ADD_LIBRARY(${${engine}_LIB} SHARED ${${engine}_SOURCES})
TARGET_LINK_LIBRARIES (${${engine}_LIB} mysqld)
IF(${engine}_LIBS)
TARGET_LINK_LIBRARIES(${dyn_libname} ${${engine}_LIBS})
TARGET_LINK_LIBRARIES(${${engine}_LIB} ${${engine}_LIBS})
ENDIF(${engine}_LIBS)
# Install the plugin
INSTALL(TARGETS ${dyn_libname} DESTINATION lib/plugin COMPONENT runtime)
MESSAGE("build ${engine} as DLL")
INSTALL(TARGETS ${${engine}_LIB} DESTINATION lib/plugin COMPONENT runtime)
MESSAGE("build ${engine} as DLL (${${engine}_LIB}.dll)")
ENDIF(${ENGINE_BUILD_TYPE} STREQUAL "STATIC")
ENDIF(NOT SOURCE_SUBLIBS)
ENDMACRO(MYSQL_PLUGIN)
MACRO(MYSQL_STORAGE_ENGINE engine)
IF(NOT SOURCE_SUBLIBS)
MYSQL_PLUGIN(${engine})
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include)
IF(${ENGINE_BUILD_TYPE} STREQUAL "STATIC")
ADD_DEFINITIONS(-DWITH_${engine}_STORAGE_ENGINE -DMYSQL_SERVER)
ENDIF(${ENGINE_BUILD_TYPE} STREQUAL "STATIC")
ENDIF(NOT SOURCE_SUBLIBS)
ENDMACRO(MYSQL_STORAGE_ENGINE)
......@@ -13,15 +13,9 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# This is the CMakeLists for InnoDB Plugin
# This is the CMakeLists for XtraDB
# Starting at 5.1.38, MySQL CMake files are simplified. But the plugin
# CMakeLists.txt still needs to work with previous versions of MySQL.
IF (MYSQL_VERSION_ID GREATER "50137")
INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
ENDIF (MYSQL_VERSION_ID GREATER "50137")
INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake")
IF (CMAKE_SIZEOF_VOID_P MATCHES 8)
SET(WIN64 TRUE)
......
......@@ -51,12 +51,10 @@ win\configure <options>
The options right now are:
WITH_INNOBASE_STORAGE_ENGINE Enable particular storage engines
WITH_PARTITION_STORAGE_ENGINE
WITH_ARCHIVE_STORAGE_ENGINE
WITH_BLACKHOLE_STORAGE_ENGINE
WITH_EXAMPLE_STORAGE_ENGINE
WITH_FEDERATED_STORAGE_ENGINE
--with-plugin-XXX Enable particular plugin or plugins
--with-plugins=XXX,YYY,...
--with-plugins=GROUP GROUP can be, for example, "max" or "max-no-ndb"
--without-plugin-XXX Disable particular plugin
__NT__ Enable named pipe support
MYSQL_SERVER_SUFFIX=<suffix> Server suffix, default none
COMPILATION_COMMENT=<comment> Server comment, default "Source distribution"
......@@ -70,7 +68,7 @@ The options right now are:
So the command line could look like:
win\configure WITH_INNOBASE_STORAGE_ENGINE WITH_PARTITION_STORAGE_ENGINE MYSQL_SERVER_SUFFIX=-pro
win\configure --with-plugin-innobase --with-plugin-partition MYSQL_SERVER_SUFFIX=-pro
Step 6
------
......
......@@ -5,4 +5,5 @@ cscript win\configure.js ^
WITH_PARTITION_STORAGE_ENGINE ^
WITH_MARIA_STORAGE_ENGINE ^
WITH_PBXT_STORAGE_ENGINE ^
WITH_XTRADB_STORAGE_ENGINE
WITH_XTRADB_STORAGE_ENGINE ^
WITH_FEEDBACK_STORAGE_ENGINE
......@@ -7,17 +7,9 @@
set -e
cscript win/configure.js \
WITH_ARCHIVE_STORAGE_ENGINE \
WITH_BLACKHOLE_STORAGE_ENGINE \
WITH_CSV_STORAGE_ENGINE \
WITH_EXAMPLE_STORAGE_ENGINE \
WITH_FEDERATEDX_STORAGE_ENGINE \
WITH_MERGE_STORAGE_ENGINE \
WITH_PARTITION_STORAGE_ENGINE \
WITH_MARIA_STORAGE_ENGINE \
WITH_PBXT_STORAGE_ENGINE \
WITH_XTRADB_STORAGE_ENGINE \
cscript win/configure.js --with-plugin-archive --with-plugin-blackhole \
--with-plugin-csv --with-plugin-example --with-plugin-federatedx \
--with-plugin-merge --with-plugin-partition --with-plugin-maria \
--with-plugin-pbxt --with-plugin-xtradb --with-plugin-feedback \
WITH_EMBEDDED_SERVER
......@@ -126,7 +126,7 @@ try
var engineOptions = ParsePlugins();
for (option in engineOptions)
{
configfile.WriteLine("SET(" + engineOptions[option] + " TRUE)");
configfile.WriteLine("SET (" + engineOptions[option] + " TRUE)");
}
configfile.Close();
......@@ -302,7 +302,7 @@ function ParsePlugins()
{
var content = fso.OpenTextFile(filename, ForReading).ReadAll();
var match =
/MYSQL_STORAGE_ENGINE([ ]*)[\(]([^\)]+)[\)]/.exec(content);
/MYSQL_(PLUGIN|STORAGE_ENGINE)([ ]*)[\(]([^\)]+)[\)]/.exec(content);
if (match== null)
continue;
match = /\[[\w,\-_]+\][\s]?\)/.exec(match[0]);
......@@ -329,9 +329,9 @@ function ParsePlugins()
for(key in config)
{
var eng = config[key];
if(eng.isGroup != undefined && !eng.isGroup && eng.include != undefined)
if(eng.isGroup != undefined && !eng.isGroup && eng.include != undefined)
{
if (fso.FolderExists("storage\\"+key) || key=="PARTITION")
if (fso.FolderExists("storage\\"+key) || fso.FolderExists("plugin\\"+key) || key=="PARTITION")
{
arr[arr.length] = eng.include?
"WITH_"+key+"_STORAGE_ENGINE":"WITHOUT_"+key+"_STORAGE_ENGINE";
......
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