#At file:///data0/magnus/mysql/7.0/ based on revid:magnus.blaudd@stripped
4360 Magnus Blåudd 2011-05-06 [merge]
Merge
modified:
storage/ndb/CMakeLists.txt
storage/ndb/include/CMakeLists.txt
=== modified file 'storage/ndb/CMakeLists.txt'
--- a/storage/ndb/CMakeLists.txt 2011-03-28 08:11:37 +0000
+++ b/storage/ndb/CMakeLists.txt 2011-05-03 09:37:35 +0000
@@ -17,6 +17,41 @@
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
${CMAKE_SOURCE_DIR}/cmake
${CMAKE_SOURCE_DIR}/storage/ndb/cmake)
+
+# Check if this is MySQL Cluster build i.e the MySQL Server
+# version string ends in -ndb-Y.Y.Y[-status]
+MACRO(NDB_CHECK_MYSQL_CLUSTER version_string)
+
+ IF(${version_string} MATCHES "(.*)-ndb-(.*)")
+ SET(mysql_version ${CMAKE_MATCH_1})
+ SET(cluster_version ${CMAKE_MATCH_2})
+
+ MESSAGE(STATUS "This is MySQL Cluster ${cluster_version}")
+
+ # Sanity check that the mysql_version matches precalcuated
+ # values from higher level scripts
+ IF(NOT ${mysql_version} EQUAL "${MYSQL_NO_DASH_VERSION}")
+ MESSAGE(FATAL_ERROR "Sanity check of version_string failed!")
+ ENDIF()
+
+ # Split the cluster_version further into Y.Y.Y subcomponents
+ IF(${cluster_version} MATCHES "([0-9]+)\\.([0-9]+)\\.([0-9]+)")
+ SET(MYSQL_CLUSTER_VERSION_MAJOR ${CMAKE_MATCH_1} CACHE INTERNAL
+ "MySQL Cluster Major version calculated from MySQL version" FORCE)
+ SET(MYSQL_CLUSTER_VERSION_MINOR ${CMAKE_MATCH_2} CACHE INTERNAL
+ "MySQL Cluster Minor version calculated from MySQL version" FORCE)
+ SET(MYSQL_CLUSTER_VERSION_BUILD ${CMAKE_MATCH_3} CACHE INTERNAL
+ "MySQL Cluster Build version calculated from MySQL version" FORCE)
+ ENDIF()
+
+ # Finally set MYSQL_CLUSTER_VERSION to be used as an indicator
+ # that this is a MySQL Cluster build, yay!
+ SET(MYSQL_CLUSTER_VERSION ${cluster_version} CACHE INTERNAL
+ "This is MySQL Cluster" FORCE)
+
+ ENDIF()
+ENDMACRO()
+
# Temporarily remove -Werror from compiler flags until
# storage/ndb/ can be built with it
@@ -37,6 +72,9 @@ IF(SOURCE_SUBLIBS)
# NDBCLUSTER_SOURCES and NDBCLUSTER_LIBS, don't configure
# again
ELSE()
+
+ NDB_CHECK_MYSQL_CLUSTER(${VERSION})
+
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/ndb_configure.cmake)
INCLUDE_DIRECTORIES(
@@ -116,8 +154,16 @@ IF(EXISTS ${CMAKE_SOURCE_DIR}/storage/my
MYSQL_STORAGE_ENGINE(NDBCLUSTER)
ELSE()
# New plugin support, cross-platform
+
+ # NDB is MANDATORY plugin in MySQL Cluster i.e it's always built
+ SET(is_mandatory_plugin "")
+ IF(MYSQL_CLUSTER_VERSION)
+ SET(is_mandatory_plugin "MANDATORY")
+ ENDIF()
+
MYSQL_ADD_PLUGIN(ndbcluster ${NDBCLUSTER_SOURCES} STORAGE_ENGINE
- DEFAULT STATIC_ONLY RECOMPILE_FOR_EMBEDDED LINK_LIBRARIES ndbclient)
+ ${is_mandatory_plugin} STATIC_ONLY RECOMPILE_FOR_EMBEDDED
+ LINK_LIBRARIES ndbclient)
IF (NOT MCP_BUG58158)
IF(WITH_EMBEDDED_SERVER)
=== modified file 'storage/ndb/include/CMakeLists.txt'
--- a/storage/ndb/include/CMakeLists.txt 2011-02-03 14:20:36 +0000
+++ b/storage/ndb/include/CMakeLists.txt 2011-05-03 09:20:34 +0000
@@ -70,6 +70,18 @@ IF(NOT DEFINED NDB_VERSION_MAJOR OR
MESSAGE(FATAL_ERROR "Couldn't parse version numbers from ndb_configure.m4")
ENDIF()
+IF (DEFINED MYSQL_CLUSTER_VERSION)
+ # This is MySQL Cluster, the MySQL Cluster version must match NDB version
+ IF(NOT MYSQL_CLUSTER_VERSION_MAJOR EQUAL NDB_VERSION_MAJOR OR
+ NOT MYSQL_CLUSTER_VERSION_MINOR EQUAL NDB_VERSION_MINOR OR
+ NOT MYSQL_CLUSTER_VERSION_BUILD EQUAL NDB_VERSION_BUILD)
+ MESSAGE(STATUS "MYSQL_CLUSTER_VERSION_MAJOR: ${MYSQL_CLUSTER_VERSION_MAJOR}")
+ MESSAGE(STATUS "MYSQL_CLUSTER_VERSION_MINOR: ${MYSQL_CLUSTER_VERSION_MINOR}")
+ MESSAGE(STATUS "MYSQL_CLUSTER_VERSION_BUILD: ${MYSQL_CLUSTER_VERSION_BUILD}")
+ MESSAGE(FATAL_ERROR "MySQL Cluster version does not match NDB version")
+ ENDIF()
+ENDIF()
+
# Create ndb_version.h
CONFIGURE_FILE(ndb_version.h.in
${CMAKE_CURRENT_SOURCE_DIR}/ndb_version.h
No bundle (reason: revision is a merge (you can force generation of a bundle with env var BZR_FORCE_BUNDLE=1)).| Thread |
|---|
| • bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:4360) | Magnus Blåudd | 6 May |