Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ Makefile.in
.libs
*.la
*.lo
/aclocal.m4
/autom4te.cache
/build-aux
/config.*
/configure
/libtool
.dirstamp
builds/gnu/aclocal.m4
builds/gnu/autom4te.cache
builds/gnu/build-aux
builds/gnu/config.*
builds/gnu/configure
builds/gnu/libtool
builds/gnu/.dirstamp

# pkg-config pc file from .pc.in
*.pc
builds/gnu/*.pc

# msbuild/msvc
/.vs
Expand Down
412 changes: 0 additions & 412 deletions Makefile.am

This file was deleted.

18 changes: 6 additions & 12 deletions builds/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,12 @@ endif()
#------------------------------------------------------------------------------
# Project options.
#------------------------------------------------------------------------------
option( with-tests "Build tests." ON )
option( with-tools "Build tools." ON )
option( with-tests "Compile with unit tests." ON )
option( with-tools "Compile with tools." ON )

#------------------------------------------------------------------------------
# Dependencies.
#------------------------------------------------------------------------------

if ( BUILD_SHARED_LIBS )
set( libbitcoin-system_USE_STATIC_LIBS "OFF" )
set( Boost_USE_STATIC_LIBS "OFF" )
Expand All @@ -96,7 +95,6 @@ find_package( Boost 1.86.0 REQUIRED
#------------------------------------------------------------------------------
# Compiler options.
#------------------------------------------------------------------------------

include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
include(CheckCXXSourceCompiles)
Expand Down Expand Up @@ -168,13 +166,8 @@ endif()
#------------------------------------------------------------------------------
# Linker options.
#------------------------------------------------------------------------------

include(CheckLinkerFlag)

#------------------------------------------------------------------------------
# Configurable file(s).
#------------------------------------------------------------------------------

#------------------------------------------------------------------------------
# libbitcoin-database library
#------------------------------------------------------------------------------
Expand All @@ -196,7 +189,7 @@ target_compile_options( libbitcoin-database
$<$<COMPILE_LANGUAGE:CXX>:-Wno-comment>
$<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-copy>
$<$<CXX_COMPILER_ID:Clang>:-Wno-mismatched-tags>
-fstack-protector-all
$<$<COMPILE_LANGUAGE:CXX>:-fstack-protector-all>
)

file( GLOB_RECURSE libbitcoin_database_HEADERS CONFIGURE_DEPENDS
Expand Down Expand Up @@ -275,7 +268,7 @@ if ( with-tests )
$<$<CXX_COMPILER_ID:Clang>:-Wno-mismatched-tags>
$<$<COMPILE_LANGUAGE:CXX>:-Wno-long-long>
$<$<CXX_COMPILER_ID:GNU>:-fno-var-tracking-assignments>
-fstack-protector-all
$<$<COMPILE_LANGUAGE:CXX>:-fstack-protector-all>
)

file( GLOB_RECURSE libbitcoin_database_test_SOURCES CONFIGURE_DEPENDS
Expand Down Expand Up @@ -325,7 +318,7 @@ if ( with-tools )
$<$<CXX_COMPILER_ID:Clang>:-Wno-mismatched-tags>
$<$<COMPILE_LANGUAGE:CXX>:-Wno-long-long>
$<$<CXX_COMPILER_ID:GNU>:-fno-var-tracking-assignments>
-fstack-protector-all
$<$<COMPILE_LANGUAGE:CXX>:-fstack-protector-all>
)

file( GLOB_RECURSE libbitcoin_database_tools_SOURCES CONFIGURE_DEPENDS
Expand All @@ -350,6 +343,7 @@ if ( with-tools )
OUTPUT_NAME initchain
)
endif()

#------------------------------------------------------------------------------
# Installation routine.
#------------------------------------------------------------------------------
Expand Down
86 changes: 60 additions & 26 deletions builds/cmake/install-cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
# Default: OFF
# -Denable-shani=<ON/OFF> Use Intel/ARM SHA Extensions.
# Default: OFF
# -Dwith-ultrafast=<ON/OFF> Use shrec/UltrafastSecp256k1.
# -Dwith-ultrafast=<ON/OFF> Use shrec/UltrafastSecp256k1 library.
# Default: OFF
# -Dwith-secp256k1=<ON/OFF> Use bitcoin-core/secp256k1.
# -Dwith-secp256k1=<ON/OFF> Use bitcoin-core/secp256k1 library.
# Default: ON
# --build-boost Build Boost libraries
# --build-secp256k1 Build libsecp256k1 libraries
Expand Down Expand Up @@ -484,10 +484,10 @@ main()
source_github "${secp256k1_OWNER}" "secp256k1" "${secp256k1_TAG}"
local SAVE_CPPFLAGS="${CPPFLAGS}"
export CPPFLAGS="${CPPFLAGS} ${secp256k1_FLAGS[@]}"
build_cmake "secp256k1" "." "${PARALLEL}" "${secp256k1_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}"
install_cmake "secp256k1"
build_cmake "secp256k1" "." "." "${PARALLEL}" "${secp256k1_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}"
install_cmake "secp256k1" "."
if [[ "${BUILD_POST_INSTALL_CLEAN}" == "yes" ]]; then
clean_cmake "secp256k1"
clean_cmake "secp256k1" "."
fi
export CPPFLAGS="${SAVE_CPPFLAGS}"
fi
Expand All @@ -496,34 +496,34 @@ main()
source_github "${UltrafastSecp256k1_OWNER}" "UltrafastSecp256k1" "${UltrafastSecp256k1_TAG}"
local SAVE_CPPFLAGS="${CPPFLAGS}"
export CPPFLAGS="${CPPFLAGS} ${UltrafastSecp256k1_FLAGS[@]}"
build_cmake "UltrafastSecp256k1" "." "${PARALLEL}" "${UltrafastSecp256k1_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}"
install_cmake "UltrafastSecp256k1"
build_cmake "UltrafastSecp256k1" "." "." "${PARALLEL}" "${UltrafastSecp256k1_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}"
install_cmake "UltrafastSecp256k1" "."
if [[ "${BUILD_POST_INSTALL_CLEAN}" == "yes" ]]; then
clean_cmake "UltrafastSecp256k1"
clean_cmake "UltrafastSecp256k1" "."
fi
export CPPFLAGS="${SAVE_CPPFLAGS}"
fi

source_github "${libbitcoin_system_OWNER}" "libbitcoin-system" "${libbitcoin_system_TAG}"
local SAVE_CPPFLAGS="${CPPFLAGS}"
export CPPFLAGS="${CPPFLAGS} ${libbitcoin_system_FLAGS[@]}"
build_cmake "libbitcoin-system" "builds/cmake" "${PARALLEL}" "${libbitcoin_system_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}"
install_cmake "libbitcoin-system"
build_cmake "libbitcoin-system" "builds/cmake" "." "${PARALLEL}" "${libbitcoin_system_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}"
install_cmake "libbitcoin-system" "."
if [[ "${BUILD_POST_INSTALL_CLEAN}" == "yes" ]]; then
clean_cmake "libbitcoin-system"
clean_cmake "libbitcoin-system" "."
fi
export CPPFLAGS="${SAVE_CPPFLAGS}"

source_github "${libbitcoin_database_OWNER}" "libbitcoin-database" "${libbitcoin_database_TAG}"
local SAVE_CPPFLAGS="${CPPFLAGS}"
export CPPFLAGS="${CPPFLAGS} ${libbitcoin_database_FLAGS[@]}"
build_cmake "libbitcoin-database" "builds/cmake" "${PARALLEL}" "${libbitcoin_database_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}"
build_cmake "libbitcoin-database" "builds/cmake" "." "${PARALLEL}" "${libbitcoin_database_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}"
if ! [[ "${BUILD_SKIP_TESTS}" == "yes" ]]; then
test_cmake "libbitcoin-database" "${PARALLEL}"
test_cmake "libbitcoin-database" "." "${PARALLEL}"
fi
install_cmake "libbitcoin-database"
install_cmake "libbitcoin-database" "."
if [[ "${BUILD_POST_INSTALL_CLEAN}" == "yes" ]]; then
clean_cmake "libbitcoin-database"
clean_cmake "libbitcoin-database" "."
fi
export CPPFLAGS="${SAVE_CPPFLAGS}"

Expand Down Expand Up @@ -741,9 +741,10 @@ build_boost()
build_cmake()
{
local PROJECT="$1"
local RELATIVE_PATH="$2"
local JOBS="$3"
shift 3
local RELATIVE_SRC_PATH="$2"
local RELATIVE_OBJ_PATH="$3"
local JOBS="$4"
shift 4

local VERBOSITY_CMAKE=""
local VERBOSITY_MAKE=""
Expand All @@ -758,7 +759,7 @@ build_cmake()

# directory rationalization
push_directory "${BUILD_SRC_DIR}/${PROJECT}"
push_directory "${RELATIVE_PATH}"
push_directory "${RELATIVE_SRC_PATH}"
local BUILD_PATH="$(pwd)"
pop_directory

Expand All @@ -772,9 +773,14 @@ build_cmake()
push_directory "${BUILD_OBJ_DIR}/${PROJECT}"
fi

if [[ "${RELATIVE_OBJ_PATH}" != "." ]]; then
create_directory_force "${RELATIVE_OBJ_PATH}"
push_directory "${RELATIVE_OBJ_PATH}"
fi

display_configure_options "$@"

cmake ${VERBOSITY_CMAKE} -LA "$@" "${BUILD_SRC_DIR}/${PROJECT}/${RELATIVE_PATH}"
cmake ${VERBOSITY_CMAKE} -LA "$@" "${BUILD_SRC_DIR}/${PROJECT}/${RELATIVE_SRC_PATH}"

# make
if [[ ${JOBS} -gt ${SEQUENTIAL} ]]; then
Expand All @@ -785,14 +791,19 @@ build_cmake()

pop_directory # BUILD_OBJ_DIR
pop_directory # BUILD_SRC_DIR/PROJECT
if [[ "${RELATIVE_OBJ_PATH}" != "." ]]; then
pop_directory
fi

msg_success "'${PROJECT}' built successfully."
}


clean_cmake()
{
local PROJECT="$1"
shift 1
local RELATIVE_OBJ_PATH="$2"
shift 2

msg "Preparing to clean ${PROJECT}"

Expand All @@ -804,6 +815,10 @@ clean_cmake()
push_directory "${BUILD_OBJ_DIR}/${PROJECT}"
fi

if [[ "${RELATIVE_OBJ_PATH}" != "." ]]; then
push_directory "${RELATIVE_OBJ_PATH}"
fi

disable_exit_on_error

cmake --build . --target clean
Expand All @@ -817,14 +832,18 @@ clean_cmake()

pop_directory # BUILD_OBJ_DIR
pop_directory # BUILD_SRC_DIR/PROJECT
if [[ "${RELATIVE_OBJ_PATH}" != "." ]]; then
pop_directory
fi

msg_success "'${PROJECT}' clean complete."
}

install_cmake()
{
local PROJECT="$1"
shift
local RELATIVE_OBJ_PATH="$2"
shift 2

msg "Preparing to install ${PROJECT}"

Expand All @@ -836,6 +855,10 @@ install_cmake()
push_directory "${BUILD_OBJ_DIR}/${PROJECT}"
fi

if [[ "${RELATIVE_OBJ_PATH}" != "." ]]; then
push_directory "${RELATIVE_OBJ_PATH}"
fi

cmake --install .

if [[ ${OS} == Linux ]] && [[ "${PREFIX}" == "/usr/local" ]]; then
Expand All @@ -844,15 +867,19 @@ install_cmake()

pop_directory # BUILD_OBJ_DIR
pop_directory # BUILD_SRC_DIR/PROJECT
if [[ "${RELATIVE_OBJ_PATH}" != "." ]]; then
pop_directory
fi

msg_success "'${PROJECT}' installation complete."
}

test_cmake()
{
local PROJECT="$1"
local JOBS="$2"
shift 2
local RELATIVE_OBJ_PATH="$2"
local JOBS="$3"
shift 3

msg "Preparing to test ${PROJECT}"

Expand All @@ -864,6 +891,10 @@ test_cmake()
push_directory "${BUILD_OBJ_DIR}/${PROJECT}"
fi

if [[ "${RELATIVE_OBJ_PATH}" != "." ]]; then
push_directory "${RELATIVE_OBJ_PATH}"
fi

disable_exit_on_error

ctest --test-dir .
Expand Down Expand Up @@ -891,6 +922,9 @@ test_cmake()

pop_directory # BUILD_OBJ_DIR
pop_directory # BUILD_SRC_DIR/PROJECT
if [[ "${RELATIVE_OBJ_PATH}" != "." ]]; then
pop_directory
fi

msg_success "'${PROJECT}' test complete."
}
Expand Down Expand Up @@ -967,9 +1001,9 @@ help()
msg " Default: OFF"
msg "-Denable-shani=<ON/OFF> Use Intel/ARM SHA Extensions."
msg " Default: OFF"
msg "-Dwith-ultrafast=<ON/OFF> Use shrec/UltrafastSecp256k1."
msg "-Dwith-ultrafast=<ON/OFF> Use shrec/UltrafastSecp256k1 library."
msg " Default: OFF"
msg "-Dwith-secp256k1=<ON/OFF> Use bitcoin-core/secp256k1."
msg "-Dwith-secp256k1=<ON/OFF> Use bitcoin-core/secp256k1 library."
msg " Default: ON"
msg "--build-boost Build Boost libraries"
msg "--build-secp256k1 Build libsecp256k1 libraries"
Expand Down
Loading
Loading