Skip to content

Commit

Permalink
removed deprecated BDB (LMDB is used anyway)
Browse files Browse the repository at this point in the history
  • Loading branch information
salda committed Apr 20, 2018
1 parent da18458 commit f3b84b9
Show file tree
Hide file tree
Showing 16 changed files with 24 additions and 3,629 deletions.
37 changes: 0 additions & 37 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -227,46 +227,14 @@ else()
message(STATUS "Could not find DATABASE in env (not required unless you want to change database type from default: ${DATABASE})")
endif()

set(BERKELEY_DB_OVERRIDE 0)
if (DEFINED ENV{BERKELEY_DB})
set(BERKELEY_DB_OVERRIDE 1)
set(BERKELEY_DB $ENV{BERKELEY_DB})
elseif()
set(BERKELEY_DB 0)
endif()

if (DATABASE STREQUAL "lmdb")
message(STATUS "Using LMDB as default DB type")
set(BLOCKCHAIN_DB DB_LMDB)
add_definitions("-DDEFAULT_DB_TYPE=\"lmdb\"")
elseif (DATABASE STREQUAL "berkeleydb")
find_package(BerkeleyDB)
if(NOT BERKELEY_DB)
die("Found BerkeleyDB includes, but could not find BerkeleyDB library. Please make sure you have installed libdb and libdb-dev / libdb++-dev or the equivalent.")
else()
message(STATUS "Found BerkeleyDB include (db.h) in ${BERKELEY_DB_INCLUDE_DIR}")
if(BERKELEY_DB_LIBRARIES)
message(STATUS "Found BerkeleyDB shared library")
set(BDB_STATIC false CACHE BOOL "BDB Static flag")
set(BDB_INCLUDE ${BERKELEY_DB_INCLUDE_DIR} CACHE STRING "BDB include path")
set(BDB_LIBRARY ${BERKELEY_DB_LIBRARIES} CACHE STRING "BDB library name")
set(BDB_LIBRARY_DIRS "" CACHE STRING "BDB Library dirs")
set(BERKELEY_DB 1)
else()
die("Found BerkeleyDB includes, but could not find BerkeleyDB library. Please make sure you have installed libdb and libdb-dev / libdb++-dev or the equivalent.")
endif()
endif()

message(STATUS "Using Berkeley DB as default DB type")
add_definitions("-DDEFAULT_DB_TYPE=\"berkeley\"")
else()
die("Invalid database type: ${DATABASE}")
endif()

if(BERKELEY_DB)
add_definitions("-DBERKELEY_DB")
endif()

add_definitions("-DBLOCKCHAIN_DB=${BLOCKCHAIN_DB}")

# Can't install hook in static build on OSX, because OSX linker does not support --wrap
Expand Down Expand Up @@ -342,11 +310,6 @@ include_directories(external/rapidjson)
# Final setup for liblmdb
include_directories(${LMDB_INCLUDE})

# Final setup for Berkeley DB
if (BERKELEY_DB)
include_directories(${BDB_INCLUDE})
endif()

# Final setup for libunwind
include_directories(${LIBUNWIND_INCLUDE})
link_directories(${LIBUNWIND_LIBRARY_DIRS})
Expand Down
25 changes: 0 additions & 25 deletions cmake/FindBerkeleyDB.cmake

This file was deleted.

73 changes: 0 additions & 73 deletions external/db_drivers/liblmdb/sample-bdb.txt

This file was deleted.

16 changes: 0 additions & 16 deletions src/blockchain_db/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,13 @@ set(blockchain_db_sources
lmdb/db_lmdb.cpp
)

if (BERKELEY_DB)
set(blockchain_db_sources
${blockchain_db_sources}
berkeleydb/db_bdb.cpp
)
endif()


set(blockchain_db_headers)

set(blockchain_db_private_headers
blockchain_db.h
lmdb/db_lmdb.h
)

if (BERKELEY_DB)
set(blockchain_db_private_headers
${blockchain_db_private_headers}
berkeleydb/db_bdb.h
)
endif()

sumokoin_private_headers(blockchain_db
${crypto_private_headers})
sumokoin_add_library(blockchain_db
Expand All @@ -64,7 +49,6 @@ target_link_libraries(blockchain_db
common
crypto
${LMDB_LIBRARY}
${BDB_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
PRIVATE
Expand Down
Loading

0 comments on commit f3b84b9

Please sign in to comment.