Commit 117ae892 authored by calvin's avatar calvin

branches/zip: for building dynamic plugin on Windows, ha_innodb.dll,

when INNODB_DYNAMIC_PLUGIN is specified.

The changes are:

CMakeLists.txt: add project ha_innodb for dynamic plugin on Windows.
ha_innodb depends on project mysqld.

ha_innodb.def: a new file with standard exports for a dynamic plugin.

Two new files will be added:
 * sql/mysqld.def:	.def file for 32-bit compiler
 * sql/mysqld_x64.def:	.def file for x64 compiler

It is also required to apply a patch to the MySQL source tree. The 
patch is described in win-plugin/README:

win-plugin/win-plugin.diff - a patch to be applied to MySQL source
tree. When applied, the following files will be modified:
 * CMakeLists.txt:	add INNODB_DYNAMIC_PLUGIN and _USE_32BIT_TIME_T
 * sql/CMakeLists.txt:	add mysqld.def or mysqld_x64.def for mysqld
 * win/configure.js:	add INNODB_DYNAMIC_PLUGIN
 * win/build-vs71.bat:	provide an option to specify CMAKE_BUILD_TYPE
 * win/build-vs8.bat:	provide an option to specify CMAKE_BUILD_TYPE
 * win/build-vs8_x64.bat: provide an option to specify CMAKE_BUILD_TYPE
parent fd683162
......@@ -69,4 +69,29 @@ SET(INNOBASE_SOURCES btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(innobase ${INNOBASE_SOURCES})
ADD_DEPENDENCIES(innobase GenError)
IF(INNODB_DYNAMIC_PLUGIN)
# The dynamic plugin requires CMake 2.6.0 or later. Otherwise, the /DELAYLOAD property
# will not be set
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
ADD_LIBRARY(ha_innodb SHARED ${INNOBASE_SOURCES} ha_innodb.def handler/win_delay_loader.cc)
ADD_DEPENDENCIES(ha_innodb GenError mysqld)
# If build type is not specified as Release, default to Debug
# This is a workaround to a problem in CMake 2.6, which does not
# set the path of mysqld.lib correctly
IF(CMAKE_BUILD_TYPE MATCHES Release)
SET(CMAKE_BUILD_TYPE "Release")
ELSE(CMAKE_BUILD_TYPE MATCHES Release)
SET(CMAKE_BUILD_TYPE "Debug")
ENDIF(CMAKE_BUILD_TYPE MATCHES Release)
TARGET_LINK_LIBRARIES(ha_innodb strings dbug zlib)
TARGET_LINK_LIBRARIES(ha_innodb ${CMAKE_SOURCE_DIR}/sql/${CMAKE_BUILD_TYPE}/mysqld.lib)
SET_TARGET_PROPERTIES(ha_innodb PROPERTIES OUTPUT_NAME ha_innodb)
SET_TARGET_PROPERTIES(ha_innodb PROPERTIES LINK_FLAGS "/MAP /MAPINFO:EXPORTS")
SET_TARGET_PROPERTIES(ha_innodb PROPERTIES LINK_FLAGS "/ENTRY:\"_DllMainCRTStartup@12\"")
SET_TARGET_PROPERTIES(ha_innodb PROPERTIES COMPILE_FLAGS "-DMYSQL_DYNAMIC_PLUGIN")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /MAP /MAPINFO:EXPORTS")
SET_TARGET_PROPERTIES(ha_innodb PROPERTIES LINK_FLAGS "/DELAYLOAD:mysqld.exe")
ENDIF(INNODB_DYNAMIC_PLUGIN)
ENDIF(NOT SOURCE_SUBLIBS)
EXPORTS
_mysql_plugin_interface_version_
_mysql_sizeof_struct_st_plugin_
_mysql_plugin_declarations_
This directory contains patches that need to be applied to the MySQL
source tree in order to build the dynamic plugin on Windows --
HA_INNODB.DLL. Please note the followings when adding the patches:
* The patch must be applied from the mysql top-level source directory.
patch -p0 < win-plugin.diff
* The patch filenames end in ".diff".
* All patches here are expected to apply cleanly to the latest MySQL 5.1
tree when storage/innobase is replaced with this InnoDB branch.
When applying the patch, the following files will be modified:
* CMakeLists.txt
* sql/CMakeLists.txt
* win/configure.js
* win/build-vs71.bat
* win/build-vs8.bat
* win/build-vs8_x64.bat
Also, two new files will be added:
* sql/mysqld.def
* sql/mysqld_x64.def
You can get "patch" utility for Windows from http://unxutils.sourceforge.net/
This diff is collapsed.
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