From 1e5a48f5217edf874d5771b29ceb7680a930d4b3 Mon Sep 17 00:00:00 2001 From: m <415fox@gmail.com> Date: Fri, 27 Jan 2012 15:24:47 -0800 Subject: [PATCH] Epoll is default for cross-compile. For regular-compile, test kernel (run) support. --- acinclude.m4 | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 19d6a2a6..9c35fc90 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -625,8 +625,9 @@ kqueue(); }]) dnl ################################################################################ -dnl # LIBZMQ_CHECK_POLLER_EPOLL([action-if-found], [action-if-not-found]) # -dnl # Checks epoll polling system # +dnl # LIBZMQ_CHECK_POLLER_EPOLL_RUN([action-if-found], [action-if-not-found]) # +dnl # Checks epoll polling system can actually run # +dnl # For cross-compile, only requires that epoll can link # dnl ################################################################################ AC_DEFUN([LIBZMQ_CHECK_POLLER_EPOLL], [{ AC_RUN_IFELSE( @@ -643,7 +644,21 @@ return(r < 0); )], [libzmq_cv_have_poller_epoll="yes" ; $1], [libzmq_cv_have_poller_epoll="no" ; $2], - [libzmq_cv_have_poller_epoll="no" ; $2]) + [ + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [ +#include + ], + [[ + struct epoll_event t_ev; + epoll_create(10); + ]] + )], + [libzmq_cv_have_poller_epoll="yes" ; $1], + [libzmq_cv_have_poller_epoll="no" ; $2]) + + ]) }]) dnl ################################################################################