Skip to content

Commit b88dd7c

Browse files
author
MarcoFalke
committed
Merge #12246: Bugfix: Only run bitcoin-tx tests when bitcoin-tx is enabled
a2a04a5 Bugfix: Only run bitcoin-tx tests when bitcoin-tx is enabled (Luke Dashjr) 92af71c configure: Make it possible to build only one of bitcoin-cli or bitcoin-tx (Luke Dashjr) Pull request description: Includes #5618 (which the reasons for rejecting no longer hold true) Tree-SHA512: f30a8e4a2f70166b7cabef77c4674163b3a9da14c6a547d34f00d1056a19bf4d23e22851eea726fad2afc8735d5473ae91122c770b65ac3886663dc20e2c5b70
2 parents edcf29c + a2a04a5 commit b88dd7c

File tree

6 files changed

+39
-14
lines changed

6 files changed

+39
-14
lines changed

configure.ac

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,18 @@ AC_ARG_WITH([utils],
406406
[build_bitcoin_utils=$withval],
407407
[build_bitcoin_utils=yes])
408408

409+
AC_ARG_ENABLE([util-cli],
410+
[AS_HELP_STRING([--enable-util-cli],
411+
[build bitcoin-cli])],
412+
[build_bitcoin_cli=$enableval],
413+
[build_bitcoin_cli=$build_bitcoin_utils])
414+
415+
AC_ARG_ENABLE([util-tx],
416+
[AS_HELP_STRING([--enable-util-tx],
417+
[build bitcoin-tx])],
418+
[build_bitcoin_tx=$enableval],
419+
[build_bitcoin_tx=$build_bitcoin_utils])
420+
409421
AC_ARG_WITH([libs],
410422
[AS_HELP_STRING([--with-libs],
411423
[build libraries (default=yes)])],
@@ -886,7 +898,7 @@ BITCOIN_QT_INIT
886898
dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus
887899
BITCOIN_QT_CONFIGURE([$use_pkgconfig])
888900

889-
if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench = xnonononono; then
901+
if test x$build_bitcoin_cli$build_bitcoin_tx$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench = xnononononono; then
890902
use_boost=no
891903
else
892904
use_boost=yes
@@ -1074,7 +1086,7 @@ if test x$use_pkgconfig = xyes; then
10741086
if test x$use_qr != xno; then
10751087
BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])])
10761088
fi
1077-
if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests != xnononono; then
1089+
if test x$build_bitcoin_cli$build_bitcoin_tx$build_bitcoind$bitcoin_enable_qt$use_tests != xnonononono; then
10781090
PKG_CHECK_MODULES([EVENT], [libevent],, [AC_MSG_ERROR(libevent not found.)])
10791091
if test x$TARGET_OS != xwindows; then
10801092
PKG_CHECK_MODULES([EVENT_PTHREADS], [libevent_pthreads],, [AC_MSG_ERROR(libevent_pthreads not found.)])
@@ -1099,7 +1111,7 @@ else
10991111
AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR(libssl headers missing),)
11001112
AC_CHECK_LIB([ssl], [main],SSL_LIBS=-lssl, AC_MSG_ERROR(libssl missing))
11011113

1102-
if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests != xnononono; then
1114+
if test x$build_bitcoin_cli$build_bitcoin_tx$build_bitcoind$bitcoin_enable_qt$use_tests != xnonononono; then
11031115
AC_CHECK_HEADER([event2/event.h],, AC_MSG_ERROR(libevent headers missing),)
11041116
AC_CHECK_LIB([event],[main],EVENT_LIBS=-levent,AC_MSG_ERROR(libevent missing))
11051117
if test x$TARGET_OS != xwindows; then
@@ -1164,7 +1176,7 @@ dnl univalue check
11641176

11651177
need_bundled_univalue=yes
11661178

1167-
if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench = xnonononono; then
1179+
if test x$build_bitcoin_cli$build_bitcoin_tx$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench = xnononononono; then
11681180
need_bundled_univalue=no
11691181
else
11701182

@@ -1214,9 +1226,13 @@ AC_MSG_CHECKING([whether to build bitcoind])
12141226
AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes])
12151227
AC_MSG_RESULT($build_bitcoind)
12161228

