Merge pull request #5809 from kwvg/bps_jan_01

backport: merge bitcoin#10508, #18051, #19683, #19688, #19761, #19015, #19916, #20527, #21505, #21629, partial bitcoin#18307, #21205 (build backports)
This commit is contained in:
PastaPastaPasta 2024-01-10 12:11:48 -06:00 committed by GitHub
commit 9cf5c64aae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 195 additions and 140 deletions

3
.gitignore vendored
View File

@ -120,7 +120,10 @@ releases
/*.info /*.info
test_dash.coverage/ test_dash.coverage/
total.coverage/ total.coverage/
fuzz.coverage/
coverage_percent.txt coverage_percent.txt
/cov_tool_wrapper.sh
qa-assets/
#build tests #build tests
linux-coverage-build linux-coverage-build

View File

@ -61,10 +61,10 @@ WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/dash.ico \
OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_INSTALLER_ICONS) \ OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_INSTALLER_ICONS) \
$(top_srcdir)/contrib/macdeploy/detached-sig-create.sh $(top_srcdir)/contrib/macdeploy/detached-sig-create.sh
COVERAGE_INFO = baseline.info \ COVERAGE_INFO = $(COV_TOOL_WRAPPER) baseline.info \
test_dash_filtered.info total_coverage.info \ test_dash_filtered.info total_coverage.info \
baseline_filtered.info functional_test.info functional_test_filtered.info \ baseline_filtered.info functional_test.info functional_test_filtered.info \
test_dash_coverage.info test_dash.info fuzz.info fuzz_coverage.info test_dash_coverage.info test_dash.info fuzz.info fuzz_filtered.info fuzz_coverage.info
dist-hook: dist-hook:
-$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf - -$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
@ -171,7 +171,13 @@ LCOV_FILTER_PATTERN = \
-p "src/secp256k1" \ -p "src/secp256k1" \
-p "depends" -p "depends"
baseline.info: DIR_FUZZ_SEED_CORPUS ?= qa-assets/fuzz_seed_corpus
$(COV_TOOL_WRAPPER):
@echo 'exec $(COV_TOOL) "$$@"' > $(COV_TOOL_WRAPPER)
@chmod +x $(COV_TOOL_WRAPPER)
baseline.info: $(COV_TOOL_WRAPPER)
$(LCOV) -c -i -d $(abs_builddir)/src -o $@ $(LCOV) -c -i -d $(abs_builddir)/src -o $@
baseline_filtered.info: baseline.info baseline_filtered.info: baseline.info
@ -179,7 +185,7 @@ baseline_filtered.info: baseline.info
$(LCOV) -a $@ $(LCOV_OPTS) -o $@ $(LCOV) -a $@ $(LCOV_OPTS) -o $@
fuzz.info: baseline_filtered.info fuzz.info: baseline_filtered.info
@TIMEOUT=15 test/fuzz/test_runner.py qa-assets/fuzz_seed_corpus -l DEBUG @TIMEOUT=15 test/fuzz/test_runner.py $(DIR_FUZZ_SEED_CORPUS) -l DEBUG
$(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src --t fuzz-tests -o $@ $(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src --t fuzz-tests -o $@
$(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src $(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src

View File

@ -13,6 +13,12 @@ AC_CONFIG_HEADERS([src/config/bitcoin-config.h])
AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([build-aux/m4]) AC_CONFIG_MACRO_DIR([build-aux/m4])
m4_ifndef([PKG_PROG_PKG_CONFIG], [AC_MSG_ERROR([PKG_PROG_PKG_CONFIG macro not found. Please install pkg-config and re-run autogen.sh])])
PKG_PROG_PKG_CONFIG
if test "x$PKG_CONFIG" = x; then
AC_MSG_ERROR([pkg-config not found])
fi
BITCOIN_DAEMON_NAME=dashd BITCOIN_DAEMON_NAME=dashd
BITCOIN_GUI_NAME=dash-qt BITCOIN_GUI_NAME=dash-qt
BITCOIN_CLI_NAME=dash-cli BITCOIN_CLI_NAME=dash-cli
@ -92,6 +98,7 @@ AC_PATH_TOOL(AR, ar)
AC_PATH_TOOL(RANLIB, ranlib) AC_PATH_TOOL(RANLIB, ranlib)
AC_PATH_TOOL(STRIP, strip) AC_PATH_TOOL(STRIP, strip)
AC_PATH_TOOL(GCOV, gcov) AC_PATH_TOOL(GCOV, gcov)
AC_PATH_TOOL(LLVM_COV, llvm-cov)
AC_PATH_PROG(LCOV, lcov) AC_PATH_PROG(LCOV, lcov)
dnl Python 3.8 is specified in .python-version and should be used if available, see doc/dependencies.md dnl Python 3.8 is specified in .python-version and should be used if available, see doc/dependencies.md
AC_PATH_PROGS([PYTHON], [python3.8 python3.9 python3.10 python3.11 python3.12 python3 python]) AC_PATH_PROGS([PYTHON], [python3.8 python3.9 python3.10 python3.11 python3.12 python3 python])
@ -460,6 +467,10 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
AX_CHECK_COMPILE_FLAG([-Wdate-time],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wdate-time"],,[[$CXXFLAG_WERROR]]) AX_CHECK_COMPILE_FLAG([-Wdate-time],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wdate-time"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wconditional-uninitialized],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wconditional-uninitialized"],,[[$CXXFLAG_WERROR]]) AX_CHECK_COMPILE_FLAG([-Wconditional-uninitialized],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wconditional-uninitialized"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wsign-compare],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsign-compare"],,[[$CXXFLAG_WERROR]]) AX_CHECK_COMPILE_FLAG([-Wsign-compare],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsign-compare"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wduplicated-branches],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wduplicated-branches"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wduplicated-cond],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wduplicated-cond"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wlogical-op],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wlogical-op"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Woverloaded-virtual],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Woverloaded-virtual"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wsuggest-override],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsuggest-override"],,[[$CXXFLAG_WERROR]], AX_CHECK_COMPILE_FLAG([-Wsuggest-override],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsuggest-override"],,[[$CXXFLAG_WERROR]],
[AC_LANG_SOURCE([[struct A { virtual void f(); }; struct B : A { void f() final; };]])]) [AC_LANG_SOURCE([[struct A { virtual void f(); }; struct B : A { void f() final; };]])])
AX_CHECK_COMPILE_FLAG([-Wunreachable-code-loop-increment],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunreachable-code-loop-increment"],,[[$CXXFLAG_WERROR]]) AX_CHECK_COMPILE_FLAG([-Wunreachable-code-loop-increment],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunreachable-code-loop-increment"],,[[$CXXFLAG_WERROR]])
@ -646,13 +657,8 @@ AC_ARG_WITH([daemon],
[build_bitcoind=$withval], [build_bitcoind=$withval],
[build_bitcoind=yes]) [build_bitcoind=yes])
use_pkgconfig=yes
case $host in case $host in
*mingw*) *mingw*)
dnl pkgconfig does more harm than good with MinGW
use_pkgconfig=no
TARGET_OS=windows TARGET_OS=windows
AC_CHECK_LIB([kernel32], [GetModuleFileNameA],, AC_MSG_ERROR(libkernel32 missing)) AC_CHECK_LIB([kernel32], [GetModuleFileNameA],, AC_MSG_ERROR(libkernel32 missing))
AC_CHECK_LIB([user32], [main],, AC_MSG_ERROR(libuser32 missing)) AC_CHECK_LIB([user32], [main],, AC_MSG_ERROR(libuser32 missing))
@ -710,16 +716,19 @@ case $host in
dnl It's safe to add these paths even if the functionality is disabled by dnl It's safe to add these paths even if the functionality is disabled by
dnl the user (--without-wallet or --without-gui for example). dnl the user (--without-wallet or --without-gui for example).
qt5_prefix=$($BREW --prefix qt5 2>/dev/null) if test "x$use_bdb" != xno && $BREW list --versions berkeley-db4 >/dev/null && test "x$BDB_CFLAGS" = "x" && test "x$BDB_LIBS" = "x"; then
if $BREW list --versions berkeley-db4 >/dev/null && test "x$BDB_CFLAGS" = "x" && test "x$BDB_LIBS" = "x" && test "$use_bdb" != "no"; then
bdb_prefix=$($BREW --prefix berkeley-db4 2>/dev/null) bdb_prefix=$($BREW --prefix berkeley-db4 2>/dev/null)
dnl This must precede the call to BITCOIN_FIND_BDB48 below. dnl This must precede the call to BITCOIN_FIND_BDB48 below.
BDB_CFLAGS="-I$bdb_prefix/include" BDB_CFLAGS="-I$bdb_prefix/include"
BDB_LIBS="-L$bdb_prefix/lib -ldb_cxx-4.8" BDB_LIBS="-L$bdb_prefix/lib -ldb_cxx-4.8"
fi fi
if test x$qt5_prefix != x; then
PKG_CONFIG_PATH="$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH" if test "x$use_sqlite" != xno && $BREW list --versions sqlite3 >/dev/null; then
export PKG_CONFIG_PATH export PKG_CONFIG_PATH="$($BREW --prefix sqlite3 2>/dev/null)/lib/pkgconfig:$PKG_CONFIG_PATH"
fi
if $BREW list --versions qt5 >/dev/null; then
export PKG_CONFIG_PATH="$($BREW --prefix qt5 2>/dev/null)/lib/pkgconfig:$PKG_CONFIG_PATH"
fi fi
gmp_prefix=$($BREW --prefix gmp 2>/dev/null) gmp_prefix=$($BREW --prefix gmp 2>/dev/null)
@ -801,16 +810,6 @@ case $host in
;; ;;
esac esac
if test x$use_pkgconfig = xyes; then
m4_ifndef([PKG_PROG_PKG_CONFIG], [AC_MSG_ERROR(PKG_PROG_PKG_CONFIG macro not found. Please install pkg-config and re-run autogen.sh.)])
m4_ifdef([PKG_PROG_PKG_CONFIG], [
PKG_PROG_PKG_CONFIG
if test x"$PKG_CONFIG" = "x"; then
AC_MSG_ERROR(pkg-config not found.)
fi
])
fi
if test x$use_extended_functional_tests != xno; then if test x$use_extended_functional_tests != xno; then
AC_SUBST(EXTENDED_FUNCTIONAL_TESTS, --extended) AC_SUBST(EXTENDED_FUNCTIONAL_TESTS, --extended)
fi fi
@ -819,16 +818,37 @@ if test x$use_lcov = xyes; then
if test x$LCOV = x; then if test x$LCOV = x; then
AC_MSG_ERROR("lcov testing requested but lcov not found") AC_MSG_ERROR("lcov testing requested but lcov not found")
fi fi
if test x$GCOV = x; then
AC_MSG_ERROR("lcov testing requested but gcov not found")
fi
if test x$PYTHON = x; then if test x$PYTHON = x; then
AC_MSG_ERROR("lcov testing requested but python not found") AC_MSG_ERROR("lcov testing requested but python not found")
fi fi
if test x$GENHTML = x; then if test x$GENHTML = x; then
AC_MSG_ERROR("lcov testing requested but genhtml not found") AC_MSG_ERROR("lcov testing requested but genhtml not found")
fi fi
LCOV="$LCOV --gcov-tool=$GCOV"
AC_MSG_CHECKING([whether compiler is Clang])
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
#if defined(__clang__) && defined(__llvm__)
// Compiler is Clang
#else
# error Compiler is not Clang
#endif
]])],[
AC_MSG_RESULT([yes])
if test x$LLVM_COV = x; then
AC_MSG_ERROR([lcov testing requested but llvm-cov not found])
fi
COV_TOOL="$LLVM_COV gcov"
],[
AC_MSG_RESULT([no])
if test x$GCOV = x; then
AC_MSG_ERROR([lcov testing requested but gcov not found])
fi
COV_TOOL="$GCOV"
])
AC_SUBST(COV_TOOL)
AC_SUBST(COV_TOOL_WRAPPER, "cov_tool_wrapper.sh")
LCOV="$LCOV --gcov-tool $(pwd)/$COV_TOOL_WRAPPER"
AX_CHECK_LINK_FLAG([[--coverage]], [LDFLAGS="$LDFLAGS --coverage"], AX_CHECK_LINK_FLAG([[--coverage]], [LDFLAGS="$LDFLAGS --coverage"],
[AC_MSG_ERROR("lcov testing requested but --coverage linker flag does not work")]) [AC_MSG_ERROR("lcov testing requested but --coverage linker flag does not work")])
AX_CHECK_COMPILE_FLAG([--coverage],[CXXFLAGS="$CXXFLAGS --coverage"], AX_CHECK_COMPILE_FLAG([--coverage],[CXXFLAGS="$CXXFLAGS --coverage"],
@ -1301,10 +1321,12 @@ fi
if test x$enable_wallet != xno; then if test x$enable_wallet != xno; then
dnl Check for libdb_cxx only if wallet enabled dnl Check for libdb_cxx only if wallet enabled
if test "x$use_bdb" != "xno"; then
BITCOIN_FIND_BDB48 BITCOIN_FIND_BDB48
if test x$suppress_external_warnings != xno ; then if test x$suppress_external_warnings != xno ; then
BDB_CPPFLAGS=SUPPRESS_WARNINGS($BDB_CPPFLAGS) BDB_CPPFLAGS=SUPPRESS_WARNINGS($BDB_CPPFLAGS)
fi fi
fi
dnl Check for sqlite3 dnl Check for sqlite3
if test "x$use_sqlite" != "xno"; then if test "x$use_sqlite" != "xno"; then
@ -1350,7 +1372,7 @@ fi
dnl Check for libminiupnpc (optional) dnl Check for libminiupnpc (optional)
if test x$use_upnp != xno; then if test x$use_upnp != xno; then
AC_CHECK_HEADERS( AC_CHECK_HEADERS(
[miniupnpc/miniwget.h miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h], [miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h],
[AC_CHECK_LIB([miniupnpc], [upnpDiscover], [MINIUPNPC_LIBS=-lminiupnpc], [have_miniupnpc=no])], [AC_CHECK_LIB([miniupnpc], [upnpDiscover], [MINIUPNPC_LIBS=-lminiupnpc], [have_miniupnpc=no])],
[have_miniupnpc=no] [have_miniupnpc=no]
) )
@ -1391,11 +1413,8 @@ fi
if test x$use_boost = xyes; then if test x$use_boost = xyes; then
dnl Minimum required Boost version dnl Check for Boost headers
define(MINIMUM_REQUIRED_BOOST, 1.64.0) AX_BOOST_BASE([1.64.0],[],[AC_MSG_ERROR([Boost is not available!])])
dnl Check for Boost libs
AX_BOOST_BASE([MINIMUM_REQUIRED_BOOST])
if test x$want_boost = xno; then if test x$want_boost = xno; then
AC_MSG_ERROR([[only libdashconsensus can be built without boost]]) AC_MSG_ERROR([[only libdashconsensus can be built without boost]])
fi fi
@ -1450,57 +1469,34 @@ if test x$use_tests = xyes; then
fi fi
fi fi
if test x$use_pkgconfig = xyes; then dnl libevent check
: dnl
m4_ifdef( if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench != xnonononono; then
[PKG_CHECK_MODULES], PKG_CHECK_MODULES([EVENT], [libevent >= 2.0.21], [use_libevent=yes], [AC_MSG_ERROR([libevent version 2.0.21 or greater not found.])])
[
if test x$use_qr != xno; then
BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])])
fi
if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench != xnononono; then
PKG_CHECK_MODULES([EVENT], [libevent >= 2.0.21], [use_libevent=yes], [AC_MSG_ERROR(libevent version 2.0.21 or greater not found.)])
if test x$TARGET_OS != xwindows; then if test x$TARGET_OS != xwindows; then
PKG_CHECK_MODULES([EVENT_PTHREADS], [libevent_pthreads >= 2.0.21],, [AC_MSG_ERROR(libevent_pthreads version 2.0.21 or greater not found.)]) PKG_CHECK_MODULES([EVENT_PTHREADS], [libevent_pthreads >= 2.0.21],, [AC_MSG_ERROR([libevent_pthreads version 2.0.21 or greater not found.])])
fi fi
fi fi
if test "x$use_zmq" = "xyes"; then dnl QR Code encoding library check
if test "x$use_qr" != xno; then
BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])])
fi
dnl ZMQ check
if test "x$use_zmq" = xyes; then
PKG_CHECK_MODULES([ZMQ], [libzmq >= 4], PKG_CHECK_MODULES([ZMQ], [libzmq >= 4],
[AC_DEFINE([ENABLE_ZMQ],[1],[Define to 1 to enable ZMQ functions])], AC_DEFINE([ENABLE_ZMQ], [1], [Define to 1 to enable ZMQ functions]),
[AC_DEFINE([ENABLE_ZMQ], [0], [Define to 1 to enable ZMQ functions]) [AC_DEFINE([ENABLE_ZMQ], [0], [Define to 1 to enable ZMQ functions])
AC_MSG_WARN([libzmq version 4.x or greater not found, disabling]) AC_MSG_WARN([libzmq version 4.x or greater not found, disabling])
use_zmq=no]) use_zmq=no])
else else
AC_DEFINE_UNQUOTED([ENABLE_ZMQ], [0], [Define to 1 to enable ZMQ functions]) AC_DEFINE_UNQUOTED([ENABLE_ZMQ], [0], [Define to 1 to enable ZMQ functions])
fi fi
]
)
else
if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench != xnonononono; then if test "x$use_zmq" = xyes; then
AC_CHECK_HEADER([event2/event.h], [use_libevent=yes], AC_MSG_ERROR(libevent headers missing),)
AC_CHECK_LIB([event],[main],EVENT_LIBS=-levent,AC_MSG_ERROR(libevent missing))
if test x$TARGET_OS != xwindows; then
AC_CHECK_LIB([event_pthreads],[main],EVENT_PTHREADS_LIBS=-levent_pthreads,AC_MSG_ERROR(libevent_pthreads missing))
fi
fi
if test "x$use_zmq" = "xyes"; then
AC_CHECK_HEADER([zmq.h],
[AC_DEFINE([ENABLE_ZMQ],[1],[Define to 1 to enable ZMQ functions])],
[AC_MSG_WARN([zmq.h not found, disabling zmq support])
use_zmq=no
AC_DEFINE([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])])
AC_CHECK_LIB([zmq],[zmq_ctx_shutdown],ZMQ_LIBS=-lzmq,
[AC_MSG_WARN([libzmq >= 4.0 not found, disabling zmq support])
use_zmq=no
AC_DEFINE([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])])
else
AC_DEFINE_UNQUOTED([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])
fi
if test "x$use_zmq" = "xyes"; then
dnl Assume libzmq was built for static linking dnl Assume libzmq was built for static linking
case $host in case $host in
*mingw*) *mingw*)
@ -1509,12 +1505,6 @@ else
esac esac
fi fi
if test x$use_qr != xno; then
BITCOIN_QT_CHECK([AC_CHECK_LIB([qrencode], [main],[QR_LIBS=-lqrencode], [have_qrencode=no])])
BITCOIN_QT_CHECK([AC_CHECK_HEADER([qrencode.h],, have_qrencode=no)])
fi
fi
dnl check if libgmp is present dnl check if libgmp is present
AC_CHECK_HEADER([gmp.h],, AC_MSG_ERROR(libgmp headers missing)) AC_CHECK_HEADER([gmp.h],, AC_MSG_ERROR(libgmp headers missing))
AC_CHECK_LIB([gmp], [__gmpz_init],GMP_LIBS=-lgmp, AC_MSG_ERROR(libgmp missing)) AC_CHECK_LIB([gmp], [__gmpz_init],GMP_LIBS=-lgmp, AC_MSG_ERROR(libgmp missing))

View File

@ -34,6 +34,8 @@ BASE_CACHE ?= $(BASEDIR)/built
SDK_PATH ?= $(BASEDIR)/SDKs SDK_PATH ?= $(BASEDIR)/SDKs
NO_QT ?= NO_QT ?=
NO_QR ?= NO_QR ?=
NO_BDB ?=
NO_SQLITE ?=
NO_WALLET ?= NO_WALLET ?=
NO_ZMQ ?= NO_ZMQ ?=
NO_UPNP ?= NO_UPNP ?=
@ -216,10 +218,13 @@ $(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_
-e 's|@CXXFLAGS@|$(strip $(host_CXXFLAGS) $(host_$(release_type)_CXXFLAGS))|' \ -e 's|@CXXFLAGS@|$(strip $(host_CXXFLAGS) $(host_$(release_type)_CXXFLAGS))|' \
-e 's|@CPPFLAGS@|$(strip $(host_CPPFLAGS) $(host_$(release_type)_CPPFLAGS))|' \ -e 's|@CPPFLAGS@|$(strip $(host_CPPFLAGS) $(host_$(release_type)_CPPFLAGS))|' \
-e 's|@LDFLAGS@|$(strip $(host_LDFLAGS) $(host_$(release_type)_LDFLAGS))|' \ -e 's|@LDFLAGS@|$(strip $(host_LDFLAGS) $(host_$(release_type)_LDFLAGS))|' \
-e 's|@allow_host_packages@|$(ALLOW_HOST_PACKAGES)|' \
-e 's|@no_qt@|$(NO_QT)|' \ -e 's|@no_qt@|$(NO_QT)|' \
-e 's|@no_qr@|$(NO_QR)|' \ -e 's|@no_qr@|$(NO_QR)|' \
-e 's|@no_zmq@|$(NO_ZMQ)|' \ -e 's|@no_zmq@|$(NO_ZMQ)|' \
-e 's|@no_wallet@|$(NO_WALLET)|' \ -e 's|@no_wallet@|$(NO_WALLET)|' \
-e 's|@no_bdb@|$(NO_BDB)|' \
-e 's|@no_sqlite@|$(NO_SQLITE)|' \
-e 's|@no_upnp@|$(NO_UPNP)|' \ -e 's|@no_upnp@|$(NO_UPNP)|' \
-e 's|@no_natpmp@|$(NO_NATPMP)|' \ -e 's|@no_natpmp@|$(NO_NATPMP)|' \
-e 's|@debug@|$(DEBUG)|' \ -e 's|@debug@|$(DEBUG)|' \

View File

@ -8,46 +8,54 @@ true # Dummy command because shellcheck treats all directives before first
# See: https://github.com/koalaman/shellcheck/wiki/Directive # See: https://github.com/koalaman/shellcheck/wiki/Directive
# shellcheck disable=SC2154 # shellcheck disable=SC2154
depends_prefix="$(cd "$(dirname ${ac_site_file})/.." && pwd)" depends_prefix="$(cd "$(dirname "$ac_site_file")/.." && pwd)"
cross_compiling=maybe cross_compiling=maybe
host_alias=@HOST@ host_alias="@HOST@"
ac_tool_prefix=${host_alias}- ac_tool_prefix="${host_alias}-"
if test -z $with_boost; then if test -z "$with_boost"; then
with_boost=$depends_prefix with_boost="$depends_prefix"
fi fi
if test -z $with_qt_plugindir; then if test -z "$with_qt_plugindir"; then
with_qt_plugindir=$depends_prefix/plugins with_qt_plugindir="${depends_prefix}/plugins"
fi fi
if test -z $with_qt_translationdir; then if test -z "$with_qt_translationdir"; then
with_qt_translationdir=$depends_prefix/translations with_qt_translationdir="${depends_prefix}/translations"
fi fi
if test -z $with_qt_bindir; then if test -z "$with_qt_bindir" && test -z "@no_qt@"; then
with_qt_bindir=$depends_prefix/native/bin with_qt_bindir="${depends_prefix}/native/bin"
fi fi
if test -z $with_qrencode && test -n "@no_qr@"; then if test -z "$with_qrencode" && test -n "@no_qr@"; then
with_qrencode=no with_qrencode=no
fi fi
if test -z $enable_wallet && test -n "@no_wallet@"; then if test -z "$enable_wallet" && test -n "@no_wallet@"; then
enable_wallet=no enable_wallet=no
fi fi
if test -z $with_miniupnpc && test -n "@no_upnp@"; then if test -z "$with_bdb" && test -n "@no_bdb@"; then
with_bdb=no
fi
if test -z "$with_sqlite" && test -n "@no_sqlite@"; then
with_sqlite=no
fi
if test -z "$with_miniupnpc" && test -n "@no_upnp@"; then
with_miniupnpc=no with_miniupnpc=no
fi fi
if test -z $with_natpmp && test -n "@no_natpmp@"; then if test -z "$with_natpmp" && test -n "@no_natpmp@"; then
with_natpmp=no with_natpmp=no
fi fi
if test -z $with_gui && test -n "@no_qt@"; then if test -z "$with_gui" && test -n "@no_qt@"; then
with_gui=no with_gui=no
fi fi
if test -z $enable_zmq && test -n "@no_zmq@"; then if test -z "$enable_zmq" && test -n "@no_zmq@"; then
enable_zmq=no enable_zmq=no
fi fi
@ -55,22 +63,23 @@ if test -n "@debug@" && test -z "@no_qt@" && test "x$with_gui" != xno; then
with_gui=qt5_debug with_gui=qt5_debug
fi fi
if test "@host_os@" = darwin; then if test "x@host_os@" = xdarwin; then
BREW=no BREW=no
fi fi
PATH=$depends_prefix/native/bin:$PATH PATH="${depends_prefix}/native/bin:${PATH}"
PKG_CONFIG="$(which pkg-config) --static" PKG_CONFIG="$(which pkg-config) --static"
# These two need to remain exported because pkg-config does not see them # These two need to remain exported because pkg-config does not see them
# otherwise. That means they must be unexported at the end of configure.ac to # otherwise. That means they must be unexported at the end of configure.ac to
# avoid ruining the cache. Sigh. # avoid ruining the cache. Sigh.
export PKG_CONFIG_PATH="${depends_prefix}/share/pkgconfig:${depends_prefix}/lib/pkgconfig"
if test -z "@allow_host_packages@"; then
export PKG_CONFIG_LIBDIR="${depends_prefix}/lib/pkgconfig"
fi
export PKG_CONFIG_LIBDIR=$depends_prefix/lib/pkgconfig CPPFLAGS="-I${depends_prefix}/include/ ${CPPFLAGS}"
export PKG_CONFIG_PATH=$depends_prefix/share/pkgconfig LDFLAGS="-L${depends_prefix}/lib ${LDFLAGS}"
CPPFLAGS="-I$depends_prefix/include/ $CPPFLAGS"
LDFLAGS="-L$depends_prefix/lib $LDFLAGS"
if test -n "@CC@" -a -z "${CC}"; then if test -n "@CC@" -a -z "${CC}"; then
CC="@CC@" CC="@CC@"
@ -81,18 +90,18 @@ fi
PYTHONPATH="${depends_prefix}/native/lib/python3/dist-packages${PYTHONPATH:+${PATH_SEPARATOR}}${PYTHONPATH}" PYTHONPATH="${depends_prefix}/native/lib/python3/dist-packages${PYTHONPATH:+${PATH_SEPARATOR}}${PYTHONPATH}"
if test -n "@AR@"; then if test -n "@AR@"; then
AR=@AR@ AR="@AR@"
ac_cv_path_ac_pt_AR=${AR} ac_cv_path_ac_pt_AR="${AR}"
fi fi
if test -n "@RANLIB@"; then if test -n "@RANLIB@"; then
RANLIB=@RANLIB@ RANLIB="@RANLIB@"
ac_cv_path_ac_pt_RANLIB=${RANLIB} ac_cv_path_ac_pt_RANLIB="${RANLIB}"
fi fi
if test -n "@NM@"; then if test -n "@NM@"; then
NM=@NM@ NM="@NM@"
ac_cv_path_ac_pt_NM=${NM} ac_cv_path_ac_pt_NM="${NM}"
fi fi
if test -n "@debug@"; then if test -n "@debug@"; then
@ -100,14 +109,14 @@ if test -n "@debug@"; then
fi fi
if test -n "@CFLAGS@"; then if test -n "@CFLAGS@"; then
CFLAGS="@CFLAGS@ $CFLAGS" CFLAGS="@CFLAGS@ ${CFLAGS}"
fi fi
if test -n "@CXXFLAGS@"; then if test -n "@CXXFLAGS@"; then
CXXFLAGS="@CXXFLAGS@ $CXXFLAGS" CXXFLAGS="@CXXFLAGS@ ${CXXFLAGS}"
fi fi
if test -n "@CPPFLAGS@"; then if test -n "@CPPFLAGS@"; then
CPPFLAGS="@CPPFLAGS@ $CPPFLAGS" CPPFLAGS="@CPPFLAGS@ ${CPPFLAGS}"
fi fi
if test -n "@LDFLAGS@"; then if test -n "@LDFLAGS@"; then
LDFLAGS="@LDFLAGS@ $LDFLAGS" LDFLAGS="@LDFLAGS@ ${LDFLAGS}"
fi fi

View File

@ -39,10 +39,8 @@ $(package)_cxxflags_android=-fPIC
$(package)_cxxflags_x86_64=-fcf-protection=full $(package)_cxxflags_x86_64=-fcf-protection=full
endef endef
# Fix unused variable in boost_process, can be removed after upgrading to 1.72
# Fix missing unary_function in clang15 on macos, can be removed after upgrading to 1.81 # Fix missing unary_function in clang15 on macos, can be removed after upgrading to 1.81
define $(package)_preprocess_cmds define $(package)_preprocess_cmds
sed -i.old "s/int ret_sig = 0;//" boost/process/detail/posix/wait_group.hpp && \
sed -i.old "s/unary_function/$(unary_function)/" boost/container_hash/hash.hpp && \ sed -i.old "s/unary_function/$(unary_function)/" boost/container_hash/hash.hpp && \
echo "using $($(package)_toolset_$(host_os)) : : $($(package)_cxx) : <cflags>\"$($(package)_cflags)\" <cxxflags>\"$($(package)_cxxflags)\" <compileflags>\"$($(package)_cppflags)\" <linkflags>\"$($(package)_ldflags)\" <archiver>\"$($(package)_ar)\" <striper>\"$(host_STRIP)\" <ranlib>\"$(host_RANLIB)\" <rc>\"$(host_WINDRES)\" : ;" > user-config.jam echo "using $($(package)_toolset_$(host_os)) : : $($(package)_cxx) : <cflags>\"$($(package)_cflags)\" <cxxflags>\"$($(package)_cxxflags)\" <compileflags>\"$($(package)_cppflags)\" <linkflags>\"$($(package)_ldflags)\" <archiver>\"$($(package)_ar)\" <striper>\"$(host_STRIP)\" <ranlib>\"$(host_RANLIB)\" <rc>\"$(host_WINDRES)\" : ;" > user-config.jam
endef endef

View File

@ -3,6 +3,7 @@ $(package)_version=4.3.1
$(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/ $(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/
$(package)_file_name=$(package)-$($(package)_version).tar.gz $(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=bcbabe1e2c7d0eec4ed612e10b94b112dd5f06fcefa994a0c79a45d835cd21eb $(package)_sha256_hash=bcbabe1e2c7d0eec4ed612e10b94b112dd5f06fcefa994a0c79a45d835cd21eb
$(package)_patches=remove_libstd_link.patch
define $(package)_set_vars define $(package)_set_vars
$(package)_config_opts=--without-docs --disable-shared --disable-curve --disable-curve-keygen --disable-perf $(package)_config_opts=--without-docs --disable-shared --disable-curve --disable-curve-keygen --disable-perf
@ -18,6 +19,7 @@ define $(package)_set_vars
endef endef
define $(package)_preprocess_cmds define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/remove_libstd_link.patch && \
cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub config cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub config
endef endef
@ -34,6 +36,5 @@ define $(package)_stage_cmds
endef endef
define $(package)_postprocess_cmds define $(package)_postprocess_cmds
sed -i.old "s/ -lstdc++//" lib/pkgconfig/libzmq.pc && \
rm -rf bin share lib/*.la rm -rf bin share lib/*.la
endef endef

View File

@ -0,0 +1,25 @@
commit 47d4cd12a2c051815ddda78adebdb3923b260d8a
Author: fanquake <fanquake@gmail.com>
Date: Tue Aug 18 14:45:40 2020 +0800
Remove needless linking against libstdc++
This is broken for a number of reasons, including:
- g++ understands "static-libstdc++ -lstdc++" to mean "link against
whatever libstdc++ exists, probably shared", which in itself is buggy.
- another stdlib (libc++ for example) may be in use
See #11981.
diff --git a/src/libzmq.pc.in b/src/libzmq.pc.in
index 233bc3a..3c2bf0d 100644
--- a/src/libzmq.pc.in
+++ b/src/libzmq.pc.in
@@ -7,6 +7,6 @@ Name: libzmq
Description: 0MQ c++ library
Version: @VERSION@
Libs: -L${libdir} -lzmq
-Libs.private: -lstdc++ @pkg_config_libs_private@
+Libs.private: @pkg_config_libs_private@
Requires.private: @pkg_config_names_private@
Cflags: -I${includedir} @pkg_config_defines@

View File

@ -19,13 +19,27 @@ Then install [Homebrew](https://brew.sh).
## Dependencies ## Dependencies
```shell ```shell
brew install automake berkeley-db4 libtool boost gmp miniupnpc pkg-config python qt libevent libnatpmp qrencode sqlite brew install automake libtool boost gmp miniupnpc pkg-config python qt libevent libnatpmp qrencode
``` ```
If you run into issues, check [Homebrew's troubleshooting page](https://docs.brew.sh/Troubleshooting). If you run into issues, check [Homebrew's troubleshooting page](https://docs.brew.sh/Troubleshooting).
See [dependencies.md](dependencies.md) for a complete overview. See [dependencies.md](dependencies.md) for a complete overview.
## Berkeley DB The wallet support requires one or both of the dependencies ([*SQLite*](#sqlite) and [*Berkeley DB*](#berkeley-db)) in the sections below.
To build Dash Core without wallet, see [*Disable-wallet mode*](#disable-wallet-mode).
#### SQLite
Usually, macOS installation already has a suitable SQLite installation.
Also, the Homebrew package could be installed:
```shell
brew install sqlite
```
In that case the Homebrew package will prevail.
#### Berkeley DB
It is recommended to use Berkeley DB 4.8. If you have to build it yourself, It is recommended to use Berkeley DB 4.8. If you have to build it yourself,
you can use [the installation script included in contrib/](contrib/install_db4.sh) you can use [the installation script included in contrib/](contrib/install_db4.sh)
@ -37,7 +51,11 @@ like so:
from the root of the repository. from the root of the repository.
**Note**: You only need Berkeley DB if the wallet is enabled (see the section *Disable-Wallet mode* below). Also, the Homebrew package could be installed:
```shell
brew install berkeley-db4
```
## Build Dash Core ## Build Dash Core
@ -68,14 +86,14 @@ from the root of the repository.
make deploy make deploy
``` ```
## `disable-wallet` mode ## Disable-wallet mode
When the intention is to run only a P2P node without a wallet, Dash Core may be When the intention is to run only a P2P node without a wallet, Dash Core may be
compiled in `disable-wallet` mode with: compiled in disable-wallet mode with:
```shell ```shell
./configure --disable-wallet ./configure --disable-wallet
``` ```
In this case there is no dependency on Berkeley DB 4.8 and SQLite. In this case there is no dependency on [*Berkeley DB*](#berkeley-db) and [*SQLite*](#sqlite).
Mining is also possible in disable-wallet mode using the `getblocktemplate` RPC call. Mining is also possible in disable-wallet mode using the `getblocktemplate` RPC call.