Browse Source

Make ZMQ optional in build.

master
Con Kolivas 5 years ago
parent
commit
6cea319f08
  1. 7
      configure.ac
  2. 6
      src/stratifier.c

7
configure.ac

@ -75,10 +75,10 @@ JANSSON_LIBS="jansson-2.10/src/.libs/libjansson.a"
AC_SUBST(JANSSON_LIBS) AC_SUBST(JANSSON_LIBS)
AC_SEARCH_LIBS(clock_nanosleep, rt, , "Error: Required library rt not found." && exit 1) AC_SEARCH_LIBS(clock_nanosleep, rt, , echo "Error: Required library rt not found." && exit 1)
AC_SEARCH_LIBS(exp, m, , echo "Error: Required library math not found." && exit 1) AC_SEARCH_LIBS(exp, m, , echo "Error: Required library math not found." && exit 1)
AC_SEARCH_LIBS(pthread_mutex_trylock, pthread, , "Error: Required library pthreads not found." && exit 1) AC_SEARCH_LIBS(pthread_mutex_trylock, pthread, , echo "Error: Required library pthreads not found." && exit 1)
AC_SEARCH_LIBS(zmq_socket, zmq, , "Error: Required library zmq not found." && exit 1) AC_SEARCH_LIBS(zmq_socket, zmq, ZMQ=yes, ZMQ=no)
AC_OUTPUT([Makefile] [src/Makefile]) AC_OUTPUT([Makefile] [src/Makefile])
@ -87,6 +87,7 @@ LDFLAGS="${LDFLAGS} -Wl,--as-needed"
echo echo
echo "Compilation............: make (or gmake)" echo "Compilation............: make (or gmake)"
echo " YASM (Intel ASM).....: $YASM" echo " YASM (Intel ASM).....: $YASM"
echo " ZMQ..................: $ZMQ"
echo " CPPFLAGS.............: $CPPFLAGS" echo " CPPFLAGS.............: $CPPFLAGS"
echo " CFLAGS...............: $CFLAGS" echo " CFLAGS...............: $CFLAGS"
echo " LDFLAGS..............: $LDFLAGS" echo " LDFLAGS..............: $LDFLAGS"

6
src/stratifier.c

@ -19,7 +19,10 @@
#include <math.h> #include <math.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#ifdef HAVE_ZMQ_H
#include <zmq.h> #include <zmq.h>
#endif
#include "ckpool.h" #include "ckpool.h"
#include "libckpool.h" #include "libckpool.h"
@ -8648,6 +8651,7 @@ static void read_poolstats(ckpool_t *ckp, int *tvsec_diff)
static void *zmqnotify(void *arg) static void *zmqnotify(void *arg)
{ {
#ifdef HAVE_ZMQ_H
ckpool_t *ckp = arg; ckpool_t *ckp = arg;
sdata_t *sdata = ckp->sdata; sdata_t *sdata = ckp->sdata;
void *context, *notify; void *context, *notify;
@ -8709,6 +8713,8 @@ static void *zmqnotify(void *arg)
zmq_close(notify); zmq_close(notify);
zmq_ctx_destroy (context); zmq_ctx_destroy (context);
#endif
pthread_detach(pthread_self());
return NULL; return NULL;
} }

Loading…
Cancel
Save