Skip to content

Commit 4f223e9

Browse files
committed
Merge #21339: build: Make AM_CONDITIONAL([ENABLE_EXTERNAL_SIGNER]) unconditional
a412813 build: Make AM_CONDITIONAL([ENABLE_EXTERNAL_SIGNER]) unconditional (Hennadii Stepanov) 9fef209 build, refactor: Fix indentation for if..then..fi (Hennadii Stepanov) Pull request description: #16546 introduced a regression in the `configure`: ``` $ ./autogen.sh $ ./configure --disable-wallet --without-utils --without-daemon --without-gui --disable-tests --disable-bench ... checking whether to build test_bitcoin... no checking whether to reduce exports... no checking that generated files are newer than configure... done configure: error: conditional "ENABLE_EXTERNAL_SIGNER" was never defined. Usually this means the macro was only invoked conditionally. ``` This PR fixes this bug, and refactors indentation to make easier to spot similar bugs in the future. ACKs for top commit: Sjors: utACK a412813 fanquake: ACK a412813 - this fixes the bug described, and improves readability. Tree-SHA512: 4469dcc006690f38f93c3cdf8d15b76f5fc8ea76e87a1b5db5ee891dc9851f6ec539f2a6fd02a361aa76baa4f4b2b9fe8289137f5d9734ee5984f265cb131ef5
2 parents 3a8fc51 + a412813 commit 4f223e9

File tree

1 file changed

+51
-51
lines changed

1 file changed

+51
-51
lines changed

configure.ac

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,52 +1379,52 @@ if test "x$use_natpmp" != xno; then
13791379
fi
13801380

13811381
if test x$build_bitcoin_wallet$build_bitcoin_cli$build_bitcoin_tx$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench = xnonononononono; then
1382-
use_boost=no
1382+
use_boost=no
13831383
else
1384-
use_boost=yes
1384+
use_boost=yes
13851385
fi
13861386

13871387
if test x$use_boost = xyes; then
13881388

1389-
dnl Check for Boost headers
1390-
AX_BOOST_BASE([1.58.0],[],[AC_MSG_ERROR([Boost is not available!])])
1391-
if test x$want_boost = xno; then
1389+
dnl Check for Boost headers
1390+
AX_BOOST_BASE([1.58.0],[],[AC_MSG_ERROR([Boost is not available!])])
1391+
if test x$want_boost = xno; then
13921392
AC_MSG_ERROR([[only libbitcoinconsensus can be built without boost]])
1393-
fi
1394-
AX_BOOST_SYSTEM
1395-
AX_BOOST_FILESYSTEM
1396-
1397-
dnl Opt-in to Boost Process if external signer support is requested
1398-
if test "x$use_external_signer" != xno; then
1399-
AC_MSG_CHECKING(for Boost Process)
1400-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/process.hpp>]],
1401-
[[ boost::process::child* child = new boost::process::child; delete child; ]])],
1402-
[ AC_MSG_RESULT(yes)
1403-
AC_DEFINE([ENABLE_EXTERNAL_SIGNER],,[define if external signer support is enabled])
1404-
],
1405-
[ AC_MSG_ERROR([Boost::Process is required for external signer support, but not available!])]
1406-
)
1407-
fi
1408-
1409-
AM_CONDITIONAL([ENABLE_EXTERNAL_SIGNER], [test "x$use_external_signer" = "xyes"])
1393+
fi
1394+
AX_BOOST_SYSTEM
1395+
AX_BOOST_FILESYSTEM
1396+
1397+
dnl Opt-in to Boost Process if external signer support is requested
1398+
if test "x$use_external_signer" != xno; then
1399+
AC_MSG_CHECKING(for Boost Process)
1400+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <boost/process.hpp>]],
1401+
[[ boost::process::child* child = new boost::process::child; delete child; ]])],
1402+
[ AC_MSG_RESULT(yes)
1403+
AC_DEFINE([ENABLE_EXTERNAL_SIGNER],,[define if external signer support is enabled])
1404+
],
1405+
[ AC_MSG_ERROR([Boost::Process is required for external signer support, but not available!])]
1406+
)
1407+
fi
14101408

1411-
if test x$suppress_external_warnings != xno; then
1409+
if test x$suppress_external_warnings != xno; then
14121410
BOOST_CPPFLAGS=SUPPRESS_WARNINGS($BOOST_CPPFLAGS)
1413-
fi
1411+
fi
14141412

