diff options
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/configure.pl | 10 | ||||
-rw-r--r-- | cmake/cpack_rpm.cmake | 19 | ||||
-rw-r--r-- | cmake/install_macros.cmake | 30 | ||||
-rw-r--r-- | cmake/os/FreeBSD.cmake | 6 | ||||
-rw-r--r-- | cmake/os/WindowsCache.cmake | 1 | ||||
-rw-r--r-- | cmake/package_name.cmake | 2 | ||||
-rw-r--r-- | cmake/plugin.cmake | 10 | ||||
-rw-r--r-- | cmake/wsrep.cmake | 64 | ||||
-rw-r--r-- | cmake/wsrep.cmake.moved | 59 |
9 files changed, 188 insertions, 13 deletions
diff --git a/cmake/configure.pl b/cmake/configure.pl index a71795a3bc8..9e4aafdc05e 100644 --- a/cmake/configure.pl +++ b/cmake/configure.pl @@ -216,6 +216,16 @@ foreach my $option (@ARGV) $cmakeargs = $cmakeargs." -DMYSQL_DATADIR=".substr($option,14); next; } + if ($option =~ /layout=/) + { + $cmakeargs = $cmakeargs." -DINSTALL_LAYOUT=".substr($option,7); + next; + } + if ($option =~ /with-unix-socket-path=/) + { + $cmakeargs = $cmakeargs." -DMYSQL_UNIX_ADDR=".substr($option,22); + next; + } if ($option =~ /mysql-maintainer-mode/) { $cmakeargs = $cmakeargs." -DMYSQL_MAINTAINER_MODE=" . diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake index fa7c563e57d..174548502d8 100644 --- a/cmake/cpack_rpm.cmake +++ b/cmake/cpack_rpm.cmake @@ -24,11 +24,8 @@ SET(CPACK_COMPONENT_COMMON_GROUP "common") SET(CPACK_COMPONENT_CLIENTPLUGINS_GROUP "common") SET(CPACK_COMPONENT_COMPAT_GROUP "compat") SET(CPACK_COMPONENTS_ALL Server ManPagesServer IniFiles Server_Scripts - SupportFiles Development ManPagesDevelopment - ManPagesTest Readme ManPagesClient Test - Common Client SharedLibraries ClientPlugins) - -SET(CPACK_RPM_PACKAGE_NAME "MariaDB") + SupportFiles Readme Test) +SET(CPACK_RPM_PACKAGE_NAME "MariaDB-Galera") SET(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${VERSION}-${RPM}-${CMAKE_SYSTEM_PROCESSOR}") SET(CPACK_RPM_PACKAGE_RELEASE "1%{?dist}") @@ -126,9 +123,15 @@ SETA(CPACK_RPM_server_PACKAGE_OBSOLETES SETA(CPACK_RPM_server_PACKAGE_PROVIDES "MariaDB" "MySQL" + "MariaDB-server" + "mariadb-server" "MySQL-server" "msqlormysql" "mysql-server") +SETA(CPACK_RPM_server_PACKAGE_REQUIRES + "${CPACK_RPM_PACKAGE_REQUIRES}" + "MariaDB-client" "galera" "rsync" "lsof" "grep" "gawk" "iproute" + "coreutils" "findutils" "tar") SETA(CPACK_RPM_shared_PACKAGE_OBSOLETES "mysql-shared" @@ -148,10 +151,8 @@ SETA(CPACK_RPM_test_PACKAGE_OBSOLETES "MySQL-OurDelta-test") SETA(CPACK_RPM_test_PACKAGE_PROVIDES "MySQL-test") - -SETA(CPACK_RPM_server_PACKAGE_REQUIRES - ${CPACK_RPM_PACKAGE_REQUIRES} - "MariaDB-client") +SET(CPACK_RPM_test_PACKAGE_CONFLICTS + "MariaDB-test") 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/install_macros.cmake b/cmake/install_macros.cmake index 15e2dc4930b..e16467619c7 100644 --- a/cmake/install_macros.cmake +++ b/cmake/install_macros.cmake @@ -13,8 +13,33 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +if(APPLE) + LIST(APPEND CMAKE_CXX_LINK_EXECUTABLE "dsymutil <TARGET>") + LIST(APPEND CMAKE_C_LINK_EXECUTABLE "dsymutil <TARGET>") + LIST(APPEND CMAKE_CXX_CREATE_SHARED_LIBRARY "dsymutil <TARGET>") + LIST(APPEND CMAKE_C_CREATE_SHARED_LIBRARY "dsymutil <TARGET>") + LIST(APPEND CMAKE_CXX_CREATE_SHARED_MODULE "dsymutil <TARGET>") + LIST(APPEND CMAKE_C_CREATE_SHARED_MODULE "dsymutil <TARGET>") +ENDIF() + GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake) +MACRO (INSTALL_DSYM_DIRECTORIES targets) + IF(APPLE) + FOREACH(target ${targets}) + GET_TARGET_PROPERTY(location ${target} LOCATION) + GET_TARGET_PROPERTY(type ${target} TYPE) + # It's a dirty hack, but cmake too stupid and mysql cmake files too buggy */ + STRING(REPLACE "liblibmysql.dylib" "libmysqlclient.${SHARED_LIB_MAJOR_VERSION}.dylib" location ${location}) + IF(DEBUG_EXTNAME) + STRING(REGEX REPLACE "/mysqld$" "/mysqld-debug" location ${location}) + ENDIF() + IF(type MATCHES "EXECUTABLE" OR type MATCHES "MODULE" OR type MATCHES "SHARED_LIBRARY") + INSTALL(DIRECTORY "${location}.dSYM" DESTINATION ${ARG_DESTINATION} COMPONENT Debuginfo) + ENDIF() + ENDFOREACH() + ENDIF() +ENDMACRO() FUNCTION (INSTALL_DEBUG_SYMBOLS) IF(MSVC) @@ -157,9 +182,9 @@ FUNCTION(INSTALL_DOCUMENTATION) ENDIF() IF(RPM) - SET(destination "${destination}/MariaDB-${group}-${VERSION}") + SET(destination "${destination}/MariaDB-Galera-${group}-${VERSION}") ELSEIF(DEB) - SET(destination "${destination}/mariadb-${group}-${MAJOR_VERSION}.${MINOR_VERSION}") + SET(destination "${destination}/mariadb-galera-${group}-${MAJOR_VERSION}.${MINOR_VERSION}") ENDIF() INSTALL(FILES ${files} DESTINATION ${destination} COMPONENT ${ARG_COMPONENT}) @@ -288,6 +313,7 @@ FUNCTION(MYSQL_INSTALL_TARGETS) INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION} ${COMP}) INSTALL_DEBUG_SYMBOLS(${TARGETS} ${COMP} INSTALL_LOCATION ${ARG_DESTINATION}) + INSTALL_DSYM_DIRECTORIES("${TARGETS}") ENDFUNCTION() diff --git a/cmake/os/FreeBSD.cmake b/cmake/os/FreeBSD.cmake index ffb89c81206..28c3a3aad98 100644 --- a/cmake/os/FreeBSD.cmake +++ b/cmake/os/FreeBSD.cmake @@ -33,3 +33,9 @@ IF(EXECINFO) SET(LIBEXECINFO ${EXECINFO}) ENDIF() +<<<<<<< TREE +======= + +SET(HAVE_SYS_TIMEB_H CACHE INTERNAL "") + +>>>>>>> MERGE-SOURCE diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake index 2808a6f749f..b36978a4604 100644 --- a/cmake/os/WindowsCache.cmake +++ b/cmake/os/WindowsCache.cmake @@ -76,6 +76,7 @@ SET(HAVE_FSYNC CACHE INTERNAL "") SET(HAVE_FTIME 1 CACHE INTERNAL "") SET(HAVE_FTRUNCATE CACHE INTERNAL "") SET(HAVE_GETADDRINFO 1 CACHE INTERNAL "") +SET(HAVE_GETIFADDRS CACHE INTERNAL "") SET(HAVE_GETCWD 1 CACHE INTERNAL "") SET(HAVE_GETHOSTBYADDR_R CACHE INTERNAL "") SET(HAVE_GETHRTIME CACHE INTERNAL "") diff --git a/cmake/package_name.cmake b/cmake/package_name.cmake index 4ba8fc18e3f..87db39d68d4 100644 --- a/cmake/package_name.cmake +++ b/cmake/package_name.cmake @@ -123,7 +123,7 @@ IF(NOT VERSION) ELSEIF(MYSQL_SERVER_SUFFIX) SET(PRODUCT_TAG "${MYSQL_SERVER_SUFFIX}") # Already has a leading dash ELSE() - SET(PRODUCT_TAG) + SET(PRODUCT_TAG "-galera") ENDIF() IF("${VERSION}" MATCHES "-ndb-") diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index e1d2af2add6..826350e076e 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -193,7 +193,15 @@ 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}) + # CPACK_COMPONENTS_ALL contains a list of components for which the + # packages would be generated (defined with the initial list under + # cpack_rpm.cmake and cpack_deb.cmake). The following lines would + # append the current component to this list if it is already not present. + # We should avoid this for wsrep builds (WITH_WSREP) as with wsrep build + # only server package is required to be generated. + IF(CPACK_COMPONENTS_ALL AND + NOT CPACK_COMPONENTS_ALL MATCHES ${ARG_COMPONENT} AND + NOT WITH_WSREP) IF (ARG_STORAGE_ENGINE) SET(ver " = %{version}-%{release}") ENDIF() diff --git a/cmake/wsrep.cmake b/cmake/wsrep.cmake new file mode 100644 index 00000000000..61e41778166 --- /dev/null +++ b/cmake/wsrep.cmake @@ -0,0 +1,64 @@ +# 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 "13") + +# MariaDB addition: Revision number of the last revision merged from +# codership branch visible in @@visible_comment. +# Branch : https://github.com/codership/mysql-wsrep/tree/5.6 +SET(WSREP_PATCH_REVNO "af7f02e") # 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() + +OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ON) +IF (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) +ENDIF() + +# diff --git a/cmake/wsrep.cmake.moved b/cmake/wsrep.cmake.moved new file mode 100644 index 00000000000..608b33b31a1 --- /dev/null +++ b/cmake/wsrep.cmake.moved @@ -0,0 +1,59 @@ +# Copyright (c) 2011, Codership Oy <info@codership.com>. +# +# 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 "7.5") + +# Obtain patch revision number +SET(WSREP_PATCH_REVNO $ENV{WSREP_REV}) +IF(NOT WSREP_PATCH_REVNO) + EXECUTE_PROCESS( + COMMAND bzr revno + OUTPUT_VARIABLE WSREP_PATCH_REVNO + RESULT_VARIABLE RESULT + ) +STRING(REGEX REPLACE "(\r?\n)+$" "" WSREP_PATCH_REVNO "${WSREP_PATCH_REVNO}") +#FILE(WRITE "wsrep_config" "Debug: WSREP_PATCH_REVNO result: ${RESULT}\n") +ENDIF() +IF(NOT WSREP_PATCH_REVNO) + SET(WSREP_PATCH_REVNO "XXXX") +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}") + +SET(WSREP_VERSION + "${WSREP_API_VERSION}.${WSREP_PATCH_VERSION}.r${WSREP_PATCH_REVNO}" +) + +OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" ON) +IF (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) +ENDIF() + +# |