Skip to content
Open
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
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
coverage: "nocov"
detectcpuflags: "ignore"
boost: "--build-boost"
icu: ""
icu: "--with-icu"
llvm: ""
secp256k1: "--build-secp256k1"
cc: "clang"
Expand All @@ -110,14 +110,14 @@ jobs:
coverage: "nocov"
detectcpuflags: "ignore"
boost: "--build-boost"
icu: ""
icu: "--build-icu --with-icu"
llvm: ""
secp256k1: "--build-secp256k1"
cc: "clang"
flags: "-Os -fvisibility=hidden -fPIE"
options: "--enable-isystem"
packager: "brew"
packages: "icu4c"
packages: ""


runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -364,7 +364,7 @@ jobs:
coverage: "nocov"
detectcpuflags: "ignore"
boost: "--build-boost"
icu: ""
icu: "--with-icu"
llvm: ""
secp256k1: "--build-secp256k1"
cc: "clang"
Expand All @@ -381,14 +381,14 @@ jobs:
coverage: "nocov"
detectcpuflags: "ignore"
boost: "--build-boost"
icu: ""
icu: "--build-icu --with-icu"
llvm: ""
secp256k1: "--build-secp256k1"
cc: "clang"
flags: "-Os -fvisibility=hidden -fPIE"
options: ""
packager: "brew"
packages: "icu4c"
packages: ""


runs-on: ${{ matrix.os }}
Expand Down
12 changes: 6 additions & 6 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ doc_DATA = \
# src/libbitcoin-system.la => ${libdir}
#------------------------------------------------------------------------------
lib_LTLIBRARIES = src/libbitcoin-system.la
src_libbitcoin_system_la_CPPFLAGS = -I${srcdir}/include ${icu} ${boost_BUILD_CPPFLAGS} ${pthread_BUILD_CPPFLAGS} ${icu_i18n_BUILD_CPPFLAGS} ${secp256k1_BUILD_CPPFLAGS}
src_libbitcoin_system_la_CPPFLAGS = -I${srcdir}/include ${icu} ${boost_BUILD_CPPFLAGS} ${icu_i18n_BUILD_CPPFLAGS} ${secp256k1_BUILD_CPPFLAGS}
src_libbitcoin_system_la_LDFLAGS = ${boost_LDFLAGS}
src_libbitcoin_system_la_LIBADD = ${boost_iostreams_LIBS} ${boost_locale_LIBS} ${boost_program_options_LIBS} ${boost_thread_LIBS} ${boost_url_LIBS} ${pthread_LIBS} ${rt_LIBS} ${icu_i18n_LIBS} ${dl_LIBS} ${secp256k1_LIBS}
src_libbitcoin_system_la_LIBADD = ${boost_iostreams_LIBS} ${boost_locale_LIBS} ${boost_program_options_LIBS} ${boost_thread_LIBS} ${boost_url_LIBS} ${icu_i18n_LIBS} ${secp256k1_LIBS}
src_libbitcoin_system_la_SOURCES = \
src/arena.cpp \
src/define.cpp \
Expand Down Expand Up @@ -193,9 +193,9 @@ src_libbitcoin_system_la_SOURCES = \
if WITH_EXAMPLES

noinst_PROGRAMS = examples/libbitcoin-system-examples
examples_libbitcoin_system_examples_CPPFLAGS = -I${srcdir}/include ${icu} ${boost_BUILD_CPPFLAGS} ${pthread_BUILD_CPPFLAGS} ${icu_i18n_BUILD_CPPFLAGS} ${secp256k1_BUILD_CPPFLAGS}
examples_libbitcoin_system_examples_CPPFLAGS = -I${srcdir}/include ${icu} ${boost_BUILD_CPPFLAGS} ${icu_i18n_BUILD_CPPFLAGS} ${secp256k1_BUILD_CPPFLAGS}
examples_libbitcoin_system_examples_LDFLAGS = ${boost_LDFLAGS}
examples_libbitcoin_system_examples_LDADD = src/libbitcoin-system.la ${boost_iostreams_LIBS} ${boost_locale_LIBS} ${boost_program_options_LIBS} ${boost_thread_LIBS} ${boost_url_LIBS} ${pthread_LIBS} ${rt_LIBS} ${icu_i18n_LIBS} ${dl_LIBS} ${secp256k1_LIBS}
examples_libbitcoin_system_examples_LDADD = src/libbitcoin-system.la ${boost_iostreams_LIBS} ${boost_locale_LIBS} ${boost_program_options_LIBS} ${boost_thread_LIBS} ${boost_url_LIBS} ${icu_i18n_LIBS} ${secp256k1_LIBS}
examples_libbitcoin_system_examples_SOURCES = \
examples/main.cpp

