From 8d77450bb720a9beecb8ad9adfa238ff563d04c1 Mon Sep 17 00:00:00 2001 From: pasta Date: Sat, 8 Nov 2025 09:31:28 -0600 Subject: [PATCH 1/3] build: fix some errors when building on macOS w/o depends --- configure.ac | 32 +++++++++++++++++++++++++++----- src/Makefile.am | 2 +- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 10898c110c8e..a4c5c4ccb92e 100644 --- a/configure.ac +++ b/configure.ac @@ -396,6 +396,16 @@ fi if test "$enable_stacktraces" != no; then AC_CHECK_HEADERS([execinfo.h], [], [enable_stacktraces=no]) + if test "$enable_stacktraces" != "no"; then + AC_CHECK_HEADERS([backtrace.h], [], [ + if test "$enable_stacktraces" = "yes"; then + AC_MSG_ERROR([backtrace.h not found but --enable-stacktraces was specified. Install libbacktrace or use --disable-stacktraces.]) + else + AC_MSG_WARN([backtrace.h not found. Stacktraces will be disabled.]) + enable_stacktraces=no + fi + ]) + fi fi AM_CONDITIONAL([ENABLE_STACKTRACES], [test "$enable_stacktraces" = "yes"]) @@ -892,11 +902,17 @@ case $host in export PKG_CONFIG_PATH="$($BREW --prefix qt@5 2>/dev/null)/lib/pkgconfig:$PKG_CONFIG_PATH" fi - gmp_prefix=$($BREW --prefix gmp 2>/dev/null) - if test "$gmp_prefix" != ""; then - CORE_CPPFLAGS="$CORE_CPPFLAGS -I$gmp_prefix/include" - CORE_LDFLAGS="$CORE_LDFLAGS -L$gmp_prefix/lib" - fi + gmp_prefix=$($BREW --prefix gmp 2>/dev/null) + if test "$gmp_prefix" != ""; then + if test "$suppress_external_warnings" != "no"; then + GMP_CPPFLAGS="-isystem $gmp_prefix/include" + else + GMP_CPPFLAGS="-I$gmp_prefix/include" + fi + GMP_LDFLAGS="-L$gmp_prefix/lib" + CORE_CPPFLAGS="$CORE_CPPFLAGS $GMP_CPPFLAGS" + CORE_LDFLAGS="$CORE_LDFLAGS $GMP_LDFLAGS" + fi case $host in *aarch64*) @@ -1669,8 +1685,14 @@ if test "$use_zmq" = "yes"; then fi dnl check if libgmp is present +TEMP_CPPFLAGS="$CPPFLAGS" +TEMP_LDFLAGS="$LDFLAGS" +CPPFLAGS="$CPPFLAGS $GMP_CPPFLAGS" +LDFLAGS="$LDFLAGS $GMP_LDFLAGS" 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)) +CPPFLAGS="$TEMP_CPPFLAGS" +LDFLAGS="$TEMP_LDFLAGS" AM_CONDITIONAL([ENABLE_ZMQ], [test "$use_zmq" = "yes"]) diff --git a/src/Makefile.am b/src/Makefile.am index 9721e8e4f35e..bdfc08ce3662 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -892,7 +892,7 @@ libbitcoin_consensus_a_SOURCES = \ version.h # common: shared between dashd, and dash-qt and non-server tools -libbitcoin_common_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) +libbitcoin_common_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS) libbitcoin_common_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) libbitcoin_common_a_SOURCES = \ base58.cpp \ From 2834aecf00a368f82b65de52714ba8a4a4557dbb Mon Sep 17 00:00:00 2001 From: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com> Date: Mon, 10 Nov 2025 09:55:46 -0600 Subject: [PATCH 2/3] fix: improve libbacktrace detection Co-authored-by: UdjinM6 --- configure.ac | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index a4c5c4ccb92e..f6653d3ead04 100644 --- a/configure.ac +++ b/configure.ac @@ -394,18 +394,22 @@ else fi fi -if test "$enable_stacktraces" != no; then - AC_CHECK_HEADERS([execinfo.h], [], [enable_stacktraces=no]) - if test "$enable_stacktraces" != "no"; then +if test "$enable_stacktraces" != "no"; then + AC_CHECK_HEADERS([execinfo.h], [ AC_CHECK_HEADERS([backtrace.h], [], [ if test "$enable_stacktraces" = "yes"; then AC_MSG_ERROR([backtrace.h not found but --enable-stacktraces was specified. Install libbacktrace or use --disable-stacktraces.]) - else - AC_MSG_WARN([backtrace.h not found. Stacktraces will be disabled.]) - enable_stacktraces=no fi + AC_MSG_WARN([backtrace.h not found. Stacktraces will be disabled.]) + enable_stacktraces=no ]) - fi + ], [ + if test "$enable_stacktraces" = "yes"; then + AC_MSG_ERROR([execinfo.h not found but --enable-stacktraces was specified. Stacktraces require execinfo.h. Use --disable-stacktraces.]) + fi + AC_MSG_WARN([execinfo.h not found. Stacktraces will be disabled.]) + enable_stacktraces=no + ]) fi AM_CONDITIONAL([ENABLE_STACKTRACES], [test "$enable_stacktraces" = "yes"]) From 6decd41809d916ff83d6d3939be1d3de5e483943 Mon Sep 17 00:00:00 2001 From: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com> Date: Wed, 12 Nov 2025 09:53:16 -0600 Subject: [PATCH 3/3] chore: limit changes to boost/gmp --- configure.ac | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index f6653d3ead04..f9138d39821e 100644 --- a/configure.ac +++ b/configure.ac @@ -394,22 +394,8 @@ else fi fi -if test "$enable_stacktraces" != "no"; then - AC_CHECK_HEADERS([execinfo.h], [ - AC_CHECK_HEADERS([backtrace.h], [], [ - if test "$enable_stacktraces" = "yes"; then - AC_MSG_ERROR([backtrace.h not found but --enable-stacktraces was specified. Install libbacktrace or use --disable-stacktraces.]) - fi - AC_MSG_WARN([backtrace.h not found. Stacktraces will be disabled.]) - enable_stacktraces=no - ]) - ], [ - if test "$enable_stacktraces" = "yes"; then - AC_MSG_ERROR([execinfo.h not found but --enable-stacktraces was specified. Stacktraces require execinfo.h. Use --disable-stacktraces.]) - fi - AC_MSG_WARN([execinfo.h not found. Stacktraces will be disabled.]) - enable_stacktraces=no - ]) +if test "$enable_stacktraces" != no; then + AC_CHECK_HEADERS([execinfo.h], [], [enable_stacktraces=no]) fi AM_CONDITIONAL([ENABLE_STACKTRACES], [test "$enable_stacktraces" = "yes"])