From 70e9f180c8718086218c37d727736bbdba2d2125 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sun, 4 Oct 2015 19:01:33 +0100 Subject: [PATCH] build: default to Berkeley DB for 32 bit and ARM --- CMakeLists.txt | 9 +++++++++ src/daemon/command_line_args.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e4dbd9457..8cf66db97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -218,8 +218,17 @@ if (DATABASE STREQUAL "lmdb") endif() endif() endif() + + if (BERKELEY_DB AND (ARCH_WIDTH STREQUAL "32" OR ARM6 OR ARM7)) + message(STATUS "Using Berkeley DB as default DB type") + 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") set(BLOCKCHAIN_DB DB_MEMORY) + add_definitions("-DDEFAULT_DB_TYPE=\"memory\"") else() die("Invalid database type: ${DATABASE}") endif() diff --git a/src/daemon/command_line_args.h b/src/daemon/command_line_args.h index ba98a6ea1..8da470c86 100644 --- a/src/daemon/command_line_args.h +++ b/src/daemon/command_line_args.h @@ -73,7 +73,7 @@ namespace daemon_args const command_line::arg_descriptor arg_db_type = { "db-type" , "Specify database type" - , "lmdb" + , DEFAULT_DB_TYPE }; const command_line::arg_descriptor arg_prep_blocks_threads = { "prep-blocks-threads"