Expand All @@ -208,9 +208,9 @@ if WITH_TESTS
TESTS = libbitcoin-system-test_runner.sh

check_PROGRAMS = test/libbitcoin-system-test
test_libbitcoin_system_test_CPPFLAGS = -I${srcdir}/include ${icu} ${boost_BUILD_CPPFLAGS} ${pthread_BUILD_CPPFLAGS} ${icu_i18n_BUILD_CPPFLAGS} ${secp256k1_BUILD_CPPFLAGS}
test_libbitcoin_system_test_CPPFLAGS = -I${srcdir}/include ${icu} ${boost_BUILD_CPPFLAGS} ${icu_i18n_BUILD_CPPFLAGS} ${secp256k1_BUILD_CPPFLAGS}
test_libbitcoin_system_test_LDFLAGS = ${boost_LDFLAGS}
test_libbitcoin_system_test_LDADD = src/libbitcoin-system.la ${boost_unit_test_framework_LIBS} ${boost_iostreams_LIBS} ${boost_locale_LIBS} ${boost_program_options_LIBS} ${boost_thread_LIBS} ${boost_url_LIBS} ${pthread_LIBS} ${rt_LIBS} ${icu_i18n_LIBS} ${dl_LIBS} ${secp256k1_LIBS}
test_libbitcoin_system_test_LDADD = src/libbitcoin-system.la ${boost_unit_test_framework_LIBS} ${boost_iostreams_LIBS} ${boost_locale_LIBS} ${boost_program_options_LIBS} ${boost_thread_LIBS} ${boost_url_LIBS} ${icu_i18n_LIBS} ${secp256k1_LIBS}
test_libbitcoin_system_test_SOURCES = \
test/allocator.cpp \
test/arena.cpp \
Expand Down
43 changes: 0 additions & 43 deletions builds/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -340,40 +340,12 @@ set( Boost_LIBRARY_DIR $<IF:$<BOOL:${enable-ndebug}>,"${Boost_LIBRARY_DIR_RELEAS
set( boost_CPPFLAGS "-I${Boost_INCLUDE_DIR}" )
set( boost_LDFLAGS "-L${Boost_LIBRARY_DIR}" )

set( CMAKE_THREAD_PREFER_PTHREAD ON )
set( THREADS_PREFER_PTHREAD_FLAG ON )

# Find threads
#------------------------------------------------------------------------------
if (NOT ANDROID)
find_package( Threads REQUIRED )
endif()

if ( Threads_FOUND AND NOT ANDROID )
# TODO: find proper detection - documentation on FindThreads appears incorrect.
set( pthread_CPPFLAGS "" )
set( pthread_LIBRARIES "-lpthread" )
set( pthread_LIBS "-lpthread" )
endif()

# Find rt
#------------------------------------------------------------------------------
if ((${CMAKE_SYSTEM_NAME} MATCHES "Linux") AND NOT ANDROID)
find_package( Rt REQUIRED )
endif()

# Find icu-i18n
#------------------------------------------------------------------------------
if (with-icu)
find_package( Icu-I18N 55.2 REQUIRED )
endif()

# Find dl
#------------------------------------------------------------------------------
if ((${CMAKE_SYSTEM_NAME} MATCHES "Linux"))
find_package( Dl REQUIRED )
endif()

# Find secp256k1
#------------------------------------------------------------------------------
find_package( Secp256K1 0.5.1.0 REQUIRED )
Expand All @@ -392,10 +364,7 @@ endif()
#------------------------------------------------------------------------------
include_directories( SYSTEM
${Boost_INCLUDE_DIR}
${pthread_INCLUDE_DIRS}
${rt_INCLUDE_DIRS}
${icu_i18n_FOR_BUILD_INCLUDE_DIRS}
${dl_INCLUDE_DIRS}
${secp256k1_FOR_BUILD_INCLUDE_DIRS} )

# Define project common library directories for build.
Expand All @@ -412,10 +381,7 @@ endif()
#------------------------------------------------------------------------------
link_directories(
${Boost_LIBRARY_DIRS}
${pthread_LIBRARY_DIRS}
${rt_LIBRARY_DIRS}
${icu_i18n_FOR_BUILD_LIBRARY_DIRS}
${dl_LIBRARY_DIRS}
${secp256k1_FOR_BUILD_LIBRARY_DIRS} )

# Define project common linker flags.
Expand Down Expand Up @@ -457,10 +423,7 @@ link_libraries(
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_THREAD_LIBRARY}
${Boost_URL_LIBRARY}
${pthread_LIBRARIES}
${rt_LIBRARIES}
${icu_i18n_FOR_BUILD_LIBRARIES}
${dl_LIBRARIES}
${secp256k1_FOR_BUILD_LIBRARIES} )

