summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/build_configurations/mysql_release.cmake9
-rw-r--r--cmake/character_sets.cmake4
-rw-r--r--cmake/configure.pl20
-rw-r--r--cmake/cpack_deb.cmake1
-rw-r--r--cmake/cpu_info.cmake30
-rw-r--r--cmake/create_initial_db.cmake.in7
-rw-r--r--cmake/jemalloc.cmake5
-rw-r--r--cmake/libutils.cmake25
-rw-r--r--cmake/maintainer.cmake4
-rw-r--r--cmake/mysql_add_executable.cmake112
-rw-r--r--cmake/mysql_version.cmake4
-rw-r--r--cmake/os/Windows.cmake4
-rw-r--r--cmake/pcre.cmake16
-rw-r--r--cmake/plugin.cmake28
-rw-r--r--cmake/ssl.cmake199
-rw-r--r--cmake/versioninfo.rc.in76
-rw-r--r--cmake/zlib.cmake2
17 files changed, 384 insertions, 162 deletions
diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake
index 543b66477bd..7e5ce563b15 100644
--- a/cmake/build_configurations/mysql_release.cmake
+++ b/cmake/build_configurations/mysql_release.cmake
@@ -46,6 +46,8 @@ SET(FEATURE_SET_large 5)
SET(FEATURE_SET_xlarge 6)
SET(FEATURE_SET_community 7)
+#SET(WITH_CASSANDRA_STORAGE_ENGINE ON)
+
IF(FEATURE_SET)
STRING(TOLOWER ${FEATURE_SET} feature_set)
SET(num ${FEATURE_SET_${feature_set}})
@@ -82,7 +84,7 @@ IF(FEATURE_SET)
# Update cache with current values, remove engines we do not care about
# from build.
- FOREACH(eng ARCHIVE BLACKHOLE FEDERATED INNOBASE PARTITION EXAMPLE)
+ FOREACH(eng ARCHIVE BLACKHOLE FEDERATED INNOBASE PARTITION)
IF(NOT WITH_${eng}_STORAGE_ENGINE)
SET(WITHOUT_${eng}_STORAGE_ENGINE ON CACHE BOOL "")
MARK_AS_ADVANCED(WITHOUT_${eng}_STORAGE_ENGINE)
@@ -101,7 +103,6 @@ ELSEIF(DEB)
SET(WITH_SSL system CACHE STRING "")
SET(WITH_ZLIB system CACHE STRING "")
SET(WITH_LIBWRAP ON)
- SET(WITH_MAX ON)
SET(HAVE_EMBEDDED_PRIVILEGE_CONTROL ON)
ELSE()
SET(WITH_SSL bundled CACHE STRING "")
@@ -142,12 +143,12 @@ IF(UNIX)
ENDIF()
# Remove libaio dependency from mysqld
- SET(XTRADB_PREFER_STATIC_LIBAIO 1)
+ #SET(XTRADB_PREFER_STATIC_LIBAIO 1)
# Unfortunately, linking shared libmysqld with static aio
# does not work, unless we add also dynamic one. This also means
# libmysqld.so will depend on libaio.so
- SET(LIBMYSQLD_SO_EXTRA_LIBS aio)
+ #SET(LIBMYSQLD_SO_EXTRA_LIBS aio)
ENDIF()
ENDIF()
diff --git a/cmake/character_sets.cmake b/cmake/character_sets.cmake
index 74a39e09cac..1c93441cbb1 100644
--- a/cmake/character_sets.cmake
+++ b/cmake/character_sets.cmake
@@ -25,14 +25,14 @@ ENDIF()
SET(CHARSETS ${DEFAULT_CHARSET} latin1 utf8 utf8mb4)
SET(CHARSETS_COMPLEX
big5 cp1250 cp932 eucjpms euckr gb2312 gbk latin1 latin2
- sjis tis620 ucs2 ujis utf8 utf8mb4 utf16 utf32)
+ sjis tis620 ucs2 ujis utf8 utf8mb4 utf16 utf16le utf32)
SET(CHARSETS_AVAILABLE
binary armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257
cp850 cp852 cp866 cp932 dec8 eucjpms euckr gb2312 gbk geostd8
greek hebrew hp8 keybcs2 koi8r koi8u
latin1 latin2 latin5 latin7 macce macroman
-sjis swe7 tis620 ucs2 ujis utf8 utf8mb4 utf16 utf32)
+sjis swe7 tis620 ucs2 ujis utf8 utf8mb4 utf16 utf16le utf32)
SET (EXTRA_CHARSETS "all")
diff --git a/cmake/configure.pl b/cmake/configure.pl
index d5c0b9b061a..a71795a3bc8 100644
--- a/cmake/configure.pl
+++ b/cmake/configure.pl
@@ -150,6 +150,16 @@ foreach my $option (@ARGV)
$cmakeargs = $cmakeargs." -DWITH_ZLIB=system";
next;
}
+ if($option =~ /with-libevent=/)
+ {
+ $cmakeargs = $cmakeargs." -DWITH_LIBEVENT=system";
+ next;
+ }
+ if($option =~ /with-libevent/)
+ {
+ $cmakeargs = $cmakeargs." -DWITH_LIBEVENT=bundled";
+ next;
+ }
if($option =~ /with-ssl=/)
{
$cmakeargs = $cmakeargs." -DWITH_SSL=yes";
@@ -237,6 +247,16 @@ foreach my $option (@ARGV)
print("configure.pl : ignoring $option\n");
next;
}
+ if ($option =~ /with-client-ldflags/)
+ {
+ print("configure.pl : ignoring $option\n");
+ next;
+ }
+ if ($option =~ /with-mysqld-ldflags=/)
+ {
+ print("configure.pl : ignoring $option\n");
+ next;
+ }
$option = uc($option);
$option =~ s/-/_/g;
diff --git a/cmake/cpack_deb.cmake b/cmake/cpack_deb.cmake
index 5fb9db1f07f..22985e5ac56 100644
--- a/cmake/cpack_deb.cmake
+++ b/cmake/cpack_deb.cmake
@@ -5,5 +5,6 @@
IF(DEB)
SET(CPACK_COMPONENT_SERVER_GROUP "server")
SET(CPACK_COMPONENT_README_GROUP "server")
+SET(CPACK_COMPONENTS_ALL Server Test SharedLibraries)
ENDIF(DEB)
diff --git a/cmake/cpu_info.cmake b/cmake/cpu_info.cmake
new file mode 100644
index 00000000000..32b98142ace
--- /dev/null
+++ b/cmake/cpu_info.cmake
@@ -0,0 +1,30 @@
+# Copyright (c) 2009, 2011, 2012 Oracle and/or its affiliates. All rights reserved.
+#
+# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+# Symbols with information about the CPU.
+
+FIND_PROGRAM(GETCONF getconf)
+MARK_AS_ADVANCED(GETCONF)
+
+IF(GETCONF)
+ EXECUTE_PROCESS(
+ COMMAND ${GETCONF} LEVEL1_DCACHE_LINESIZE
+ OUTPUT_VARIABLE CPU_LEVEL1_DCACHE_LINESIZE
+ )
+ENDIF()
+IF(CPU_LEVEL1_DCACHE_LINESIZE AND CPU_LEVEL1_DCACHE_LINESIZE GREATER 0)
+ELSE()
+ SET(CPU_LEVEL1_DCACHE_LINESIZE 64)
+ENDIF()
diff --git a/cmake/create_initial_db.cmake.in b/cmake/create_initial_db.cmake.in
index ce638b14e39..c77e28d882c 100644
--- a/cmake/create_initial_db.cmake.in
+++ b/cmake/create_initial_db.cmake.in
@@ -40,10 +40,11 @@ FOREACH(FILENAME mysql_system_tables.sql mysql_system_tables_data.sql mysql_perf
ENDFOREACH()
ENDFOREACH()
FILE(READ ${CMAKE_SOURCE_DIR}/scripts/fill_help_tables.sql CONTENTS)
-FILE(APPEND bootstrap.sql ${CONTENTS})
+FILE(APPEND bootstrap.sql "${CONTENTS}")
+FILE(REMOVE_RECURSE mysql performance_schema)
+FILE(REMOVE ibdata1 ib_logfile0 ib_logfile1)
-FILE(REMOVE_RECURSE mysql)
MAKE_DIRECTORY(mysql)
IF(WIN32)
SET(CONSOLE --console)
@@ -58,8 +59,6 @@ SET(BOOTSTRAP_COMMAND
--basedir=.
--datadir=.
--default-storage-engine=MyISAM
- --loose-skip-innodb
- --loose-skip-ndbcluster
--max_allowed_packet=8M
--net_buffer_length=16K
)
diff --git a/cmake/jemalloc.cmake b/cmake/jemalloc.cmake
index 39a97334071..876688f02f6 100644
--- a/cmake/jemalloc.cmake
+++ b/cmake/jemalloc.cmake
@@ -1,7 +1,7 @@
INCLUDE (CheckLibraryExists)
SET(WITH_JEMALLOC auto CACHE STRING
- "Build with jemalloc (possible values are 'yes', 'no', 'auto')")
+ "Build with jemalloc. Possible values are 'yes', 'no', 'auto'")
MACRO (CHECK_JEMALLOC)
# compatibility with old WITH_JEMALLOC values
@@ -18,8 +18,10 @@ MACRO (CHECK_JEMALLOC)
IF(WITH_JEMALLOC STREQUAL "static")
SET(libname jemalloc_pic)
SET(CMAKE_REQUIRED_LIBRARIES pthread dl m)
+ SET(what bundled)
ELSE()
SET(libname jemalloc)
+ SET(what system)
ENDIF()
CHECK_LIBRARY_EXISTS(${libname} malloc_stats_print "" HAVE_JEMALLOC)
@@ -27,6 +29,7 @@ MACRO (CHECK_JEMALLOC)
IF (HAVE_JEMALLOC)
SET(LIBJEMALLOC ${libname})
+ SET(MALLOC_LIBRARY "${what} jemalloc")
ELSEIF (NOT WITH_JEMALLOC STREQUAL "auto")
MESSAGE(FATAL_ERROR "${libname} is not found")
ENDIF()
diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake
index cca0032962d..8f85b988f8d 100644
--- a/cmake/libutils.cmake
+++ b/cmake/libutils.cmake
@@ -304,20 +304,22 @@ FUNCTION(GET_DEPENDEND_OS_LIBS target result)
SET(${result} ${ret} PARENT_SCOPE)
ENDFUNCTION()
-MACRO(RESTRICT_SYMBOL_EXPORTS target)
- SET(VISIBILITY_HIDDEN_FLAG)
+SET(VISIBILITY_HIDDEN_FLAG)
- IF(CMAKE_COMPILER_IS_GNUCXX AND UNIX)
- CHECK_C_COMPILER_FLAG("-fvisibility=hidden" HAVE_VISIBILITY_HIDDEN)
- IF(HAVE_VISIBILITY_HIDDEN)
- SET(VISIBILITY_HIDDEN_FLAG "-fvisibility=hidden")
- ENDIF()
+IF(CMAKE_COMPILER_IS_GNUCXX AND UNIX)
+ CHECK_C_COMPILER_FLAG("-fvisibility=hidden" HAVE_VISIBILITY_HIDDEN)
+ IF(HAVE_VISIBILITY_HIDDEN)
+ SET(VISIBILITY_HIDDEN_FLAG "-fvisibility=hidden")
ENDIF()
+ENDIF()
- IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
- SET(VISIBILITY_HIDDEN_FLAG "-xldscope=hidden")
- ENDIF()
+IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
+ SET(VISIBILITY_HIDDEN_FLAG "-xldscope=hidden")
+ENDIF()
+# We try to hide the symbols in yassl/zlib to avoid name clashes with
+# other libraries like openssl.
+FUNCTION(RESTRICT_SYMBOL_EXPORTS target)
IF(VISIBILITY_HIDDEN_FLAG)
GET_TARGET_PROPERTY(COMPILE_FLAGS ${target} COMPILE_FLAGS)
IF(NOT COMPILE_FLAGS)
@@ -327,5 +329,4 @@ MACRO(RESTRICT_SYMBOL_EXPORTS target)
SET_TARGET_PROPERTIES(${target} PROPERTIES
COMPILE_FLAGS "${COMPILE_FLAGS} ${VISIBILITY_HIDDEN_FLAG}")
ENDIF()
-
-ENDMACRO()
+ENDFUNCTION()
diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake
index 9c9ab8cca3b..874e05b8a43 100644
--- a/cmake/maintainer.cmake
+++ b/cmake/maintainer.cmake
@@ -18,7 +18,7 @@ INCLUDE(CheckCCompilerFlag)
# Setup GCC (GNU C compiler) warning options.
MACRO(SET_MYSQL_MAINTAINER_GNU_C_OPTIONS)
SET(MY_MAINTAINER_WARNINGS
- "-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing")
+ "-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -DFORCE_INIT_OF_VARS")
CHECK_C_COMPILER_FLAG("-Wno-missing-field-initializers"
HAVE_NO_MISSING_FIELD_INITIALIZERS)
@@ -44,7 +44,7 @@ ENDMACRO()
# Setup G++ (GNU C++ compiler) warning options.
MACRO(SET_MYSQL_MAINTAINER_GNU_CXX_OPTIONS)
SET(MY_MAINTAINER_CXX_WARNINGS
- "${MY_MAINTAINER_WARNINGS} -Wno-unused-parameter -Woverloaded-virtual"
+ "${MY_MAINTAINER_WARNINGS} -Wno-invalid-offsetof -Wno-unused-parameter -Woverloaded-virtual"
CACHE INTERNAL "C++ warning options used in maintainer builds.")
ENDMACRO()
diff --git a/cmake/mysql_add_executable.cmake b/cmake/mysql_add_executable.cmake
index b5f6b27abab..0c93fb179f5 100644
--- a/cmake/mysql_add_executable.cmake
+++ b/cmake/mysql_add_executable.cmake
@@ -1,56 +1,56 @@
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-# Add executable plus some additional MySQL specific stuff
-# Usage (same as for standard CMake's ADD_EXECUTABLE)
-#
-# MYSQL_ADD_EXECUTABLE(target source1...sourceN)
-#
-# MySQL specifics:
-# - instruct CPack to install executable under ${CMAKE_INSTALL_PREFIX}/bin directory
-# On Windows :
-# - add version resource
-# - instruct CPack to do autenticode signing if SIGNCODE is set
-
-INCLUDE(cmake_parse_arguments)
-
-FUNCTION (MYSQL_ADD_EXECUTABLE)
- # Pass-through arguments for ADD_EXECUTABLE
- MYSQL_PARSE_ARGUMENTS(ARG
- "WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION;COMPONENT"
- ""
- ${ARGN}
- )
- LIST(GET ARG_DEFAULT_ARGS 0 target)
- LIST(REMOVE_AT ARG_DEFAULT_ARGS 0)
-
- SET(sources ${ARG_DEFAULT_ARGS})
- ADD_VERSION_INFO(${target} EXECUTABLE sources)
- ADD_EXECUTABLE(${target} ${ARG_WIN32} ${ARG_MACOSX_BUNDLE} ${ARG_EXCLUDE_FROM_ALL} ${sources})
- # tell CPack where to install
- IF(NOT ARG_EXCLUDE_FROM_ALL)
- IF(NOT ARG_DESTINATION)
- SET(ARG_DESTINATION ${INSTALL_BINDIR})
- ENDIF()
- IF(ARG_COMPONENT)
- SET(COMP COMPONENT ${ARG_COMPONENT})
- ELSEIF(MYSQL_INSTALL_COMPONENT)
- SET(COMP COMPONENT ${MYSQL_INSTALL_COMPONENT})
- ELSE()
- SET(COMP COMPONENT Client)
- ENDIF()
- MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION} ${COMP})
- ENDIF()
-ENDFUNCTION()
+# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+#
+# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+# Add executable plus some additional MySQL specific stuff
+# Usage (same as for standard CMake's ADD_EXECUTABLE)
+#
+# MYSQL_ADD_EXECUTABLE(target source1...sourceN)
+#
+# MySQL specifics:
+# - instruct CPack to install executable under ${CMAKE_INSTALL_PREFIX}/bin directory
+# On Windows :
+# - add version resource
+# - instruct CPack to do autenticode signing if SIGNCODE is set
+
+INCLUDE(cmake_parse_arguments)
+
+FUNCTION (MYSQL_ADD_EXECUTABLE)
+ # Pass-through arguments for ADD_EXECUTABLE
+ MYSQL_PARSE_ARGUMENTS(ARG
+ "WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION;COMPONENT"
+ ""
+ ${ARGN}
+ )
+ LIST(GET ARG_DEFAULT_ARGS 0 target)
+ LIST(REMOVE_AT ARG_DEFAULT_ARGS 0)
+
+ SET(sources ${ARG_DEFAULT_ARGS})
+ ADD_VERSION_INFO(${target} EXECUTABLE sources)
+ ADD_EXECUTABLE(${target} ${ARG_WIN32} ${ARG_MACOSX_BUNDLE} ${ARG_EXCLUDE_FROM_ALL} ${sources})
+ # tell CPack where to install
+ IF(NOT ARG_EXCLUDE_FROM_ALL)
+ IF(NOT ARG_DESTINATION)
+ SET(ARG_DESTINATION ${INSTALL_BINDIR})
+ ENDIF()
+ IF(ARG_COMPONENT)
+ SET(COMP COMPONENT ${ARG_COMPONENT})
+ ELSEIF(MYSQL_INSTALL_COMPONENT)
+ SET(COMP COMPONENT ${MYSQL_INSTALL_COMPONENT})
+ ELSE()
+ SET(COMP COMPONENT Client)
+ ENDIF()
+ MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION} ${COMP})
+ ENDIF()
+ENDFUNCTION()
diff --git a/cmake/mysql_version.cmake b/cmake/mysql_version.cmake
index 7fa5240e324..f147f6ef2bf 100644
--- a/cmake/mysql_version.cmake
+++ b/cmake/mysql_version.cmake
@@ -49,7 +49,9 @@ MACRO(GET_MYSQL_VERSION)
MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_PATCH" PATCH_VERSION)
MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_EXTRA" EXTRA_VERSION)
- IF(NOT MAJOR_VERSION OR NOT MINOR_VERSION OR NOT PATCH_VERSION)
+IF(NOT "${MAJOR_VERSION}" MATCHES "[0-9]+" OR
+ NOT "${MINOR_VERSION}" MATCHES "[0-9]+" OR
+ NOT "${PATCH_VERSION}" MATCHES "[0-9]+")
MESSAGE(FATAL_ERROR "VERSION file cannot be parsed.")
ENDIF()
diff --git a/cmake/os/Windows.cmake b/cmake/os/Windows.cmake
index 16c2743aa4a..d52e36193ca 100644
--- a/cmake/os/Windows.cmake
+++ b/cmake/os/Windows.cmake
@@ -88,10 +88,6 @@ IF(MSVC)
STRING(REPLACE "/Zi" "/Z7" "${flag}" "${${flag}}")
ENDFOREACH()
- # Remove support for exceptions
- FOREACH(flag CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_INIT)
- STRING(REPLACE "/EHsc" "" "${flag}" "${${flag}}")
- ENDFOREACH()
# Fix CMake's predefined huge stack size
FOREACH(type EXE SHARED MODULE)
diff --git a/cmake/pcre.cmake b/cmake/pcre.cmake
new file mode 100644
index 00000000000..45d9bc01ddb
--- /dev/null
+++ b/cmake/pcre.cmake
@@ -0,0 +1,16 @@
+SET(WITH_PCRE "auto" CACHE STRING
+ "Which pcre to use (possible values are 'bundled', 'system', or 'auto')")
+
+MACRO (CHECK_PCRE)
+ IF(WITH_PCRE STREQUAL "system" OR WITH_PCRE STREQUAL "auto")
+ CHECK_LIBRARY_EXISTS(pcre pcre_stack_guard "" HAVE_PCRE)
+ ENDIF()
+ IF(NOT HAVE_PCRE)
+ IF (WITH_PCRE STREQUAL "system")
+ MESSAGE(FATAL_ERROR "system pcre is not found or unusable")
+ ENDIF()
+ SET(PCRE_INCLUDES ${CMAKE_BINARY_DIR}/pcre ${CMAKE_SOURCE_DIR}/pcre)
+ ADD_SUBDIRECTORY(pcre)
+ ENDIF()
+ENDMACRO()
+
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index 83f819836f8..51949ef6672 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -29,7 +29,7 @@ INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
MACRO(MYSQL_ADD_PLUGIN)
MYSQL_PARSE_ARGUMENTS(ARG
- "LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT"
+ "LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG"
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED"
${ARGN}
)
@@ -37,7 +37,7 @@ MACRO(MYSQL_ADD_PLUGIN)
# Add common include directories
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/sql
- ${CMAKE_SOURCE_DIR}/regex
+ ${PCRE_INCLUDES}
${SSL_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIR})
@@ -73,7 +73,8 @@ MACRO(MYSQL_ADD_PLUGIN)
AND NOT ARG_MODULE_ONLY)
SET(WITH_${plugin} 1)
- ELSEIF(WITHOUT_${plugin}_STORAGE_ENGINE OR WITH_NONE OR ${plugin}_DISABLED)
+ ELSEIF(WITHOUT_${plugin} OR WITHOUT_${plugin}_STORAGE_ENGINE OR
+ WITH_NONE OR ${plugin}_DISABLED)
SET(WITHOUT_${plugin} 1)
SET(WITH_${plugin}_STORAGE_ENGINE 0)
SET(WITH_${plugin} 0)
@@ -126,6 +127,7 @@ MACRO(MYSQL_ADD_PLUGIN)
IF(ARG_RECOMPILE_FOR_EMBEDDED OR NOT _SKIP_PIC)
# Recompile some plugins for embedded
ADD_CONVENIENCE_LIBRARY(${target}_embedded ${SOURCES})
+ RESTRICT_SYMBOL_EXPORTS(${target}_embedded)
DTRACE_INSTRUMENT(${target}_embedded)
IF(ARG_RECOMPILE_FOR_EMBEDDED)
SET_TARGET_PROPERTIES(${target}_embedded
@@ -154,12 +156,12 @@ MACRO(MYSQL_ADD_PLUGIN)
IF(ARG_MANDATORY)
SET (mysql_mandatory_plugins
- "${mysql_mandatory_plugins} builtin_maria_${target}_plugin,"
- PARENT_SCOPE)
+ "${mysql_mandatory_plugins} builtin_maria_${target}_plugin,")
+ SET (mysql_mandatory_plugins ${mysql_mandatory_plugins} PARENT_SCOPE)
ELSE()
SET (mysql_optional_plugins
- "${mysql_optional_plugins} builtin_maria_${target}_plugin,"
- PARENT_SCOPE)
+ "${mysql_optional_plugins} builtin_maria_${target}_plugin,")
+ SET (mysql_optional_plugins ${mysql_optional_plugins} PARENT_SCOPE)
ENDIF()
ELSEIF(NOT WITHOUT_${plugin} AND NOT ARG_STATIC_ONLY AND NOT WITHOUT_DYNAMIC_PLUGINS)
@@ -191,14 +193,20 @@ MACRO(MYSQL_ADD_PLUGIN)
OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}")
# Install dynamic library
IF(ARG_COMPONENT)
- IF(RPM AND NOT CPACK_COMPONENTS_ALL MATCHES ${ARG_COMPONENT})
+ IF(CPACK_COMPONENTS_ALL AND NOT CPACK_COMPONENTS_ALL MATCHES ${ARG_COMPONENT})
SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} ${ARG_COMPONENT} PARENT_SCOPE)
- SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB-server" PARENT_SCOPE)
+ SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB" PARENT_SCOPE)
+
+ IF (NOT ARG_CONFIG)
+ SET(ARG_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/${target}.cnf")
+ FILE(WRITE ${ARG_CONFIG} "[mariadb]\nplugin-load-add=${ARG_MODULE_OUTPUT_NAME}.so\n")
+ ENDIF()
+ INSTALL(FILES ${ARG_CONFIG} COMPONENT ${ARG_COMPONENT} DESTINATION ${INSTALL_SYSCONF2DIR})
# workarounds for cmake issues #13248 and #12864:
- SET(CPACK_RPM_${ARG_COMPONENT}_USER_FILELIST ${ignored} PARENT_SCOPE)
SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_PROVIDES "cmake_bug_13248" PARENT_SCOPE)
SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_OBSOLETES "cmake_bug_13248" PARENT_SCOPE)
+ SET(CPACK_RPM_${ARG_COMPONENT}_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*" PARENT_SCOPE)
ENDIF()
ELSE()
SET(ARG_COMPONENT Server)
diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake
index ca950229129..2a8d1f17fbc 100644
--- a/cmake/ssl.cmake
+++ b/cmake/ssl.cmake
@@ -13,80 +13,227 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+# We support different versions of SSL:
+# - "bundled" uses source code in <source dir>/extra/yassl
+# - "system" (typically) uses headers/libraries in /usr/lib and /usr/lib64
+# - a custom installation of openssl can be used like this
+# - cmake -DCMAKE_PREFIX_PATH=</path/to/custom/openssl> -DWITH_SSL="system"
+# or
+# - cmake -DWITH_SSL=</path/to/custom/openssl>
+#
+# The default value for WITH_SSL is "bundled"
+# set in cmake/build_configurations/feature_set.cmake
+#
+# For custom build/install of openssl, see the accompanying README and
+# INSTALL* files. When building with gcc, you must build the shared libraries
+# (in addition to the static ones):
+# ./config --prefix=</path/to/custom/openssl> --shared; make; make install
+# On some platforms (mac) you need to choose 32/64 bit architecture.
+# Build/Install of openssl on windows is slightly different: you need to run
+# perl and nmake. You might also need to
+# 'set path=</path/to/custom/openssl>\bin;%PATH%
+# in order to find the .dll files at runtime.
+
+SET(WITH_SSL_DOC "bundled (use yassl)")
+SET(WITH_SSL_DOC
+ "${WITH_SSL_DOC}, yes (prefer os library if present, otherwise use bundled)")
+SET(WITH_SSL_DOC
+ "${WITH_SSL_DOC}, system (use os library)")
+SET(WITH_SSL_DOC
+ "${WITH_SSL_DOC}, </path/to/custom/installation>")
+
MACRO (CHANGE_SSL_SETTINGS string)
- SET(WITH_SSL ${string} CACHE STRING "Options are: no bundled yes(prefer os library if present otherwise use bundled) system(use os library)" FORCE)
+ SET(WITH_SSL ${string} CACHE STRING ${WITH_SSL_DOC} FORCE)
ENDMACRO()
MACRO (MYSQL_USE_BUNDLED_SSL)
SET(INC_DIRS
- ${CMAKE_SOURCE_DIR}/extra/yassl/include
- ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/include
+ ${CMAKE_SOURCE_DIR}/extra/yassl/include
+ ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/include
)
SET(SSL_LIBRARIES yassl taocrypt)
SET(SSL_INCLUDE_DIRS ${INC_DIRS})
SET(SSL_INTERNAL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL)
- SET(SSL_DEFINES "-DHAVE_YASSL -DYASSL_PURE_C -DYASSL_PREFIX -DHAVE_OPENSSL -DMULTI_THREADED")
+ SET(SSL_DEFINES "-DHAVE_YASSL -DYASSL_PREFIX -DHAVE_OPENSSL -DMULTI_THREADED")
CHANGE_SSL_SETTINGS("bundled")
- #Remove -fno-implicit-templates
- #(yassl sources cannot be compiled with it)
- SET(SAVE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
- IF(CMAKE_CXX_FLAGS)
- STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS
- ${CMAKE_CXX_FLAGS})
- ENDIF()
ADD_SUBDIRECTORY(extra/yassl)
ADD_SUBDIRECTORY(extra/yassl/taocrypt)
- SET(CMAKE_CXX_FLAGS ${SAVE_CXX_FLAGS})
GET_TARGET_PROPERTY(src yassl SOURCES)
FOREACH(file ${src})
SET(SSL_SOURCES ${SSL_SOURCES} ${CMAKE_SOURCE_DIR}/extra/yassl/${file})
ENDFOREACH()
GET_TARGET_PROPERTY(src taocrypt SOURCES)
FOREACH(file ${src})
- SET(SSL_SOURCES ${SSL_SOURCES} ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/${file})
+ SET(SSL_SOURCES ${SSL_SOURCES}
+ ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/${file})
ENDFOREACH()
ENDMACRO()
# MYSQL_CHECK_SSL
#
# Provides the following configure options:
-# WITH_SSL=[yes|no|bundled]
+# WITH_SSL=[yes|bundled|system|<path/to/custom/installation>]
MACRO (MYSQL_CHECK_SSL)
IF(NOT WITH_SSL)
IF(WIN32)
CHANGE_SSL_SETTINGS("bundled")
ELSE()
- CHANGE_SSL_SETTINGS("no")
+ SET(WITH_SSL "yes")
ENDIF()
ENDIF()
+ # See if WITH_SSL is of the form </path/to/custom/installation>
+ FILE(GLOB WITH_SSL_HEADER ${WITH_SSL}/include/openssl/ssl.h)
+ IF (WITH_SSL_HEADER)
+ SET(WITH_SSL_PATH ${WITH_SSL} CACHE PATH "path to custom SSL installation")
+ ENDIF()
+
IF(WITH_SSL STREQUAL "bundled")
MYSQL_USE_BUNDLED_SSL()
- ELSEIF(WITH_SSL STREQUAL "system" OR WITH_SSL STREQUAL "yes")
- # Check for system library
- SET(OPENSSL_FIND_QUIETLY TRUE)
- INCLUDE(FindOpenSSL)
- FIND_LIBRARY(CRYPTO_LIBRARY crypto)
- MARK_AS_ADVANCED(CRYPTO_LIBRARY)
+ # Reset some variables, in case we switch from /path/to/ssl to "bundled".
+ IF (WITH_SSL_PATH)
+ UNSET(WITH_SSL_PATH)
+ UNSET(WITH_SSL_PATH CACHE)
+ ENDIF()
+ IF (OPENSSL_ROOT_DIR)
+ UNSET(OPENSSL_ROOT_DIR)
+ UNSET(OPENSSL_ROOT_DIR CACHE)
+ ENDIF()
+ IF (OPENSSL_INCLUDE_DIR)
+ UNSET(OPENSSL_INCLUDE_DIR)
+ UNSET(OPENSSL_INCLUDE_DIR CACHE)
+ ENDIF()
+ IF (WIN32 AND OPENSSL_APPLINK_C)
+ UNSET(OPENSSL_APPLINK_C)
+ UNSET(OPENSSL_APPLINK_C CACHE)
+ ENDIF()
+ IF (OPENSSL_LIBRARIES)
+ UNSET(OPENSSL_LIBRARIES)
+ UNSET(OPENSSL_LIBRARIES CACHE)
+ ENDIF()
+ ELSEIF(WITH_SSL STREQUAL "system" OR
+ WITH_SSL STREQUAL "yes" OR
+ WITH_SSL_PATH
+ )
+ # First search in WITH_SSL_PATH.
+ FIND_PATH(OPENSSL_ROOT_DIR
+ NAMES include/openssl/ssl.h
+ NO_CMAKE_PATH
+ NO_CMAKE_ENVIRONMENT_PATH
+ HINTS ${WITH_SSL_PATH}
+ )
+ # Then search in standard places (if not found above).
+ FIND_PATH(OPENSSL_ROOT_DIR
+ NAMES include/openssl/ssl.h
+ )
+
+ FIND_PATH(OPENSSL_INCLUDE_DIR
+ NAMES openssl/ssl.h
+ HINTS ${OPENSSL_ROOT_DIR}/include
+ )
+
+ IF (WIN32)
+ FIND_FILE(OPENSSL_APPLINK_C
+ NAMES openssl/applink.c
+ HINTS ${OPENSSL_ROOT_DIR}/include
+ )
+ MESSAGE(STATUS "OPENSSL_APPLINK_C ${OPENSSL_APPLINK_C}")
+ ENDIF()
+
+ # On mac this list is <.dylib;.so;.a>
+ # We prefer static libraries, so we revert it here.
+ IF (WITH_SSL_PATH)
+ LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
+ ENDIF()
+ MESSAGE(STATUS "suffixes <${CMAKE_FIND_LIBRARY_SUFFIXES}>")
+ FIND_LIBRARY(OPENSSL_LIBRARIES
+ NAMES ssl ssleay32 ssleay32MD
+ HINTS ${OPENSSL_ROOT_DIR}/lib)
+ FIND_LIBRARY(CRYPTO_LIBRARY
+ NAMES crypto libeay32
+ HINTS ${OPENSSL_ROOT_DIR}/lib)
+ IF (WITH_SSL_PATH)
+ LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
+ ENDIF()
+
+ # Verify version number. Version information looks like:
+ # #define OPENSSL_VERSION_NUMBER 0x1000103fL
+ # Encoded as MNNFFPPS: major minor fix patch status
+ FILE(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h"
+ OPENSSL_VERSION_NUMBER
+ REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x[0-9].*"
+ )
+ STRING(REGEX REPLACE
+ "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9]).*$" "\\1"
+ OPENSSL_MAJOR_VERSION "${OPENSSL_VERSION_NUMBER}"
+ )
+
+ IF(OPENSSL_INCLUDE_DIR AND
+ OPENSSL_LIBRARIES AND
+ CRYPTO_LIBRARY
+ )
+ SET(OPENSSL_FOUND TRUE)
+ ELSE()
+ SET(OPENSSL_FOUND FALSE)
+ ENDIF()
+
+ MESSAGE(STATUS "OPENSSL_INCLUDE_DIR = ${OPENSSL_INCLUDE_DIR}")
+ MESSAGE(STATUS "OPENSSL_LIBRARIES = ${OPENSSL_LIBRARIES}")
+ MESSAGE(STATUS "CRYPTO_LIBRARY = ${CRYPTO_LIBRARY}")
+ MESSAGE(STATUS "OPENSSL_MAJOR_VERSION = ${OPENSSL_MAJOR_VERSION}")
+
INCLUDE(CheckSymbolExists)
SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
CHECK_SYMBOL_EXISTS(SHA512_DIGEST_LENGTH "openssl/sha.h"
HAVE_SHA512_DIGEST_LENGTH)
- SET(CMAKE_REQUIRED_INCLUDES)
- IF(OPENSSL_FOUND AND CRYPTO_LIBRARY AND HAVE_SHA512_DIGEST_LENGTH)
+ IF(OPENSSL_FOUND AND HAVE_SHA512_DIGEST_LENGTH)
SET(SSL_SOURCES "")
SET(SSL_LIBRARIES ${OPENSSL_LIBRARIES} ${CRYPTO_LIBRARY})
+ IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
+ SET(SSL_LIBRARIES ${SSL_LIBRARIES} ${LIBSOCKET})
+ ENDIF()
+ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
+ SET(SSL_LIBRARIES ${SSL_LIBRARIES} ${LIBDL})
+ ENDIF()
+ MESSAGE(STATUS "SSL_LIBRARIES = ${SSL_LIBRARIES}")
SET(SSL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
SET(SSL_INTERNAL_INCLUDE_DIRS "")
SET(SSL_DEFINES "-DHAVE_OPENSSL")
- CHANGE_SSL_SETTINGS("system")
ELSE()
IF(WITH_SSL STREQUAL "system")
MESSAGE(SEND_ERROR "Cannot find appropriate system libraries for SSL. Use WITH_SSL=bundled to enable SSL support")
ENDIF()
MYSQL_USE_BUNDLED_SSL()
ENDIF()
- ELSEIF(NOT WITH_SSL STREQUAL "no")
- MESSAGE(SEND_ERROR "Wrong option for WITH_SSL. Valid values are : yes, no, bundled")
+ ELSE()
+ MESSAGE(SEND_ERROR
+ "Wrong option for WITH_SSL. Valid values are: ${WITH_SSL_DOC}")
+ ENDIF()
+ENDMACRO()
+
+
+# Many executables will depend on libeay32.dll and ssleay32.dll at runtime.
+# In order to ensure we find the right version(s), we copy them into
+# the same directory as the executables.
+# NOTE: Using dlls will likely crash in malloc/free,
+# see INSTALL.W32 which comes with the openssl sources.
+# So we should be linking static versions of the libraries.
+MACRO (COPY_OPENSSL_DLLS target_name)
+ IF (WIN32 AND WITH_SSL_PATH)
+ GET_FILENAME_COMPONENT(CRYPTO_NAME "${CRYPTO_LIBRARY}" NAME_WE)
+ GET_FILENAME_COMPONENT(OPENSSL_NAME "${OPENSSL_LIBRARIES}" NAME_WE)
+ FILE(GLOB HAVE_CRYPTO_DLL "${WITH_SSL_PATH}/bin/${CRYPTO_NAME}.dll")
+ FILE(GLOB HAVE_OPENSSL_DLL "${WITH_SSL_PATH}/bin/${OPENSSL_NAME}.dll")
+ IF (HAVE_CRYPTO_DLL AND HAVE_OPENSSL_DLL)
+ ADD_CUSTOM_COMMAND(OUTPUT ${target_name}
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "${WITH_SSL_PATH}/bin/${CRYPTO_NAME}.dll"
+ "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${CRYPTO_NAME}.dll"
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "${WITH_SSL_PATH}/bin/${OPENSSL_NAME}.dll"
+ "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${OPENSSL_NAME}.dll"
+ )
+ ADD_CUSTOM_TARGET(${target_name} ALL)
+ ENDIF()
ENDIF()
ENDMACRO()
diff --git a/cmake/versioninfo.rc.in b/cmake/versioninfo.rc.in
index 6eb853936d2..cd880b917e0 100644
--- a/cmake/versioninfo.rc.in
+++ b/cmake/versioninfo.rc.in
@@ -1,38 +1,38 @@
-// Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
-//
-// 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-#include <windows.h>
-VS_VERSION_INFO VERSIONINFO
-FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,@TINY_VERSION@
-PRODUCTVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,@TINY_VERSION@
-FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
-FILEFLAGS 0
-FILEOS VOS__WINDOWS32
-FILETYPE @FILETYPE@
-FILESUBTYPE VFT2_UNKNOWN
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904E4"
- BEGIN
- VALUE "FileVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.@TINY_VERSION@\0"
- VALUE "ProductVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.@TINY_VERSION@\0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1252
- END
-END
+// Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+//
+// 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+#include <windows.h>
+VS_VERSION_INFO VERSIONINFO
+FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,@TINY_VERSION@
+PRODUCTVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,@TINY_VERSION@
+FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+FILEFLAGS 0
+FILEOS VOS__WINDOWS32
+FILETYPE @FILETYPE@
+FILESUBTYPE VFT2_UNKNOWN
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4"
+ BEGIN
+ VALUE "FileVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.@TINY_VERSION@\0"
+ VALUE "ProductVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.@TINY_VERSION@\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1252
+ END
+END
diff --git a/cmake/zlib.cmake b/cmake/zlib.cmake
index c70d0e29ecf..03d2c542ba4 100644
--- a/cmake/zlib.cmake
+++ b/cmake/zlib.cmake
@@ -50,7 +50,6 @@ MACRO (MYSQL_CHECK_ZLIB_WITH_COMPRESS)
IF(WITH_ZLIB STREQUAL "bundled")
MYSQL_USE_BUNDLED_ZLIB()
ELSE()
- SET(ZLIB_FIND_QUIETLY TRUE)
INCLUDE(FindZLIB)
IF(ZLIB_FOUND)
INCLUDE(CheckFunctionExists)
@@ -60,7 +59,6 @@ MACRO (MYSQL_CHECK_ZLIB_WITH_COMPRESS)
CHECK_FUNCTION_EXISTS(deflateBound HAVE_DEFLATEBOUND)
SET(CMAKE_REQUIRED_LIBRARIES)
IF(HAVE_CRC32 AND HAVE_COMPRESSBOUND AND HAVE_DEFLATEBOUND)
- SET(ZLIB_LIBRARY z CACHE INTERNAL "System zlib library")
SET(WITH_ZLIB "system" CACHE STRING
"Which zlib to use (possible values are 'bundled' or 'system')")
SET(ZLIB_SOURCES "")