diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-10-11 12:55:42 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-10-11 12:55:42 +0200 |
commit | ae6330080102f31edd6cd3b49028f0f3e39be769 (patch) | |
tree | b277d27fcc4f0471c86fd0b756f120718b8d759a /CMakeLists.txt | |
parent | 8feff690b6d1f09acb6a68315669e75924da5f80 (diff) | |
parent | 3e8731dee04ec5f47557e0a0f55aa5f6f8d1f698 (diff) | |
download | mariadb-git-ae6330080102f31edd6cd3b49028f0f3e39be769.tar.gz |
merge
Diffstat (limited to 'CMakeLists.txt')
-rwxr-xr-x | CMakeLists.txt | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index fd98586c359..5ed8dedb574 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,6 +114,9 @@ ENDIF(ENABLED_DEBUG_SYNC) SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC") +SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") +SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") + # in some places we use DBUG_OFF SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DDBUG_OFF") SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DDBUG_OFF") @@ -247,16 +250,15 @@ IF(WITHOUT_DYNAMIC_PLUGINS) MESSAGE("Dynamic plugins are disabled.") ENDIF(WITHOUT_DYNAMIC_PLUGINS) -FILE(GLOB STORAGE_SUBDIRS storage/*) +FILE(GLOB STORAGE_SUBDIRS storage/* plugin/*) FOREACH(SUBDIR ${STORAGE_SUBDIRS}) - FILE(RELATIVE_PATH DIRNAME ${PROJECT_SOURCE_DIR}/storage ${SUBDIR}) IF (EXISTS ${SUBDIR}/CMakeLists.txt) # Check MYSQL_STORAGE_ENGINE macro is present - FILE(STRINGS ${SUBDIR}/CMakeLists.txt HAVE_STORAGE_ENGINE REGEX MYSQL_STORAGE_ENGINE) + FILE(STRINGS ${SUBDIR}/CMakeLists.txt HAVE_STORAGE_ENGINE REGEX "MYSQL_(STORAGE_ENGINE|PLUGIN)") IF(HAVE_STORAGE_ENGINE) # Extract name of engine from HAVE_STORAGE_ENGINE - STRING(REGEX REPLACE ".*MYSQL_STORAGE_ENGINE\\((.*\)\\).*" - "\\1" ENGINE_NAME ${HAVE_STORAGE_ENGINE}) + STRING(REGEX REPLACE ".*MYSQL_(STORAGE_ENGINE|PLUGIN)\\((.*\)\\).*" + "\\2" ENGINE_NAME ${HAVE_STORAGE_ENGINE}) STRING(TOUPPER ${ENGINE_NAME} ENGINE) STRING(TOLOWER ${ENGINE_NAME} ENGINE_LOWER) @@ -265,21 +267,23 @@ FOREACH(SUBDIR ${STORAGE_SUBDIRS}) # build as shared library (dynamic). IF(EXISTS ${SUBDIR}/plug.in) FILE(READ ${SUBDIR}/plug.in PLUGIN_FILE_CONTENT) - STRING (REGEX MATCH "MYSQL_PLUGIN_DYNAMIC" MYSQL_PLUGIN_DYNAMIC ${PLUGIN_FILE_CONTENT}) + IF (PLUGIN_FILE_CONTENT MATCHES "MYSQL_PLUGIN_DYNAMIC\\(${ENGINE_LOWER}") + STRING (REGEX REPLACE + ".*MYSQL_PLUGIN_DYNAMIC\\(${ENGINE_LOWER},[ \\t]*\\[?([a-zA-Z0-9_]+/)*([a-zA-Z0-9_]+).*" + "\\2" MYSQL_PLUGIN_DYNAMIC ${PLUGIN_FILE_CONTENT}) + ELSE (PLUGIN_FILE_CONTENT MATCHES "MYSQL_PLUGIN_DYNAMIC\\(${ENGINE_LOWER}") + SET (MYSQL_PLUGIN_DYNAMIC "") + ENDIF(PLUGIN_FILE_CONTENT MATCHES "MYSQL_PLUGIN_DYNAMIC\\(${ENGINE_LOWER}") + IF (PLUGIN_FILE_CONTENT MATCHES "MYSQL_PLUGIN_STATIC\\(${ENGINE_LOWER}") + STRING (REGEX REPLACE + ".*MYSQL_PLUGIN_STATIC\\(${ENGINE_LOWER},[ \\t]*\\[?([a-zA-Z0-9_]+/)*([a-zA-Z0-9_]+).*" + "\\2" + MYSQL_PLUGIN_STATIC ${PLUGIN_FILE_CONTENT}) + ELSE (PLUGIN_FILE_CONTENT MATCHES "MYSQL_PLUGIN_STATIC\\(${ENGINE_LOWER}") + SET (MYSQL_PLUGIN_STATIC "") + ENDIF(PLUGIN_FILE_CONTENT MATCHES "MYSQL_PLUGIN_STATIC\\(${ENGINE_LOWER}") STRING (REGEX MATCH "MYSQL_PLUGIN_MANDATORY" MYSQL_PLUGIN_MANDATORY ${PLUGIN_FILE_CONTENT}) - STRING (REGEX MATCH "MYSQL_PLUGIN_STATIC" MYSQL_PLUGIN_STATIC ${PLUGIN_FILE_CONTENT}) - - # - # XTRADB is located in storage/xtradb, but it says everywhere it is 'innobase' (e.g. - # it declares 'builtin_innobase_plugin', not builtin_xtradb_plugin). - # Extract the intended plugin name from MYSQL_STORAGE_ENGINE definition and use it - # where appropriate. - STRING (REGEX MATCH "MYSQL_STORAGE_ENGINE.[a-z]*" PLUGIN_NAME ${PLUGIN_FILE_CONTENT}) - STRING (REGEX REPLACE "MYSQL_STORAGE_ENGINE.(.*)" "\\1" PLUGIN_NAME ${PLUGIN_NAME}) - # Also remember this "xtradb"/"innobase" name discrepancy for libmysqld/CMakeLists.txt: - SET (plugin_dir_${PLUGIN_NAME} ${DIRNAME}) - IF(MYSQL_PLUGIN_MANDATORY) SET(WITH_${ENGINE}_STORAGE_ENGINE TRUE) ENDIF(MYSQL_PLUGIN_MANDATORY) @@ -293,15 +297,17 @@ FOREACH(SUBDIR ${STORAGE_SUBDIRS}) ENDIF(WITH_${ENGINE}_STORAGE_ENGINE AND MYSQL_PLUGIN_STATIC) IF (ENGINE_BUILD_TYPE STREQUAL "STATIC") - SET (maria_plugin_defs "${maria_plugin_defs},builtin_maria_${PLUGIN_NAME}_plugin") - SET (MYSQLD_STATIC_ENGINE_LIBS ${MYSQLD_STATIC_ENGINE_LIBS} ${PLUGIN_NAME}) + SET (maria_plugin_defs "${maria_plugin_defs},builtin_maria_${ENGINE_LOWER}_plugin") + SET (MYSQLD_STATIC_ENGINE_LIBS ${MYSQLD_STATIC_ENGINE_LIBS} ${MYSQL_PLUGIN_STATIC}) + SET (MYSQLD_STATIC_ENGINES ${MYSQLD_STATIC_ENGINES} ${ENGINE}) SET (STORAGE_ENGINE_DEFS "${STORAGE_ENGINE_DEFS} -DWITH_${ENGINE}_STORAGE_ENGINE") SET (WITH_${ENGINE}_STORAGE_ENGINE TRUE) - SET (${ENGINE}_DIR ${DIRNAME}) + SET (${ENGINE}_DIR ${SUBDIR}) ENDIF (ENGINE_BUILD_TYPE STREQUAL "STATIC") ENDIF(EXISTS ${SUBDIR}/plug.in) IF(NOT ENGINE_BUILD_TYPE STREQUAL "NONE") + SET (${ENGINE}_LIB ${MYSQL_PLUGIN_${ENGINE_BUILD_TYPE}}) LIST(APPEND ${ENGINE_BUILD_TYPE}_ENGINE_DIRECTORIES ${SUBDIR}) ENDIF(NOT ENGINE_BUILD_TYPE STREQUAL "NONE") |