diff --git a/configure.ac b/configure.ac index 7d8de406..fbfed893 100644 --- a/configure.ac +++ b/configure.ac @@ -75,10 +75,10 @@ JANSSON_LIBS="jansson-2.10/src/.libs/libjansson.a" 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(pthread_mutex_trylock, pthread, , "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(pthread_mutex_trylock, pthread, , echo "Error: Required library pthreads not found." && exit 1) +AC_SEARCH_LIBS(zmq_socket, zmq, ZMQ=yes, ZMQ=no) AC_OUTPUT([Makefile] [src/Makefile]) @@ -87,6 +87,7 @@ LDFLAGS="${LDFLAGS} -Wl,--as-needed" echo echo "Compilation............: make (or gmake)" echo " YASM (Intel ASM).....: $YASM" +echo " ZMQ..................: $ZMQ" echo " CPPFLAGS.............: $CPPFLAGS" echo " CFLAGS...............: $CFLAGS" echo " LDFLAGS..............: $LDFLAGS" diff --git a/src/stratifier.c b/src/stratifier.c index 8be6a86a..33046f98 100644 --- a/src/stratifier.c +++ b/src/stratifier.c @@ -19,7 +19,10 @@ #include #include #include + +#ifdef HAVE_ZMQ_H #include +#endif #include "ckpool.h" #include "libckpool.h" @@ -8648,6 +8651,7 @@ static void read_poolstats(ckpool_t *ckp, int *tvsec_diff) static void *zmqnotify(void *arg) { +#ifdef HAVE_ZMQ_H ckpool_t *ckp = arg; sdata_t *sdata = ckp->sdata; void *context, *notify; @@ -8709,6 +8713,8 @@ static void *zmqnotify(void *arg) zmq_close(notify); zmq_ctx_destroy (context); +#endif + pthread_detach(pthread_self()); return NULL; }