1415-
dnl Boost 1.56 through 1.62 allow using std::atomic instead of its own atomic
1416-
dnl counter implementations. In 1.63 and later the std::atomic approach is default.
1417-
m4_pattern_allow(DBOOST_AC_USE_STD_ATOMIC) dnl otherwise it's treated like a macro
1418-
BOOST_CPPFLAGS="-DBOOST_SP_USE_STD_ATOMIC -DBOOST_AC_USE_STD_ATOMIC $BOOST_CPPFLAGS"
1413+
dnl Boost 1.56 through 1.62 allow using std::atomic instead of its own atomic
1414+
dnl counter implementations. In 1.63 and later the std::atomic approach is default.
1415+
m4_pattern_allow(DBOOST_AC_USE_STD_ATOMIC) dnl otherwise it's treated like a macro
1416+
BOOST_CPPFLAGS="-DBOOST_SP_USE_STD_ATOMIC -DBOOST_AC_USE_STD_ATOMIC $BOOST_CPPFLAGS"
14191417

1420-
BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB"
1418+
BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB"
14211419
fi
14221420

1421+
AM_CONDITIONAL([ENABLE_EXTERNAL_SIGNER], [test "x$use_external_signer" = "xyes"])
1422+
14231423
dnl Check for reduced exports
14241424
if test x$use_reduce_exports = xyes; then
1425-
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[CXXFLAGS="$CXXFLAGS -fvisibility=hidden"],
1426-
[AC_MSG_ERROR([Cannot set hidden symbol visibility. Use --disable-reduce-exports.])],[[$CXXFLAG_WERROR]])
1427-
AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]],[RELDFLAGS="-Wl,--exclude-libs,ALL"],,[[$LDFLAG_WERROR]])
1425+
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[CXXFLAGS="$CXXFLAGS -fvisibility=hidden"],
1426+
[AC_MSG_ERROR([Cannot set hidden symbol visibility. Use --disable-reduce-exports.])],[[$CXXFLAG_WERROR]])
1427+
AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]],[RELDFLAGS="-Wl,--exclude-libs,ALL"],,[[$LDFLAG_WERROR]])
14281428
fi
14291429

14301430
if test x$use_tests = xyes; then
@@ -1435,25 +1435,25 @@ if test x$use_tests = xyes; then
14351435

14361436
if test x$use_boost = xyes; then
14371437

1438-
AX_BOOST_UNIT_TEST_FRAMEWORK
1439-
1440-
dnl Determine if -DBOOST_TEST_DYN_LINK is needed
1441-
AC_MSG_CHECKING([for dynamic linked boost test])
1442-
TEMP_LIBS="$LIBS"
1443-
LIBS="$LIBS $BOOST_LDFLAGS $BOOST_UNIT_TEST_FRAMEWORK_LIB"
1444-
TEMP_CPPFLAGS="$CPPFLAGS"
1445-
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
1446-
AC_LINK_IFELSE([AC_LANG_SOURCE([
1447-
#define BOOST_TEST_DYN_LINK
1448-
#define BOOST_TEST_MAIN
1449-
#include <boost/test/unit_test.hpp>
1450-
1451-
])],
1452-
[AC_MSG_RESULT(yes)]
1453-
[TESTDEFS="$TESTDEFS -DBOOST_TEST_DYN_LINK"],
1454-
[AC_MSG_RESULT(no)])
1455-
LIBS="$TEMP_LIBS"
1456-
CPPFLAGS="$TEMP_CPPFLAGS"
1438+
AX_BOOST_UNIT_TEST_FRAMEWORK
1439+
1440+
dnl Determine if -DBOOST_TEST_DYN_LINK is needed
1441+
AC_MSG_CHECKING([for dynamic linked boost test])
1442+
TEMP_LIBS="$LIBS"
1443+
LIBS="$LIBS $BOOST_LDFLAGS $BOOST_UNIT_TEST_FRAMEWORK_LIB"
1444+
TEMP_CPPFLAGS="$CPPFLAGS"
1445+
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
1446+
AC_LINK_IFELSE([AC_LANG_SOURCE([
1447+
#define BOOST_TEST_DYN_LINK
1448+
#define BOOST_TEST_MAIN
1449+
#include <boost/test/unit_test.hpp>
1450+
1451+
])],
1452+
[AC_MSG_RESULT(yes)]
1453+
[TESTDEFS="$TESTDEFS -DBOOST_TEST_DYN_LINK"],
1454+
[AC_MSG_RESULT(no)])
1455+
LIBS="$TEMP_LIBS"
1456+
CPPFLAGS="$TEMP_CPPFLAGS"
14571457

14581458
fi
14591459
fi

0 commit comments

Comments
 (0)