add_definitions(
Expand Down Expand Up @@ -636,10 +599,7 @@ endif()
target_include_directories( ${CANONICAL_LIB_NAME} PRIVATE
"../../include"
${Boost_INCLUDE_DIR}
${pthread_INCLUDE_DIRS}
${rt_INCLUDE_DIRS}
${icu_i18n_FOR_BUILD_INCLUDE_DIRS}
${dl_INCLUDE_DIRS}
${secp256k1_FOR_BUILD_INCLUDE_DIRS} )

target_include_directories( ${CANONICAL_LIB_NAME} PUBLIC
Expand All @@ -663,10 +623,7 @@ target_link_libraries( ${CANONICAL_LIB_NAME}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_THREAD_LIBRARY}
${Boost_URL_LIBRARY}
${pthread_LIBRARIES}
${rt_LIBRARIES}
${icu_i18n_FOR_BUILD_LIBRARIES}
${dl_LIBRARIES}
${secp256k1_FOR_BUILD_LIBRARIES} )

# Define libbitcoin-system-examples project.
Expand Down
48 changes: 0 additions & 48 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -412,42 +412,6 @@ AS_CASE([${with_tests}], [yes],
AC_MSG_NOTICE([boost_unit_test_framework_LIBS : ${boost_unit_test_framework_LIBS}])],
[AC_SUBST([boost_unit_test_framework_LIBS], [])])

# Require pthread if not on android and output ${pthread_CPPFLAGS/LIBS}.
#------------------------------------------------------------------------------
# Hard wired -lpthread because AX_PTHREAD does not do it.
AS_CASE([${host_os}],
[*android*],
[AC_SUBST([pthread_LIBS], [])],
[AX_PTHREAD(
[AC_SUBST([pthread_CPPFLAGS], [${PTHREAD_CPPFLAGS}])
AC_SUBST([pthread_ISYS_CPPFLAGS], [`echo ${PTHREAD_CPPFLAGS} | $SED s/^-I/-isystem/g | $SED s/' -I'/' -isystem'/g`])
AC_SUBST([pthread_LIBS], [-lpthread])
AC_MSG_NOTICE([pthread_CPPFLAGS : ${pthread_CPPFLAGS}])
AC_MSG_NOTICE([pthread_ISYS_CPPFLAGS : ${pthread_ISYS_CPPFLAGS}])],
[AC_MSG_ERROR([pthread library is required but was not found.])])

AS_CASE([${enable_isystem}],[yes],
[AC_SUBST([pthread_BUILD_CPPFLAGS], [${pthread_ISYS_CPPFLAGS}])],
[AC_SUBST([pthread_BUILD_CPPFLAGS], [${pthread_CPPFLAGS}])])

AC_MSG_NOTICE([pthread_BUILD_CPPFLAGS : ${pthread_BUILD_CPPFLAGS}])])

AC_MSG_NOTICE([pthread_LIBS : ${pthread_LIBS}])

# Require rt if on linux if not on android and output ${rt_LIBS}.
#------------------------------------------------------------------------------

AS_CASE([${host_os}],
[*android*],
[AC_SUBST([rt_LIBS], [])],
[*linux*],
[AC_CHECK_LIB([rt], [clock_gettime],
[AC_SUBST([rt_LIBS], [-lrt])],
[AC_MSG_ERROR([rt library is required but was not found.])])],
[AC_SUBST([rt_LIBS], [])])

AC_MSG_NOTICE([rt_LIBS : ${rt_LIBS}])