1217-
AC_MSG_CHECKING([whether to build utils (bitcoin-cli bitcoin-tx)])
1218-
AM_CONDITIONAL([BUILD_BITCOIN_UTILS], [test x$build_bitcoin_utils = xyes])
1219-
AC_MSG_RESULT($build_bitcoin_utils)
1229+
AC_MSG_CHECKING([whether to build bitcoin-cli])
1230+
AM_CONDITIONAL([BUILD_BITCOIN_CLI], [test x$build_bitcoin_cli = xyes])
1231+
AC_MSG_RESULT($build_bitcoin_cli)
1232+
1233+
AC_MSG_CHECKING([whether to build bitcoin-tx])
1234+
AM_CONDITIONAL([BUILD_BITCOIN_TX], [test x$build_bitcoin_tx = xyes])
1235+
AC_MSG_RESULT($build_bitcoin_tx)
12201236

12211237
AC_MSG_CHECKING([whether to build libraries])
12221238
AM_CONDITIONAL([BUILD_BITCOIN_LIBS], [test x$build_bitcoin_libs = xyes])
@@ -1342,7 +1358,7 @@ else
13421358
AC_MSG_RESULT([no])
13431359
fi
13441360

1345-
if test x$build_bitcoin_utils$build_bitcoin_libs$build_bitcoind$bitcoin_enable_qt$use_bench$use_tests = xnononononono; then
1361+
if test x$build_bitcoin_cli$build_bitcoin_tx$build_bitcoin_libs$build_bitcoind$bitcoin_enable_qt$use_bench$use_tests = xnonononononono; then
13461362
AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui --enable-bench or --enable-tests])
13471363
fi
13481364

doc/man/Makefile.am

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ if ENABLE_QT
88
dist_man1_MANS+=bitcoin-qt.1
99
endif
1010

11-
if BUILD_BITCOIN_UTILS
12-
dist_man1_MANS+=bitcoin-cli.1 bitcoin-tx.1
11+
if BUILD_BITCOIN_CLI
12+
dist_man1_MANS+=bitcoin-cli.1
13+
endif
14+
15+
if BUILD_BITCOIN_TX
16+
dist_man1_MANS+=bitcoin-tx.1
1317
endif

src/Makefile.am

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,11 @@ if BUILD_BITCOIND
8383
bin_PROGRAMS += bitcoind
8484
endif
8585

86-
if BUILD_BITCOIN_UTILS
87-
bin_PROGRAMS += bitcoin-cli bitcoin-tx
86+
if BUILD_BITCOIN_CLI
87+
bin_PROGRAMS += bitcoin-cli
88+
endif
89+
if BUILD_BITCOIN_TX
90+
bin_PROGRAMS += bitcoin-tx
8891
endif
8992

9093
.PHONY: FORCE check-symbols check-security

src/Makefile.test.include

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,10 @@ bitcoin_test_clean : FORCE
174174
rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)
175175

176176
check-local: $(BITCOIN_TESTS:.cpp=.cpp.test)
177+
if BUILD_BITCOIN_TX
177178
@echo "Running test/util/bitcoin-util-test.py..."
178179
$(PYTHON) $(top_builddir)/test/util/bitcoin-util-test.py
180+
endif
179181
@echo "Running test/util/rpcauth-test.py..."
180182
$(PYTHON) $(top_builddir)/test/util/rpcauth-test.py
181183
$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check

test/config.ini.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ RPCAUTH=@abs_top_srcdir@/share/rpcauth/rpcauth.py
1414
[components]
1515
# Which components are enabled. These are commented out by `configure` if they were disabled when running config.
1616
@ENABLE_WALLET_TRUE@ENABLE_WALLET=true
17-
@BUILD_BITCOIN_UTILS_TRUE@ENABLE_UTILS=true
17+
@BUILD_BITCOIN_CLI_TRUE@ENABLE_CLI=true
1818
@BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=true
1919
@ENABLE_ZMQ_TRUE@ENABLE_ZMQ=true

test/functional/test_framework/test_framework.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ def is_cli_compiled(self):
525525
config = configparser.ConfigParser()
526526
config.read_file(open(self.options.configfile))
527527

528-
return config["components"].getboolean("ENABLE_UTILS")
528+
return config["components"].getboolean("ENABLE_CLI")
529529

530530
def is_wallet_compiled(self):
531531
"""Checks whether the wallet module was compiled."""

0 commit comments

Comments
 (0)