@@ -13,6 +13,12 @@ AC_CONFIG_HEADERS([src/config/bitcoin-config.h])
13
13
AC_CONFIG_AUX_DIR ( [ build-aux] )
14
14
AC_CONFIG_MACRO_DIR ( [ build-aux/m4] )
15
15
16
+ 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] ) ] )
17
+ PKG_PROG_PKG_CONFIG
18
+ if test "x$PKG_CONFIG" = x; then
19
+ AC_MSG_ERROR ( [ pkg-config not found] )
20
+ fi
21
+
16
22
BITCOIN_DAEMON_NAME=dashd
17
23
BITCOIN_GUI_NAME=dash-qt
18
24
BITCOIN_CLI_NAME=dash-cli
@@ -92,6 +98,7 @@ AC_PATH_TOOL(AR, ar)
92
98
AC_PATH_TOOL ( RANLIB , ranlib )
93
99
AC_PATH_TOOL ( STRIP , strip )
94
100
AC_PATH_TOOL ( GCOV , gcov )
101
+ AC_PATH_TOOL ( LLVM_COV , llvm-cov )
95
102
AC_PATH_PROG ( LCOV , lcov )
96
103
dnl Python 3.8 is specified in .python-version and should be used if available, see doc/dependencies.md
97
104
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
460
467
AX_CHECK_COMPILE_FLAG ( [ -Wdate-time] ,[ WARN_CXXFLAGS="$WARN_CXXFLAGS -Wdate-time"] ,,[ [ $CXXFLAG_WERROR] ] )
461
468
AX_CHECK_COMPILE_FLAG ( [ -Wconditional-uninitialized] ,[ WARN_CXXFLAGS="$WARN_CXXFLAGS -Wconditional-uninitialized"] ,,[ [ $CXXFLAG_WERROR] ] )
462
469
AX_CHECK_COMPILE_FLAG ( [ -Wsign-compare] ,[ WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsign-compare"] ,,[ [ $CXXFLAG_WERROR] ] )
470
+ AX_CHECK_COMPILE_FLAG ( [ -Wduplicated-branches] ,[ WARN_CXXFLAGS="$WARN_CXXFLAGS -Wduplicated-branches"] ,,[ [ $CXXFLAG_WERROR] ] )
471
+ AX_CHECK_COMPILE_FLAG ( [ -Wduplicated-cond] ,[ WARN_CXXFLAGS="$WARN_CXXFLAGS -Wduplicated-cond"] ,,[ [ $CXXFLAG_WERROR] ] )
472
+ AX_CHECK_COMPILE_FLAG ( [ -Wlogical-op] ,[ WARN_CXXFLAGS="$WARN_CXXFLAGS -Wlogical-op"] ,,[ [ $CXXFLAG_WERROR] ] )
473
+ AX_CHECK_COMPILE_FLAG ( [ -Woverloaded-virtual] ,[ WARN_CXXFLAGS="$WARN_CXXFLAGS -Woverloaded-virtual"] ,,[ [ $CXXFLAG_WERROR] ] )
463
474
AX_CHECK_COMPILE_FLAG ( [ -Wsuggest-override] ,[ WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsuggest-override"] ,,[ [ $CXXFLAG_WERROR] ] ,
464
475
[ AC_LANG_SOURCE ( [ [ struct A { virtual void f(); }; struct B : A { void f() final; };] ] ) ] )
465
476
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],
646
657
[ build_bitcoind=$withval] ,
647
658
[ build_bitcoind=yes] )
648
659
649
- use_pkgconfig=yes
650
660
case $host in
651
661
*mingw*)
652
-
653
- dnl pkgconfig does more harm than good with MinGW
654
- use_pkgconfig=no
655
-
656
662
TARGET_OS=windows
657
663
AC_CHECK_LIB ( [ kernel32] , [ GetModuleFileNameA] ,, AC_MSG_ERROR ( libkernel32 missing ) )
658
664
AC_CHECK_LIB ( [ user32] , [ main] ,, AC_MSG_ERROR ( libuser32 missing ) )
@@ -710,16 +716,19 @@ case $host in
710
716
dnl It's safe to add these paths even if the functionality is disabled by
711
717
dnl the user (--without-wallet or --without-gui for example).
712
718
713
- qt5_prefix=$($BREW --prefix qt5 2>/dev/null)
714
- if $BREW list --versions berkeley-db4 >/dev/null && test "x$BDB_CFLAGS" = "x" && test "x$BDB_LIBS" = "x" && test "$use_bdb" != "no"; then
719
+ if test "x$use_bdb" != xno && $BREW list --versions berkeley-db4 >/dev/null && test "x$BDB_CFLAGS" = "x" && test "x$BDB_LIBS" = "x"; then
715
720
bdb_prefix=$($BREW --prefix berkeley-db4 2>/dev/null)
716
721
dnl This must precede the call to BITCOIN_FIND_BDB48 below.
717
722
BDB_CFLAGS="-I$bdb_prefix/include"
718
723
BDB_LIBS="-L$bdb_prefix/lib -ldb_cxx-4.8"
719
724
fi
720
- if test x$qt5_prefix != x; then
721
- PKG_CONFIG_PATH="$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
722
- export PKG_CONFIG_PATH
725
+
726
+ if test "x$use_sqlite" != xno && $BREW list --versions sqlite3 >/dev/null; then
727
+ export PKG_CONFIG_PATH="$($BREW --prefix sqlite3 2>/dev/null)/lib/pkgconfig:$PKG_CONFIG_PATH"
728
+ fi
729
+
730
+ if $BREW list --versions qt5 >/dev/null; then
731
+ export PKG_CONFIG_PATH="$($BREW --prefix qt5 2>/dev/null)/lib/pkgconfig:$PKG_CONFIG_PATH"
723
732
fi
724
733
725
734
gmp_prefix=$($BREW --prefix gmp 2>/dev/null)
@@ -801,16 +810,6 @@ case $host in
801
810
;;
802
811
esac
803
812
804
- if test x$use_pkgconfig = xyes; then
805
- 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. ) ] )
806
- m4_ifdef ( [ PKG_PROG_PKG_CONFIG] , [
807
- PKG_PROG_PKG_CONFIG
808
- if test x"$PKG_CONFIG" = "x"; then
809
- AC_MSG_ERROR ( pkg-config not found. )
810
- fi
811
- ] )
812
- fi
813
-
814
813
if test x$use_extended_functional_tests != xno; then
815
814
AC_SUBST ( EXTENDED_FUNCTIONAL_TESTS , -- extended )
816
815
fi
@@ -819,16 +818,37 @@ if test x$use_lcov = xyes; then
819
818
if test x$LCOV = x; then
820
819
AC_MSG_ERROR ( "lcov testing requested but lcov not found" )
821
820
fi
822
- if test x$GCOV = x; then
823
- AC_MSG_ERROR ( "lcov testing requested but gcov not found" )
824
- fi
825
821
if test x$PYTHON = x; then
826
822
AC_MSG_ERROR ( "lcov testing requested but python not found" )
827
823
fi
828
824
if test x$GENHTML = x; then
829
825
AC_MSG_ERROR ( "lcov testing requested but genhtml not found" )
830
826
fi
831
- LCOV="$LCOV --gcov-tool=$GCOV"
827
+
828
+ AC_MSG_CHECKING ( [ whether compiler is Clang] )
829
+ AC_PREPROC_IFELSE ( [ AC_LANG_SOURCE ( [ [
830
+ #if defined(__clang__) && defined(__llvm__)
831
+ // Compiler is Clang
832
+ #else
833
+ # error Compiler is not Clang
834
+ #endif
835
+ ] ] ) ] ,[
836
+ AC_MSG_RESULT ( [ yes] )
837
+ if test x$LLVM_COV = x; then
838
+ AC_MSG_ERROR ( [ lcov testing requested but llvm-cov not found] )
839
+ fi
840
+ COV_TOOL="$LLVM_COV gcov"
841
+ ] ,[
842
+ AC_MSG_RESULT ( [ no] )
843
+ if test x$GCOV = x; then
844
+ AC_MSG_ERROR ( [ lcov testing requested but gcov not found] )
845
+ fi
846
+ COV_TOOL="$GCOV"
847
+ ] )
848
+ AC_SUBST ( COV_TOOL )
849
+ AC_SUBST ( COV_TOOL_WRAPPER , "cov_tool_wrapper.sh" )
850
+ LCOV="$LCOV --gcov-tool $(pwd)/$COV_TOOL_WRAPPER"
851
+
832
852
AX_CHECK_LINK_FLAG ( [ [ --coverage] ] , [ LDFLAGS="$LDFLAGS --coverage"] ,
833
853
[ AC_MSG_ERROR ( "lcov testing requested but -- coverage linker flag does not work" ) ] )
834
854
AX_CHECK_COMPILE_FLAG ( [ --coverage] ,[ CXXFLAGS="$CXXFLAGS --coverage"] ,
@@ -1301,9 +1321,11 @@ fi
1301
1321
1302
1322
if test x$enable_wallet != xno; then
1303
1323
dnl Check for libdb_cxx only if wallet enabled
1304
- BITCOIN_FIND_BDB48
1305
- if test x$suppress_external_warnings != xno ; then
1324
+ if test "x$use_bdb" != "xno"; then
1325
+ BITCOIN_FIND_BDB48
1326
+ if test x$suppress_external_warnings != xno ; then
1306
1327
BDB_CPPFLAGS=SUPPRESS_WARNINGS($BDB_CPPFLAGS)
1328
+ fi
1307
1329
fi
1308
1330
1309
1331
dnl Check for sqlite3
1350
1372
dnl Check for libminiupnpc (optional)
1351
1373
if test x$use_upnp != xno; then
1352
1374
AC_CHECK_HEADERS (
1353
- [ miniupnpc/miniwget.h miniupnpc/ miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h] ,
1375
+ [ miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h] ,
1354
1376
[ AC_CHECK_LIB ( [ miniupnpc] , [ upnpDiscover] , [ MINIUPNPC_LIBS=-lminiupnpc] , [ have_miniupnpc=no] ) ] ,
1355
1377
[ have_miniupnpc=no]
1356
1378
)
@@ -1391,11 +1413,8 @@ fi
1391
1413
1392
1414
if test x$use_boost = xyes; then
1393
1415
1394
- dnl Minimum required Boost version
1395
- define ( MINIMUM_REQUIRED_BOOST , 1.64.0 )
1396
-
1397
- dnl Check for Boost libs
1398
- AX_BOOST_BASE ( [ MINIMUM_REQUIRED_BOOST] )
1416
+ dnl Check for Boost headers
1417
+ AX_BOOST_BASE ( [ 1.64.0] ,[ ] ,[ AC_MSG_ERROR ( [ Boost is not available!] ) ] )
1399
1418
if test x$want_boost = xno; then
1400
1419
AC_MSG_ERROR ( [ [ only libdashconsensus can be built without boost] ] )
1401
1420
fi
@@ -1450,69 +1469,40 @@ if test x$use_tests = xyes; then
1450
1469
fi
1451
1470
fi
1452
1471
1453
- if test x$use_pkgconfig = xyes; then
1454
- : dnl
1455
- m4_ifdef (
1456
- [ PKG_CHECK_MODULES] ,
1457
- [
1458
- if test x$use_qr != xno; then
1459
- BITCOIN_QT_CHECK([ PKG_CHECK_MODULES([ QR] , [ libqrencode] , [ have_qrencode=yes] , [ have_qrencode=no] )] )
1460
- fi
1461
- if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench != xnononono; then
1462
- PKG_CHECK_MODULES([ EVENT] , [ libevent >= 2.0.21] , [ use_libevent=yes] , [ AC_MSG_ERROR ( libevent version 2.0.21 or greater not found. ) ] )
1463
- if test x$TARGET_OS != xwindows; then
1464
- PKG_CHECK_MODULES([ EVENT_PTHREADS] , [ libevent_pthreads >= 2.0.21] ,, [ AC_MSG_ERROR ( libevent_pthreads version 2.0.21 or greater not found. ) ] )
1465
- fi
1466
- fi
1467
-
1468
- if test "x$use_zmq" = "xyes"; then
1469
- PKG_CHECK_MODULES([ ZMQ] ,[ libzmq >= 4] ,
1470
- [ AC_DEFINE ( [ ENABLE_ZMQ] ,[ 1] ,[ Define to 1 to enable ZMQ functions] ) ] ,
1471
- [ AC_DEFINE ( [ ENABLE_ZMQ] ,[ 0] ,[ Define to 1 to enable ZMQ functions] )
1472
- AC_MSG_WARN ( [ libzmq version 4.x or greater not found, disabling] )
1473
- use_zmq=no] )
1474
- else
1475
- AC_DEFINE_UNQUOTED ( [ ENABLE_ZMQ] ,[ 0] ,[ Define to 1 to enable ZMQ functions] )
1476
- fi
1477
- ]
1478
- )
1479
- else
1472
+ dnl libevent check
1480
1473
1481
- if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench != xnonononono; then
1482
- AC_CHECK_HEADER ( [ event2/event.h] , [ use_libevent=yes] , AC_MSG_ERROR ( libevent headers missing ) ,)
1483
- AC_CHECK_LIB ( [ event] ,[ main] ,EVENT_LIBS=-levent ,AC_MSG_ERROR ( libevent missing ) )
1484
- if test x$TARGET_OS != xwindows; then
1485
- AC_CHECK_LIB ( [ event_pthreads] ,[ main] ,EVENT_PTHREADS_LIBS=-levent_pthreads ,AC_MSG_ERROR ( libevent_pthreads missing ) )
1486
- fi
1474
+ if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench != xnonononono; then
1475
+ PKG_CHECK_MODULES([ EVENT] , [ libevent >= 2.0.21] , [ use_libevent=yes] , [ AC_MSG_ERROR ( [ libevent version 2.0.21 or greater not found.] ) ] )
1476
+ if test x$TARGET_OS != xwindows; then
1477
+ PKG_CHECK_MODULES([ EVENT_PTHREADS] , [ libevent_pthreads >= 2.0.21] ,, [ AC_MSG_ERROR ( [ libevent_pthreads version 2.0.21 or greater not found.] ) ] )
1487
1478
fi
1479
+ fi
1488
1480
1489
- if test "x$use_zmq" = "xyes"; then
1490
- AC_CHECK_HEADER ( [ zmq.h] ,
1491
- [ AC_DEFINE ( [ ENABLE_ZMQ] ,[ 1] ,[ Define to 1 to enable ZMQ functions] ) ] ,
1492
- [ AC_MSG_WARN ( [ zmq.h not found, disabling zmq support] )
1493
- use_zmq=no
1494
- AC_DEFINE ( [ ENABLE_ZMQ] ,[ 0] ,[ Define to 1 to enable ZMQ functions] ) ] )
1495
- AC_CHECK_LIB ( [ zmq] ,[ zmq_ctx_shutdown] ,ZMQ_LIBS=-lzmq ,
1496
- [ AC_MSG_WARN ( [ libzmq >= 4.0 not found, disabling zmq support] )
1497
- use_zmq=no
1498
- AC_DEFINE ( [ ENABLE_ZMQ] ,[ 0] ,[ Define to 1 to enable ZMQ functions] ) ] )
1499
- else
1500
- AC_DEFINE_UNQUOTED ( [ ENABLE_ZMQ] ,[ 0] ,[ Define to 1 to enable ZMQ functions] )
1501
- fi
1481
+ dnl QR Code encoding library check
1502
1482
1503
- if test "x$use_zmq" = "xyes"; then
1504
- dnl Assume libzmq was built for static linking
1505
- case $host in
1506
- *mingw*)
1507
- ZMQ_CFLAGS="$ZMQ_CFLAGS -DZMQ_STATIC"
1508
- ;;
1509
- esac
1510
- fi
1483
+ if test "x$use_qr" != xno; then
1484
+ BITCOIN_QT_CHECK([ PKG_CHECK_MODULES([ QR] , [ libqrencode] , [ have_qrencode=yes] , [ have_qrencode=no] )] )
1485
+ fi
1511
1486
1512
- if test x$use_qr != xno; then
1513
- BITCOIN_QT_CHECK([ AC_CHECK_LIB ( [ qrencode] , [ main] ,[ QR_LIBS=-lqrencode] , [ have_qrencode=no] ) ] )
1514
- BITCOIN_QT_CHECK([ AC_CHECK_HEADER ( [ qrencode.h] ,, have_qrencode=no ) ] )
1515
- fi
1487
+ dnl ZMQ check
1488
+
1489
+ if test "x$use_zmq" = xyes; then
1490
+ PKG_CHECK_MODULES([ ZMQ] , [ libzmq >= 4] ,
1491
+ AC_DEFINE ( [ ENABLE_ZMQ] , [ 1] , [ Define to 1 to enable ZMQ functions] ) ,
1492
+ [ AC_DEFINE ( [ ENABLE_ZMQ] , [ 0] , [ Define to 1 to enable ZMQ functions] )
1493
+ AC_MSG_WARN ( [ libzmq version 4.x or greater not found, disabling] )
1494
+ use_zmq=no] )
1495
+ else
1496
+ AC_DEFINE_UNQUOTED ( [ ENABLE_ZMQ] , [ 0] , [ Define to 1 to enable ZMQ functions] )
1497
+ fi
1498
+
1499
+ if test "x$use_zmq" = xyes; then
1500
+ dnl Assume libzmq was built for static linking
1501
+ case $host in
1502
+ *mingw*)
1503
+ ZMQ_CFLAGS="$ZMQ_CFLAGS -DZMQ_STATIC"
1504
+ ;;
1505
+ esac
1516
1506
fi
1517
1507
1518
1508
dnl check if libgmp is present
0 commit comments