Skip to content

Commit bdece50

Browse files
committed
Merge pull request #6743
dd28089 autotools: move checking for zmq library to common area in configure.ac (Johnathan Corgan)
2 parents 0a5385b + dd28089 commit bdece50

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

configure.ac

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,16 @@ if test x$use_pkgconfig = xyes; then
676676
PKG_CHECK_MODULES([EVENT_PTHREADS], [libevent_pthreads],, [AC_MSG_ERROR(libevent_pthreads not found.)])
677677
fi
678678
fi
679+
680+
if test "x$use_zmq" = "xyes"; then
681+
PKG_CHECK_MODULES([ZMQ],[libzmq >= 4],
682+
[AC_DEFINE([ENABLE_ZMQ],[1],[Define to 1 to enable ZMQ functions])],
683+
[AC_DEFINE([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])
684+
AC_MSG_WARN([libzmq version 4.x or greater not found, disabling])
685+
use_zmq=no])
686+
else
687+
AC_DEFINE_UNQUOTED([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])
688+
fi
679689
]
680690
)
681691
else
@@ -693,6 +703,20 @@ else
693703
fi
694704
fi
695705

706+
if test "x$use_zmq" = "xyes"; then
707+
AC_CHECK_HEADER([zmq.h],
708+
[AC_DEFINE([ENABLE_ZMQ],[1],[Define to 1 to enable ZMQ functions])],
709+
[AC_MSG_WARN([zmq.h not found, disabling zmq support])
710+
use_zmq=no
711+
AC_DEFINE([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])])
712+
AC_CHECK_LIB([zmq],[zmq_ctx_shutdown],ZMQ_LIBS=-lzmq,
713+
[AC_MSG_WARN([libzmq >= 4.0 not found, disabling zmq support])
714+
use_zmq=no
715+
AC_DEFINE([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])])
716+
else
717+
AC_DEFINE_UNQUOTED([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])
718+
fi
719+
696720
BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],[PROTOBUF_LIBS=-lprotobuf], BITCOIN_QT_FAIL(libprotobuf not found)))
697721
if test x$use_qr != xno; then
698722
BITCOIN_QT_CHECK([AC_CHECK_LIB([qrencode], [main],[QR_LIBS=-lqrencode], [have_qrencode=no])])
@@ -824,20 +848,6 @@ if test x$bitcoin_enable_qt != xno; then
824848
fi
825849
fi
826850

827-
# conditional search for and use libzmq
828-
AC_MSG_CHECKING([whether to build ZMQ support])
829-
if test "x$use_zmq" = "xyes"; then
830-
AC_MSG_RESULT([yes])
831-
PKG_CHECK_MODULES([ZMQ],[libzmq >= 4],
832-
[AC_DEFINE([ENABLE_ZMQ],[1],[Define to 1 to enable ZMQ functions])],
833-
[AC_DEFINE([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])
834-
AC_MSG_WARN([libzmq version 4.x or greater not found, disabling])
835-
use_zmq=no])
836-
else
837-
AC_MSG_RESULT([no, --disable-zmq used])
838-
AC_DEFINE_UNQUOTED([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])
839-
fi
840-
841851
AM_CONDITIONAL([ENABLE_ZMQ], [test "x$use_zmq" = "xyes"])
842852

843853
AC_MSG_CHECKING([whether to build test_bitcoin])

0 commit comments

Comments
 (0)