build: Do not define ENABLE_ZMQ when ZMQ is not available

A new behavior is consistent with the other optional dependencies.

The source code contains `#if ENABLE_ZMQ` lines only.
This commit is contained in:
Hennadii Stepanov 2023-05-18 10:48:48 +01:00
parent 4e8a7654f6
commit fa5831bd6f
No known key found for this signature in database
GPG key ID: 410108112E7EA81F
2 changed files with 5 additions and 8 deletions

View file

@ -38,7 +38,7 @@
/* Define to 1 to enable SQLite wallet */ /* Define to 1 to enable SQLite wallet */
#define USE_SQLITE 1 #define USE_SQLITE 1
/* Define to 1 to enable ZMQ functions */ /* Define this symbol to enable ZMQ functions */
#define ENABLE_ZMQ 1 #define ENABLE_ZMQ 1
/* define if external signer support is enabled (requires Boost::Process) */ /* define if external signer support is enabled (requires Boost::Process) */

View file

@ -1633,12 +1633,9 @@ dnl ZMQ check
if test "$use_zmq" = "yes"; then if test "$use_zmq" = "yes"; then
PKG_CHECK_MODULES([ZMQ], [libzmq >= 4], PKG_CHECK_MODULES([ZMQ], [libzmq >= 4],
AC_DEFINE([ENABLE_ZMQ], [1], [Define to 1 to enable ZMQ functions]), AC_DEFINE([ENABLE_ZMQ], [1], [Define this symbol to enable ZMQ functions]),
[AC_DEFINE([ENABLE_ZMQ], [0], [Define to 1 to enable ZMQ functions]) [AC_MSG_WARN([libzmq version 4.x or greater not found, disabling])
AC_MSG_WARN([libzmq version 4.x or greater not found, disabling])
use_zmq=no]) use_zmq=no])
else
AC_DEFINE_UNQUOTED([ENABLE_ZMQ], [0], [Define to 1 to enable ZMQ functions])
fi fi
if test "$use_zmq" = "yes"; then if test "$use_zmq" = "yes"; then
@ -1650,6 +1647,8 @@ if test "$use_zmq" = "yes"; then
esac esac
fi fi
AM_CONDITIONAL([ENABLE_ZMQ], [test "$use_zmq" = "yes"])
dnl libmultiprocess library check dnl libmultiprocess library check
libmultiprocess_found=no libmultiprocess_found=no
@ -1844,8 +1843,6 @@ if test "$bitcoin_enable_qt" != "no"; then
fi fi
fi fi
AM_CONDITIONAL([ENABLE_ZMQ], [test "$use_zmq" = "yes"])
AC_MSG_CHECKING([whether to build test_bitcoin]) AC_MSG_CHECKING([whether to build test_bitcoin])
if test "$use_tests" = "yes"; then if test "$use_tests" = "yes"; then
if test "$enable_fuzz" = "yes"; then if test "$enable_fuzz" = "yes"; then