Commit a482f222 authored by Sergei Petrunia's avatar Sergei Petrunia

Fix MariaRocks build (unfinished)

Got to the point where we fail when compiling MyRocks files.
parent be331788
# TODO: Copyrights
IF (NOT EXISTS "${CMAKE_SOURCE_DIR}/rocksdb/Makefile")
IF (NOT EXISTS "${CMAKE_SOURCE_DIR}/storage/rocksdb/rocksdb/Makefile")
MESSAGE(SEND_ERROR "Missing Makefile in rocksdb directory. Try \"git submodule update\".")
ENDIF()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# get a list of rocksdb library source files
# run with env -i to avoid passing variables
EXECUTE_PROCESS(
......@@ -15,8 +17,8 @@ EXECUTE_PROCESS(
STRING(REGEX MATCHALL "[^\n]+" ROCKSDB_LIB_SOURCES ${SCRIPT_OUTPUT})
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/rocksdb
${CMAKE_SOURCE_DIR}/rocksdb/include
${CMAKE_SOURCE_DIR}/storage/rocksdb/rocksdb
${CMAKE_SOURCE_DIR}/storage/rocksdb/rocksdb/include
${CMAKE_SOURCE_DIR}/rocksdb/third-party/gtest-1.7.0/fused-src
)
......@@ -93,14 +95,14 @@ ENDIF()
IF (WITH_ROCKSDB_SE_STORAGE_ENGINE)
# TODO: read this file list from src.mk:TOOL_SOURCES
SET(ROCKSDB_TOOL_SOURCES
${CMAKE_SOURCE_DIR}/rocksdb/tools/ldb_tool.cc
${CMAKE_SOURCE_DIR}/rocksdb/tools/ldb_cmd.cc
${CMAKE_SOURCE_DIR}/rocksdb/tools/sst_dump_tool.cc
${CMAKE_SOURCE_DIR}/storage/rocksdb/rocksdb/tools/ldb_tool.cc
${CMAKE_SOURCE_DIR}/storage/rocksdb/rocksdb/tools/ldb_cmd.cc
${CMAKE_SOURCE_DIR}/storage/rocksdb/rocksdb/tools/sst_dump_tool.cc
)
MYSQL_ADD_EXECUTABLE(sst_dump ${CMAKE_SOURCE_DIR}/rocksdb/tools/sst_dump.cc ${ROCKSDB_TOOL_SOURCES})
MYSQL_ADD_EXECUTABLE(sst_dump ${CMAKE_SOURCE_DIR}/storage/rocksdb/rocksdb/tools/sst_dump.cc ${ROCKSDB_TOOL_SOURCES})
TARGET_LINK_LIBRARIES(sst_dump rocksdb_se)
MYSQL_ADD_EXECUTABLE(ldb ${CMAKE_SOURCE_DIR}/rocksdb/tools/ldb.cc ${ROCKSDB_TOOL_SOURCES})
MYSQL_ADD_EXECUTABLE(ldb ${CMAKE_SOURCE_DIR}/storage/rocksdb/rocksdb/tools/ldb.cc ${ROCKSDB_TOOL_SOURCES})
TARGET_LINK_LIBRARIES(ldb rocksdb_se)
MYSQL_ADD_EXECUTABLE(mysql_ldb ${CMAKE_SOURCE_DIR}/storage/rocksdb/tools/mysql_ldb.cc ${ROCKSDB_TOOL_SOURCES})
......
......@@ -2,20 +2,20 @@
MKFILE=`mktemp`
# create and run a simple makefile
# include rocksdb make file relative to the path of this script
echo "include rocksdb/src.mk
echo "include ./storage/rocksdb/rocksdb/src.mk
all:
@echo \$(LIB_SOURCES)" > $MKFILE
for f in `make --makefile $MKFILE`
do
echo ../../rocksdb/$f
echo ./rocksdb/$f
done
rm $MKFILE
# create build_version.cc file. Only create one if it doesn't exists or if it is different
# this is so that we don't rebuild mysqld every time
bv=rocksdb/util/build_version.cc
bv=storage/rocksdb/rocksdb/util/build_version.cc
date=$(date +%F)
git_sha=$(pushd rocksdb >/dev/null && git rev-parse HEAD 2>/dev/null && popd >/dev/null)
git_sha=$(pushd storage/rocksdb/rocksdb >/dev/null && git rev-parse HEAD 2>/dev/null && popd >/dev/null)
if [ ! -f $bv ] || [ -z $git_sha ] || [ ! `grep $git_sha $bv` ]
then
echo "#include \"build_version.h\"
......
......@@ -21,6 +21,7 @@
#define MYSQL_SERVER 1
/* The C++ file's header */
#include <my_config.h>
#include "./ha_rocksdb.h"
/* C++ standard header files */
......@@ -36,7 +37,9 @@
#include "./sql_table.h"
#include <mysys_err.h>
#include <mysql/psi/mysql_table.h>
#ifdef MARIAROCKS_NOT_YET
#include <mysql/thread_pool_priv.h>
#endif
/* RocksDB includes */
#include "rocksdb/compaction_filter.h"
......
......@@ -29,7 +29,7 @@
#include "./handler.h" /* handler */
#include "./my_global.h" /* ulonglong */
#include "./sql_string.h"
#include "./ut0counter.h"
#include "../storage/innobase/include/ut0counter.h"
/* RocksDB header files */
#include "rocksdb/cache.h"
......
......@@ -18,6 +18,7 @@
#pragma implementation // gcc: Class implementation
#endif
#include <my_config.h>
/* This C++ file's header file */
#include "./rdb_datadic.h"
......
......@@ -19,7 +19,9 @@
/* MySQL includes */
#include "./my_global.h"
#include <mysql/psi/mysql_table.h>
#ifdef MARIAROCKS_NOT_YET
#include <mysql/thread_pool_priv.h>
#endif
/* MyRocks header files */
#include "./rdb_utils.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