Commit fc3c7330 authored by Leif Walsh's avatar Leif Walsh

Merge branch 'simplify-build'

parents 0020e1cc 5a4bf978
......@@ -17,7 +17,7 @@ include(TokuMergeLibs)
## need a way to change the name of libs we build
set(LIBTOKUPORTABILITY "tokuportability" CACHE STRING "Name of libtokuportability.so")
set(LIBTOKUDB "tokudb" CACHE STRING "Name of libtokudb.so")
set(LIBTOKUDB "tokufractaltree" CACHE STRING "Name of libtokufractaltree.so")
include_directories(
${VALGRIND_INCLUDE_DIR}
......
# Merge static libraries into a big static lib. The resulting library
# should not not have dependencies on other static libraries.
# We use it in MySQL to merge mysys,dbug,vio etc into mysqlclient
FUNCTION(GET_DEPENDEND_OS_LIBS target result)
FUNCTION(TOKU_GET_DEPENDEND_OS_LIBS target result)
SET(deps ${${target}_LIB_DEPENDS})
IF(deps)
FOREACH(lib ${deps})
......@@ -15,9 +15,9 @@ FUNCTION(GET_DEPENDEND_OS_LIBS target result)
ENDFOREACH()
ENDIF()
SET(${result} ${ret} PARENT_SCOPE)
ENDFUNCTION(GET_DEPENDEND_OS_LIBS)
ENDFUNCTION(TOKU_GET_DEPENDEND_OS_LIBS)
MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
MACRO(TOKU_MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
# To produce a library we need at least one source file.
# It is created by ADD_CUSTOM_COMMAND below and will helps
# also help to track dependencies.
......@@ -40,7 +40,7 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
SET(STATIC_LIBS ${STATIC_LIBS} ${LIB_LOCATION})
ADD_DEPENDENCIES(${TARGET} ${LIB})
# Extract dependend OS libraries
GET_DEPENDEND_OS_LIBS(${LIB} LIB_OSLIBS)
TOKU_GET_DEPENDEND_OS_LIBS(${LIB} LIB_OSLIBS)
LIST(APPEND OSLIBS ${LIB_OSLIBS})
ELSE()
# This is a shared library our static lib depends on.
......@@ -97,4 +97,4 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
)
ENDIF()
ENDIF()
ENDMACRO(MERGE_STATIC_LIBS)
ENDMACRO(TOKU_MERGE_STATIC_LIBS)
......@@ -92,6 +92,12 @@ set_cflags_if_supported(
)
## set_cflags_if_supported_named("-Weffc++" -Weffcpp)
# must append this because mysql sets -fno-implicit-templates and we need to override it
check_cxx_compiler_flag(-fimplicit-templates HAVE_CXX_-fimplicit-templates)
if (HAVE_CXX_-fimplicit-templates)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fimplicit-templates")
endif ()
## Clang has stricter POD checks. So, only enable this warning on our other builds (Linux + GCC)
if (NOT CMAKE_CXX_COMPILER_ID MATCHES Clang)
set_cflags_if_supported(
......
......@@ -18,11 +18,11 @@ ExternalProject_Add(build_jemalloc
"--prefix=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/jemalloc"
)
add_library(jemalloc STATIC IMPORTED)
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)
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)
......
......@@ -87,7 +87,7 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#include <config.h>
#include "toku_config.h"
#include <stdio.h>
#include <assert.h>
#include <stdint.h>
......
......@@ -89,7 +89,7 @@ PATENT RIGHTS GRANT:
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#include "background_job_manager.h"
#include <config.h>
#include "toku_config.h"
#include <memory.h>
#include <toku_pthread.h>
......
......@@ -91,7 +91,7 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#include <config.h>
#include "toku_config.h"
#include <toku_race_tools.h>
// Symbol TOKUDB_REVISION is not defined by fractal-tree makefiles, so
......
......@@ -21,7 +21,7 @@ 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})
merge_static_libs(${LIBTOKUPORTABILITY}_static ${LIBTOKUPORTABILITY}_static "${tokuportability_source_libs}")
toku_merge_static_libs(${LIBTOKUPORTABILITY}_static ${LIBTOKUPORTABILITY}_static "${tokuportability_source_libs}")
maybe_add_gcov_to_libraries(${LIBTOKUPORTABILITY} tokuportability_static_conv)
set_property(TARGET ${LIBTOKUPORTABILITY} tokuportability_static_conv APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE)
......
......@@ -87,7 +87,7 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#include <config.h>
#include "toku_config.h"
#include <toku_portability.h>
#include <string.h>
......
......@@ -88,7 +88,7 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#include <config.h>
#include "toku_config.h"
#include <toku_portability.h>
#include <stdlib.h>
......
......@@ -87,7 +87,7 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#ident "$Id$"
#include <config.h>
#include "toku_config.h"
#include <stdio.h>
#include <stdlib.h>
......
......@@ -88,7 +88,7 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#include <config.h>
#include "toku_config.h"
#include <memory.h>
#include <portability/toku_atomic.h>
#include "test.h"
......
......@@ -87,7 +87,7 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#include <config.h>
#include "toku_config.h"
#include <stdio.h>
#include <toku_stdint.h>
#include <unistd.h>
......
......@@ -87,7 +87,7 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#include <config.h>
#include "toku_config.h"
#include <toku_portability.h>
#include "toku_assert.h"
......
......@@ -90,7 +90,7 @@ PATENT RIGHTS GRANT:
#ifndef TOKU_ATOMIC_H
#define TOKU_ATOMIC_H
#include <config.h>
#include "toku_config.h"
#include <toku_assert.h>
#include <stdbool.h>
#include <stdint.h>
......
......@@ -90,7 +90,7 @@ PATENT RIGHTS GRANT:
#ifndef TOKU_BYTESWAP_H
#define TOKU_BYTESWAP_H
#include <config.h>
#include "toku_config.h"
#if defined(HAVE_BYTESWAP_H)
# include <byteswap.h>
......
......@@ -88,7 +88,7 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2010-2013 Tokutek Inc. All rights reserved."
#include <config.h>
#include "toku_config.h"
#include <pthread.h>
#include <toku_assert.h>
......
......@@ -88,7 +88,7 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#define _GNU_SOURCE 1
#include <config.h>
#include "toku_config.h"
#include <toku_pthread.h>
int toku_pthread_yield(void) {
......
......@@ -90,7 +90,7 @@ PATENT RIGHTS GRANT:
#ifndef TOKU_RANDOM_H
#define TOKU_RANDOM_H
#include <config.h>
#include "toku_config.h"
#include <toku_portability.h>
#include <toku_assert.h>
#include <stdlib.h>
......
......@@ -90,7 +90,7 @@ PATENT RIGHTS GRANT:
#ifndef TOKU_TIME_H
#define TOKU_TIME_H
#include "config.h"
#include "toku_config.h"
#include <time.h>
#include <sys/time.h>
#include <stdint.h>
......
......@@ -26,7 +26,7 @@ add_library(tokudb_static_conv STATIC ${tokudb_srcs})
add_dependencies(tokudb_static_conv install_tdb_h generate_log_code)
set_target_properties(tokudb_static_conv PROPERTIES POSITION_INDEPENDENT_CODE ON)
set(tokudb_source_libs tokudb_static_conv locktree_static ft_static util_static lzma)
merge_static_libs(${LIBTOKUDB}_static ${LIBTOKUDB}_static "${tokudb_source_libs}")
toku_merge_static_libs(${LIBTOKUDB}_static ${LIBTOKUDB}_static "${tokudb_source_libs}")
## add gcov and define _GNU_SOURCE
maybe_add_gcov_to_libraries(${LIBTOKUDB} tokudb_static_conv)
......
......@@ -87,7 +87,7 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2010-2013 Tokutek Inc. All rights reserved."
#ident "$Id$"
#include <config.h>
#include "toku_config.h"
#include "test.h"
#include "toku_pthread.h"
#include <db.h>
......
......@@ -104,7 +104,7 @@ PATENT RIGHTS GRANT:
#ifndef _THREADED_STRESS_TEST_HELPERS_H_
#define _THREADED_STRESS_TEST_HELPERS_H_
#include <config.h>
#include "toku_config.h"
#include "test.h"
#include <stdio.h>
......
configure_file(config.h.in config.h)
configure_file(toku_config.h.in toku_config.h)
add_custom_target(generate_config_h DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/config.h")
"${CMAKE_CURRENT_BINARY_DIR}/toku_config.h")
install(
FILES toku_list.h toku_os.h
DESTINATION include
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/config.h"
FILES "${CMAKE_CURRENT_BINARY_DIR}/toku_config.h"
DESTINATION include
)
......@@ -93,7 +93,7 @@ PATENT RIGHTS GRANT:
/* This version will complain if NDEBUG is set. */
/* It evaluates the argument and then calls a function toku_do_assert() which takes all the hits for the branches not taken. */
#include "config.h"
#include "toku_config.h"
#include <stdint.h>
#include <errno.h>
......
......@@ -108,7 +108,7 @@ PATENT RIGHTS GRANT:
#ifndef _TOKU_HTOD_H
#define _TOKU_HTOD_H
#include <config.h>
#include "toku_config.h"
#if defined(HAVE_ENDIAN_H)
# include <endian.h>
......
......@@ -90,7 +90,7 @@ PATENT RIGHTS GRANT:
#ifndef TOKU_PORTABILITY_H
#define TOKU_PORTABILITY_H
#include "config.h"
#include "toku_config.h"
// Tokutek portability layer
......
......@@ -90,7 +90,7 @@ PATENT RIGHTS GRANT:
#ifndef TOKU_RACE_TOOLS_H
#define TOKU_RACE_TOOLS_H
#include "config.h"
#include "toku_config.h"
#if defined(__linux__) && USE_VALGRIND
......
......@@ -89,7 +89,7 @@ PATENT RIGHTS GRANT:
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#include "kibbutz.h"
#include <config.h>
#include "toku_config.h"
#include <memory.h>
#include <toku_pthread.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment