Skip to content

Commit a252c39

Browse files
committed
build: add check for zeromq CURVE support
Problem: when zeromq is configured with --disable-curve, the flux broker will fail to initialize. Add a configure time check that zmq_curve_keypair() can be run successfully. It fails with ENOTSUPP if CURVE support is lacking. Fixes #6151
1 parent f296a19 commit a252c39

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

config/x_ac_zeromq.m4

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,32 @@ AC_DEFUN([X_AC_ZEROMQ], [
44
55
PKG_CHECK_MODULES([ZMQ], [libzmq >= 4.0.4])
66
7+
old_CFLAGS=$CFLAGS
8+
CFLAGS="$CFLAGS $ZMQ_CFLAGS"
9+
10+
old_LIBS=$LIBS
11+
LIBS="$LIBS $ZMQ_LIBS"
12+
13+
AC_MSG_CHECKING([whether zeromq has CURVE support])
14+
AC_RUN_IFELSE([
15+
AC_LANG_SOURCE([[
16+
#include <zmq.h>
17+
int main () {
18+
char pub[41];
19+
char sec[41];
20+
if (zmq_curve_keypair (pub, sec) < 0) return 1;
21+
return 0;
22+
}
23+
]])],
24+
[have_zmq_curve_support=yes; AC_MSG_RESULT([yes])],
25+
[AC_MSG_RESULT([no])]
26+
)
27+
28+
CFLAGS=$old_CFLAGS
29+
LIBS=$old_LIBS
30+
31+
AS_IF([test "x$have_zmq_curve_support" != "xyes"],
32+
[AC_MSG_ERROR([zeromq CURVE/libsodium support is required])]
33+
)
734
]
835
)

0 commit comments

Comments
 (0)