From 2336e1f170842b8a93a3036b9204ae92a9c5d89a Mon Sep 17 00:00:00 2001 From: KIU Shueng Chuan Date: Sun, 3 Jun 2018 11:55:26 +0800 Subject: [PATCH] Problem: not able to use wepoll in configure script Solution: add wepoll as a polling system --- Makefile.am | 5 +++++ acinclude.m4 | 10 +++++++++- configure.ac | 2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 354d0492..31d7c5fe 100644 --- a/Makefile.am +++ b/Makefile.am @@ -257,6 +257,11 @@ src_libzmq_la_SOURCES = \ src/zap_client.hpp \ src/zmq_draft.h +if USE_WEPOLL +src_libzmq_la_SOURCES += \ + external/wepoll/wepoll.c +endif + if USE_TWEETNACL src_libzmq_la_SOURCES += \ src/tweetnacl.c \ diff --git a/acinclude.m4 b/acinclude.m4 index 891d9cfe..1993d340 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1052,7 +1052,7 @@ AC_DEFUN([LIBZMQ_CHECK_POLLER], [{ # Allow user to override poller autodetection AC_ARG_WITH([poller], [AS_HELP_STRING([--with-poller], - [choose I/O thread polling system manually. Valid values are 'kqueue', 'epoll', 'devpoll', 'pollset', 'poll', 'select', or 'auto'. [default=auto]])]) + [choose I/O thread polling system manually. Valid values are 'kqueue', 'epoll', 'devpoll', 'pollset', 'poll', 'select', 'wepoll', or 'auto'. [default=auto]])]) # Allow user to override poller autodetection AC_ARG_WITH([api_poller], @@ -1134,6 +1134,12 @@ AC_DEFUN([LIBZMQ_CHECK_POLLER], [{ poller_found=1 ]) ;; + wepoll) + # wepoll can only be manually selected + AC_MSG_NOTICE([Using 'wepoll' I/O thread polling system]) + AC_DEFINE(ZMQ_IOTHREAD_POLLER_USE_EPOLL, 1, [Use 'epoll' I/O thread polling system]) + poller_found=1 + ;; esac test $poller_found -eq 1 && break done @@ -1146,6 +1152,8 @@ AC_DEFUN([LIBZMQ_CHECK_POLLER], [{ if test "x$with_api_poller" == "xauto"; then if test $poller == "select"; then api_poller=select + elif test $poller == "wepoll"; then + api_poller=select else api_poller=poll fi diff --git a/configure.ac b/configure.ac index ef58b700..8f199986 100644 --- a/configure.ac +++ b/configure.ac @@ -507,6 +507,8 @@ AM_CONDITIONAL(USE_LIBSODIUM, test "$curve_library" = "libsodium") AM_CONDITIONAL(USE_TWEETNACL, test "$curve_library" = "tweetnacl") AM_CONDITIONAL(HAVE_CURVE, test "x$curve_library" != "x") +AM_CONDITIONAL(USE_WEPOLL, test "$poller" = "wepoll") + # build using pgm have_pgm_library="no"