From 732db8d67f186d80ce27b1eeec5dff62da6ae673 Mon Sep 17 00:00:00 2001 From: Phillip Mienk Date: Sat, 28 Feb 2026 01:47:47 -0800 Subject: [PATCH] Update ICU to version 78.2 (installation, not minimum supported version), remove explicit dependencies for dl, rt, pthread. --- .github/workflows/ci.yml | 12 +++++----- Makefile.am | 12 +++++----- builds/cmake/CMakeLists.txt | 43 --------------------------------- configure.ac | 48 ------------------------------------- install-cmake.sh | 15 +++++++----- install-cmakepresets.sh | 15 +++++++----- install.sh | 15 +++++++----- libbitcoin-system.pc.in | 4 ++-- 8 files changed, 41 insertions(+), 123 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77943b2bab..941fb79419 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,7 +93,7 @@ jobs: coverage: "nocov" detectcpuflags: "ignore" boost: "--build-boost" - icu: "" + icu: "--with-icu" llvm: "" secp256k1: "--build-secp256k1" cc: "clang" @@ -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 }} @@ -364,7 +364,7 @@ jobs: coverage: "nocov" detectcpuflags: "ignore" boost: "--build-boost" - icu: "" + icu: "--with-icu" llvm: "" secp256k1: "--build-secp256k1" cc: "clang" @@ -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 }} diff --git a/Makefile.am b/Makefile.am index 1ae3bdb0d3..5ade09512c 100755 --- a/Makefile.am +++ b/Makefile.am @@ -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 \ @@ -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 @@ -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 \ diff --git a/builds/cmake/CMakeLists.txt b/builds/cmake/CMakeLists.txt index 2a7350fd7d..093bbe11b1 100644 --- a/builds/cmake/CMakeLists.txt +++ b/builds/cmake/CMakeLists.txt @@ -340,40 +340,12 @@ set( Boost_LIBRARY_DIR $,"${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 ) @@ -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. @@ -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. @@ -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( @@ -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 @@ -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. diff --git a/configure.ac b/configure.ac index ba9cd4ebba..5b9b373151 100644 --- a/configure.ac +++ b/configure.ac @@ -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], @@ -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], [], diff --git a/install-cmake.sh b/install-cmake.sh index e8d027d5a8..f12bcb38c8 100755 --- a/install-cmake.sh +++ b/install-cmake.sh @@ -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. #------------------------------------------------------------------------------ @@ -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 @@ -880,7 +883,7 @@ build_from_tarball_boost() # "-sICU_LINK=${ICU_LIBS[*]}" ./b2 install \ - "cxxstd=11" \ + "cxxstd=20" \ "variant=release" \ "threading=multi" \ "$BOOST_TOOLSET" \ diff --git a/install-cmakepresets.sh b/install-cmakepresets.sh index 86269677ea..b2e52b8fe2 100755 --- a/install-cmakepresets.sh +++ b/install-cmakepresets.sh @@ -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. #------------------------------------------------------------------------------ @@ -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 @@ -923,7 +926,7 @@ build_from_tarball_boost() # "-sICU_LINK=${ICU_LIBS[*]}" ./b2 install \ - "cxxstd=11" \ + "cxxstd=20" \ "variant=release" \ "threading=multi" \ "$BOOST_TOOLSET" \ diff --git a/install.sh b/install.sh index 706a12e07e..9b1c10a0e7 100755 --- a/install.sh +++ b/install.sh @@ -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. #------------------------------------------------------------------------------ @@ -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 @@ -755,7 +758,7 @@ build_from_tarball_boost() # "-sICU_LINK=${ICU_LIBS[*]}" ./b2 install \ - "cxxstd=11" \ + "cxxstd=20" \ "variant=release" \ "threading=multi" \ "$BOOST_TOOLSET" \ diff --git a/libbitcoin-system.pc.in b/libbitcoin-system.pc.in index 6a28a4ce09..217c37eacf 100644 --- a/libbitcoin-system.pc.in +++ b/libbitcoin-system.pc.in @@ -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@