Commit 7a76d84d authored by John Esmet's avatar John Esmet

fixes #198 Consolidate our portability code by moving toku_include/*

stuff into portability/
parent 3cd52626
......@@ -27,13 +27,12 @@ if (USE_VALGRIND AND NOT VALGRIND_INCLUDE_DIR MATCHES NOTFOUND)
)
endif()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/toku_include
${CMAKE_CURRENT_SOURCE_DIR}/portability
${CMAKE_CURRENT_SOURCE_DIR} ## so you can include <ft/ft-ops.h> from inside src/
${CMAKE_CURRENT_BINARY_DIR} ## for logging code
)
## include where config.h will be generated
include_directories(${CMAKE_CURRENT_BINARY_DIR}/toku_include)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/portability)
## build db.h and include where it will be generated
add_subdirectory(buildheader)
......@@ -54,7 +53,6 @@ add_subdirectory(src)
add_subdirectory(tools)
## subdirectories that just install things
add_subdirectory(toku_include)
add_subdirectory(examples)
install(
......
......@@ -7,7 +7,6 @@ file(GLOB_RECURSE all_srcs
locktree/*.cc
portability/*.cc
src/*.cc
toku_include/*.cc
utils/*.cc
util/*.cc
db-benchmark-test/*.cc
......@@ -24,13 +23,12 @@ file(GLOB_RECURSE all_hdrs
locktree/*.h
portability/*.h
src/*.h
toku_include/*.h
utils/*.h
util/*.h
db-benchmark-test/*.h
)
list(APPEND all_hdrs
${CMAKE_CURRENT_BINARY_DIR}/toku_include/toku_config.h
${CMAKE_CURRENT_BINARY_DIR}/portability/toku_config.h
${CMAKE_CURRENT_BINARY_DIR}/buildheader/db.h
${CMAKE_CURRENT_BINARY_DIR}/ft/log_header.h
)
......@@ -79,7 +77,7 @@ if (USE_CSCOPE)
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/cscope.out"
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/cscope.in.out"
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/cscope.po.out"
COMMAND ${CSCOPE} -b -q -R -i"${CMAKE_CURRENT_BINARY_DIR}/cscope.files" -I"${CMAKE_CURRENT_SOURCE_DIR}" -I"${CMAKE_CURRENT_SOURCE_DIR}/include" -I"${CMAKE_CURRENT_SOURCE_DIR}/toku_include" -I"${CMAKE_CURRENT_SOURCE_DIR}/portability" -I"${CMAKE_CURRENT_SOURCE_DIR}/ft" -I"${CMAKE_CURRENT_SOURCE_DIR}/src" -I"${CMAKE_CURRENT_SOURCE_DIR}/locktree" -I"${CMAKE_CURRENT_SOURCE_DIR}/utils" -I"${CMAKE_CURRENT_SOURCE_DIR}/db-benchmark-test" -I"${CMAKE_CURRENT_BINARY_DIR}" -I"${CMAKE_CURRENT_BINARY_DIR}/toku_include" -I"${CMAKE_CURRENT_BINARY_DIR}/buildheader"
COMMAND ${CSCOPE} -b -q -R -i"${CMAKE_CURRENT_BINARY_DIR}/cscope.files" -I"${CMAKE_CURRENT_SOURCE_DIR}" -I"${CMAKE_CURRENT_SOURCE_DIR}/include" -I"${CMAKE_CURRENT_SOURCE_DIR}/portability" -I"${CMAKE_CURRENT_SOURCE_DIR}/portability" -I"${CMAKE_CURRENT_SOURCE_DIR}/ft" -I"${CMAKE_CURRENT_SOURCE_DIR}/src" -I"${CMAKE_CURRENT_SOURCE_DIR}/locktree" -I"${CMAKE_CURRENT_SOURCE_DIR}/utils" -I"${CMAKE_CURRENT_SOURCE_DIR}/db-benchmark-test" -I"${CMAKE_CURRENT_BINARY_DIR}" -I"${CMAKE_CURRENT_BINARY_DIR}/portability" -I"${CMAKE_CURRENT_BINARY_DIR}/buildheader"
DEPENDS ${all_srcs} ${all_hdrs} install_tdb_h generate_config_h generate_log_code
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
add_custom_target(build_cscope.out ALL DEPENDS
......
......@@ -89,11 +89,12 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2011-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 "background_job_manager.h"
#include "toku_config.h"
#include <portability/toku_config.h>
#include <memory.h>
#include <toku_pthread.h>
#include "background_job_manager.h"
struct background_job_manager_struct {
bool accepting_jobs;
uint32_t num_jobs;
......
......@@ -92,7 +92,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 "toku_config.h"
#include <portability/toku_config.h>
#include <toku_race_tools.h>
// Symbol TOKUDB_REVISION is not defined by fractal-tree makefiles, so
......
......@@ -90,7 +90,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 <memory.h>
#include <toku_include/toku_portability.h>
#include <portability/toku_portability.h>
#include "rollback_log_node_cache.h"
......
......@@ -93,7 +93,7 @@ PATENT RIGHTS GRANT:
#include <string.h>
#include <toku_include/memory.h>
#include <portability/memory.h>
#include <locktree/range_buffer.h>
......
......@@ -29,10 +29,19 @@ set_property(TARGET ${LIBTOKUPORTABILITY} tokuportability_static_conv APPEND PRO
set_property(SOURCE file memory os_malloc portability toku_assert toku_rwlock APPEND PROPERTY
COMPILE_DEFINITIONS TOKU_ALLOW_DEPRECATED=1)
configure_file(toku_config.h.in toku_config.h)
add_custom_target(generate_config_h DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/toku_config.h")
# detect when we are being built as a subproject
if (NOT DEFINED MYSQL_PROJECT_NAME_DOCSTRING)
install(
FILES toku_os_types.h toku_time.h
FILES toku_os_types.h toku_time.h toku_list.h toku_os.h
DESTINATION include
COMPONENT tokukv_headers
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/toku_config.h"
DESTINATION include
COMPONENT tokukv_headers
)
......
......@@ -93,8 +93,8 @@ PATENT RIGHTS GRANT:
#include <stdio.h>
#include <string.h>
#include <toku_include/toku_assert.h>
#include <toku_include/toku_os.h>
#include <portability/toku_assert.h>
#include <portability/toku_os.h>
static bool check_huge_pages_config_file(const char *fname)
// Effect: Return true if huge pages are there. If so, print diagnostics.
......
......@@ -88,7 +88,7 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#include "toku_config.h"
#include <portability/toku_config.h>
#include <toku_portability.h>
#include <string.h>
......
......@@ -89,7 +89,7 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#include "toku_config.h"
#include <portability/toku_config.h>
#include <toku_portability.h>
#include <stdlib.h>
......
......@@ -88,7 +88,7 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#ident "$Id$"
#include "toku_config.h"
#include <portability/toku_config.h>
#include <stdio.h>
#include <stdlib.h>
......
......@@ -89,15 +89,17 @@ 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 "toku_config.h"
#include <memory.h>
#include <portability/toku_config.h>
#include <portability/toku_atomic.h>
#include "test.h"
#include <memory.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include "test.h"
int verbose = 0;
static const size_t cachelinesize = 64;
......
......@@ -88,12 +88,12 @@ 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 <stdio.h>
#include <assert.h>
#include <toku_include/toku_os.h>
#include <portability/toku_os.h>
#include <portability/toku_assert.h>
int main(void) {
bool enabled = toku_os_huge_pages_enabled();
assert(!enabled);
invariant(!enabled);
return 0;
}
......@@ -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 "toku_config.h"
#include <portability/toku_config.h>
#include <stdio.h>
#include <toku_stdint.h>
#include <unistd.h>
......
......@@ -88,7 +88,7 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#include "toku_config.h"
#include <portability/toku_config.h>
#include <toku_portability.h>
#include "toku_assert.h"
......
......@@ -94,7 +94,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 "toku_config.h"
#include <portability/toku_config.h>
#include <stdint.h>
#include <errno.h>
......@@ -103,7 +103,6 @@ PATENT RIGHTS GRANT:
#error NDEBUG should not be set
#endif
static inline int get_error_errno(void);
static inline int
......
......@@ -91,8 +91,9 @@ PATENT RIGHTS GRANT:
#ifndef TOKU_ATOMIC_H
#define TOKU_ATOMIC_H
#include "toku_config.h"
#include <portability/toku_config.h>
#include <toku_assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
......
......@@ -91,7 +91,7 @@ PATENT RIGHTS GRANT:
#ifndef TOKU_BYTESWAP_H
#define TOKU_BYTESWAP_H
#include "toku_config.h"
#include <portability/toku_config.h>
#if defined(HAVE_BYTESWAP_H)
# include <byteswap.h>
......
......@@ -109,7 +109,7 @@ PATENT RIGHTS GRANT:
#ifndef _TOKU_HTOD_H
#define _TOKU_HTOD_H
#include "toku_config.h"
#include <portability/toku_config.h>
#if defined(HAVE_ENDIAN_H)
# include <endian.h>
......
......@@ -95,7 +95,6 @@ PATENT RIGHTS GRANT:
//#error
#endif
// TODO: This byte order stuff should all be in once place (ie: portability layer, not toku_include)
#include <toku_htod.h>
#include <arpa/inet.h>
......
......@@ -91,7 +91,7 @@ PATENT RIGHTS GRANT:
#ifndef TOKU_PORTABILITY_H
#define TOKU_PORTABILITY_H
#include "toku_config.h"
#include <portability/toku_config.h>
// Tokutek portability layer
......
......@@ -89,7 +89,7 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2007-2013 Tokutek Inc. All rights reserved."
#define _GNU_SOURCE 1
#include "toku_config.h"
#include <portability/toku_config.h>
#include <toku_pthread.h>
int toku_pthread_yield(void) {
......
......@@ -91,7 +91,7 @@ PATENT RIGHTS GRANT:
#ifndef TOKU_RACE_TOOLS_H
#define TOKU_RACE_TOOLS_H
#include "toku_config.h"
#include <portability/toku_config.h>
#if defined(__linux__) && USE_VALGRIND
......
......@@ -91,7 +91,7 @@ PATENT RIGHTS GRANT:
#ifndef TOKU_RANDOM_H
#define TOKU_RANDOM_H
#include "toku_config.h"
#include <portability/toku_config.h>
#include <toku_portability.h>
#include <toku_assert.h>
#include <stdlib.h>
......
......@@ -91,7 +91,7 @@ PATENT RIGHTS GRANT:
#ifndef TOKU_TIME_H
#define TOKU_TIME_H
#include "toku_config.h"
#include <portability/toku_config.h>
#include <time.h>
#include <sys/time.h>
#include <stdint.h>
......
......@@ -400,7 +400,7 @@ if(BUILD_TESTING OR BUILD_SRC_TESTS)
set_property(TARGET ${base}.bdb APPEND PROPERTY
COMPILE_DEFINITIONS "USE_BDB;IS_TDB=0;TOKU_ALLOW_DEPRECATED")
set_target_properties(${base}.bdb PROPERTIES
INCLUDE_DIRECTORIES "${BDB_INCLUDE_DIR};${CMAKE_CURRENT_BINARY_DIR}/../../toku_include;${CMAKE_CURRENT_SOURCE_DIR}/../../toku_include;${CMAKE_CURRENT_SOURCE_DIR}/../../portability;${CMAKE_CURRENT_SOURCE_DIR}/../..")
INCLUDE_DIRECTORIES "${BDB_INCLUDE_DIR};${CMAKE_CURRENT_SOURCE_DIR}/../../portability;${CMAKE_CURRENT_SOURCE_DIR}/../..")
target_link_libraries(${base}.bdb ${LIBTOKUPORTABILITY} ${BDB_LIBRARIES})
add_space_separated_property(TARGET ${base}.bdb COMPILE_FLAGS -fvisibility=hidden)
endforeach(bin)
......
configure_file(toku_config.h.in toku_config.h)
add_custom_target(generate_config_h DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/toku_config.h")
# detect when we are being built as a subproject
if (NOT DEFINED MYSQL_PROJECT_NAME_DOCSTRING)
install(
FILES toku_list.h toku_os.h
DESTINATION include
COMPONENT tokukv_headers
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/toku_config.h"
DESTINATION include
COMPONENT tokukv_headers
)
endif ()
\ No newline at end of file
......@@ -14,7 +14,7 @@ foreach(util ${utils})
set_property(TARGET ${util}.bdb APPEND PROPERTY
COMPILE_DEFINITIONS "IS_TDB=0;USE_BDB=1;TOKU_ALLOW_DEPRECATED")
set_target_properties(${util}.bdb PROPERTIES
INCLUDE_DIRECTORIES "${BDB_INCLUDE_DIR};${CMAKE_CURRENT_BINARY_DIR}/../toku_include;${CMAKE_CURRENT_SOURCE_DIR}/../toku_include;${CMAKE_CURRENT_SOURCE_DIR}/../portability;${CMAKE_CURRENT_SOURCE_DIR}/..")
INCLUDE_DIRECTORIES "${BDB_INCLUDE_DIR};${CMAKE_CURRENT_SOURCE_DIR}/../portability;${CMAKE_CURRENT_SOURCE_DIR}/..")
target_link_libraries(${util}.bdb ${LIBTOKUPORTABILITY} ${BDB_LIBRARIES})
add_space_separated_property(TARGET ${util}.bdb COMPILE_FLAGS -fvisibility=hidden)
endif()
......
......@@ -91,7 +91,7 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2007-2014 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 <toku_include/toku_portability.h>
#include <portability/toku_portability.h>
#include <db.h>
......
......@@ -91,7 +91,7 @@ PATENT RIGHTS GRANT:
#include <string.h>
#include <db.h>
#include <toku_include/memory.h>
#include <portability/memory.h>
#include <limits.h>
namespace toku {
......
......@@ -117,7 +117,7 @@ PATENT RIGHTS GRANT:
//******************************************************************************
#include <stdbool.h>
#include <toku_include/toku_assert.h>
#include <portability/toku_assert.h>
namespace toku {
......
......@@ -89,11 +89,13 @@ PATENT RIGHTS GRANT:
#ident "Copyright (c) 2011-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 "kibbutz.h"
#include "toku_config.h"
#include <memory.h>
#include <portability/toku_config.h>
#include <toku_pthread.h>
#include "kibbutz.h"
// A Kibbutz is a collection of workers and some work to do.
struct todo {
void (*f)(void *extra);
......
......@@ -92,7 +92,7 @@ PATENT RIGHTS GRANT:
#include <string.h>
#include <db.h>
#include <toku_include/memory.h>
#include <portability/memory.h>
namespace toku {
......
......@@ -89,7 +89,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 <toku_include/memory.h>
#include <portability/memory.h>
#include <util/scoped_malloc.h>
......
......@@ -90,7 +90,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 <toku_stdlib.h>
#include <toku_include/toku_portability.h>
#include <portability/toku_portability.h>
#include "x1764.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