# Require icu-i18n of at least version 55.2 and output ${icu_i18n_CPPFLAGS/LIBS/PKG}.
#------------------------------------------------------------------------------
AS_CASE([${with_icu}], [yes],
Expand All @@ -471,18 +435,6 @@ AS_CASE([${enable_isystem}],[yes],

AC_MSG_NOTICE([icu_i18n_BUILD_CPPFLAGS : ${icu_i18n_BUILD_CPPFLAGS}])

# Require dl if on linux and output ${dl_LIBS}.
#------------------------------------------------------------------------------

AS_CASE([${host_os}],
[*linux*],
[AC_CHECK_LIB([dl], [dlopen],
[AC_SUBST([dl_LIBS], [-ldl])],
[AC_MSG_ERROR([dl library is required but was not found.])])],
[AC_SUBST([dl_LIBS], [])])

AC_MSG_NOTICE([dl_LIBS : ${dl_LIBS}])

# Require secp256k1 of at least version 0.5.1.0 and output ${secp256k1_CPPFLAGS/LIBS/PKG}.
#------------------------------------------------------------------------------
PKG_CHECK_MODULES([secp256k1], [libsecp256k1 >= 0.5.1.0], [],
Expand Down
15 changes: 9 additions & 6 deletions install-cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ PRESUMED_CI_PROJECT_PATH=$(pwd)

# ICU archive.
#------------------------------------------------------------------------------
ICU_URL="https://github.com/unicode-org/icu/releases/download/release-55-2/icu4c-55_2-src.tgz"
ICU_ARCHIVE="icu4c-55_2-src.tgz"
ICU_URL="https://github.com/unicode-org/icu/releases/download/release-78.2/icu4c-78.2-sources.tgz"
ICU_ARCHIVE="icu4c-78.2-sources.tgz"

# Boost archive.
#------------------------------------------------------------------------------
Expand Down Expand Up @@ -494,11 +494,14 @@ initialize_icu_packages()
# Update PKG_CONFIG_PATH for ICU package installations on OSX.
# OSX provides libicucore.dylib with no pkgconfig and doesn't support
# renaming or important features, so we can't use that.
local HOMEBREW_ICU_PKG_CONFIG="/usr/local/opt/icu4c/lib/pkgconfig"
local HOMEBREW_USR_ICU_PKG_CONFIG="/usr/local/opt/icu4c/lib/pkgconfig"
local HOMEBREW_OPT_ICU_PKG_CONFIG="/opt/homebrew/opt/icu4c/lib/pkgconfig"
local MACPORTS_ICU_PKG_CONFIG="/opt/local/lib/pkgconfig"

if [[ -d "$HOMEBREW_ICU_PKG_CONFIG" ]]; then
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$HOMEBREW_ICU_PKG_CONFIG"
if [[ -d "$HOMEBREW_USR_ICU_PKG_CONFIG" ]]; then
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$HOMEBREW_USR_ICU_PKG_CONFIG"
elif [[ -d "$HOMEBREW_OPT_ICU_PKG_CONFIG" ]]; then
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$HOMEBREW_OPT_ICU_PKG_CONFIG"
elif [[ -d "$MACPORTS_ICU_PKG_CONFIG" ]]; then
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$MACPORTS_ICU_PKG_CONFIG"
fi
Expand Down Expand Up @@ -880,7 +883,7 @@ build_from_tarball_boost()
# "-sICU_LINK=${ICU_LIBS[*]}"

./b2 install \
"cxxstd=11" \
"cxxstd=20" \
"variant=release" \
"threading=multi" \
"$BOOST_TOOLSET" \
Expand Down
15 changes: 9 additions & 6 deletions install-cmakepresets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ PRESUMED_CI_PROJECT_PATH=$(pwd)

# ICU archive.
#------------------------------------------------------------------------------
ICU_URL="https://github.com/unicode-org/icu/releases/download/release-55-2/icu4c-55_2-src.tgz"
ICU_ARCHIVE="icu4c-55_2-src.tgz"
ICU_URL="https://github.com/unicode-org/icu/releases/download/release-78.2/icu4c-78.2-sources.tgz"
ICU_ARCHIVE="icu4c-78.2-sources.tgz"

# Boost archive.
#------------------------------------------------------------------------------
Expand Down Expand Up @@ -534,11 +534,14 @@ initialize_icu_packages()
# Update PKG_CONFIG_PATH for ICU package installations on OSX.
# OSX provides libicucore.dylib with no pkgconfig and doesn't support
# renaming or important features, so we can't use that.
local HOMEBREW_ICU_PKG_CONFIG="/usr/local/opt/icu4c/lib/pkgconfig"
local HOMEBREW_USR_ICU_PKG_CONFIG="/usr/local/opt/icu4c/lib/pkgconfig"
local HOMEBREW_OPT_ICU_PKG_CONFIG="/opt/homebrew/opt/icu4c/lib/pkgconfig"
local MACPORTS_ICU_PKG_CONFIG="/opt/local/lib/pkgconfig"

if [[ -d "$HOMEBREW_ICU_PKG_CONFIG" ]]; then
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$HOMEBREW_ICU_PKG_CONFIG"
if [[ -d "$HOMEBREW_USR_ICU_PKG_CONFIG" ]]; then
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$HOMEBREW_USR_ICU_PKG_CONFIG"
elif [[ -d "$HOMEBREW_OPT_ICU_PKG_CONFIG" ]]; then
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$HOMEBREW_OPT_ICU_PKG_CONFIG"
elif [[ -d "$MACPORTS_ICU_PKG_CONFIG" ]]; then
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$MACPORTS_ICU_PKG_CONFIG"
fi
Expand Down Expand Up @@ -923,7 +926,7 @@ build_from_tarball_boost()
# "-sICU_LINK=${ICU_LIBS[*]}"

./b2 install \
"cxxstd=11" \
"cxxstd=20" \
"variant=release" \
"threading=multi" \
"$BOOST_TOOLSET" \
Expand Down
15 changes: 9 additions & 6 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ PRESUMED_CI_PROJECT_PATH=$(pwd)

# ICU archive.
#------------------------------------------------------------------------------
ICU_URL="https://github.com/unicode-org/icu/releases/download/release-55-2/icu4c-55_2-src.tgz"
ICU_ARCHIVE="icu4c-55_2-src.tgz"
ICU_URL="https://github.com/unicode-org/icu/releases/download/release-78.2/icu4c-78.2-sources.tgz"
ICU_ARCHIVE="icu4c-78.2-sources.tgz"

# Boost archive.
#------------------------------------------------------------------------------
Expand Down Expand Up @@ -437,11 +437,14 @@ initialize_icu_packages()
# Update PKG_CONFIG_PATH for ICU package installations on OSX.
# OSX provides libicucore.dylib with no pkgconfig and doesn't support
# renaming or important features, so we can't use that.
local HOMEBREW_ICU_PKG_CONFIG="/usr/local/opt/icu4c/lib/pkgconfig"
local HOMEBREW_USR_ICU_PKG_CONFIG="/usr/local/opt/icu4c/lib/pkgconfig"
local HOMEBREW_OPT_ICU_PKG_CONFIG="/opt/homebrew/opt/icu4c/lib/pkgconfig"
local MACPORTS_ICU_PKG_CONFIG="/opt/local/lib/pkgconfig"

if [[ -d "$HOMEBREW_ICU_PKG_CONFIG" ]]; then
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$HOMEBREW_ICU_PKG_CONFIG"
if [[ -d "$HOMEBREW_USR_ICU_PKG_CONFIG" ]]; then
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$HOMEBREW_USR_ICU_PKG_CONFIG"
elif [[ -d "$HOMEBREW_OPT_ICU_PKG_CONFIG" ]]; then
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$HOMEBREW_OPT_ICU_PKG_CONFIG"
elif [[ -d "$MACPORTS_ICU_PKG_CONFIG" ]]; then
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$MACPORTS_ICU_PKG_CONFIG"
fi
Expand Down Expand Up @@ -755,7 +758,7 @@ build_from_tarball_boost()
# "-sICU_LINK=${ICU_LIBS[*]}"

./b2 install \
"cxxstd=11" \
"cxxstd=20" \
"variant=release" \
"threading=multi" \
"$BOOST_TOOLSET" \
Expand Down
4 changes: 2 additions & 2 deletions libbitcoin-system.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ Requires: @icu_i18n_PKG@ libsecp256k1 >= 0.5.1.0

# Include directory and any other required compiler flags.
#------------------------------------------------------------------------------
Cflags: -I${includedir} @icu@ @avx2@ @avx512@ @shani@ @sse41@ @boost_CPPFLAGS@ @pthread_CPPFLAGS@
Cflags: -I${includedir} @icu@ @avx2@ @avx512@ @shani@ @sse41@ @boost_CPPFLAGS@

# Lib directory, lib and any required that do not publish pkg-config.
#------------------------------------------------------------------------------
Libs: -L${libdir} -lbitcoin-system @boost_LDFLAGS@ @boost_iostreams_LIBS@ @boost_locale_LIBS@ @boost_program_options_LIBS@ @boost_thread_LIBS@ @boost_url_LIBS@ @pthread_LIBS@ @rt_LIBS@ @dl_LIBS@
Libs: -L${libdir} -lbitcoin-system @boost_LDFLAGS@ @boost_iostreams_LIBS@ @boost_locale_LIBS@ @boost_program_options_LIBS@ @boost_thread_LIBS@ @boost_url_LIBS@

Loading