diff --git a/.gitignore b/.gitignore index 6c38940b..f8e691b4 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 3b15bee8..00000000 --- a/Makefile.am +++ /dev/null @@ -1,267 +0,0 @@ -############################################################################### -# Copyright (c) 2014-2026 libbitcoin-server developers (see COPYING). -# -# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY -# -############################################################################### - -# Automake settings. -#============================================================================== -# Look for macros in the m4 subdirectory. -#------------------------------------------------------------------------------ -ACLOCAL_AMFLAGS = -I m4 - - -# Distribute, make and install products. -#============================================================================== -# files => ${pkgconfigdir} -#------------------------------------------------------------------------------ -pkgconfig_DATA = \ - libbitcoin-server.pc - -# files => ${docdir} -#------------------------------------------------------------------------------ -doc_DATA = \ - AUTHORS \ - COPYING \ - ChangeLog \ - INSTALL \ - NEWS \ - README - -# src/libbitcoin-server.la => ${libdir} -#------------------------------------------------------------------------------ -lib_LTLIBRARIES = src/libbitcoin-server.la -src_libbitcoin_server_la_CPPFLAGS = -I${srcdir}/include -DSYSCONFDIR=\"${sysconfdir}\" ${bitcoin_node_BUILD_CPPFLAGS} -src_libbitcoin_server_la_LIBADD = ${bitcoin_node_LIBS} -src_libbitcoin_server_la_SOURCES = \ - src/configuration.cpp \ - src/error.cpp \ - src/parser.cpp \ - src/server_node.cpp \ - src/settings.cpp \ - src/parsers/bitcoind_target.cpp \ - src/parsers/electrum_version.cpp \ - src/parsers/native_query.cpp \ - src/parsers/native_target.cpp \ - src/protocols/protocol_html.cpp \ - src/protocols/protocol_http.cpp \ - src/protocols/bitcoind/protocol_bitcoind_rest.cpp \ - src/protocols/bitcoind/protocol_bitcoind_rpc.cpp \ - src/protocols/bitcoind/protocol_bitcoind_rpc_json.cpp \ - src/protocols/electrum/protocol_electrum.cpp \ - src/protocols/electrum/protocol_electrum_addresses.cpp \ - src/protocols/electrum/protocol_electrum_fees.cpp \ - src/protocols/electrum/protocol_electrum_headers.cpp \ - src/protocols/electrum/protocol_electrum_mempool.cpp \ - src/protocols/electrum/protocol_electrum_outpoints.cpp \ - src/protocols/electrum/protocol_electrum_scripthash.cpp \ - src/protocols/electrum/protocol_electrum_scriptpubkey.cpp \ - src/protocols/electrum/protocol_electrum_server.cpp \ - src/protocols/electrum/protocol_electrum_subscribe.cpp \ - src/protocols/electrum/protocol_electrum_transactions.cpp \ - src/protocols/electrum/protocol_electrum_version.cpp \ - src/protocols/native/protocol_native.cpp \ - src/protocols/native/protocol_native_address.cpp \ - src/protocols/native/protocol_native_block.cpp \ - src/protocols/native/protocol_native_configuration.cpp \ - src/protocols/native/protocol_native_input.cpp \ - src/protocols/native/protocol_native_output.cpp \ - src/protocols/native/protocol_native_tx.cpp \ - src/protocols/stratum_v1/protocol_stratum_v1.cpp - -# local: test/libbitcoin-server-test -#------------------------------------------------------------------------------ -if WITH_TESTS - -TESTS = libbitcoin-server-test_runner.sh - -check_PROGRAMS = test/libbitcoin-server-test -test_libbitcoin_server_test_CPPFLAGS = -I${srcdir}/include ${bitcoin_node_BUILD_CPPFLAGS} -test_libbitcoin_server_test_LDADD = src/libbitcoin-server.la ${boost_unit_test_framework_LIBS} ${bitcoin_node_LIBS} -test_libbitcoin_server_test_SOURCES = \ - test/configuration.cpp \ - test/error.cpp \ - test/main.cpp \ - test/settings.cpp \ - test/test.cpp \ - test/test.hpp \ - test/mocks/blocks.cpp \ - test/mocks/blocks.hpp \ - test/parsers/bitcoind_target.cpp \ - test/parsers/electrum_version.cpp \ - test/parsers/native_query.cpp \ - test/parsers/native_target.cpp \ - test/protocols/bitcoind/bitcoind_json.cpp \ - test/protocols/bitcoind/bitcoind_rest.cpp \ - test/protocols/bitcoind/bitcoind_rpc.cpp \ - test/protocols/bitcoind/bitcoind_setup_fixture.cpp \ - test/protocols/bitcoind/bitcoind_setup_fixture.hpp \ - test/protocols/electrum/electrum_addresses.cpp \ - test/protocols/electrum/electrum_disabled.cpp \ - test/protocols/electrum/electrum_fees.cpp \ - test/protocols/electrum/electrum_headers.cpp \ - test/protocols/electrum/electrum_mempool.cpp \ - test/protocols/electrum/electrum_outpoints.cpp \ - test/protocols/electrum/electrum_scripthash.cpp \ - test/protocols/electrum/electrum_scriptpubkey.cpp \ - test/protocols/electrum/electrum_server.cpp \ - test/protocols/electrum/electrum_setup_fixture.cpp \ - test/protocols/electrum/electrum_setup_fixture.hpp \ - test/protocols/electrum/electrum_subscribe.cpp \ - test/protocols/electrum/electrum_transactions.cpp \ - test/protocols/electrum/electrum_version.cpp \ - test/protocols/native/native_address.cpp \ - test/protocols/native/native_block.cpp \ - test/protocols/native/native_configuration.cpp \ - test/protocols/native/native_input.cpp \ - test/protocols/native/native_output.cpp \ - test/protocols/native/native_setup_fixture.cpp \ - test/protocols/native/native_setup_fixture.hpp \ - test/protocols/native/native_tx.cpp - -endif WITH_TESTS - -# console/bs => ${bindir} -#------------------------------------------------------------------------------ -if WITH_CONSOLE - -bin_PROGRAMS = console/bs -console_bs_CPPFLAGS = -I${srcdir}/include ${bitcoin_node_BUILD_CPPFLAGS} -console_bs_LDADD = src/libbitcoin-server.la ${bitcoin_node_LIBS} -console_bs_SOURCES = \ - console/executor.cpp \ - console/executor.hpp \ - console/executor_commands.cpp \ - console/executor_daemon.cpp \ - console/executor_dumps.cpp \ - console/executor_events.cpp \ - console/executor_logging.cpp \ - console/executor_options.cpp \ - console/executor_paging.cpp \ - console/executor_runner.cpp \ - console/executor_scans.cpp \ - console/executor_signals.cpp \ - console/executor_store.cpp \ - console/executor_test_reader.cpp \ - console/executor_test_writer.cpp \ - console/executor_window.cpp \ - console/localize.hpp \ - console/main.cpp \ - console/stack_trace.cpp \ - console/stack_trace.hpp \ - console/embedded/admin_css.cpp \ - console/embedded/admin_font.cpp \ - console/embedded/admin_html.cpp \ - console/embedded/admin_icon.cpp \ - console/embedded/amin_ecma.cpp \ - console/embedded/embedded.hpp \ - console/embedded/native_css.cpp \ - console/embedded/native_ecma.cpp \ - console/embedded/native_font.cpp \ - console/embedded/native_html.cpp \ - console/embedded/native_icon.cpp - -endif WITH_CONSOLE - -# files => ${includedir}/bitcoin -#------------------------------------------------------------------------------ -include_bitcoindir = ${includedir}/bitcoin -include_bitcoin_HEADERS = \ - include/bitcoin/server.hpp - -include_bitcoin_serverdir = ${includedir}/bitcoin/server -include_bitcoin_server_HEADERS = \ - include/bitcoin/server/configuration.hpp \ - include/bitcoin/server/define.hpp \ - include/bitcoin/server/error.hpp \ - include/bitcoin/server/parser.hpp \ - include/bitcoin/server/server_node.hpp \ - include/bitcoin/server/settings.hpp \ - include/bitcoin/server/version.hpp - -include_bitcoin_server_channelsdir = ${includedir}/bitcoin/server/channels -include_bitcoin_server_channels_HEADERS = \ - include/bitcoin/server/channels/channel.hpp \ - include/bitcoin/server/channels/channel_electrum.hpp \ - include/bitcoin/server/channels/channel_http.hpp \ - include/bitcoin/server/channels/channel_stratum_v1.hpp \ - include/bitcoin/server/channels/channel_stratum_v2.hpp \ - include/bitcoin/server/channels/channels.hpp - -include_bitcoin_server_impl_protocolsdir = ${includedir}/bitcoin/server/impl/protocols -include_bitcoin_server_impl_protocols_HEADERS = \ - include/bitcoin/server/impl/protocols/protocol_native.ipp - -include_bitcoin_server_interfacesdir = ${includedir}/bitcoin/server/interfaces -include_bitcoin_server_interfaces_HEADERS = \ - include/bitcoin/server/interfaces/bitcoind_rest.hpp \ - include/bitcoin/server/interfaces/bitcoind_rpc.hpp \ - include/bitcoin/server/interfaces/btcd.hpp \ - include/bitcoin/server/interfaces/electrum.hpp \ - include/bitcoin/server/interfaces/interfaces.hpp \ - include/bitcoin/server/interfaces/native.hpp \ - include/bitcoin/server/interfaces/stratum_v1.hpp \ - include/bitcoin/server/interfaces/stratum_v2.hpp \ - include/bitcoin/server/interfaces/types.hpp - -include_bitcoin_server_parsersdir = ${includedir}/bitcoin/server/parsers -include_bitcoin_server_parsers_HEADERS = \ - include/bitcoin/server/parsers/bitcoind_target.hpp \ - include/bitcoin/server/parsers/electrum_version.hpp \ - include/bitcoin/server/parsers/native_query.hpp \ - include/bitcoin/server/parsers/native_target.hpp \ - include/bitcoin/server/parsers/parsers.hpp - -include_bitcoin_server_protocolsdir = ${includedir}/bitcoin/server/protocols -include_bitcoin_server_protocols_HEADERS = \ - include/bitcoin/server/protocols/protocol.hpp \ - include/bitcoin/server/protocols/protocol_admin.hpp \ - include/bitcoin/server/protocols/protocol_bitcoind_rest.hpp \ - include/bitcoin/server/protocols/protocol_bitcoind_rpc.hpp \ - include/bitcoin/server/protocols/protocol_electrum.hpp \ - include/bitcoin/server/protocols/protocol_electrum_version.hpp \ - include/bitcoin/server/protocols/protocol_html.hpp \ - include/bitcoin/server/protocols/protocol_http.hpp \ - include/bitcoin/server/protocols/protocol_native.hpp \ - include/bitcoin/server/protocols/protocol_rpc.hpp \ - include/bitcoin/server/protocols/protocol_stratum_v1.hpp \ - include/bitcoin/server/protocols/protocol_stratum_v2.hpp \ - include/bitcoin/server/protocols/protocols.hpp - -include_bitcoin_server_sessionsdir = ${includedir}/bitcoin/server/sessions -include_bitcoin_server_sessions_HEADERS = \ - include/bitcoin/server/sessions/session.hpp \ - include/bitcoin/server/sessions/session_handshake.hpp \ - include/bitcoin/server/sessions/session_server.hpp \ - include/bitcoin/server/sessions/sessions.hpp - -# files => ${bash_completiondir} -#------------------------------------------------------------------------------ -if BASH_COMPLETIONDIR - -dist_bash_completion_DATA = \ - data/bs - -endif BASH_COMPLETIONDIR - -# files => ${sysconfdir}/libbitcoin -#------------------------------------------------------------------------------ -if WITH_CONSOLE - -sysconf_libbitcoindir = ${sysconfdir}/libbitcoin -sysconf_libbitcoin_DATA = \ - data/bs.cfg - -endif WITH_CONSOLE - - -# Custom make targets. -#============================================================================== -# make target: console -#------------------------------------------------------------------------------ -target_console = \ - console/bs - -console: ${target_console} - diff --git a/builds/cmake/CMakeLists.txt b/builds/cmake/CMakeLists.txt index 0dfad414..2f738c97 100644 --- a/builds/cmake/CMakeLists.txt +++ b/builds/cmake/CMakeLists.txt @@ -71,13 +71,12 @@ endif() #------------------------------------------------------------------------------ # Project options. #------------------------------------------------------------------------------ -option( with-tests "Build tests." ON ) -option( with-console "Build console." ON ) +option( with-tests "Compile with unit tests." ON ) +option( with-console "Compile with console application." ON ) #------------------------------------------------------------------------------ # Dependencies. #------------------------------------------------------------------------------ - if ( BUILD_SHARED_LIBS ) set( libbitcoin-node_USE_STATIC_LIBS "OFF" ) set( Boost_USE_STATIC_LIBS "OFF" ) @@ -96,7 +95,6 @@ find_package( Boost 1.86.0 REQUIRED #------------------------------------------------------------------------------ # Compiler options. #------------------------------------------------------------------------------ - include(CheckCCompilerFlag) include(CheckCXXCompilerFlag) include(CheckCXXSourceCompiles) @@ -168,13 +166,8 @@ endif() #------------------------------------------------------------------------------ # Linker options. #------------------------------------------------------------------------------ - include(CheckLinkerFlag) -#------------------------------------------------------------------------------ -# Configurable file(s). -#------------------------------------------------------------------------------ - #------------------------------------------------------------------------------ # libbitcoin-server library #------------------------------------------------------------------------------ @@ -196,7 +189,7 @@ target_compile_options( libbitcoin-server $<$:-Wno-comment> $<$:-Wno-deprecated-copy> $<$:-Wno-mismatched-tags> - -fstack-protector-all + $<$:-fstack-protector-all> ) file( GLOB_RECURSE libbitcoin_server_HEADERS CONFIGURE_DEPENDS @@ -275,7 +268,7 @@ if ( with-tests ) $<$:-Wno-mismatched-tags> $<$:-Wno-long-long> $<$:-fno-var-tracking-assignments> - -fstack-protector-all + $<$:-fstack-protector-all> ) file( GLOB_RECURSE libbitcoin_server_test_SOURCES CONFIGURE_DEPENDS @@ -325,7 +318,7 @@ if ( with-console ) $<$:-Wno-mismatched-tags> $<$:-Wno-long-long> $<$:-fno-var-tracking-assignments> - -fstack-protector-all + $<$:-fstack-protector-all> ) file( GLOB_RECURSE bitcoin_server_HEADERS CONFIGURE_DEPENDS @@ -368,6 +361,7 @@ if ( with-console ) OUTPUT_NAME bs ) endif() + #------------------------------------------------------------------------------ # Installation routine. #------------------------------------------------------------------------------ diff --git a/builds/cmake/install-cmake.sh b/builds/cmake/install-cmake.sh index 98568636..bf275606 100755 --- a/builds/cmake/install-cmake.sh +++ b/builds/cmake/install-cmake.sh @@ -16,9 +16,9 @@ # Default: OFF # -Denable-shani= Use Intel/ARM SHA Extensions. # Default: OFF -# -Dwith-ultrafast= Use shrec/UltrafastSecp256k1. +# -Dwith-ultrafast= Use shrec/UltrafastSecp256k1 library. # Default: OFF -# -Dwith-secp256k1= Use bitcoin-core/secp256k1. +# -Dwith-secp256k1= Use bitcoin-core/secp256k1 library. # Default: ON # -Dwith-ssl= Use embedded ssl library. # Default: ON @@ -524,10 +524,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 @@ -536,10 +536,10 @@ 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 @@ -547,53 +547,53 @@ main() 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[@]}" - install_cmake "libbitcoin-database" + build_cmake "libbitcoin-database" "builds/cmake" "." "${PARALLEL}" "${libbitcoin_database_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}" + install_cmake "libbitcoin-database" "." if [[ "${BUILD_POST_INSTALL_CLEAN}" == "yes" ]]; then - clean_cmake "libbitcoin-database" + clean_cmake "libbitcoin-database" "." fi export CPPFLAGS="${SAVE_CPPFLAGS}" source_github "${libbitcoin_network_OWNER}" "libbitcoin-network" "${libbitcoin_network_TAG}" local SAVE_CPPFLAGS="${CPPFLAGS}" export CPPFLAGS="${CPPFLAGS} ${libbitcoin_network_FLAGS[@]}" - build_cmake "libbitcoin-network" "builds/cmake" "${PARALLEL}" "${libbitcoin_network_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}" - install_cmake "libbitcoin-network" + build_cmake "libbitcoin-network" "builds/cmake" "." "${PARALLEL}" "${libbitcoin_network_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}" + install_cmake "libbitcoin-network" "." if [[ "${BUILD_POST_INSTALL_CLEAN}" == "yes" ]]; then - clean_cmake "libbitcoin-network" + clean_cmake "libbitcoin-network" "." fi export CPPFLAGS="${SAVE_CPPFLAGS}" source_github "${libbitcoin_node_OWNER}" "libbitcoin-node" "${libbitcoin_node_TAG}" local SAVE_CPPFLAGS="${CPPFLAGS}" export CPPFLAGS="${CPPFLAGS} ${libbitcoin_node_FLAGS[@]}" - build_cmake "libbitcoin-node" "builds/cmake" "${PARALLEL}" "${libbitcoin_node_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}" - install_cmake "libbitcoin-node" + build_cmake "libbitcoin-node" "builds/cmake" "." "${PARALLEL}" "${libbitcoin_node_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}" + install_cmake "libbitcoin-node" "." if [[ "${BUILD_POST_INSTALL_CLEAN}" == "yes" ]]; then - clean_cmake "libbitcoin-node" + clean_cmake "libbitcoin-node" "." fi export CPPFLAGS="${SAVE_CPPFLAGS}" source_github "${libbitcoin_server_OWNER}" "libbitcoin-server" "${libbitcoin_server_TAG}" local SAVE_CPPFLAGS="${CPPFLAGS}" export CPPFLAGS="${CPPFLAGS} ${libbitcoin_server_FLAGS[@]}" - build_cmake "libbitcoin-server" "builds/cmake" "${PARALLEL}" "${libbitcoin_server_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}" + build_cmake "libbitcoin-server" "builds/cmake" "." "${PARALLEL}" "${libbitcoin_server_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}" if ! [[ "${BUILD_SKIP_TESTS}" == "yes" ]]; then - test_cmake "libbitcoin-server" "${PARALLEL}" + test_cmake "libbitcoin-server" "." "${PARALLEL}" fi - install_cmake "libbitcoin-server" + install_cmake "libbitcoin-server" "." if [[ "${BUILD_POST_INSTALL_CLEAN}" == "yes" ]]; then - clean_cmake "libbitcoin-server" + clean_cmake "libbitcoin-server" "." fi export CPPFLAGS="${SAVE_CPPFLAGS}" @@ -811,9 +811,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="" @@ -828,7 +829,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 @@ -842,9 +843,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 @@ -855,6 +861,10 @@ 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." } @@ -862,7 +872,8 @@ build_cmake() clean_cmake() { local PROJECT="$1" - shift 1 + local RELATIVE_OBJ_PATH="$2" + shift 2 msg "Preparing to clean ${PROJECT}" @@ -874,6 +885,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 @@ -887,6 +902,9 @@ 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." } @@ -894,7 +912,8 @@ clean_cmake() install_cmake() { local PROJECT="$1" - shift + local RELATIVE_OBJ_PATH="$2" + shift 2 msg "Preparing to install ${PROJECT}" @@ -906,6 +925,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 @@ -914,6 +937,9 @@ 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." } @@ -921,8 +947,9 @@ install_cmake() 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}" @@ -934,6 +961,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 . @@ -961,6 +992,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." } @@ -1046,9 +1080,9 @@ help() msg " Default: OFF" msg "-Denable-shani= Use Intel/ARM SHA Extensions." msg " Default: OFF" - msg "-Dwith-ultrafast= Use shrec/UltrafastSecp256k1." + msg "-Dwith-ultrafast= Use shrec/UltrafastSecp256k1 library." msg " Default: OFF" - msg "-Dwith-secp256k1= Use bitcoin-core/secp256k1." + msg "-Dwith-secp256k1= Use bitcoin-core/secp256k1 library." msg " Default: ON" msg "-Dwith-ssl= Use embedded ssl library." msg " Default: ON" diff --git a/builds/cmake/install-presets.sh b/builds/cmake/install-presets.sh index 46159818..c3085812 100755 --- a/builds/cmake/install-presets.sh +++ b/builds/cmake/install-presets.sh @@ -16,9 +16,9 @@ # Default: OFF # -Denable-shani= Use Intel/ARM SHA Extensions. # Default: OFF -# -Dwith-ultrafast= Use shrec/UltrafastSecp256k1. +# -Dwith-ultrafast= Use shrec/UltrafastSecp256k1 library. # Default: OFF -# -Dwith-secp256k1= Use bitcoin-core/secp256k1. +# -Dwith-secp256k1= Use bitcoin-core/secp256k1 library. # Default: ON # -Dwith-ssl= Use embedded ssl library. # Default: ON @@ -540,10 +540,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 @@ -552,10 +552,10 @@ 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 @@ -563,53 +563,53 @@ main() source_github "${libbitcoin_system_OWNER}" "libbitcoin-system" "${libbitcoin_system_TAG}" local SAVE_CPPFLAGS="${CPPFLAGS}" export CPPFLAGS="${CPPFLAGS} ${libbitcoin_system_FLAGS[@]}" - build_preset "libbitcoin-system" "builds/cmake" "${PARALLEL}" "${libbitcoin_system_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}" - install_cmake "libbitcoin-system" + build_preset "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_preset "libbitcoin-database" "builds/cmake" "${PARALLEL}" "${libbitcoin_database_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}" - install_cmake "libbitcoin-database" + build_preset "libbitcoin-database" "builds/cmake" "." "${PARALLEL}" "${libbitcoin_database_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}" + install_cmake "libbitcoin-database" "." if [[ "${BUILD_POST_INSTALL_CLEAN}" == "yes" ]]; then - clean_cmake "libbitcoin-database" + clean_cmake "libbitcoin-database" "." fi export CPPFLAGS="${SAVE_CPPFLAGS}" source_github "${libbitcoin_network_OWNER}" "libbitcoin-network" "${libbitcoin_network_TAG}" local SAVE_CPPFLAGS="${CPPFLAGS}" export CPPFLAGS="${CPPFLAGS} ${libbitcoin_network_FLAGS[@]}" - build_preset "libbitcoin-network" "builds/cmake" "${PARALLEL}" "${libbitcoin_network_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}" - install_cmake "libbitcoin-network" + build_preset "libbitcoin-network" "builds/cmake" "." "${PARALLEL}" "${libbitcoin_network_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}" + install_cmake "libbitcoin-network" "." if [[ "${BUILD_POST_INSTALL_CLEAN}" == "yes" ]]; then - clean_cmake "libbitcoin-network" + clean_cmake "libbitcoin-network" "." fi export CPPFLAGS="${SAVE_CPPFLAGS}" source_github "${libbitcoin_node_OWNER}" "libbitcoin-node" "${libbitcoin_node_TAG}" local SAVE_CPPFLAGS="${CPPFLAGS}" export CPPFLAGS="${CPPFLAGS} ${libbitcoin_node_FLAGS[@]}" - build_preset "libbitcoin-node" "builds/cmake" "${PARALLEL}" "${libbitcoin_node_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}" - install_cmake "libbitcoin-node" + build_preset "libbitcoin-node" "builds/cmake" "." "${PARALLEL}" "${libbitcoin_node_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}" + install_cmake "libbitcoin-node" "." if [[ "${BUILD_POST_INSTALL_CLEAN}" == "yes" ]]; then - clean_cmake "libbitcoin-node" + clean_cmake "libbitcoin-node" "." fi export CPPFLAGS="${SAVE_CPPFLAGS}" source_github "${libbitcoin_server_OWNER}" "libbitcoin-server" "${libbitcoin_server_TAG}" local SAVE_CPPFLAGS="${CPPFLAGS}" export CPPFLAGS="${CPPFLAGS} ${libbitcoin_server_FLAGS[@]}" - build_preset "libbitcoin-server" "builds/cmake" "${PARALLEL}" "${libbitcoin_server_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}" + build_preset "libbitcoin-server" "builds/cmake" "." "${PARALLEL}" "${libbitcoin_server_OPTIONS[@]}" "${CONFIGURE_OPTIONS_CMAKE[@]}" if ! [[ "${BUILD_SKIP_TESTS}" == "yes" ]]; then - test_cmake "libbitcoin-server" "test" "${PARALLEL}" + test_cmake "libbitcoin-server" "." "${PARALLEL}" fi - install_cmake "libbitcoin-server" + install_cmake "libbitcoin-server" "." if [[ "${BUILD_POST_INSTALL_CLEAN}" == "yes" ]]; then - clean_cmake "libbitcoin-server" + clean_cmake "libbitcoin-server" "." fi export CPPFLAGS="${SAVE_CPPFLAGS}" @@ -827,9 +827,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="" @@ -844,7 +845,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 @@ -858,9 +859,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 @@ -871,6 +877,10 @@ 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." } @@ -878,9 +888,10 @@ build_cmake() build_preset() { 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="" @@ -895,7 +906,7 @@ build_preset() # directory rationalization push_directory "${BUILD_SRC_DIR}/${PROJECT}" - push_directory "${RELATIVE_PATH}" + push_directory "${RELATIVE_SRC_PATH}" local BUILD_PATH="$(pwd)" pop_directory @@ -909,9 +920,14 @@ build_preset() 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 --preset="${BUILD_PRESET}" "$@" "${BUILD_SRC_DIR}/${PROJECT}/${RELATIVE_PATH}" + cmake ${VERBOSITY_CMAKE} -LA --preset="${BUILD_PRESET}" "$@" "${BUILD_SRC_DIR}/${PROJECT}/${RELATIVE_SRC_PATH}" # make if [[ ${JOBS} -gt ${SEQUENTIAL} ]]; then @@ -922,6 +938,10 @@ build_preset() pop_directory # BUILD_OBJ_DIR pop_directory # BUILD_SRC_DIR/PROJECT + if [[ "${RELATIVE_OBJ_PATH}" != "." ]]; then + pop_directory + fi + msg_success "'${PROJECT}' built successfully." } @@ -929,7 +949,8 @@ build_preset() clean_cmake() { local PROJECT="$1" - shift 1 + local RELATIVE_OBJ_PATH="$2" + shift 2 msg "Preparing to clean ${PROJECT}" @@ -941,6 +962,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 @@ -954,6 +979,9 @@ 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." } @@ -961,7 +989,8 @@ clean_cmake() install_cmake() { local PROJECT="$1" - shift + local RELATIVE_OBJ_PATH="$2" + shift 2 msg "Preparing to install ${PROJECT}" @@ -973,6 +1002,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 @@ -981,6 +1014,9 @@ 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." } @@ -988,8 +1024,9 @@ install_cmake() 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}" @@ -1001,6 +1038,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 . @@ -1028,6 +1069,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." } @@ -1114,9 +1158,9 @@ help() msg " Default: OFF" msg "-Denable-shani= Use Intel/ARM SHA Extensions." msg " Default: OFF" - msg "-Dwith-ultrafast= Use shrec/UltrafastSecp256k1." + msg "-Dwith-ultrafast= Use shrec/UltrafastSecp256k1 library." msg " Default: OFF" - msg "-Dwith-secp256k1= Use bitcoin-core/secp256k1." + msg "-Dwith-secp256k1= Use bitcoin-core/secp256k1 library." msg " Default: ON" msg "-Dwith-ssl= Use embedded ssl library." msg " Default: ON" diff --git a/AUTHORS b/builds/gnu/AUTHORS similarity index 100% rename from AUTHORS rename to builds/gnu/AUTHORS diff --git a/COPYING b/builds/gnu/COPYING similarity index 100% rename from COPYING rename to builds/gnu/COPYING diff --git a/ChangeLog b/builds/gnu/ChangeLog similarity index 100% rename from ChangeLog rename to builds/gnu/ChangeLog diff --git a/INSTALL b/builds/gnu/INSTALL similarity index 100% rename from INSTALL rename to builds/gnu/INSTALL diff --git a/builds/gnu/Makefile.am b/builds/gnu/Makefile.am new file mode 100644 index 00000000..ec0562aa --- /dev/null +++ b/builds/gnu/Makefile.am @@ -0,0 +1,287 @@ +############################################################################### +# Copyright (c) 2014-2026 libbitcoin-server developers (see COPYING). +# +# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY +# +############################################################################### + +# Automake settings. +#============================================================================== +# Look for macros in the 'm4' subdirectory. +#------------------------------------------------------------------------------ +ACLOCAL_AMFLAGS = -I m4 + +# Distribute data. +#============================================================================== +# files => ${pkgconfigdir} +#------------------------------------------------------------------------------ +pkgconfig_DATA = \ + libbitcoin-server.pc + +# files => ${docdir} +#------------------------------------------------------------------------------ +doc_DATA = \ + AUTHORS \ + COPYING \ + ChangeLog \ + INSTALL \ + NEWS \ + README + +# Libraries. +#============================================================================== +# Target library 'src/libbitcoin-server.la' +#------------------------------------------------------------------------------ +lib_LTLIBRARIES = src/libbitcoin-server.la + +src_libbitcoin_server_la_LIBS = src/libbitcoin-server.la + +src_libbitcoin_server_la_CPPFLAGS = \ + -I${srcdir}/../../include \ + ${libbitcoin_node_BUILD_CPPFLAGS} + +src_libbitcoin_server_la_LDFLAGS = \ + ${libbitcoin_node_LDFLAGS} + +src_libbitcoin_server_la_LIBADD = \ + ${libbitcoin_node_LIBS} + +src_libbitcoin_server_la_SOURCES = \ + ${srcdir}/../../src/configuration.cpp \ + ${srcdir}/../../src/error.cpp \ + ${srcdir}/../../src/parser.cpp \ + ${srcdir}/../../src/server_node.cpp \ + ${srcdir}/../../src/settings.cpp \ + ${srcdir}/../../src/parsers/bitcoind_target.cpp \ + ${srcdir}/../../src/parsers/electrum_version.cpp \ + ${srcdir}/../../src/parsers/native_query.cpp \ + ${srcdir}/../../src/parsers/native_target.cpp \ + ${srcdir}/../../src/protocols/protocol_html.cpp \ + ${srcdir}/../../src/protocols/protocol_http.cpp \ + ${srcdir}/../../src/protocols/bitcoind/protocol_bitcoind_rest.cpp \ + ${srcdir}/../../src/protocols/bitcoind/protocol_bitcoind_rpc.cpp \ + ${srcdir}/../../src/protocols/bitcoind/protocol_bitcoind_rpc_json.cpp \ + ${srcdir}/../../src/protocols/electrum/protocol_electrum.cpp \ + ${srcdir}/../../src/protocols/electrum/protocol_electrum_addresses.cpp \ + ${srcdir}/../../src/protocols/electrum/protocol_electrum_fees.cpp \ + ${srcdir}/../../src/protocols/electrum/protocol_electrum_headers.cpp \ + ${srcdir}/../../src/protocols/electrum/protocol_electrum_mempool.cpp \ + ${srcdir}/../../src/protocols/electrum/protocol_electrum_outpoints.cpp \ + ${srcdir}/../../src/protocols/electrum/protocol_electrum_scripthash.cpp \ + ${srcdir}/../../src/protocols/electrum/protocol_electrum_scriptpubkey.cpp \ + ${srcdir}/../../src/protocols/electrum/protocol_electrum_server.cpp \ + ${srcdir}/../../src/protocols/electrum/protocol_electrum_subscribe.cpp \ + ${srcdir}/../../src/protocols/electrum/protocol_electrum_transactions.cpp \ + ${srcdir}/../../src/protocols/electrum/protocol_electrum_version.cpp \ + ${srcdir}/../../src/protocols/native/protocol_native.cpp \ + ${srcdir}/../../src/protocols/native/protocol_native_address.cpp \ + ${srcdir}/../../src/protocols/native/protocol_native_block.cpp \ + ${srcdir}/../../src/protocols/native/protocol_native_configuration.cpp \ + ${srcdir}/../../src/protocols/native/protocol_native_input.cpp \ + ${srcdir}/../../src/protocols/native/protocol_native_output.cpp \ + ${srcdir}/../../src/protocols/native/protocol_native_tx.cpp \ + ${srcdir}/../../src/protocols/stratum_v1/protocol_stratum_v1.cpp + +include_bitcoindir = \ + ${includedir}/bitcoin + +include_bitcoin_HEADERS = \ + ${srcdir}/../../include/bitcoin/server.hpp + +include_bitcoin_serverdir = \ + ${includedir}/bitcoin/server + +include_bitcoin_server_HEADERS = \ + ${srcdir}/../../include/bitcoin/server/configuration.hpp \ + ${srcdir}/../../include/bitcoin/server/define.hpp \ + ${srcdir}/../../include/bitcoin/server/error.hpp \ + ${srcdir}/../../include/bitcoin/server/parser.hpp \ + ${srcdir}/../../include/bitcoin/server/server_node.hpp \ + ${srcdir}/../../include/bitcoin/server/settings.hpp \ + ${srcdir}/../../include/bitcoin/server/version.hpp + +include_bitcoin_server_channelsdir = \ + ${includedir}/bitcoin/server/channels + +include_bitcoin_server_channels_HEADERS = \ + ${srcdir}/../../include/bitcoin/server/channels/channel.hpp \ + ${srcdir}/../../include/bitcoin/server/channels/channel_electrum.hpp \ + ${srcdir}/../../include/bitcoin/server/channels/channel_http.hpp \ + ${srcdir}/../../include/bitcoin/server/channels/channel_stratum_v1.hpp \ + ${srcdir}/../../include/bitcoin/server/channels/channel_stratum_v2.hpp \ + ${srcdir}/../../include/bitcoin/server/channels/channels.hpp + +include_bitcoin_server_impl_protocolsdir = \ + ${includedir}/bitcoin/server/impl/protocols + +include_bitcoin_server_impl_protocols_HEADERS = \ + ${srcdir}/../../include/bitcoin/server/impl/protocols/protocol_native.ipp + +include_bitcoin_server_interfacesdir = \ + ${includedir}/bitcoin/server/interfaces + +include_bitcoin_server_interfaces_HEADERS = \ + ${srcdir}/../../include/bitcoin/server/interfaces/bitcoind_rest.hpp \ + ${srcdir}/../../include/bitcoin/server/interfaces/bitcoind_rpc.hpp \ + ${srcdir}/../../include/bitcoin/server/interfaces/btcd.hpp \ + ${srcdir}/../../include/bitcoin/server/interfaces/electrum.hpp \ + ${srcdir}/../../include/bitcoin/server/interfaces/interfaces.hpp \ + ${srcdir}/../../include/bitcoin/server/interfaces/native.hpp \ + ${srcdir}/../../include/bitcoin/server/interfaces/stratum_v1.hpp \ + ${srcdir}/../../include/bitcoin/server/interfaces/stratum_v2.hpp \ + ${srcdir}/../../include/bitcoin/server/interfaces/types.hpp + +include_bitcoin_server_parsersdir = \ + ${includedir}/bitcoin/server/parsers + +include_bitcoin_server_parsers_HEADERS = \ + ${srcdir}/../../include/bitcoin/server/parsers/bitcoind_target.hpp \ + ${srcdir}/../../include/bitcoin/server/parsers/electrum_version.hpp \ + ${srcdir}/../../include/bitcoin/server/parsers/native_query.hpp \ + ${srcdir}/../../include/bitcoin/server/parsers/native_target.hpp \ + ${srcdir}/../../include/bitcoin/server/parsers/parsers.hpp + +include_bitcoin_server_protocolsdir = \ + ${includedir}/bitcoin/server/protocols + +include_bitcoin_server_protocols_HEADERS = \ + ${srcdir}/../../include/bitcoin/server/protocols/protocol.hpp \ + ${srcdir}/../../include/bitcoin/server/protocols/protocol_admin.hpp \ + ${srcdir}/../../include/bitcoin/server/protocols/protocol_bitcoind_rest.hpp \ + ${srcdir}/../../include/bitcoin/server/protocols/protocol_bitcoind_rpc.hpp \ + ${srcdir}/../../include/bitcoin/server/protocols/protocol_electrum.hpp \ + ${srcdir}/../../include/bitcoin/server/protocols/protocol_electrum_version.hpp \ + ${srcdir}/../../include/bitcoin/server/protocols/protocol_html.hpp \ + ${srcdir}/../../include/bitcoin/server/protocols/protocol_http.hpp \ + ${srcdir}/../../include/bitcoin/server/protocols/protocol_native.hpp \ + ${srcdir}/../../include/bitcoin/server/protocols/protocol_rpc.hpp \ + ${srcdir}/../../include/bitcoin/server/protocols/protocol_stratum_v1.hpp \ + ${srcdir}/../../include/bitcoin/server/protocols/protocol_stratum_v2.hpp \ + ${srcdir}/../../include/bitcoin/server/protocols/protocols.hpp + +include_bitcoin_server_sessionsdir = \ + ${includedir}/bitcoin/server/sessions + +include_bitcoin_server_sessions_HEADERS = \ + ${srcdir}/../../include/bitcoin/server/sessions/session.hpp \ + ${srcdir}/../../include/bitcoin/server/sessions/session_handshake.hpp \ + ${srcdir}/../../include/bitcoin/server/sessions/session_server.hpp \ + ${srcdir}/../../include/bitcoin/server/sessions/sessions.hpp + +# Tests. +#============================================================================== +# Target test 'test/libbitcoin-server-test' +#------------------------------------------------------------------------------ +if WITH_TESTS + +check_PROGRAMS = test/libbitcoin-server-test + +test_libbitcoin_server_test_CPPFLAGS = \ + ${boost_BUILD_CPPFLAGS} \ + ${boost_unit_test_framework_BUILD_CPPFLAGS} \ + ${src_libbitcoin_server_la_CPPFLAGS} + +test_libbitcoin_server_test_LDFLAGS = \ + ${boost_LDFLAGS} \ + ${boost_unit_test_framework_LDFLAGS} \ + ${src_libbitcoin_server_la_LDFLAGS} + +test_libbitcoin_server_test_LDADD = \ + ${boost_LIBS} \ + ${boost_unit_test_framework_LIBS} \ + ${src_libbitcoin_server_la_LIBS} \ + ${src_libbitcoin_server_la_LIBADD} + +test_libbitcoin_server_test_SOURCES = \ + ${srcdir}/../../test/configuration.cpp \ + ${srcdir}/../../test/main.cpp \ + ${srcdir}/../../test/test.cpp \ + ${srcdir}/../../test/error.cpp \ + ${srcdir}/../../test/settings.cpp \ + ${srcdir}/../../test/parsers/bitcoind_target.cpp \ + ${srcdir}/../../test/parsers/electrum_version.cpp \ + ${srcdir}/../../test/parsers/native_query.cpp \ + ${srcdir}/../../test/parsers/native_target.cpp \ + ${srcdir}/../../test/protocols/bitcoind/bitcoind_json.cpp \ + ${srcdir}/../../test/protocols/bitcoind/bitcoind_rest.cpp \ + ${srcdir}/../../test/protocols/bitcoind/bitcoind_rpc.cpp \ + ${srcdir}/../../test/protocols/bitcoind/bitcoind_setup_fixture.cpp \ + ${srcdir}/../../test/protocols/electrum/electrum_addresses.cpp \ + ${srcdir}/../../test/protocols/electrum/electrum_disabled.cpp \ + ${srcdir}/../../test/protocols/electrum/electrum_fees.cpp \ + ${srcdir}/../../test/protocols/electrum/electrum_headers.cpp \ + ${srcdir}/../../test/protocols/electrum/electrum_mempool.cpp \ + ${srcdir}/../../test/protocols/electrum/electrum_outpoints.cpp \ + ${srcdir}/../../test/protocols/electrum/electrum_scripthash.cpp \ + ${srcdir}/../../test/protocols/electrum/electrum_scriptpubkey.cpp \ + ${srcdir}/../../test/protocols/electrum/electrum_server.cpp \ + ${srcdir}/../../test/protocols/electrum/electrum_setup_fixture.cpp \ + ${srcdir}/../../test/protocols/electrum/electrum_subscribe.cpp \ + ${srcdir}/../../test/protocols/electrum/electrum_transactions.cpp \ + ${srcdir}/../../test/protocols/electrum/electrum_version.cpp \ + ${srcdir}/../../test/protocols/native/native_address.cpp \ + ${srcdir}/../../test/protocols/native/native_block.cpp \ + ${srcdir}/../../test/protocols/native/native_configuration.cpp \ + ${srcdir}/../../test/protocols/native/native_input.cpp \ + ${srcdir}/../../test/protocols/native/native_output.cpp \ + ${srcdir}/../../test/protocols/native/native_setup_fixture.cpp \ + ${srcdir}/../../test/protocols/native/native_tx.cpp \ + ${srcdir}/../../test/mocks/blocks.cpp + +TESTS = test_runner.sh + +endif WITH_TESTS + +# Installed Binaries. +#============================================================================== +# Target binary 'console/bs' +#------------------------------------------------------------------------------ +if WITH_CONSOLE + +bin_PROGRAMS = console/bs + +console_bs_CPPFLAGS = \ + -I${srcdir}/../../console \ + ${src_libbitcoin_server_la_CPPFLAGS} + +console_bs_LDFLAGS = \ + ${src_libbitcoin_server_la_LDFLAGS} + +console_bs_LDADD = \ + ${src_libbitcoin_server_la_LIBS} \ + ${src_libbitcoin_server_la_LIBADD} + +console_bs_SOURCES = \ + ${srcdir}/../../console/executor_commands.cpp \ + ${srcdir}/../../console/executor_daemon.cpp \ + ${srcdir}/../../console/executor_signals.cpp \ + ${srcdir}/../../console/executor_window.cpp \ + ${srcdir}/../../console/main.cpp \ + ${srcdir}/../../console/stack_trace.cpp \ + ${srcdir}/../../console/executor_runner.cpp \ + ${srcdir}/../../console/executor.cpp \ + ${srcdir}/../../console/executor_logging.cpp \ + ${srcdir}/../../console/executor_options.cpp \ + ${srcdir}/../../console/executor_paging.cpp \ + ${srcdir}/../../console/executor_scans.cpp \ + ${srcdir}/../../console/executor_store.cpp \ + ${srcdir}/../../console/executor_test_reader.cpp \ + ${srcdir}/../../console/executor_test_writer.cpp \ + ${srcdir}/../../console/executor_dumps.cpp \ + ${srcdir}/../../console/executor_events.cpp \ + ${srcdir}/../../console/embedded/admin_css.cpp \ + ${srcdir}/../../console/embedded/admin_font.cpp \ + ${srcdir}/../../console/embedded/admin_html.cpp \ + ${srcdir}/../../console/embedded/admin_icon.cpp \ + ${srcdir}/../../console/embedded/amin_ecma.cpp \ + ${srcdir}/../../console/embedded/native_css.cpp \ + ${srcdir}/../../console/embedded/native_ecma.cpp \ + ${srcdir}/../../console/embedded/native_font.cpp \ + ${srcdir}/../../console/embedded/native_html.cpp \ + ${srcdir}/../../console/embedded/native_icon.cpp + +target_console = console/bs + +console: ${target_console} + +endif WITH_CONSOLE diff --git a/NEWS b/builds/gnu/NEWS similarity index 100% rename from NEWS rename to builds/gnu/NEWS diff --git a/README b/builds/gnu/README similarity index 100% rename from README rename to builds/gnu/README diff --git a/builds/gnu/configure.ac b/builds/gnu/configure.ac new file mode 100644 index 00000000..b7b12ac0 --- /dev/null +++ b/builds/gnu/configure.ac @@ -0,0 +1,253 @@ +############################################################################### +# Copyright (c) 2014-2026 libbitcoin-server developers (see COPYING). +# +# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY +# +############################################################################### + +# Standard declarations. +#============================================================================== +# Requires Automake 1.14 or newer. + +# Declare the required version of Autoconf. +AC_PREREQ([2.65]) + +# Process command-line arguments and perform initialization and verification. +AC_INIT([libbitcoin-server], [4.0.0], [eric@voskuil.org]) + +# Do compilation tests. +AC_LANG(C++) + +# Specify the temporary directory for build tools. +AC_CONFIG_AUX_DIR([build-aux]) + +# Specify the directory of additional local Autoconf macros. +AC_CONFIG_MACRO_DIR([m4]) + +# Run macros for operation of generated Makefiles, enable non-recursive make. +# Unless [foreign] is specified standard GNU files will be required, +# specifically: AUTHORS, COPYING, INSTALL, NEWS, README and ChangeLog. +AM_INIT_AUTOMAKE([subdir-objects]) + +# Enable C and POSIX extensions that may be disabled on certain platforms. +AC_USE_SYSTEM_EXTENSIONS + +# Enable the archiver. +AM_PROG_AR + +# Initialize libtool. +LT_PREREQ(2.4.2) + +# Enable shared libraries if available, and static if they don't conflict. +LT_INIT +AC_SUBST([LIBTOOL_DEPS]) + +# Determine C++ compiler to use. +AC_PROG_CXX + +# Enable sed for substitution. +AC_PROG_SED + +# Compute the canonical host-system type variable host, including host_os. +AC_CANONICAL_HOST + +# Enable silent rules option. +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +# Check for pkg-config. +PKG_PROG_PKG_CONFIG +AS_IF([test -n "${PKG_CONFIG}"], [], + [AC_MSG_ERROR([pkg-config is required but was not found.])]) + +AS_IF([test "x${enable_static}" != "xno"], + [AC_SUBST([PKG_CONFIG], ["${PKG_CONFIG} --static"])]) + +# Declare environment variables that affect the build. +#------------------------------------------------------------------------------ +AC_ARG_VAR([CC], "C compiler to use, such as gcc or clang") +AC_ARG_VAR([CXX], "C++ compiler to use, such as g++ or clang++") +AC_ARG_VAR([PKG_CONFIG_PATH], "Additional directories for package discovery.") + +repository_root_dir="@abs_top_srcdir@/../.." + +# Check for baseline language coverage in the compiler for the C++20 standard. +#------------------------------------------------------------------------------ +AX_CXX_COMPILE_STDCXX([20], [noext], [mandatory]) + +# Process options. +#============================================================================== +AC_MSG_CHECKING([--enable-isystem option]) +AC_ARG_ENABLE([isystem], + AS_HELP_STRING([--enable-isystem], + [Substitute -isystem for -I in dependencies. @<:@default=no@:>@]), + [enable_isystem=$enableval], + [enable_isystem=no]) +AC_MSG_RESULT([$enable_isystem]) +AM_CONDITIONAL([ENABLE_ISYSTEM], [test "x${enable_isystem}" != "xno"]) + +AC_MSG_CHECKING([--with-pkgconfigdir option]) +AC_ARG_WITH([pkgconfigdir], + AS_HELP_STRING([--with-pkgconfigdir=DIR], + [Path to pkgconfig directory. @<:@default=${libdir}/pkgconfig@:>@]), + [with_pkgconfigdir=$withval], + [with_pkgconfigdir=${libdir}/pkgconfig]) +AC_MSG_RESULT([$with_pkgconfigdir]) +AC_SUBST([pkgconfigdir],[${with_pkgconfigdir}]) + +AC_MSG_CHECKING([--enable-ndebug option]) +AC_ARG_ENABLE([ndebug], + AS_HELP_STRING([--enable-ndebug], + [Compile with NDEBUG assertion. @<:@default=no@:>@]), + [enable_ndebug=$enableval], + [enable_ndebug=no]) +AC_MSG_RESULT([$enable_ndebug]) +AM_CONDITIONAL([ENABLE_NDEBUG], [test "x${enable_ndebug}" != "xno"]) +AS_IF([test "x${enable_ndebug}" != "xno"], [AC_DEFINE([NDEBUG])]) + +AS_IF([test "x${enable_shared}" != "xno"], [AC_DEFINE([BOOST_ALL_DYN_LINK])]) + +AC_MSG_CHECKING([--with-tests option]) +AC_ARG_WITH([tests], + AS_HELP_STRING([--with-tests], + [Compile with unit tests. @<:@default=yes@:>@]), + [with_tests=$withval], + [with_tests=yes]) +AC_MSG_RESULT([$with_tests]) +AM_CONDITIONAL([WITH_TESTS], [test "x${with_tests}" != "xno"]) + +AC_MSG_CHECKING([--with-console option]) +AC_ARG_WITH([console], + AS_HELP_STRING([--with-console], + [Compile with console application. @<:@default=yes@:>@]), + [with_console=$withval], + [with_console=yes]) +AC_MSG_RESULT([$with_console]) +AM_CONDITIONAL([WITH_CONSOLE], [test "x${with_console}" != "xno"]) + +# Set flags. +#============================================================================== +AX_CHECK_COMPILE_FLAG([-Wall], + [ + CFLAGS="${CFLAGS} -Wall"; + CXXFLAGS="${CXXFLAGS} -Wall"; + ]) + +AX_CHECK_COMPILE_FLAG([-Wextra], + [ + CFLAGS="${CFLAGS} -Wextra"; + CXXFLAGS="${CXXFLAGS} -Wextra"; + ]) + +AX_CHECK_COMPILE_FLAG([-Wno-reorder], + [ + CXXFLAGS="${CXXFLAGS} -Wno-reorder"; + ]) + +AX_CHECK_COMPILE_FLAG([-Wno-missing-field-initializers], + [ + CXXFLAGS="${CXXFLAGS} -Wno-missing-field-initializers"; + ]) + +AX_CHECK_COMPILE_FLAG([-Wno-missing-braces], + [ + CXXFLAGS="${CXXFLAGS} -Wno-missing-braces"; + ]) + +AX_CHECK_COMPILE_FLAG([-Wno-comment], + [ + CXXFLAGS="${CXXFLAGS} -Wno-comment"; + ]) + +AX_CHECK_COMPILE_FLAG([-Wno-deprecated-copy], + [ + CXXFLAGS="${CXXFLAGS} -Wno-deprecated-copy"; + ]) + +AS_CASE([${CC}], [*clang*], + [ + AX_CHECK_COMPILE_FLAG([-Wno-mismatched-tags], + [ + CXXFLAGS="${CXXFLAGS} -Wno-mismatched-tags"; + ]) + ]) + +AX_CHECK_COMPILE_FLAG([-fstack-protector-all], + [ + CXXFLAGS="${CXXFLAGS} -fstack-protector-all"; + ]) + +AX_CHECK_COMPILE_FLAG([-Wno-ignored-attributes], + [ + libbitcoin_server_test_CXXFLAGS="${libbitcoin_server_test_CXXFLAGS} -Wno-ignored-attributes"; + bitcoin_server_CXXFLAGS="${bitcoin_server_CXXFLAGS} -Wno-ignored-attributes"; + ]) + +AX_CHECK_COMPILE_FLAG([-Wno-long-long], + [ + libbitcoin_server_test_CXXFLAGS="${libbitcoin_server_test_CXXFLAGS} -Wno-long-long"; + bitcoin_server_CXXFLAGS="${bitcoin_server_CXXFLAGS} -Wno-long-long"; + ]) + +AS_CASE([${CC}], [*gnu*], + [ + AX_CHECK_COMPILE_FLAG([-fno-var-tracking-assignments], + [ + libbitcoin_server_test_CXXFLAGS="${libbitcoin_server_test_CXXFLAGS} -fno-var-tracking-assignments"; + bitcoin_server_CXXFLAGS="${bitcoin_server_CXXFLAGS} -fno-var-tracking-assignments"; + ]) + ]) + +# Check dependencies. +#============================================================================== +PKG_CHECK_MODULES( + [libbitcoin_node], + [libbitcoin-node >= 4.0.0], + [], + [ + AC_MSG_ERROR([libbitcoin-node >= 4.0.0 is required but was not found.]) + ]) +AC_SUBST([libbitcoin_node_PKG], ['libbitcoin-node >= 4.0.0']) +AC_SUBST([libbitcoin_node_CPPFLAGS], [${libbitcoin_node_CFLAGS}]) +AC_SUBST([libbitcoin_node_ISYS_CPPFLAGS], [`echo ${libbitcoin_node_CPPFLAGS} | ${SED} s/^-I/-isystem/g | ${SED} s/' -I'/' -isystem'/g`]) +AC_MSG_NOTICE([libbitcoin_node_CPPFLAGS : ${libbitcoin_node_CPPFLAGS}]) +AC_MSG_NOTICE([libbitcoin_node_ISYS_CPPFLAGS : ${libbitcoin_node_ISYS_CPPFLAGS}]) +AC_MSG_NOTICE([libbitcoin_node_OTHER_CFLAGS : ${libbitcoin_node_OTHER_CFLAGS}]) +AC_MSG_NOTICE([libbitcoin_node_INCLUDEDIR : ${libbitcoin_node_INCLUDEDIR}]) +AC_MSG_NOTICE([libbitcoin_node_LIBS : ${libbitcoin_node_LIBS}]) +AS_IF([test "x${enable_isystem}" != "xno"], + [AC_SUBST([libbitcoin_node_BUILD_CPPFLAGS], [${libbitcoin_node_ISYS_CPPFLAGS}])], + [AC_SUBST([libbitcoin_node_BUILD_CPPFLAGS], [${libbitcoin_node_CPPFLAGS}])]) +AC_MSG_NOTICE([libbitcoin_node_BUILD_CPPFLAGS : ${libbitcoin_node_BUILD_CPPFLAGS}]) + +AX_BOOST_BASE([1.86.0], + [ + AC_SUBST([boost_CPPFLAGS], [${BOOST_CPPFLAGS}]) + AC_SUBST([boost_ISYSTEM_CPPFLAGS], [`echo ${boost_CPPFLAGS} | ${SED} s/^-I/-isystem/g | ${SED} s/' -I'/' -isystem'/g`]) + AC_SUBST([boost_LDFLAGS], [${BOOST_LDFLAGS}]) + AC_MSG_NOTICE([boost_CPPFLAGS : ${boost_CPPFLAGS}]) + AC_MSG_NOTICE([boost_ISYS_CPPFLAGS : ${boost_ISYS_CPPFLAGS}]) + AC_MSG_NOTICE([boost_LDFLAGS : ${boost_LDFLAGS}]) + ], + [ + AC_MSG_ERROR([Boost 1.86.0 or later is required but was not found.]) + ]) + +AS_IF([test "x${enable_isystem}" != "xno"], + [ AC_SUBST([boost_BUILD_CPPFLAGS], [${boost_ISYSTEM_CPPFLAGS}]) ], + [ AC_SUBST([boost_BUILD_CPPFLAGS], [${boost_CPPFLAGS}]) ]) + +AC_MSG_NOTICE([boost_BUILD_CPPFLAGS : ${boost_BUILD_CPPFLAGS}]) + +AS_IF([(test "x${with_tests}" != "xno")], + [ + AX_BOOST_UNIT_TEST_FRAMEWORK + AC_SUBST([boost_unit_test_framework_LIBS], [${BOOST_UNIT_TEST_FRAMEWORK_LIB}]) + AC_MSG_NOTICE([boost_unit_test_framework_LIBS : ${boost_unit_test_framework_LIBS}]) + ]) + +AC_CONFIG_FILES([ + Makefile + libbitcoin-server.pc + ]) + +AC_OUTPUT diff --git a/builds/gnu/install-gnu.sh b/builds/gnu/install-gnu.sh index ab6fe602..58bbf7a9 100755 --- a/builds/gnu/install-gnu.sh +++ b/builds/gnu/install-gnu.sh @@ -16,9 +16,9 @@ # Default: --disable-sse41 # ---shani Use Intel/ARM SHA Extensions. # Default: --disable-shani -# ---ultrafast Use shrec/UltrafastSecp256k1. +# ---ultrafast Use shrec/UltrafastSecp256k1 library. # Default: --without-ultrafast -# ---secp256k1 Use bitcoin-core/secp256k1. +# ---secp256k1 Use bitcoin-core/secp256k1 library. # Default: --with-secp256k1 # ---ssl Use embedded ssl library. # Default: --with-ssl @@ -561,10 +561,10 @@ main() source_github "${secp256k1_OWNER}" "secp256k1" "${secp256k1_TAG}" local SAVE_CPPFLAGS="${CPPFLAGS}" export CPPFLAGS="${CPPFLAGS} ${secp256k1_FLAGS[@]}" - build_gnu "secp256k1" "." "${PARALLEL}" "${secp256k1_OPTIONS[@]}" "${CONFIGURE_OPTIONS_GNU[@]}" - install_gnu "secp256k1" + build_gnu "secp256k1" "." "." "${PARALLEL}" "${secp256k1_OPTIONS[@]}" "${CONFIGURE_OPTIONS_GNU[@]}" + install_gnu "secp256k1" "." if [[ "${BUILD_POST_INSTALL_CLEAN}" == "yes" ]]; then - clean_gnu "secp256k1" + clean_gnu "secp256k1" "." fi export CPPFLAGS="${SAVE_CPPFLAGS}" fi @@ -573,10 +573,10 @@ 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 @@ -584,53 +584,53 @@ main() source_github "${libbitcoin_system_OWNER}" "libbitcoin-system" "${libbitcoin_system_TAG}" local SAVE_CPPFLAGS="${CPPFLAGS}" export CPPFLAGS="${CPPFLAGS} ${libbitcoin_system_FLAGS[@]}" - build_gnu "libbitcoin-system" "." "${PARALLEL}" "${libbitcoin_system_OPTIONS[@]}" "${CONFIGURE_OPTIONS_GNU[@]}" - install_gnu "libbitcoin-system" + build_gnu "libbitcoin-system" "builds/gnu" "builds/gnu" "${PARALLEL}" "${libbitcoin_system_OPTIONS[@]}" "${CONFIGURE_OPTIONS_GNU[@]}" + install_gnu "libbitcoin-system" "builds/gnu" if [[ "${BUILD_POST_INSTALL_CLEAN}" == "yes" ]]; then - clean_gnu "libbitcoin-system" + clean_gnu "libbitcoin-system" "builds/gnu" 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_gnu "libbitcoin-database" "." "${PARALLEL}" "${libbitcoin_database_OPTIONS[@]}" "${CONFIGURE_OPTIONS_GNU[@]}" - install_gnu "libbitcoin-database" + build_gnu "libbitcoin-database" "builds/gnu" "builds/gnu" "${PARALLEL}" "${libbitcoin_database_OPTIONS[@]}" "${CONFIGURE_OPTIONS_GNU[@]}" + install_gnu "libbitcoin-database" "builds/gnu" if [[ "${BUILD_POST_INSTALL_CLEAN}" == "yes" ]]; then - clean_gnu "libbitcoin-database" + clean_gnu "libbitcoin-database" "builds/gnu" fi export CPPFLAGS="${SAVE_CPPFLAGS}" source_github "${libbitcoin_network_OWNER}" "libbitcoin-network" "${libbitcoin_network_TAG}" local SAVE_CPPFLAGS="${CPPFLAGS}" export CPPFLAGS="${CPPFLAGS} ${libbitcoin_network_FLAGS[@]}" - build_gnu "libbitcoin-network" "." "${PARALLEL}" "${libbitcoin_network_OPTIONS[@]}" "${CONFIGURE_OPTIONS_GNU[@]}" - install_gnu "libbitcoin-network" + build_gnu "libbitcoin-network" "builds/gnu" "builds/gnu" "${PARALLEL}" "${libbitcoin_network_OPTIONS[@]}" "${CONFIGURE_OPTIONS_GNU[@]}" + install_gnu "libbitcoin-network" "builds/gnu" if [[ "${BUILD_POST_INSTALL_CLEAN}" == "yes" ]]; then - clean_gnu "libbitcoin-network" + clean_gnu "libbitcoin-network" "builds/gnu" fi export CPPFLAGS="${SAVE_CPPFLAGS}" source_github "${libbitcoin_node_OWNER}" "libbitcoin-node" "${libbitcoin_node_TAG}" local SAVE_CPPFLAGS="${CPPFLAGS}" export CPPFLAGS="${CPPFLAGS} ${libbitcoin_node_FLAGS[@]}" - build_gnu "libbitcoin-node" "." "${PARALLEL}" "${libbitcoin_node_OPTIONS[@]}" "${CONFIGURE_OPTIONS_GNU[@]}" - install_gnu "libbitcoin-node" + build_gnu "libbitcoin-node" "builds/gnu" "builds/gnu" "${PARALLEL}" "${libbitcoin_node_OPTIONS[@]}" "${CONFIGURE_OPTIONS_GNU[@]}" + install_gnu "libbitcoin-node" "builds/gnu" if [[ "${BUILD_POST_INSTALL_CLEAN}" == "yes" ]]; then - clean_gnu "libbitcoin-node" + clean_gnu "libbitcoin-node" "builds/gnu" fi export CPPFLAGS="${SAVE_CPPFLAGS}" source_github "${libbitcoin_server_OWNER}" "libbitcoin-server" "${libbitcoin_server_TAG}" local SAVE_CPPFLAGS="${CPPFLAGS}" export CPPFLAGS="${CPPFLAGS} ${libbitcoin_server_FLAGS[@]}" - build_gnu "libbitcoin-server" "." "${PARALLEL}" "${libbitcoin_server_OPTIONS[@]}" "${CONFIGURE_OPTIONS_GNU[@]}" + build_gnu "libbitcoin-server" "builds/gnu" "builds/gnu" "${PARALLEL}" "${libbitcoin_server_OPTIONS[@]}" "${CONFIGURE_OPTIONS_GNU[@]}" if ! [[ "${BUILD_SKIP_TESTS}" == "yes" ]]; then - test_gnu "libbitcoin-server" "${PARALLEL}" + test_gnu "libbitcoin-server" "builds/gnu" "${PARALLEL}" fi - install_gnu "libbitcoin-server" + install_gnu "libbitcoin-server" "builds/gnu" if [[ "${BUILD_POST_INSTALL_CLEAN}" == "yes" ]]; then - clean_gnu "libbitcoin-server" + clean_gnu "libbitcoin-server" "builds/gnu" fi export CPPFLAGS="${SAVE_CPPFLAGS}" @@ -848,9 +848,10 @@ build_boost() build_gnu() { 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_GNU="" local VERBOSITY_MAKE="" @@ -865,7 +866,7 @@ build_gnu() # directory rationalization push_directory "${BUILD_SRC_DIR}/${PROJECT}" - push_directory "${RELATIVE_PATH}" + push_directory "${RELATIVE_SRC_PATH}" local BUILD_PATH="$(pwd)" pop_directory @@ -879,6 +880,11 @@ build_gnu() push_directory "${BUILD_OBJ_DIR}/${PROJECT}" fi + if [[ "${RELATIVE_OBJ_PATH}" != "." ]]; then + create_directory_force "${RELATIVE_OBJ_PATH}" + push_directory "${RELATIVE_OBJ_PATH}" + fi + # configuration push_directory "${BUILD_PATH}" autoreconf ${VERBOSITY_GNU} -i @@ -897,6 +903,10 @@ build_gnu() pop_directory # BUILD_OBJ_DIR pop_directory # BUILD_SRC_DIR/PROJECT + if [[ "${RELATIVE_OBJ_PATH}" != "." ]]; then + pop_directory + fi + msg_success "'${PROJECT}' built successfully." } @@ -904,9 +914,10 @@ build_gnu() 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="" @@ -921,7 +932,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 @@ -935,9 +946,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 @@ -948,6 +964,10 @@ 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." } @@ -955,7 +975,8 @@ build_cmake() clean_cmake() { local PROJECT="$1" - shift 1 + local RELATIVE_OBJ_PATH="$2" + shift 2 msg "Preparing to clean ${PROJECT}" @@ -967,6 +988,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 @@ -980,6 +1005,9 @@ 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." } @@ -987,7 +1015,8 @@ clean_cmake() install_cmake() { local PROJECT="$1" - shift + local RELATIVE_OBJ_PATH="$2" + shift 2 msg "Preparing to install ${PROJECT}" @@ -999,6 +1028,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 @@ -1007,6 +1040,9 @@ 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." } @@ -1014,8 +1050,9 @@ install_cmake() 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}" @@ -1027,6 +1064,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 . @@ -1054,6 +1095,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." } @@ -1061,7 +1105,8 @@ test_cmake() clean_gnu() { local PROJECT="$1" - shift 1 + local RELATIVE_OBJ_PATH="$2" + shift 2 msg "Preparing to clean ${PROJECT}" @@ -1073,6 +1118,10 @@ clean_gnu() push_directory "${BUILD_OBJ_DIR}/${PROJECT}" fi + if [[ "${RELATIVE_OBJ_PATH}" != "." ]]; then + push_directory "${RELATIVE_OBJ_PATH}" + fi + disable_exit_on_error make clean @@ -1086,6 +1135,9 @@ clean_gnu() pop_directory # BUILD_OBJ_DIR pop_directory # BUILD_SRC_DIR/PROJECT + if [[ "${RELATIVE_OBJ_PATH}" != "." ]]; then + pop_directory + fi msg_success "'${PROJECT}' clean complete." } @@ -1093,7 +1145,8 @@ clean_gnu() install_gnu() { local PROJECT="$1" - shift + local RELATIVE_OBJ_PATH="$2" + shift 2 msg "Preparing to install ${PROJECT}" @@ -1105,6 +1158,10 @@ install_gnu() push_directory "${BUILD_OBJ_DIR}/${PROJECT}" fi + if [[ "${RELATIVE_OBJ_PATH}" != "." ]]; then + push_directory "${RELATIVE_OBJ_PATH}" + fi + make install if [[ ${OS} == Linux ]] && [[ "${PREFIX}" == "/usr/local" ]]; then @@ -1113,6 +1170,9 @@ install_gnu() pop_directory # BUILD_OBJ_DIR pop_directory # BUILD_SRC_DIR/PROJECT + if [[ "${RELATIVE_OBJ_PATH}" != "." ]]; then + pop_directory + fi msg_success "'${PROJECT}' installation complete." } @@ -1120,8 +1180,9 @@ install_gnu() test_gnu() { local PROJECT="$1" - local JOBS="$2" - shift 2 + local RELATIVE_OBJ_PATH="$2" + local JOBS="$3" + shift 3 msg "Preparing to test ${PROJECT}" @@ -1133,6 +1194,10 @@ test_gnu() push_directory "${BUILD_OBJ_DIR}/${PROJECT}" fi + if [[ "${RELATIVE_OBJ_PATH}" != "." ]]; then + push_directory "${RELATIVE_OBJ_PATH}" + fi + disable_exit_on_error if [[ ${JOBS} -gt ${SEQUENTIAL} ]]; then @@ -1164,6 +1229,9 @@ test_gnu() pop_directory # BUILD_OBJ_DIR pop_directory # BUILD_SRC_DIR/PROJECT + if [[ "${RELATIVE_OBJ_PATH}" != "." ]]; then + pop_directory + fi msg_success "'${PROJECT}' test complete." } @@ -1249,9 +1317,9 @@ help() msg " Default: --disable-sse41" msg "---shani Use Intel/ARM SHA Extensions." msg " Default: --disable-shani" - msg "---ultrafast Use shrec/UltrafastSecp256k1." + msg "---ultrafast Use shrec/UltrafastSecp256k1 library." msg " Default: --without-ultrafast" - msg "---secp256k1 Use bitcoin-core/secp256k1." + msg "---secp256k1 Use bitcoin-core/secp256k1 library." msg " Default: --with-secp256k1" msg "---ssl Use embedded ssl library." msg " Default: --with-ssl" diff --git a/libbitcoin-server.pc.in b/builds/gnu/libbitcoin-server.pc.in similarity index 61% rename from libbitcoin-server.pc.in rename to builds/gnu/libbitcoin-server.pc.in index 6d26f4bb..3881e371 100644 --- a/libbitcoin-server.pc.in +++ b/builds/gnu/libbitcoin-server.pc.in @@ -5,6 +5,7 @@ # ############################################################################### + # Substitutions #============================================================================== prefix=@prefix@ @@ -12,6 +13,7 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ + # Metadata #============================================================================== Name: libbitcoin-server @@ -22,15 +24,12 @@ Version: @PACKAGE_VERSION@ # Variables #============================================================================== -# Dependencies that publish package configuration. -#------------------------------------------------------------------------------ -Requires: libbitcoin-node >= 4.0.0 - -# Include directory and any other required compiler flags. -#------------------------------------------------------------------------------ -Cflags: -I${includedir} +Requires: \ + @libbitcoin_node_PKG@ -# Lib directory, lib and any required that do not publish pkg-config. -#------------------------------------------------------------------------------ -Libs: -L${libdir} -lbitcoin-server +Cflags: \ + -I${includedir} +Libs: \ + -L${libdir} \ + -lbitcoin-server diff --git a/m4/.gitignore b/builds/gnu/m4/.gitignore similarity index 100% rename from m4/.gitignore rename to builds/gnu/m4/.gitignore diff --git a/m4/ax_boost_base.m4 b/builds/gnu/m4/ax_boost_base.m4 similarity index 100% rename from m4/ax_boost_base.m4 rename to builds/gnu/m4/ax_boost_base.m4 diff --git a/m4/ax_boost_unit_test_framework.m4 b/builds/gnu/m4/ax_boost_unit_test_framework.m4 similarity index 100% rename from m4/ax_boost_unit_test_framework.m4 rename to builds/gnu/m4/ax_boost_unit_test_framework.m4 diff --git a/m4/ax_check_compile_flag.m4 b/builds/gnu/m4/ax_check_compile_flag.m4 similarity index 100% rename from m4/ax_check_compile_flag.m4 rename to builds/gnu/m4/ax_check_compile_flag.m4 diff --git a/m4/ax_check_link_flag.m4 b/builds/gnu/m4/ax_check_link_flag.m4 similarity index 100% rename from m4/ax_check_link_flag.m4 rename to builds/gnu/m4/ax_check_link_flag.m4 diff --git a/m4/ax_check_preproc_flag.m4 b/builds/gnu/m4/ax_check_preproc_flag.m4 similarity index 100% rename from m4/ax_check_preproc_flag.m4 rename to builds/gnu/m4/ax_check_preproc_flag.m4 diff --git a/m4/ax_cxx_compile_stdcxx.m4 b/builds/gnu/m4/ax_cxx_compile_stdcxx.m4 similarity index 100% rename from m4/ax_cxx_compile_stdcxx.m4 rename to builds/gnu/m4/ax_cxx_compile_stdcxx.m4 diff --git a/libbitcoin-server-test_runner.sh b/builds/gnu/test_runner.sh similarity index 68% rename from libbitcoin-server-test_runner.sh rename to builds/gnu/test_runner.sh index 27789e6a..d1c7604a 100755 --- a/libbitcoin-server-test_runner.sh +++ b/builds/gnu/test_runner.sh @@ -1,6 +1,6 @@ #!/bin/sh ############################################################################### -# Copyright (c) 2014-2026 libbitcoin-server developers (see COPYING). +# Copyright (c) 2014-2026 libbitcoin-server-test developers (see COPYING). # # GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY # @@ -9,18 +9,16 @@ # Define tests and options. #============================================================================== BOOST_UNIT_TEST_OPTIONS=\ -"--run_test=* "\ -"--log_level=warning "\ -"--show_progress=no "\ -"--detect_memory_leak=0 "\ -"--report_level=no "\ -"--build_info=yes" - + "--log_level=warning "\ + "--show_progress=no "\ + "--detect_memory_leak=0 "\ + "--report_level=no "\ + "--build-info=yes "\ + "--run_tests=*" # Run tests. #============================================================================== -# ALlow CI to send errors to standard output -if [[ $CI == true ]]; then +if [[ ${CI} == true ]]; then ./test/libbitcoin-server-test ${BOOST_UNIT_TEST_OPTIONS} else ./test/libbitcoin-server-test ${BOOST_UNIT_TEST_OPTIONS} > test.log diff --git a/builds/msvc/debug.natvis b/builds/msvc/debug.natvis index 981fa3d4..6e73929e 100644 --- a/builds/msvc/debug.natvis +++ b/builds/msvc/debug.natvis @@ -6,15 +6,10 @@ | --> - - { m_backend } - - { m_data } - diff --git a/configure.ac b/configure.ac deleted file mode 100644 index d4e42ff6..00000000 --- a/configure.ac +++ /dev/null @@ -1,313 +0,0 @@ -############################################################################### -# Copyright (c) 2014-2026 libbitcoin-server developers (see COPYING). -# -# GENERATED SOURCE CODE, DO NOT EDIT EXCEPT EXPERIMENTALLY -# -############################################################################### - -# Standard declarations. -#============================================================================== -# Requires Automake 1.14 or newer. - -# Declare the required version of Autoconf. -AC_PREREQ([2.65]) - -# Process command-line arguments and perform initialization and verification. -AC_INIT([libbitcoin-server], [4.0.0], [eric@voskuil.org]) - -# Do compilation tests. -AC_LANG(C++) - -# Specify the temporary directory for build tools. -AC_CONFIG_AUX_DIR([build-aux]) - -# Specify the directory of additional local Autoconf macros. -AC_CONFIG_MACRO_DIR([m4]) - -# Run macros for operation of generated Makefiles, enable non-recursive make. -# Unless [foreign] is specified standard GNU files will be required, -# specifically: AUTHORS, COPYING, INSTALL, NEWS, README and ChangeLog. -AM_INIT_AUTOMAKE([subdir-objects]) - -# Enable C and POSIX extensions that may be disabled on certain platforms. -AC_USE_SYSTEM_EXTENSIONS - -# Enable the archiver. -AM_PROG_AR - -# Initialize libtool. -LT_PREREQ(2.4.2) - -# Enable shared libraries if available, and static if they don't conflict. -LT_INIT -AC_SUBST([LIBTOOL_DEPS]) - -# Determine C++ compiler to use. -AC_PROG_CXX - -# Enable sed for substitution. -AC_PROG_SED - -# Compute the canonical host-system type variable host, including host_os. -AC_CANONICAL_HOST - -# Enable silent rules option. -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) - -# Check for pkg-config. -PKG_PROG_PKG_CONFIG -AS_IF([test -n "$PKG_CONFIG"], [], - [AC_MSG_ERROR([pkg-config is required but was not found.])]) - -AS_CASE([${enable_static}], - [yes], [AC_SUBST([PKG_CONFIG], ["$PKG_CONFIG --static"])], - []) - -# Declare environment variables that affect the build. -#------------------------------------------------------------------------------ -AC_ARG_VAR([CC], "C compiler to use, such as gcc or clang") -AC_ARG_VAR([CXX], "C++ compiler to use, such as g++ or clang++") -AC_ARG_VAR([PKG_CONFIG_PATH], "Additional directories for package discovery.") - -# Check for baseline language coverage in the compiler for the C++20 standard. -#------------------------------------------------------------------------------ -AX_CXX_COMPILE_STDCXX([20], [noext], [mandatory]) - - -# Process options. -#============================================================================== -# Implement --with-bash-completiondir and output ${bash_completiondir} and declare BASH_COMPLETIONDIR. -#------------------------------------------------------------------------------ -AC_MSG_CHECKING([--with-bash-completiondir option]) -AC_ARG_WITH([bash-completiondir], - AS_HELP_STRING([--with-bash-completiondir[=DIR]], - [Install bash completion support, optionally specifying the directory. This option may require elevated permissions. @<:@default=no@:>@]), - [bash_completiondir=$withval], - [bash_completiondir=no]) -AC_MSG_RESULT([$bash_completiondir]) -AC_SUBST([bash_completiondir]) -AM_CONDITIONAL([BASH_COMPLETIONDIR], [test x$bash_completiondir != xno]) - -# Implement --with-pkgconfigdir and output ${pkgconfigdir}. -#------------------------------------------------------------------------------ -AC_MSG_CHECKING([--with-pkgconfigdir option]) -AC_ARG_WITH([pkgconfigdir], - AS_HELP_STRING([--with-pkgconfigdir=DIR], - [Path to pkgconfig directory. @<:@default=${libdir}/pkgconfig@:>@]), - [pkgconfigdir=$withval], - [pkgconfigdir=${libdir}/pkgconfig]) -AC_MSG_RESULT([$pkgconfigdir]) -AC_SUBST([pkgconfigdir]) - -# Implement --with-tests and declare WITH_TESTS. -#------------------------------------------------------------------------------ -AC_MSG_CHECKING([--with-tests option]) -AC_ARG_WITH([tests], - AS_HELP_STRING([--with-tests], - [Compile with unit tests. @<:@default=yes@:>@]), - [with_tests=$withval], - [with_tests=yes]) -AC_MSG_RESULT([$with_tests]) -AM_CONDITIONAL([WITH_TESTS], [test x$with_tests != xno]) - -# Implement --with-console and declare WITH_CONSOLE. -#------------------------------------------------------------------------------ -AC_MSG_CHECKING([--with-console option]) -AC_ARG_WITH([console], - AS_HELP_STRING([--with-console], - [Compile console application. @<:@default=yes@:>@]), - [with_console=$withval], - [with_console=yes]) -AC_MSG_RESULT([$with_console]) -AM_CONDITIONAL([WITH_CONSOLE], [test x$with_console != xno]) - -# Implement --enable-ndebug and define NDEBUG. -#------------------------------------------------------------------------------ -AC_MSG_CHECKING([--enable-ndebug option]) -AC_ARG_ENABLE([ndebug], - AS_HELP_STRING([--enable-ndebug], - [Compile without debug assertions. @<:@default=yes@:>@]), - [enable_ndebug=$enableval], - [enable_ndebug=yes]) -AC_MSG_RESULT([$enable_ndebug]) -AS_CASE([${enable_ndebug}], [yes], AC_DEFINE([NDEBUG])) - -# Inherit --enable-shared and define BOOST_ALL_DYN_LINK. -#------------------------------------------------------------------------------ -AS_CASE([${enable_shared}], [yes], AC_DEFINE([BOOST_ALL_DYN_LINK])) - -# Implement --enable-isystem. -#------------------------------------------------------------------------------ -AC_MSG_CHECKING([--enable-isystem option]) -AC_ARG_ENABLE([isystem], - AS_HELP_STRING([--enable-isystem], - [Substitute -isystem for -I in dependencies. @<:@default=no@:>@]), - [enable_isystem=$enableval], - [enable_isystem=no]) -AC_MSG_RESULT([$enable_isystem]) - - -# Set flags. -#============================================================================== -# Require c++20 for all c++ products. -#------------------------------------------------------------------------------ -AS_CASE([${CC}], [*], - [AX_CHECK_COMPILE_FLAG([-std=c++20], - [CXXFLAGS="$CXXFLAGS -std=c++20"])]) - -# Warn on all stuff. -#------------------------------------------------------------------------------ -AS_CASE([${CC}], [*], - [AX_CHECK_COMPILE_FLAG([-Wall], - [CFLAGS="$CFLAGS -Wall"])]) - -# Warn on all stuff. -#------------------------------------------------------------------------------ -AS_CASE([${CC}], [*], - [AX_CHECK_COMPILE_FLAG([-Wall], - [CXXFLAGS="$CXXFLAGS -Wall"])]) - -# Warn on extra stuff. -#------------------------------------------------------------------------------ -AS_CASE([${CC}], [*], - [AX_CHECK_COMPILE_FLAG([-Wextra], - [CFLAGS="$CFLAGS -Wextra"])]) - -# Warn on extra stuff. -#------------------------------------------------------------------------------ -AS_CASE([${CC}], [*], - [AX_CHECK_COMPILE_FLAG([-Wextra], - [CXXFLAGS="$CXXFLAGS -Wextra"])]) - -# Disallow warning on style order of declarations. -#------------------------------------------------------------------------------ -AS_CASE([${CC}], [*], - [AX_CHECK_COMPILE_FLAG([-Wno-reorder], - [CXXFLAGS="$CXXFLAGS -Wno-reorder"])]) - -# Suppress warning for incomplete field initialization. -#------------------------------------------------------------------------------ -AS_CASE([${CC}], [*], - [AX_CHECK_COMPILE_FLAG([-Wno-missing-field-initializers], - [CXXFLAGS="$CXXFLAGS -Wno-missing-field-initializers"])]) - -# Conform to style. -#------------------------------------------------------------------------------ -AS_CASE([${CC}], [*], - [AX_CHECK_COMPILE_FLAG([-Wno-missing-braces], - [CXXFLAGS="$CXXFLAGS -Wno-missing-braces"])]) - -# Ignore comments within comments or commenting of backslash extended lines. -#------------------------------------------------------------------------------ -AS_CASE([${CC}], [*], - [AX_CHECK_COMPILE_FLAG([-Wno-comment], - [CXXFLAGS="$CXXFLAGS -Wno-comment"])]) - -# Suppress warning for copy of implicitly generated copy constructor. -#------------------------------------------------------------------------------ -AS_CASE([${CC}], [*], - [AX_CHECK_COMPILE_FLAG([-Wno-deprecated-copy], - [CXXFLAGS="$CXXFLAGS -Wno-deprecated-copy"])]) - -# Conflict in stdlib under clang. Enabled in clang only. -#------------------------------------------------------------------------------ -AS_CASE([${CC}], [*clang*], - [AX_CHECK_COMPILE_FLAG([-Wno-mismatched-tags], - [CXXFLAGS="$CXXFLAGS -Wno-mismatched-tags"])]) - -# Address -undefined dynamic_lookup MacOS error. -#------------------------------------------------------------------------------ -AS_CASE([${CC}], [*], - [AX_CHECK_LINK_FLAG([-no_fixup_chains], - [LDFLAGS="$LDFLAGS -no_fixup_chains"])]) - -# Protect stack. -#------------------------------------------------------------------------------ -AS_CASE([${CC}], [*], - [AX_CHECK_LINK_FLAG([-fstack-protector], - [LDFLAGS="$LDFLAGS -fstack-protector"])]) - -# Protect stack comprehensively. -#------------------------------------------------------------------------------ -AS_CASE([${CC}], [*], - [AX_CHECK_LINK_FLAG([-fstack-protector-all], - [LDFLAGS="$LDFLAGS -fstack-protector-all"])]) - - -# Check dependencies. -#============================================================================== -# Require Boost of at least version 1.86.0 and output ${boost_CPPFLAGS/LDFLAGS}. -#------------------------------------------------------------------------------ -AS_CASE([${CC}], [*], - [AX_BOOST_BASE([1.86.0], - [AC_SUBST([boost_CPPFLAGS], [${BOOST_CPPFLAGS}]) - AC_SUBST([boost_ISYS_CPPFLAGS], [`echo ${BOOST_CPPFLAGS} | $SED s/^-I/-isystem/g | $SED s/' -I'/' -isystem'/g`]) - AC_SUBST([boost_LDFLAGS], [${BOOST_LDFLAGS}]) - AC_MSG_NOTICE([boost_CPPFLAGS : ${boost_CPPFLAGS}]) - AC_MSG_NOTICE([boost_ISYS_CPPFLAGS : ${boost_ISYS_CPPFLAGS}]) - AC_MSG_NOTICE([boost_LDFLAGS : ${boost_LDFLAGS}])], - [AC_MSG_ERROR([Boost 1.86.0 or later is required but was not found.])])]) - -AS_CASE([${enable_isystem}],[yes], - [AC_SUBST([boost_BUILD_CPPFLAGS], [${boost_ISYS_CPPFLAGS}])], - [AC_SUBST([boost_BUILD_CPPFLAGS], [${boost_CPPFLAGS}])]) - -AC_MSG_NOTICE([boost_BUILD_CPPFLAGS : ${boost_BUILD_CPPFLAGS}]) - -AS_CASE([${with_tests}], [yes], - [AX_BOOST_UNIT_TEST_FRAMEWORK - AC_SUBST([boost_unit_test_framework_LIBS], [${BOOST_UNIT_TEST_FRAMEWORK_LIB}]) - AC_MSG_NOTICE([boost_unit_test_framework_LIBS : ${boost_unit_test_framework_LIBS}])], - [AC_SUBST([boost_unit_test_framework_LIBS], [])]) - -# Require bash-completion of at least version 2.0.0 and output ${bash_completion_CPPFLAGS/LIBS/PKG}. -#------------------------------------------------------------------------------ -AS_CASE([${bash_completiondir}], [yes], - [PKG_CHECK_MODULES([bash_completion], [bash-completion >= 2.0.0], [], - [ - bash_completion_INCLUDEDIR="" - bash_completion_OTHER_CFLAGS="" - bash_completiondir="${datadir}/bash-completion/completions" - ]) - AC_SUBST([bash_completion_PKG], ['bash-completion >= 2.0.0']) - AC_SUBST([bash_completion_CPPFLAGS], [${bash_completion_CFLAGS}]) - AC_SUBST([bash_completion_ISYS_CPPFLAGS], [`echo ${bash_completion_CPPFLAGS} | $SED s/^-I/-isystem/g | $SED s/' -I'/' -isystem'/g`]]) - AC_MSG_NOTICE([bash_completion_CPPFLAGS : ${bash_completion_CPPFLAGS}]) - AC_MSG_NOTICE([bash_completion_ISYS_CPPFLAGS : ${bash_completion_ISYS_CPPFLAGS}]) - AC_MSG_NOTICE([bash_completion_OTHER_CFLAGS : ${bash_completion_OTHER_CFLAGS}]) - AC_MSG_NOTICE([bash_completion_INCLUDEDIR : ${bash_completion_INCLUDEDIR}]) - AC_MSG_NOTICE([bash_completion_LIBS : ${bash_completion_LIBS}])], - [AC_SUBST([bash_completion_PKG], [])]) - -AS_CASE([${enable_isystem}],[yes], - [AC_SUBST([bash_completion_BUILD_CPPFLAGS], [${bash_completion_ISYS_CPPFLAGS}])], - [AC_SUBST([bash_completion_BUILD_CPPFLAGS], [${bash_completion_CPPFLAGS}])]) - -AC_MSG_NOTICE([bash_completion_BUILD_CPPFLAGS : ${bash_completion_BUILD_CPPFLAGS}]) - -# Require bitcoin-node of at least version 4.0.0 and output ${bitcoin_node_CPPFLAGS/LIBS/PKG}. -#------------------------------------------------------------------------------ -PKG_CHECK_MODULES([bitcoin_node], [libbitcoin-node >= 4.0.0], [], - [ - AC_MSG_ERROR([libbitcoin-node >= 4.0.0 is required but was not found.]) - ]) -AC_SUBST([bitcoin_node_PKG], ['libbitcoin-node >= 4.0.0']) -AC_SUBST([bitcoin_node_CPPFLAGS], [${bitcoin_node_CFLAGS}]) -AC_SUBST([bitcoin_node_ISYS_CPPFLAGS], [`echo ${bitcoin_node_CPPFLAGS} | $SED s/^-I/-isystem/g | $SED s/' -I'/' -isystem'/g`]]) -AC_MSG_NOTICE([bitcoin_node_CPPFLAGS : ${bitcoin_node_CPPFLAGS}]) -AC_MSG_NOTICE([bitcoin_node_ISYS_CPPFLAGS : ${bitcoin_node_ISYS_CPPFLAGS}]) -AC_MSG_NOTICE([bitcoin_node_OTHER_CFLAGS : ${bitcoin_node_OTHER_CFLAGS}]) -AC_MSG_NOTICE([bitcoin_node_INCLUDEDIR : ${bitcoin_node_INCLUDEDIR}]) -AC_MSG_NOTICE([bitcoin_node_LIBS : ${bitcoin_node_LIBS}]) - -AS_CASE([${enable_isystem}],[yes], - [AC_SUBST([bitcoin_node_BUILD_CPPFLAGS], [${bitcoin_node_ISYS_CPPFLAGS}])], - [AC_SUBST([bitcoin_node_BUILD_CPPFLAGS], [${bitcoin_node_CPPFLAGS}])]) - -AC_MSG_NOTICE([bitcoin_node_BUILD_CPPFLAGS : ${bitcoin_node_BUILD_CPPFLAGS}]) - - -# Process outputs into templates. -#============================================================================== -AC_CONFIG_FILES([Makefile libbitcoin-server.pc]) -AC_OUTPUT