@@ -14,6 +14,12 @@ AC_CONFIG_HEADERS([src/config/bitcoin-config.h])
14
14
AC_CONFIG_AUX_DIR ( [ build-aux] )
15
15
AC_CONFIG_MACRO_DIR ( [ build-aux/m4] )
16
16
17
+ 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] ) ] )
18
+ PKG_PROG_PKG_CONFIG
19
+ if test "x$PKG_CONFIG" = x; then
20
+ AC_MSG_ERROR ( [ pkg-config not found] )
21
+ fi
22
+
17
23
BITCOIN_DAEMON_NAME=bitcoind
18
24
BITCOIN_GUI_NAME=bitcoin-qt
19
25
BITCOIN_CLI_NAME=bitcoin-cli
@@ -560,13 +566,8 @@ AC_ARG_WITH([daemon],
560
566
[ build_bitcoind=$withval] ,
561
567
[ build_bitcoind=yes] )
562
568
563
- use_pkgconfig=yes
564
569
case $host in
565
570
*mingw*)
566
-
567
- dnl pkgconfig does more harm than good with MinGW
568
- use_pkgconfig=no
569
-
570
571
TARGET_OS=windows
571
572
AC_CHECK_LIB ( [ kernel32] , [ GetModuleFileNameA] ,, AC_MSG_ERROR ( libkernel32 missing ) )
572
573
AC_CHECK_LIB ( [ user32] , [ main] ,, AC_MSG_ERROR ( libuser32 missing ) )
@@ -670,16 +671,6 @@ case $host in
670
671
;;
671
672
esac
672
673
673
- if test x$use_pkgconfig = xyes; then
674
- 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. ) ] )
675
- m4_ifdef ( [ PKG_PROG_PKG_CONFIG] , [
676
- PKG_PROG_PKG_CONFIG
677
- if test x"$PKG_CONFIG" = "x"; then
678
- AC_MSG_ERROR ( pkg-config not found. )
679
- fi
680
- ] )
681
- fi
682
-
683
674
if test x$use_extended_functional_tests != xno; then
684
675
AC_SUBST ( EXTENDED_FUNCTIONAL_TESTS , -- extended )
685
676
fi
@@ -1303,115 +1294,66 @@ CPPFLAGS="$TEMP_CPPFLAGS"
1303
1294
1304
1295
fi
1305
1296
1306
- if test x$use_pkgconfig = xyes; then
1307
- : dnl
1308
- m4_ifdef (
1309
- [ PKG_CHECK_MODULES] ,
1310
- [
1311
- if test x$use_qr != xno; then
1312
- BITCOIN_QT_CHECK([ PKG_CHECK_MODULES([ QR] , [ libqrencode] , [ have_qrencode=yes] , [ have_qrencode=no] )] )
1313
- fi
1314
- if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench != xnonononono; then
1315
- PKG_CHECK_MODULES([ EVENT] , [ libevent >= 2.0.21] , [ use_libevent=yes] , [ AC_MSG_ERROR ( libevent version 2.0.21 or greater not found. ) ] )
1316
- if test x$TARGET_OS != xwindows; then
1317
- PKG_CHECK_MODULES([ EVENT_PTHREADS] , [ libevent_pthreads >= 2.0.21] ,, [ AC_MSG_ERROR ( libevent_pthreads version 2.0.21 or greater not found. ) ] )
1318
- fi
1319
- fi
1320
-
1321
- if test "x$use_zmq" = "xyes"; then
1322
- PKG_CHECK_MODULES([ ZMQ] ,[ libzmq >= 4] ,
1323
- [ AC_DEFINE ( [ ENABLE_ZMQ] ,[ 1] ,[ Define to 1 to enable ZMQ functions] ) ] ,
1324
- [ AC_DEFINE ( [ ENABLE_ZMQ] ,[ 0] ,[ Define to 1 to enable ZMQ functions] )
1325
- AC_MSG_WARN ( [ libzmq version 4.x or greater not found, disabling] )
1326
- use_zmq=no] )
1327
- else
1328
- AC_DEFINE_UNQUOTED ( [ ENABLE_ZMQ] ,[ 0] ,[ Define to 1 to enable ZMQ functions] )
1329
- fi
1330
- ]
1331
- )
1332
- else
1297
+ dnl libevent check
1333
1298
1334
- if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench != xnonononono; then
1335
- AC_CHECK_HEADER ( [ event2/event.h] , [ use_libevent=yes] , AC_MSG_ERROR ( libevent headers missing ) ,)
1336
- AC_CHECK_LIB ( [ event] ,[ main] ,EVENT_LIBS=-levent ,AC_MSG_ERROR ( libevent missing ) )
1337
- if test x$TARGET_OS != xwindows; then
1338
- AC_CHECK_LIB ( [ event_pthreads] ,[ main] ,EVENT_PTHREADS_LIBS=-levent_pthreads ,AC_MSG_ERROR ( libevent_pthreads missing ) )
1339
- fi
1299
+ if test x$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench != xnonononono; then
1300
+ PKG_CHECK_MODULES([ EVENT] , [ libevent >= 2.0.21] , [ use_libevent=yes] , [ AC_MSG_ERROR ( [ libevent version 2.0.21 or greater not found.] ) ] )
1301
+ if test x$TARGET_OS != xwindows; then
1302
+ PKG_CHECK_MODULES([ EVENT_PTHREADS] , [ libevent_pthreads >= 2.0.21] ,, [ AC_MSG_ERROR ( [ libevent_pthreads version 2.0.21 or greater not found.] ) ] )
1340
1303
fi
1304
+ fi
1341
1305
1342
- if test "x$use_zmq" = "xyes"; then
1343
- AC_CHECK_HEADER ( [ zmq.h] ,
1344
- [ AC_DEFINE ( [ ENABLE_ZMQ] ,[ 1] ,[ Define to 1 to enable ZMQ functions] ) ] ,
1345
- [ AC_MSG_WARN ( [ zmq.h not found, disabling zmq support] )
1346
- use_zmq=no
1347
- AC_DEFINE ( [ ENABLE_ZMQ] ,[ 0] ,[ Define to 1 to enable ZMQ functions] ) ] )
1348
- AC_CHECK_LIB ( [ zmq] ,[ zmq_ctx_shutdown] ,ZMQ_LIBS=-lzmq ,
1349
- [ AC_MSG_WARN ( [ libzmq >= 4.0 not found, disabling zmq support] )
1350
- use_zmq=no
1351
- AC_DEFINE ( [ ENABLE_ZMQ] ,[ 0] ,[ Define to 1 to enable ZMQ functions] ) ] )
1352
- else
1353
- AC_DEFINE_UNQUOTED ( [ ENABLE_ZMQ] ,[ 0] ,[ Define to 1 to enable ZMQ functions] )
1354
- fi
1306
+ dnl QR Code encoding library check
1355
1307
1356
- if test "x$use_zmq" = "xyes"; then
1357
- dnl Assume libzmq was built for static linking
1358
- case $host in
1359
- *mingw*)
1360
- ZMQ_CFLAGS="$ZMQ_CFLAGS -DZMQ_STATIC"
1361
- ;;
1362
- esac
1363
- fi
1308
+ if test "x$use_qr" != xno; then
1309
+ BITCOIN_QT_CHECK([ PKG_CHECK_MODULES([ QR] , [ libqrencode] , [ have_qrencode=yes] , [ have_qrencode=no] )] )
1310
+ fi
1364
1311
1365
- if test x$use_qr != xno; then
1366
- BITCOIN_QT_CHECK([ AC_CHECK_LIB ( [ qrencode] , [ main] ,[ QR_LIBS=-lqrencode] , [ have_qrencode=no] ) ] )
1367
- BITCOIN_QT_CHECK([ AC_CHECK_HEADER ( [ qrencode.h] ,, have_qrencode=no ) ] )
1368
- fi
1312
+ dnl ZMQ check
1313
+
1314
+ if test "x$use_zmq" = xyes; then
1315
+ PKG_CHECK_MODULES([ ZMQ] , [ libzmq >= 4] ,
1316
+ AC_DEFINE ( [ ENABLE_ZMQ] , [ 1] , [ Define to 1 to enable ZMQ functions] ) ,
1317
+ [ AC_DEFINE ( [ ENABLE_ZMQ] , [ 0] , [ Define to 1 to enable ZMQ functions] )
1318
+ AC_MSG_WARN ( [ libzmq version 4.x or greater not found, disabling] )
1319
+ use_zmq=no] )
1320
+ else
1321
+ AC_DEFINE_UNQUOTED ( [ ENABLE_ZMQ] , [ 0] , [ Define to 1 to enable ZMQ functions] )
1322
+ fi
1323
+
1324
+ if test "x$use_zmq" = xyes; then
1325
+ dnl Assume libzmq was built for static linking
1326
+ case $host in
1327
+ *mingw*)
1328
+ ZMQ_CFLAGS="$ZMQ_CFLAGS -DZMQ_STATIC"
1329
+ ;;
1330
+ esac
1369
1331
fi
1370
1332
1371
1333
dnl univalue check
1372
1334
1373
1335
need_bundled_univalue=yes
1374
-
1375
1336
if test x$build_bitcoin_wallet$build_bitcoin_cli$build_bitcoin_tx$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench = xnonononononono; then
1376
1337
need_bundled_univalue=no
1377
1338
else
1378
-
1379
- if test x$system_univalue != xno ; then
1380
- found_univalue=no
1381
- if test x$use_pkgconfig = xyes; then
1382
- : # NOP
1383
- m4_ifdef (
1384
- [ PKG_CHECK_MODULES] ,
1385
- [
1386
- PKG_CHECK_MODULES([ UNIVALUE] ,[ libunivalue >= 1.0.4] ,[ found_univalue=yes] ,[ true] )
1387
- ]
1388
- )
1389
- else
1390
- AC_CHECK_HEADER ( [ univalue.h] ,[
1391
- AC_CHECK_LIB ( [ univalue] , [ main] ,[
1392
- UNIVALUE_LIBS=-lunivalue
1393
- found_univalue=yes
1394
- ] ,[ true] )
1395
- ] ,[ true] )
1339
+ if test x$system_univalue != xno; then
1340
+ PKG_CHECK_MODULES([ UNIVALUE] , [ libunivalue >= 1.0.4] , [ found_univalue=yes] , [ found_univalue=no] )
1341
+ if test x$found_univalue = xyes; then
1342
+ system_univalue=yes
1343
+ need_bundled_univalue=no
1344
+ elif test x$system_univalue = xyes; then
1345
+ AC_MSG_ERROR ( [ univalue not found] )
1346
+ else
1347
+ system_univalue=no
1348
+ fi
1396
1349
fi
1397
1350
1398
- if test x$found_univalue = xyes ; then
1399
- system_univalue=yes
1400
- need_bundled_univalue=no
1401
- elif test x$system_univalue = xyes ; then
1402
- AC_MSG_ERROR ( [ univalue not found] )
1403
- else
1404
- system_univalue=no
1351
+ if test x$need_bundled_univalue = xyes; then
1352
+ UNIVALUE_CFLAGS='-I$(srcdir)/univalue/include'
1353
+ UNIVALUE_LIBS='univalue/libunivalue.la'
1405
1354
fi
1406
1355
fi
1407
1356
1408
- if test x$need_bundled_univalue = xyes ; then
1409
- UNIVALUE_CFLAGS='-I$(srcdir)/univalue/include'
1410
- UNIVALUE_LIBS='univalue/libunivalue.la'
1411
- fi
1412
-
1413
- fi
1414
-
1415
1357
AM_CONDITIONAL([ EMBEDDED_UNIVALUE] ,[ test x$need_bundled_univalue = xyes] )
1416
1358
AC_SUBST ( UNIVALUE_CFLAGS )
1417
1359
AC_SUBST ( UNIVALUE_LIBS )
@@ -1420,12 +1362,10 @@ dnl libmultiprocess library check
1420
1362
1421
1363
libmultiprocess_found=no
1422
1364
if test "x$with_libmultiprocess" = xyes || test "x$with_libmultiprocess" = xauto; then
1423
- if test "x$use_pkgconfig" = xyes; then
1424
- m4_ifdef ( [ PKG_CHECK_MODULES] , [ PKG_CHECK_MODULES([ LIBMULTIPROCESS] , [ libmultiprocess] , [
1425
- libmultiprocess_found=yes;
1426
- libmultiprocess_prefix=`$PKG_CONFIG --variable=prefix libmultiprocess`;
1427
- ] , [ true] )] )
1428
- fi
1365
+ m4_ifdef ( [ PKG_CHECK_MODULES] , [ PKG_CHECK_MODULES([ LIBMULTIPROCESS] , [ libmultiprocess] , [
1366
+ libmultiprocess_found=yes;
1367
+ libmultiprocess_prefix=`$PKG_CONFIG --variable=prefix libmultiprocess`;
1368
+ ] , [ true] )] )
1429
1369
elif test "x$with_libmultiprocess" != xno; then
1430
1370
AC_MSG_ERROR ( [ --with-libmultiprocess=$with_libmultiprocess value is not yes, auto, or no] )
1431
1371
fi
0 commit comments