mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
configure: add --enable-external-signer
This option replaces --with-boost-process This prepares external signer support to be disabled by default. It adds a configure option to enable this feature and to check if Boost::Process is present. This also exposes ENABLE_EXTERNAL_SIGNER to the test suite via test/config.ini
This commit is contained in:
parent
5bb64acd9d
commit
87a97941f6
7 changed files with 59 additions and 52 deletions
|
@ -50,8 +50,8 @@
|
||||||
/* define if the Boost::Filesystem library is available */
|
/* define if the Boost::Filesystem library is available */
|
||||||
#define HAVE_BOOST_FILESYSTEM /**/
|
#define HAVE_BOOST_FILESYSTEM /**/
|
||||||
|
|
||||||
/* define if the Boost::Process library is available */
|
/* define if external signer support is enabled (requires Boost::Process) */
|
||||||
#define HAVE_BOOST_PROCESS /**/
|
#define ENABLE_EXTERNAL_SIGNER /**/
|
||||||
|
|
||||||
/* define if the Boost::System library is available */
|
/* define if the Boost::System library is available */
|
||||||
#define HAVE_BOOST_SYSTEM /**/
|
#define HAVE_BOOST_SYSTEM /**/
|
||||||
|
|
82
configure.ac
82
configure.ac
|
@ -338,10 +338,10 @@ AC_ARG_ENABLE([werror],
|
||||||
[enable_werror=$enableval],
|
[enable_werror=$enableval],
|
||||||
[enable_werror=no])
|
[enable_werror=no])
|
||||||
|
|
||||||
AC_ARG_WITH([boost-process],
|
AC_ARG_ENABLE([external-signer],
|
||||||
[AS_HELP_STRING([--with-boost-process],[Opt in to using Boost Process (default is no)])],
|
[AS_HELP_STRING([--enable-external-signer],[compile external signer support (default is no, requires Boost::Process)])],
|
||||||
[boost_process=$withval],
|
[use_external_signer=$enableval],
|
||||||
[boost_process=no])
|
[use_external_signer=no])
|
||||||
|
|
||||||
AC_LANG_PUSH([C++])
|
AC_LANG_PUSH([C++])
|
||||||
|
|
||||||
|
@ -1253,6 +1253,7 @@ if test "x$enable_fuzz" = "xyes"; then
|
||||||
bitcoin_enable_qt_dbus=no
|
bitcoin_enable_qt_dbus=no
|
||||||
enable_wallet=no
|
enable_wallet=no
|
||||||
use_bench=no
|
use_bench=no
|
||||||
|
use_external_signer=no
|
||||||
use_upnp=no
|
use_upnp=no
|
||||||
use_natpmp=no
|
use_natpmp=no
|
||||||
use_zmq=no
|
use_zmq=no
|
||||||
|
@ -1390,16 +1391,20 @@ fi
|
||||||
AX_BOOST_SYSTEM
|
AX_BOOST_SYSTEM
|
||||||
AX_BOOST_FILESYSTEM
|
AX_BOOST_FILESYSTEM
|
||||||
|
|
||||||
dnl Opt-in to Boost Process
|
dnl Opt-in to Boost Process if external signer support is requested
|
||||||
if test "x$boost_process" != xno; then
|
if test "x$use_external_signer" != xno; then
|
||||||
AC_MSG_CHECKING(for Boost Process)
|
AC_MSG_CHECKING(for Boost Process)
|
||||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/process.hpp>]],
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/process.hpp>]],
|
||||||
[[ boost::process::child* child = new boost::process::child; delete child; ]])],
|
[[ boost::process::child* child = new boost::process::child; delete child; ]])],
|
||||||
[ AC_MSG_RESULT(yes); AC_DEFINE([HAVE_BOOST_PROCESS],,[define if Boost::Process is available])],
|
[ AC_MSG_RESULT(yes)
|
||||||
[ AC_MSG_ERROR([Boost::Process is not available!])]
|
AC_DEFINE([ENABLE_EXTERNAL_SIGNER],,[define if external signer support is enabled])
|
||||||
|
],
|
||||||
|
[ AC_MSG_ERROR([Boost::Process is required for external signer support, but not available!])]
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
AM_CONDITIONAL([ENABLE_EXTERNAL_SIGNER], [test "x$use_external_signer" = "xyes"])
|
||||||
|
|
||||||
if test x$suppress_external_warnings != xno; then
|
if test x$suppress_external_warnings != xno; then
|
||||||
BOOST_CPPFLAGS=SUPPRESS_WARNINGS($BOOST_CPPFLAGS)
|
BOOST_CPPFLAGS=SUPPRESS_WARNINGS($BOOST_CPPFLAGS)
|
||||||
fi
|
fi
|
||||||
|
@ -1810,6 +1815,7 @@ AC_SUBST(ARM_CRC_CXXFLAGS)
|
||||||
AC_SUBST(LIBTOOL_APP_LDFLAGS)
|
AC_SUBST(LIBTOOL_APP_LDFLAGS)
|
||||||
AC_SUBST(USE_SQLITE)
|
AC_SUBST(USE_SQLITE)
|
||||||
AC_SUBST(USE_BDB)
|
AC_SUBST(USE_BDB)
|
||||||
|
AC_SUBST(ENABLE_EXTERNAL_SIGNER)
|
||||||
AC_SUBST(USE_UPNP)
|
AC_SUBST(USE_UPNP)
|
||||||
AC_SUBST(USE_QRCODE)
|
AC_SUBST(USE_QRCODE)
|
||||||
AC_SUBST(BOOST_LIBS)
|
AC_SUBST(BOOST_LIBS)
|
||||||
|
@ -1885,43 +1891,43 @@ esac
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Options used to compile and link:"
|
echo "Options used to compile and link:"
|
||||||
echo " boost process = $with_boost_process"
|
echo " external signer = $use_external_signer"
|
||||||
echo " multiprocess = $build_multiprocess"
|
echo " multiprocess = $build_multiprocess"
|
||||||
echo " with libs = $build_bitcoin_libs"
|
echo " with libs = $build_bitcoin_libs"
|
||||||
echo " with wallet = $enable_wallet"
|
echo " with wallet = $enable_wallet"
|
||||||
if test "x$enable_wallet" != "xno"; then
|
if test "x$enable_wallet" != "xno"; then
|
||||||
echo " with sqlite = $use_sqlite"
|
echo " with sqlite = $use_sqlite"
|
||||||
echo " with bdb = $use_bdb"
|
echo " with bdb = $use_bdb"
|
||||||
fi
|
fi
|
||||||
echo " with gui / qt = $bitcoin_enable_qt"
|
echo " with gui / qt = $bitcoin_enable_qt"
|
||||||
if test x$bitcoin_enable_qt != xno; then
|
if test x$bitcoin_enable_qt != xno; then
|
||||||
echo " with qr = $use_qr"
|
echo " with qr = $use_qr"
|
||||||
fi
|
fi
|
||||||
echo " with zmq = $use_zmq"
|
echo " with zmq = $use_zmq"
|
||||||
if test x$enable_fuzz == xno; then
|
if test x$enable_fuzz == xno; then
|
||||||
echo " with test = $use_tests"
|
echo " with test = $use_tests"
|
||||||
else
|
else
|
||||||
echo " with test = not building test_bitcoin because fuzzing is enabled"
|
echo " with test = not building test_bitcoin because fuzzing is enabled"
|
||||||
echo " with fuzz = $enable_fuzz"
|
echo " with fuzz = $enable_fuzz"
|
||||||
fi
|
fi
|
||||||
echo " with bench = $use_bench"
|
echo " with bench = $use_bench"
|
||||||
echo " with upnp = $use_upnp"
|
echo " with upnp = $use_upnp"
|
||||||
echo " with natpmp = $use_natpmp"
|
echo " with natpmp = $use_natpmp"
|
||||||
echo " use asm = $use_asm"
|
echo " use asm = $use_asm"
|
||||||
echo " ebpf tracing = $have_sdt"
|
echo " ebpf tracing = $have_sdt"
|
||||||
echo " sanitizers = $use_sanitizers"
|
echo " sanitizers = $use_sanitizers"
|
||||||
echo " debug enabled = $enable_debug"
|
echo " debug enabled = $enable_debug"
|
||||||
echo " gprof enabled = $enable_gprof"
|
echo " gprof enabled = $enable_gprof"
|
||||||
echo " werror = $enable_werror"
|
echo " werror = $enable_werror"
|
||||||
echo
|
echo
|
||||||
echo " target os = $TARGET_OS"
|
echo " target os = $TARGET_OS"
|
||||||
echo " build os = $build_os"
|
echo " build os = $build_os"
|
||||||
echo
|
echo
|
||||||
echo " CC = $CC"
|
echo " CC = $CC"
|
||||||
echo " CFLAGS = $PTHREAD_CFLAGS $CFLAGS"
|
echo " CFLAGS = $PTHREAD_CFLAGS $CFLAGS"
|
||||||
echo " CPPFLAGS = $DEBUG_CPPFLAGS $HARDENED_CPPFLAGS $CPPFLAGS"
|
echo " CPPFLAGS = $DEBUG_CPPFLAGS $HARDENED_CPPFLAGS $CPPFLAGS"
|
||||||
echo " CXX = $CXX"
|
echo " CXX = $CXX"
|
||||||
echo " CXXFLAGS = $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $GPROF_CXXFLAGS $CXXFLAGS"
|
echo " CXXFLAGS = $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $GPROF_CXXFLAGS $CXXFLAGS"
|
||||||
echo " LDFLAGS = $PTHREAD_LIBS $HARDENED_LDFLAGS $GPROF_LDFLAGS $LDFLAGS"
|
echo " LDFLAGS = $PTHREAD_LIBS $HARDENED_LDFLAGS $GPROF_LDFLAGS $LDFLAGS"
|
||||||
echo " ARFLAGS = $ARFLAGS"
|
echo " ARFLAGS = $ARFLAGS"
|
||||||
echo
|
echo
|
||||||
|
|
|
@ -2073,7 +2073,7 @@ INCLUDE_FILE_PATTERNS =
|
||||||
# recursively expanded use the := operator instead of the = operator.
|
# recursively expanded use the := operator instead of the = operator.
|
||||||
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
||||||
|
|
||||||
PREDEFINED = HAVE_BOOST_PROCESS
|
PREDEFINED = ENABLE_EXTERNAL_SIGNER
|
||||||
|
|
||||||
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
|
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
|
||||||
# tag can be used to specify a list of macro names that should be expanded. The
|
# tag can be used to specify a list of macro names that should be expanded. The
|
||||||
|
|
|
@ -6,22 +6,22 @@
|
||||||
#include <util/system.h>
|
#include <util/system.h>
|
||||||
#include <univalue.h>
|
#include <univalue.h>
|
||||||
|
|
||||||
#ifdef HAVE_BOOST_PROCESS
|
#ifdef ENABLE_EXTERNAL_SIGNER
|
||||||
#include <boost/process.hpp>
|
#include <boost/process.hpp>
|
||||||
#endif // HAVE_BOOST_PROCESS
|
#endif // ENABLE_EXTERNAL_SIGNER
|
||||||
|
|
||||||
#include <boost/test/unit_test.hpp>
|
#include <boost/test/unit_test.hpp>
|
||||||
|
|
||||||
BOOST_FIXTURE_TEST_SUITE(system_tests, BasicTestingSetup)
|
BOOST_FIXTURE_TEST_SUITE(system_tests, BasicTestingSetup)
|
||||||
|
|
||||||
// At least one test is required (in case HAVE_BOOST_PROCESS is not defined).
|
// At least one test is required (in case ENABLE_EXTERNAL_SIGNER is not defined).
|
||||||
// Workaround for https://github.com/bitcoin/bitcoin/issues/19128
|
// Workaround for https://github.com/bitcoin/bitcoin/issues/19128
|
||||||
BOOST_AUTO_TEST_CASE(dummy)
|
BOOST_AUTO_TEST_CASE(dummy)
|
||||||
{
|
{
|
||||||
BOOST_CHECK(true);
|
BOOST_CHECK(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_BOOST_PROCESS
|
#ifdef ENABLE_EXTERNAL_SIGNER
|
||||||
|
|
||||||
bool checkMessage(const std::runtime_error& ex)
|
bool checkMessage(const std::runtime_error& ex)
|
||||||
{
|
{
|
||||||
|
@ -90,6 +90,6 @@ BOOST_AUTO_TEST_CASE(run_command)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif // HAVE_BOOST_PROCESS
|
#endif // ENABLE_EXTERNAL_SIGNER
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE_END()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
|
|
||||||
#include <util/system.h>
|
#include <util/system.h>
|
||||||
|
|
||||||
#ifdef HAVE_BOOST_PROCESS
|
#ifdef ENABLE_EXTERNAL_SIGNER
|
||||||
#include <boost/process.hpp>
|
#include <boost/process.hpp>
|
||||||
#endif // HAVE_BOOST_PROCESS
|
#endif // ENABLE_EXTERNAL_SIGNER
|
||||||
|
|
||||||
#include <chainparamsbase.h>
|
#include <chainparamsbase.h>
|
||||||
#include <sync.h>
|
#include <sync.h>
|
||||||
|
@ -1247,7 +1247,7 @@ void runCommand(const std::string& strCommand)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_BOOST_PROCESS
|
#ifdef ENABLE_EXTERNAL_SIGNER
|
||||||
UniValue RunCommandParseJSON(const std::string& str_command, const std::string& str_std_in)
|
UniValue RunCommandParseJSON(const std::string& str_command, const std::string& str_std_in)
|
||||||
{
|
{
|
||||||
namespace bp = boost::process;
|
namespace bp = boost::process;
|
||||||
|
@ -1282,7 +1282,7 @@ UniValue RunCommandParseJSON(const std::string& str_command, const std::string&
|
||||||
|
|
||||||
return result_json;
|
return result_json;
|
||||||
}
|
}
|
||||||
#endif // HAVE_BOOST_PROCESS
|
#endif // ENABLE_EXTERNAL_SIGNER
|
||||||
|
|
||||||
void SetupEnvironment()
|
void SetupEnvironment()
|
||||||
{
|
{
|
||||||
|
|
|
@ -108,7 +108,7 @@ std::string ShellEscape(const std::string& arg);
|
||||||
#if HAVE_SYSTEM
|
#if HAVE_SYSTEM
|
||||||
void runCommand(const std::string& strCommand);
|
void runCommand(const std::string& strCommand);
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_BOOST_PROCESS
|
#ifdef ENABLE_EXTERNAL_SIGNER
|
||||||
/**
|
/**
|
||||||
* Execute a command which returns JSON, and parse the result.
|
* Execute a command which returns JSON, and parse the result.
|
||||||
*
|
*
|
||||||
|
@ -117,7 +117,7 @@ void runCommand(const std::string& strCommand);
|
||||||
* @return parsed JSON
|
* @return parsed JSON
|
||||||
*/
|
*/
|
||||||
UniValue RunCommandParseJSON(const std::string& str_command, const std::string& str_std_in="");
|
UniValue RunCommandParseJSON(const std::string& str_command, const std::string& str_std_in="");
|
||||||
#endif // HAVE_BOOST_PROCESS
|
#endif // ENABLE_EXTERNAL_SIGNER
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Most paths passed as configuration arguments are treated as relative to
|
* Most paths passed as configuration arguments are treated as relative to
|
||||||
|
|
|
@ -23,3 +23,4 @@ RPCAUTH=@abs_top_srcdir@/share/rpcauth/rpcauth.py
|
||||||
@BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=true
|
@BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=true
|
||||||
@ENABLE_FUZZ_TRUE@ENABLE_FUZZ=true
|
@ENABLE_FUZZ_TRUE@ENABLE_FUZZ=true
|
||||||
@ENABLE_ZMQ_TRUE@ENABLE_ZMQ=true
|
@ENABLE_ZMQ_TRUE@ENABLE_ZMQ=true
|
||||||
|
@ENABLE_EXTERNAL_SIGNER_TRUE@ENABLE_EXTERNAL_SIGNER=true
|
||||||
|
|
Loading…
Add table
Reference in a new issue