Commit 056e7fb1 authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

[t:4871] move generated logging code into the binary directory

git-svn-id: file:///svn/toku/tokudb@43527 c7de825b-a66e-492c-adef-691d508d4ae1
parent 71075e0d
......@@ -85,6 +85,7 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/toku_include
${CMAKE_CURRENT_SOURCE_DIR}/portability
${CMAKE_CURRENT_SOURCE_DIR} ## so you can include <newbrt/brt.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)
......@@ -110,29 +111,5 @@ install(
DESTINATION .
)
## set up lists of sources and headers for tags
file(GLOB_RECURSE all_srcs
include/*.c
toku_include/*.c
buildheader/*.c
portability/*.c
newbrt/*.c
src/*.c
utils/*.c
db-benchmark-test/*.c
)
file(GLOB_RECURSE all_hdrs
include/*.h
toku_include/*.h
buildheader/*.h
portability/*.h
newbrt/*.h
src/*.h
utils/*.h
db-benchmark-test/*.h
${CMAKE_CURRENT_BINARY_DIR}/toku_include/*.h
${CMAKE_CURRENT_BINARY_DIR}/buildheader/*.h
)
## build tags
include(TokuBuildTagDatabases)
## set up lists of sources and headers for tags
file(GLOB_RECURSE all_srcs
include/*.c
toku_include/*.c
buildheader/*.c
portability/*.c
newbrt/*.c
src/*.c
utils/*.c
db-benchmark-test/*.c
${CMAKE_CURRENT_BINARY_DIR}/newbrt/log_code.c
${CMAKE_CURRENT_BINARY_DIR}/newbrt/log_print.c
)
file(GLOB_RECURSE all_hdrs
include/*.h
toku_include/*.h
buildheader/*.h
portability/*.h
newbrt/*.h
src/*.h
utils/*.h
db-benchmark-test/*.h
${CMAKE_CURRENT_BINARY_DIR}/toku_include/config.h
${CMAKE_CURRENT_BINARY_DIR}/buildheader/db.h
${CMAKE_CURRENT_BINARY_DIR}/newbrt/log_header.h
)
option(USE_CTAGS "Build the ctags database." ON)
if (USE_CTAGS)
find_program(CTAGS "ctags")
......@@ -7,7 +34,7 @@ if (USE_CTAGS)
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ctags-stamp"
COMMAND ${CTAGS} -o tags ${all_srcs} ${all_hdrs}
COMMAND touch "${CMAKE_CURRENT_BINARY_DIR}/ctags-stamp"
DEPENDS ${all_srcs} ${all_hdrs} install_tdb_h generate_logging_code generate_config_h
DEPENDS ${all_srcs} ${all_hdrs} install_tdb_h generate_config_h
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
add_custom_target(build_ctags ALL DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/tags" ctags-stamp)
endif ()
......@@ -22,7 +49,7 @@ if (USE_ETAGS)
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/etags-stamp"
COMMAND ${ETAGS} -o TAGS ${all_srcs} ${all_hdrs}
COMMAND touch "${CMAKE_CURRENT_BINARY_DIR}/etags-stamp"
DEPENDS ${all_srcs} ${all_hdrs} install_tdb_h generate_logging_code generate_config_h
DEPENDS ${all_srcs} ${all_hdrs} install_tdb_h generate_config_h
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
add_custom_target(build_etags ALL DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/TAGS" etags-stamp)
endif ()
......@@ -37,7 +64,7 @@ if (USE_CSCOPE)
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/cscope.in.out"
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/cscope.po.out"
COMMAND ${CSCOPE} -b -q -R
DEPENDS ${all_srcs} ${all_hdrs} install_tdb_h generate_logging_code generate_config_h
DEPENDS ${all_srcs} ${all_hdrs} install_tdb_h generate_config_h
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
add_custom_target(build_cscope.out ALL DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/cscope.out"
......@@ -56,7 +83,7 @@ if (USE_GTAGS)
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/GRTAGS"
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/GPATH"
COMMAND ${GTAGS} --gtagsconf "${CMAKE_CURRENT_SOURCE_DIR}/.globalrc"
DEPENDS ${all_srcs} ${all_hdrs} install_tdb_h generate_logging_code generate_config_h
DEPENDS ${all_srcs} ${all_hdrs} install_tdb_h generate_config_h
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
add_custom_target(build_GTAGS ALL DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/GTAGS"
......
......@@ -10,16 +10,12 @@ add_executable(logformat logformat.c)
target_link_libraries(logformat ${LIBTOKUPORTABILITY})
add_custom_command(
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/log_code.c"
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/log_print.c"
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/log_header.h"
COMMAND $<TARGET_FILE:logformat> "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/log_code.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/log_print.c"
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/log_header.h"
COMMAND $<TARGET_FILE:logformat> .
DEPENDS logformat
)
add_custom_target(generate_logging_code DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/log_code.c"
"${CMAKE_CURRENT_SOURCE_DIR}/log_print.c"
"${CMAKE_CURRENT_SOURCE_DIR}/log_header.h")
)
set(BRT_SOURCES
block_allocator.c
......@@ -46,9 +42,10 @@ set(BRT_SOURCES
le-cursor.c
logfilemgr.c
logger.c
log_code.c
"${CMAKE_CURRENT_BINARY_DIR}/log_code.c"
"${CMAKE_CURRENT_BINARY_DIR}/log_header.h"
log_upgrade.c
log_print.c
"${CMAKE_CURRENT_BINARY_DIR}/log_print.c"
logcursor.c
memarena.c
mempool.c
......
......@@ -17,7 +17,7 @@
#include "cachetable.h"
#include "rwlock.h"
#include "nonblocking_mutex.h"
#include "log_header.h"
#include <newbrt/log_header.h>
#include "checkpoint.h"
#include "minicron.h"
#include "log-internal.h"
......
......@@ -45,7 +45,7 @@
#include "key.h"
#include "leafentry.h"
#include "log-internal.h"
#include "log_header.h"
#include <newbrt/log_header.h>
#include "logcursor.h"
#include "logfilemgr.h"
#include "rbuf.h"
......
......@@ -4,7 +4,7 @@
#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 "includes.h"
#include "log_header.h"
#include <newbrt/log_header.h>
#include "checkpoint.h"
static uint64_t footprint = 0; // for debug and accountability
......
......@@ -5,7 +5,7 @@
#ident "Copyright (c) 2007-2010 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 "log_header.h"
#include <newbrt/log_header.h>
#if defined(__cplusplus) || defined(__cilkplusplus)
extern "C" {
......
......@@ -5,7 +5,7 @@
#ident "Copyright (c) 2007-2010 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 "log_header.h"
#include <newbrt/log_header.h>
#if defined(__cplusplus) || defined(__cilkplusplus)
extern "C" {
......
......@@ -722,9 +722,9 @@ int main (int argc, const char *const argv[]) {
fprintf(hf, "#define LOG_HEADER_H\n");
fprintf2(cf, hf, "/* Do not edit this file. This code generated by logformat.c. Copyright 2007-2010 Tokutek. */\n");
fprintf2(cf, hf, "#ident \"Copyright (c) 2007-2010 Tokutek Inc. All rights reserved.\"\n");
fprintf2(cf, pf, "#include \"includes.h\"\n");
fprintf(hf, "#include \"brt-internal.h\"\n");
fprintf(hf, "#include \"memarena.h\"\n");
fprintf2(cf, pf, "#include <newbrt/includes.h>\n");
fprintf(hf, "#include <newbrt/brt-internal.h>\n");
fprintf(hf, "#include <newbrt/memarena.h>\n");
fprintf(hf, "#if defined(__cplusplus)\nextern \"C\" {\n#endif\n");
generate_enum();
generate_log_struct();
......
......@@ -4,7 +4,7 @@
#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 "includes.h"
#include "log_header.h"
#include <newbrt/log_header.h>
#include "checkpoint.h"
static const char recovery_lock_file[] = "/__tokudb_recoverylock_dont_delete_me";
......
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_BINARY_DIR}/..")
add_subdirectory(range_tree)
add_subdirectory(lock_tree)
......
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