summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/jemalloc.cmake4
-rw-r--r--sql/CMakeLists.txt4
-rw-r--r--storage/tokudb/CMakeLists.txt18
-rw-r--r--storage/tokudb/ft-index/CMakeLists.txt2
-rw-r--r--storage/tokudb/ft-index/CTestCustom.cmake.in (renamed from storage/tokudb/ft-index/CTestCustom.cmake)0
-rw-r--r--storage/tokudb/ft-index/buildheader/CMakeLists.txt4
-rw-r--r--storage/tokudb/ft-index/cmake_modules/TokuMergeLibs.cmake2
-rw-r--r--storage/tokudb/ft-index/cmake_modules/TokuSetupCTest.cmake5
-rw-r--r--storage/tokudb/ft-index/cmake_modules/TokuThirdParty.cmake35
-rw-r--r--storage/tokudb/ft-index/ft/CMakeLists.txt2
-rw-r--r--storage/tokudb/ft-index/ft/tests/CMakeLists.txt2
-rw-r--r--storage/tokudb/ft-index/locktree/tests/CMakeLists.txt2
-rw-r--r--storage/tokudb/ft-index/portability/CMakeLists.txt5
-rw-r--r--storage/tokudb/ft-index/portability/os_malloc.cc2
-rw-r--r--storage/tokudb/ft-index/portability/tests/CMakeLists.txt2
-rw-r--r--storage/tokudb/ft-index/src/tests/CMakeLists.txt6
-rw-r--r--storage/tokudb/ft-index/util/tests/CMakeLists.txt2
-rw-r--r--storage/tokudb/ft-index/utils/CMakeLists.txt2
18 files changed, 40 insertions, 59 deletions
diff --git a/cmake/jemalloc.cmake b/cmake/jemalloc.cmake
index 590ca82655b..b890e155ed6 100644
--- a/cmake/jemalloc.cmake
+++ b/cmake/jemalloc.cmake
@@ -3,7 +3,7 @@ INCLUDE(ExternalProject)
MACRO (USE_BUNDLED_JEMALLOC)
SET(SOURCE_DIR "${CMAKE_SOURCE_DIR}/extra/jemalloc")
SET(BINARY_DIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/extra/jemalloc/build")
- SET(LIBJEMALLOC "${BINARY_DIR}/lib/libjemalloc_pic.a")
+ SET(LIBJEMALLOC "libjemalloc")
SET(JEMALLOC_CONFIGURE_OPTS "CC=${CMAKE_C_COMPILER}" "--with-private-namespace=jemalloc_internal_" "--enable-cc-silence")
IF (CMAKE_BUILD_TYPE MATCHES "Debug" AND NOT APPLE) # see the comment in CMakeLists.txt
LIST(APPEND JEMALLOC_CONFIGURE_OPTS --enable-debug)
@@ -18,7 +18,7 @@ MACRO (USE_BUNDLED_JEMALLOC)
INSTALL_COMMAND ""
)
ADD_LIBRARY(libjemalloc STATIC IMPORTED)
- SET_TARGET_PROPERTIES(libjemalloc PROPERTIES IMPORTED_LOCATION ${LIBJEMALLOC})
+ SET_TARGET_PROPERTIES(libjemalloc PROPERTIES IMPORTED_LOCATION "${BINARY_DIR}/lib/libjemalloc_pic.a")
ADD_DEPENDENCIES(libjemalloc jemalloc)
ENDMACRO()
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 5e71b49a4d8..02265196e2d 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -102,8 +102,8 @@ ADD_LIBRARY(sql STATIC ${SQL_SOURCE})
ADD_DEPENDENCIES(sql GenServerSource)
DTRACE_INSTRUMENT(sql)
TARGET_LINK_LIBRARIES(sql ${MYSQLD_STATIC_PLUGIN_LIBS}
- mysys dbug strings vio regex
- ${LIBWRAP} ${LIBCRYPT} ${LIBDL} ${LIBJEMALLOC} ${CMAKE_THREAD_LIBS_INIT}
+ mysys dbug strings vio regex ${LIBJEMALLOC}
+ ${LIBWRAP} ${LIBCRYPT} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT}
${SSL_LIBRARIES})
IF(WIN32)
diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt
index 9095a7202e7..398c7d642e0 100644
--- a/storage/tokudb/CMakeLists.txt
+++ b/storage/tokudb/CMakeLists.txt
@@ -1,3 +1,19 @@
+# ft-index can be compiled only with gcc-4.7+, cmake-2.8.8+
+# and supports only x86-64 platform
+IF(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR
+ CMAKE_VERSION VERSION_LESS "2.8.8" OR
+ NOT CMAKE_COMPILER_IS_GNUCXX OR
+ CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7")
+ IF (NOT WITHOUT_TOKUDB)
+ MESSAGE("TokuDB is disabled: not supported
+ (${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_VERSION}-<${CMAKE_COMPILER_IS_GNUCXX}>-${CMAKE_CXX_COMPILER_VERSION}")
+ ENDIF()
+ RETURN()
+ENDIF()
+SET(ENV{TOKUDB_VERSION} "7.0.2")
+SET(USE_BDB OFF CACHE BOOL "")
+############################################
+
IF(DEFINED ENV{TOKUDB_VERSION})
SET(TOKUDB_VERSION $ENV{TOKUDB_VERSION})
ADD_DEFINITIONS("-DTOKUDB_VERSION=\"${TOKUDB_VERSION}\"")
@@ -24,4 +40,4 @@ SET(TOKUDB_PLUGIN_DYNAMIC "ha_tokudb")
SET(TOKUDB_SOURCES ha_tokudb.cc)
MYSQL_ADD_PLUGIN(tokudb ${TOKUDB_SOURCES} STORAGE_ENGINE MODULE_ONLY
LINK_LIBRARIES tokufractaltree_static tokuportability_static z stdc++)
-SET_PROPERTY(TARGET tokudb APPEND PROPERTY LINK_FLAGS_RELEASE "-flto -fuse-linker-plugin")
+SET(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -flto -fuse-linker-plugin")
diff --git a/storage/tokudb/ft-index/CMakeLists.txt b/storage/tokudb/ft-index/CMakeLists.txt
index 79703bb8480..dfab216aceb 100644
--- a/storage/tokudb/ft-index/CMakeLists.txt
+++ b/storage/tokudb/ft-index/CMakeLists.txt
@@ -53,7 +53,7 @@ add_subdirectory(utils)
## subdirectories that just install things
add_subdirectory(include)
add_subdirectory(toku_include)
-add_subdirectory(examples)
+#add_subdirectory(examples)
install(
FILES README.md README-TOKUDB
diff --git a/storage/tokudb/ft-index/CTestCustom.cmake b/storage/tokudb/ft-index/CTestCustom.cmake.in
index 9861d8e20a2..9861d8e20a2 100644
--- a/storage/tokudb/ft-index/CTestCustom.cmake
+++ b/storage/tokudb/ft-index/CTestCustom.cmake.in
diff --git a/storage/tokudb/ft-index/buildheader/CMakeLists.txt b/storage/tokudb/ft-index/buildheader/CMakeLists.txt
index 3b2ba854d93..8427f216fd4 100644
--- a/storage/tokudb/ft-index/buildheader/CMakeLists.txt
+++ b/storage/tokudb/ft-index/buildheader/CMakeLists.txt
@@ -4,7 +4,7 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/runcat.sh" "#!/bin/bash
out=$1; shift
exec \"$@\" >$out")
-add_executable(make_tdb make_tdb)
+add_executable(make_tdb make_tdb.cc)
set_property(TARGET make_tdb APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/db.h"
@@ -24,4 +24,4 @@ if (NOT DEFINED MYSQL_PROJECT_NAME_DOCSTRING)
FILES "${CMAKE_CURRENT_BINARY_DIR}/db.h"
DESTINATION include
)
-endif () \ No newline at end of file
+endif ()
diff --git a/storage/tokudb/ft-index/cmake_modules/TokuMergeLibs.cmake b/storage/tokudb/ft-index/cmake_modules/TokuMergeLibs.cmake
index 588fc43272d..0902f148e75 100644
--- a/storage/tokudb/ft-index/cmake_modules/TokuMergeLibs.cmake
+++ b/storage/tokudb/ft-index/cmake_modules/TokuMergeLibs.cmake
@@ -49,7 +49,7 @@ MACRO(TOKU_MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
ENDIF()
ENDFOREACH()
IF(OSLIBS)
- LIST(REMOVE_DUPLICATES OSLIBS)
+ #LIST(REMOVE_DUPLICATES OSLIBS)
TARGET_LINK_LIBRARIES(${TARGET} ${OSLIBS})
ENDIF()
diff --git a/storage/tokudb/ft-index/cmake_modules/TokuSetupCTest.cmake b/storage/tokudb/ft-index/cmake_modules/TokuSetupCTest.cmake
index 64596031851..f6aedca0868 100644
--- a/storage/tokudb/ft-index/cmake_modules/TokuSetupCTest.cmake
+++ b/storage/tokudb/ft-index/cmake_modules/TokuSetupCTest.cmake
@@ -9,6 +9,7 @@ macro(real_executable_name filename_input out)
execute_process(
COMMAND which ${filename}
RESULT_VARIABLE res
+ ERROR_QUIET
OUTPUT_VARIABLE full_filename
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT(res))
@@ -84,7 +85,7 @@ include(CTest)
set(TOKUDB_DATA "${TokuDB_SOURCE_DIR}/../tokudb.data" CACHE FILEPATH "Path to data files for tests")
if (BUILD_TESTING OR BUILD_FT_TESTS OR BUILD_SRC_TESTS)
- set(WARNED_ABOUT_DATA 0)
+ set(WARNED_ABOUT_DATA 1) # disable the warning below
if (NOT EXISTS "${TOKUDB_DATA}/" AND NOT WARNED_ABOUT_DATA)
message(WARNING "Test data files are missing from ${TOKUDB_DATA}, which will cause some tests to fail. Please put them there or modify TOKUDB_DATA to avoid this.")
set(WARNED_ABOUT_DATA 1)
@@ -152,5 +153,5 @@ if (BUILD_TESTING OR BUILD_FT_TESTS OR BUILD_SRC_TESTS)
option(RUN_STRESS_TESTS "If set, run the stress tests." OFF)
option(RUN_PERF_TESTS "If set, run the perf tests." OFF)
- configure_file(CTestCustom.cmake . @ONLY)
+ configure_file(CTestCustom.cmake.in CTestCustom.cmake @ONLY)
endif (BUILD_TESTING OR BUILD_FT_TESTS OR BUILD_SRC_TESTS)
diff --git a/storage/tokudb/ft-index/cmake_modules/TokuThirdParty.cmake b/storage/tokudb/ft-index/cmake_modules/TokuThirdParty.cmake
index 069b7112508..212e378bca3 100644
--- a/storage/tokudb/ft-index/cmake_modules/TokuThirdParty.cmake
+++ b/storage/tokudb/ft-index/cmake_modules/TokuThirdParty.cmake
@@ -1,40 +1,5 @@
include(ExternalProject)
-## add jemalloc with an external project
-set(JEMALLOC_SOURCE_DIR "${TokuDB_SOURCE_DIR}/third_party/jemalloc" CACHE FILEPATH "Where to find jemalloc sources.")
-if (NOT EXISTS "${JEMALLOC_SOURCE_DIR}/configure")
- message(FATAL_ERROR "Can't find jemalloc sources. Please check them out to ${JEMALLOC_SOURCE_DIR} or modify JEMALLOC_SOURCE_DIR.")
-endif ()
-set(jemalloc_configure_opts "CC=${CMAKE_C_COMPILER}" "--with-jemalloc-prefix=" "--with-private-namespace=tokudb_jemalloc_internal_" "--enable-cc-silence")
-option(JEMALLOC_DEBUG "Build jemalloc with --enable-debug." OFF)
-if (JEMALLOC_DEBUG)
- list(APPEND jemalloc_configure_opts --enable-debug)
-endif ()
-ExternalProject_Add(build_jemalloc
- PREFIX jemalloc
- SOURCE_DIR "${JEMALLOC_SOURCE_DIR}"
- CONFIGURE_COMMAND
- "${JEMALLOC_SOURCE_DIR}/configure" ${jemalloc_configure_opts}
- "--prefix=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/jemalloc"
- )
-
-add_library(jemalloc STATIC IMPORTED GLOBAL)
-set_target_properties(jemalloc PROPERTIES IMPORTED_LOCATION
- "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/jemalloc/lib/libjemalloc_pic.a")
-add_dependencies(jemalloc build_jemalloc)
-add_library(jemalloc_nopic STATIC IMPORTED GLOBAL)
-set_target_properties(jemalloc_nopic PROPERTIES IMPORTED_LOCATION
- "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/jemalloc/lib/libjemalloc.a")
-add_dependencies(jemalloc_nopic build_jemalloc)
-
-# detect when we are being built as a subproject
-if (NOT DEFINED MYSQL_PROJECT_NAME_DOCSTRING)
- install(
- DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/jemalloc/lib"
- DESTINATION .
- )
-endif ()
-
## add lzma with an external project
set(xz_configure_opts --with-pic --enable-static)
if (APPLE)
diff --git a/storage/tokudb/ft-index/ft/CMakeLists.txt b/storage/tokudb/ft-index/ft/CMakeLists.txt
index 75cee86d77c..c59e5eabd4b 100644
--- a/storage/tokudb/ft-index/ft/CMakeLists.txt
+++ b/storage/tokudb/ft-index/ft/CMakeLists.txt
@@ -92,7 +92,7 @@ target_link_libraries(ft_static LINK_PRIVATE lzma)
## build the bins in this directory
foreach(tool tokuftdump tdb_logprint tdb-recover ftverify)
- add_executable(${tool} ${tool})
+ add_executable(${tool} ${tool}.cc)
add_dependencies(${tool} install_tdb_h)
target_link_libraries(${tool} ft_static util_static z lzma ${LIBTOKUPORTABILITY}_static ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})
add_space_separated_property(TARGET ${tool} COMPILE_FLAGS -fvisibility=hidden)
diff --git a/storage/tokudb/ft-index/ft/tests/CMakeLists.txt b/storage/tokudb/ft-index/ft/tests/CMakeLists.txt
index 17883755c21..209155d692d 100644
--- a/storage/tokudb/ft-index/ft/tests/CMakeLists.txt
+++ b/storage/tokudb/ft-index/ft/tests/CMakeLists.txt
@@ -29,7 +29,7 @@ if(BUILD_TESTING OR BUILD_FT_TESTS)
add_test(ft/logcursor-bw echo "logcursor-bw must be run manually (needs logs to iterate over).")
foreach(test ${tests})
- add_executable(${test} ${test})
+ add_executable(${test} ${test}.cc)
target_link_libraries(${test} ft ${LIBTOKUPORTABILITY})
set_target_properties(${test} PROPERTIES POSITION_INDEPENDENT_CODE ON)
add_space_separated_property(TARGET ${test} COMPILE_FLAGS -fvisibility=hidden)
diff --git a/storage/tokudb/ft-index/locktree/tests/CMakeLists.txt b/storage/tokudb/ft-index/locktree/tests/CMakeLists.txt
index 47ec4d884fb..20ab682ae12 100644
--- a/storage/tokudb/ft-index/locktree/tests/CMakeLists.txt
+++ b/storage/tokudb/ft-index/locktree/tests/CMakeLists.txt
@@ -7,7 +7,7 @@ if(BUILD_TESTING)
foreach(src ${srcs})
get_filename_component(base ${src} NAME_WE)
- add_executable(${base} ${base})
+ add_executable(${base} ${base}.cc)
add_space_separated_property(TARGET ${base} COMPILE_FLAGS -fvisibility=hidden)
target_link_libraries(${base} locktree ft ${LIBTOKUPORTABILITY})
add_locktree_test(${base})
diff --git a/storage/tokudb/ft-index/portability/CMakeLists.txt b/storage/tokudb/ft-index/portability/CMakeLists.txt
index 89dc8e8caab..1d64878675e 100644
--- a/storage/tokudb/ft-index/portability/CMakeLists.txt
+++ b/storage/tokudb/ft-index/portability/CMakeLists.txt
@@ -15,13 +15,12 @@ set(tokuportability_srcs
)
add_library(${LIBTOKUPORTABILITY} SHARED ${tokuportability_srcs})
-target_link_libraries(${LIBTOKUPORTABILITY} LINK_PRIVATE jemalloc)
+target_link_libraries(${LIBTOKUPORTABILITY} LINK_PRIVATE ${LIBJEMALLOC})
target_link_libraries(${LIBTOKUPORTABILITY} LINK_PUBLIC ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})
add_library(tokuportability_static_conv STATIC ${tokuportability_srcs})
set_target_properties(tokuportability_static_conv PROPERTIES POSITION_INDEPENDENT_CODE ON)
-add_dependencies(tokuportability_static_conv build_jemalloc)
-set(tokuportability_source_libs tokuportability_static_conv jemalloc ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})
+set(tokuportability_source_libs tokuportability_static_conv ${LIBJEMALLOC} ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})
toku_merge_static_libs(${LIBTOKUPORTABILITY}_static ${LIBTOKUPORTABILITY}_static "${tokuportability_source_libs}")
maybe_add_gcov_to_libraries(${LIBTOKUPORTABILITY} tokuportability_static_conv)
diff --git a/storage/tokudb/ft-index/portability/os_malloc.cc b/storage/tokudb/ft-index/portability/os_malloc.cc
index a432c2f60fd..a03608d7d57 100644
--- a/storage/tokudb/ft-index/portability/os_malloc.cc
+++ b/storage/tokudb/ft-index/portability/os_malloc.cc
@@ -92,7 +92,7 @@ PATENT RIGHTS GRANT:
#include <toku_portability.h>
#include <stdlib.h>
-#include <jemalloc/include/jemalloc/jemalloc.h>
+//#include <jemalloc/include/jemalloc/jemalloc.h>
#if defined(HAVE_MALLOC_H)
# include <malloc.h>
#elif defined(HAVE_SYS_MALLOC_H)
diff --git a/storage/tokudb/ft-index/portability/tests/CMakeLists.txt b/storage/tokudb/ft-index/portability/tests/CMakeLists.txt
index 7fea21fc8e3..ff233327436 100644
--- a/storage/tokudb/ft-index/portability/tests/CMakeLists.txt
+++ b/storage/tokudb/ft-index/portability/tests/CMakeLists.txt
@@ -10,7 +10,7 @@ if(BUILD_TESTING)
foreach(src ${srcs})
get_filename_component(test ${src} NAME_WE)
- add_executable(${test} ${test})
+ add_executable(${test} ${test}.cc)
target_link_libraries(${test} ${LIBTOKUPORTABILITY})
set_target_properties(${test} PROPERTIES POSITION_INDEPENDENT_CODE ON)
add_space_separated_property(TARGET ${test} COMPILE_FLAGS -fvisibility=hidden)
diff --git a/storage/tokudb/ft-index/src/tests/CMakeLists.txt b/storage/tokudb/ft-index/src/tests/CMakeLists.txt
index 1cc44bae871..394015defea 100644
--- a/storage/tokudb/ft-index/src/tests/CMakeLists.txt
+++ b/storage/tokudb/ft-index/src/tests/CMakeLists.txt
@@ -359,7 +359,7 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS)
## #5138 only reproduces when using the static library.
list(REMOVE_ITEM tdb_bins test-5138.tdb)
- add_executable(test-5138.tdb test-5138)
+ add_executable(test-5138.tdb test-5138.cc)
target_link_libraries(test-5138.tdb ${LIBTOKUDB}_static z ${LIBTOKUPORTABILITY}_static ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})
set_property(TARGET test-5138.tdb APPEND PROPERTY
COMPILE_DEFINITIONS "USE_TDB;IS_TDB=1;TOKUDB=1")
@@ -369,7 +369,7 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS)
foreach(bin ${tdb_bins})
get_filename_component(base ${bin} NAME_WE)
- add_executable(${base}.tdb ${base})
+ add_executable(${base}.tdb ${base}.cc)
# Some of the symbols in util may not be exported properly by
# libtokudb.so.
# We link the test with util directly so that the test code itself can use
@@ -384,7 +384,7 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS)
foreach(bin ${bdb_bins})
get_filename_component(base ${bin} NAME_WE)
- add_executable(${base}.bdb ${base})
+ add_executable(${base}.bdb ${base}.cc)
set_property(TARGET ${base}.bdb APPEND PROPERTY
COMPILE_DEFINITIONS "USE_BDB;IS_TDB=0;TOKU_ALLOW_DEPRECATED")
set_target_properties(${base}.bdb PROPERTIES
diff --git a/storage/tokudb/ft-index/util/tests/CMakeLists.txt b/storage/tokudb/ft-index/util/tests/CMakeLists.txt
index bda4eee6794..80b5497dcca 100644
--- a/storage/tokudb/ft-index/util/tests/CMakeLists.txt
+++ b/storage/tokudb/ft-index/util/tests/CMakeLists.txt
@@ -6,7 +6,7 @@ if(BUILD_TESTING)
endforeach(src)
foreach(test ${tests})
- add_executable(${test} ${test})
+ add_executable(${test} ${test}.cc)
target_link_libraries(${test} util ${LIBTOKUPORTABILITY})
endforeach(test)
diff --git a/storage/tokudb/ft-index/utils/CMakeLists.txt b/storage/tokudb/ft-index/utils/CMakeLists.txt
index 7ce54b89233..5c73927dd80 100644
--- a/storage/tokudb/ft-index/utils/CMakeLists.txt
+++ b/storage/tokudb/ft-index/utils/CMakeLists.txt
@@ -2,7 +2,7 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE DONT_DEPR
set(utils tokudb_gen tokudb_load tokudb_dump)
foreach(util ${utils})
- add_executable(${util} ${util})
+ add_executable(${util} ${util}.cc)
set_target_properties(${util} PROPERTIES
COMPILE_DEFINITIONS "IS_TDB=1;USE_TDB=1;TDB_IS_STATIC=1")
target_link_libraries(${util} ${LIBTOKUDB}_static ft_static z lzma ${LIBTOKUPORTABILITY}_static ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS})