| 24 |
|
AC_ARG_ENABLE([kqueue], [AS_HELP_STRING([--enable-kqueue], [Force kqueue usage.])], [desired_iopoll_mechanism="kqueue"]) |
| 25 |
|
AC_ARG_ENABLE([epoll], [AS_HELP_STRING([--enable-epoll], [Force epoll usage.])], [desired_iopoll_mechanism="epoll"]) |
| 26 |
|
AC_ARG_ENABLE([devpoll],[AS_HELP_STRING([--enable-devpoll],[Force devpoll usage.])],[desired_iopoll_mechanism="devpoll"]) |
| 27 |
– |
AC_ARG_ENABLE([rtsigio],[AS_HELP_STRING([--enable-rtsigio],[Force rtsigio usage.])],[desired_iopoll_mechanism="rtsigio"]) |
| 27 |
|
AC_ARG_ENABLE([poll], [AS_HELP_STRING([--enable-poll], [Force poll usage.])], [desired_iopoll_mechanism="poll"]) |
| 28 |
|
AC_ARG_ENABLE([select], [AS_HELP_STRING([--enable-select], [Force select usage.])], [desired_iopoll_mechanism="select"]) |
| 29 |
|
dnl }}} |
| 84 |
|
AC_DEFINE([HAVE_SYS_DEVPOLL_H],[1],[Define to 1 if you have the <sys/devpoll.h> header file.]) |
| 85 |
|
fi |
| 86 |
|
dnl }}} |
| 88 |
– |
dnl {{{ check for rtsigio mechanism support |
| 89 |
– |
iopoll_mechanism_rtsigio=4 |
| 90 |
– |
AC_DEFINE_UNQUOTED([__IOPOLL_MECHANISM_RTSIGIO],[$iopoll_mechanism_rtsigio],[rtsigio mechanism]) |
| 91 |
– |
AC_RUN_IFELSE([AC_LANG_PROGRAM([[ |
| 92 |
– |
#define _GNU_SOURCE |
| 93 |
– |
#include <fcntl.h> |
| 94 |
– |
static unsigned int have_f_setsig = 0; |
| 95 |
– |
]], [[ |
| 96 |
– |
#ifdef F_SETSIG |
| 97 |
– |
have_f_setsig = 1; |
| 98 |
– |
#endif |
| 99 |
– |
return have_f_setsig == 0; |
| 100 |
– |
]])], [is_rtsigio_mechanism_available="yes"],[is_rtsigio_mechanism_available="no"]) |
| 101 |
– |
dnl }}} |
| 87 |
|
dnl {{{ check for poll mechanism support |
| 88 |
< |
iopoll_mechanism_poll=5 |
| 88 |
> |
iopoll_mechanism_poll=4 |
| 89 |
|
AC_DEFINE_UNQUOTED([__IOPOLL_MECHANISM_POLL],[$iopoll_mechanism_poll],[poll mechanism]) |
| 90 |
|
AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([poll])],[is_poll_mechanism_available="yes"],[is_poll_mechanism_available="no"]) |
| 91 |
|
dnl }}} |
| 92 |
|
dnl {{{ check for select mechanism support |
| 93 |
< |
iopoll_mechanism_select=6 |
| 93 |
> |
iopoll_mechanism_select=5 |
| 94 |
|
AC_DEFINE_UNQUOTED([__IOPOLL_MECHANISM_SELECT],[$iopoll_mechanism_select],[select mechanism]) |
| 95 |
|
AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([select])],[is_select_mechanism_available="yes"],[is_select_mechanism_available="no"]) |
| 96 |
|
dnl }}} |
| 97 |
|
dnl {{{ determine the optimal mechanism |
| 98 |
|
optimal_iopoll_mechanism="none" |
| 99 |
< |
for mechanism in "kqueue" "epoll" "devpoll" "rtsigio" "poll" "select" ; do # order is important |
| 99 |
> |
for mechanism in "kqueue" "epoll" "devpoll" "poll" "select" ; do # order is important |
| 100 |
|
eval "is_optimal_iopoll_mechanism_available=\$is_${mechanism}_mechanism_available" |
| 101 |
|
if test "$is_optimal_iopoll_mechanism_available" = "yes" ; then |
| 102 |
|
optimal_iopoll_mechanism="$mechanism" |