diff options
author | Jan Lindström <jan.lindstrom@skysql.com> | 2014-08-06 15:39:15 +0300 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@skysql.com> | 2014-08-26 15:43:46 +0300 |
commit | df4dd593f29aec8e2116aec1775ad4b8833d8c93 (patch) | |
tree | becae67f02054e15ead58e929e91c044f0b7aa15 /cmake | |
parent | e974b564389af8251c2ba51060e6129e45431586 (diff) | |
download | mariadb-git-df4dd593f29aec8e2116aec1775ad4b8833d8c93.tar.gz |
MDEV-6247: Merge 10.0-galera to 10.1.
Merged lp:maria/maria-10.0-galera up to revision 3879.
Added a new functions to handler API to forcefully abort_transaction,
producing fake_trx_id, get_checkpoint and set_checkpoint for XA. These
were added for future possiblity to add more storage engines that
could use galera replication.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/cpack_rpm.cmake | 7 | ||||
-rw-r--r-- | cmake/plugin.cmake | 22 | ||||
-rw-r--r-- | cmake/wsrep.cmake | 76 |
3 files changed, 100 insertions, 5 deletions
diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake index 30924120526..d8f659ec5ea 100644 --- a/cmake/cpack_rpm.cmake +++ b/cmake/cpack_rpm.cmake @@ -147,9 +147,10 @@ SETA(CPACK_RPM_test_PACKAGE_OBSOLETES SETA(CPACK_RPM_test_PACKAGE_PROVIDES "MySQL-test") -SETA(CPACK_RPM_server_PACKAGE_REQUIRES - ${CPACK_RPM_PACKAGE_REQUIRES} - "MariaDB-client") +SETA(CPACK_RPM_server_PACKAGE_REQUIRES + "${CPACK_RPM_PACKAGE_REQUIRES}" + "MariaDB-client" "galera" "rsync" "lsof" "socat" "grep" "gawk" "iproute" + "coreutils" "findutils") SET(CPACK_RPM_server_PRE_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-prein.sh) SET(CPACK_RPM_server_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-preun.sh) diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index b550695b796..2dc88782937 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -153,6 +153,14 @@ MACRO(MYSQL_ADD_PLUGIN) ADD_DEPENDENCIES(${target}_embedded GenError) ENDIF() ENDIF() + + IF (WITH_WSREP) + # Set compile definitions for non-embedded plugins + LIST(APPEND wsrep_definitions "WITH_WSREP") + LIST(APPEND wsrep_definitions "WSREP_PROC_INFO") + SET_TARGET_PROPERTIES(${target} PROPERTIES + COMPILE_DEFINITIONS "${wsrep_definitions}") + ENDIF() IF(ARG_STATIC_OUTPUT_NAME) SET_TARGET_PROPERTIES(${target} PROPERTIES @@ -185,8 +193,17 @@ MACRO(MYSQL_ADD_PLUGIN) ADD_VERSION_INFO(${target} MODULE SOURCES) ADD_LIBRARY(${target} MODULE ${SOURCES}) DTRACE_INSTRUMENT(${target}) + + LIST(APPEND dyn_compile_definitions "MYSQL_DYNAMIC_PLUGIN") + + IF (WITH_WSREP) + LIST(APPEND dyn_compile_definitions "WITH_WSREP") + LIST(APPEND dyn_compile_definitions "WSREP_PROC_INFO") + ENDIF() + SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX "" - COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN") + COMPILE_DEFINITIONS "${dyn_compile_definitions}") + TARGET_LINK_LIBRARIES (${target} mysqlservices ${ARG_LINK_LIBRARIES}) # Plugin uses symbols defined in mysqld executable. @@ -207,7 +224,8 @@ MACRO(MYSQL_ADD_PLUGIN) OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}") # Install dynamic library IF(ARG_COMPONENT) - IF(CPACK_COMPONENTS_ALL 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) diff --git a/cmake/wsrep.cmake b/cmake/wsrep.cmake new file mode 100644 index 00000000000..7dc797e9a05 --- /dev/null +++ b/cmake/wsrep.cmake @@ -0,0 +1,76 @@ +# Copyright (c) 2011, Codership Oy <info@codership.com>. +# Copyright (c) 2013, Monty Program Ab. +# +# 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 + +# We need to generate a proper spec file even without --with-wsrep flag, +# so WSREP_VERSION is produced regardless + +# Set the patch version +SET(WSREP_PATCH_VERSION "10") + +# MariaDB addition: Revision number of the last revision merged from +# codership branch visible in @@visible_comment. +# Branch : codership-mysql/5.6 +SET(WSREP_PATCH_REVNO "4123") # Should be updated on every merge. + +# MariaDB addition: Revision number of the last revision merged from +# Branch : lp:maria/maria-10.0-galera +SET(WSREP_PATCH_REVNO2 "3867") # Should be updated on every merge. + +# MariaDB: Obtain patch revision number: +# Update WSREP_PATCH_REVNO if WSREP_REV environment variable is set. +IF (DEFINED ENV{WSREP_REV}) + SET(WSREP_PATCH_REVNO $ENV{WSREP_REV}) +ENDIF() + +# Obtain wsrep API version +EXECUTE_PROCESS( + COMMAND sh -c "grep WSREP_INTERFACE_VERSION ${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h | cut -d '\"' -f 2" + OUTPUT_VARIABLE WSREP_API_VERSION + RESULT_VARIABLE RESULT +) +#FILE(WRITE "wsrep_config" "Debug: WSREP_API_VERSION result: ${RESULT}\n") +STRING(REGEX REPLACE "(\r?\n)+$" "" WSREP_API_VERSION "${WSREP_API_VERSION}") + +IF(NOT WSREP_PATCH_REVNO) + MESSAGE(WARNING "Could not determine bzr revision number, WSREP_VERSION will " + "not contain the revision number.") + SET(WSREP_VERSION + "${WSREP_API_VERSION}.${WSREP_PATCH_VERSION}" + ) +ELSE() + SET(WSREP_VERSION + "${WSREP_API_VERSION}.${WSREP_PATCH_VERSION}.r${WSREP_PATCH_REVNO}" + ) +ENDIF() + +# +# Galera library does not compile with windows and solaris +# +IF(UNIX) +OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ON) +ELSE() +OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" OFF) +ENDIF() + +MACRO (BUILD_WITH_WSREP) + SET(WSREP_C_FLAGS "-DWITH_WSREP -DWSREP_PROC_INFO -DMYSQL_MAX_VARIABLE_VALUE_LEN=2048") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WSREP_C_FLAGS}") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WSREP_C_FLAGS}") + SET(COMPILATION_COMMENT "${COMPILATION_COMMENT}, wsrep_${WSREP_VERSION}") + #SET(WITH_EMBEDDED_SERVER OFF CACHE INTERNAL "" FORCE) +ENDMACRO() + +# |