change to LMDB as default, even on 32-bit and ARM

This commit is contained in:
Riccardo Spagni 2016-03-12 21:20:00 +02:00 committed by Howard Chu
parent 2f8366fb21
commit b28258a1c6

View file

@ -206,41 +206,32 @@ elseif()
endif() endif()
if (DATABASE STREQUAL "lmdb") if (DATABASE STREQUAL "lmdb")
message(STATUS "Using LMDB as default DB type")
set(BLOCKCHAIN_DB DB_LMDB) set(BLOCKCHAIN_DB DB_LMDB)
add_definitions("-DDEFAULT_DB_TYPE=\"lmdb\"")
# temporarily allow mingw to compile with berkeley_db, elseif (DATABASE STREQUAL "berkeleydb")
# regardless if building static or not find_package(BerkeleyDB)
if(NOT STATIC OR MINGW) if(NOT BERKELEY_DB)
find_package(BerkeleyDB) 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()
if(BERKELEY_DB_OVERRIDE AND NOT BERKELEY_DB) message(STATUS "Found BerkeleyDB include (db.h) in ${BERKELEY_DB_INCLUDE_DIR}")
message(STATUS "BERKELEY_DB setting has been overridden and disabled") if(BERKELEY_DB_LIBRARIES)
elseif(NOT BERKELEY_DB_LIBRARIES) message(STATUS "Found BerkeleyDB shared library")
message(STATUS "BerkeleyDB not found and has been disabled.") 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() else()
message(STATUS "Found BerkeleyDB include (db.h) in ${BERKELEY_DB_INCLUDE_DIR}") 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.")
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()
message(STATUS "Found BerkeleyDB includes, but could not find BerkeleyDB library. Please make sure you have installed libdb and libdb-dev or the equivalent")
endif()
endif() endif()
endif() endif()
if (BERKELEY_DB AND (ARCH_WIDTH STREQUAL "32" OR ARM6 OR ARM7)) message(STATUS "Using Berkeley DB as default DB type")
message(STATUS "Using Berkeley DB as default DB type") add_definitions("-DDEFAULT_DB_TYPE=\"berkeley\"")
add_definitions("-DDEFAULT_DB_TYPE=\"berkeley\"")
else()
message(STATUS "Using LMDB as default DB type")
add_definitions("-DDEFAULT_DB_TYPE=\"lmdb\"")
endif()
elseif (DATABASE STREQUAL "memory") elseif (DATABASE STREQUAL "memory")
set(BLOCKCHAIN_DB DB_MEMORY) set(BLOCKCHAIN_DB DB_MEMORY)
message(STATUS "Using Serialised In Memory as default DB type")
add_definitions("-DDEFAULT_DB_TYPE=\"memory\"") add_definitions("-DDEFAULT_DB_TYPE=\"memory\"")
else() else()
die("Invalid database type: ${DATABASE}") die("Invalid database type: ${DATABASE}")