2 |
AC_DEFUN([POLL_OR_SELECT], |
AC_DEFUN([POLL_OR_SELECT], |
3 |
[ |
[ |
4 |
AC_MSG_CHECKING(whether to use poll or select) |
AC_MSG_CHECKING(whether to use poll or select) |
5 |
AC_ARG_WITH(poll, |
AC_ARG_WITH(select, |
6 |
[ --with-poll Use poll], |
[ --with-select Use select instead of poll], |
7 |
[ |
[ |
8 |
if test "$withval" = "yes" ; then |
if test "$withval" = "yes" ; then |
9 |
AC_MSG_RESULT(trying poll) |
AC_MSG_RESULT(trying select) |
10 |
ac_x=1 |
ac_x=1 |
11 |
else |
else |
12 |
AC_MSG_RESULT(trying select) |
AC_MSG_RESULT(trying poll) |
13 |
ac_x=0 |
ac_x=0 |
14 |
fi |
fi |
15 |
], |
], |
16 |
[ |
[ |
17 |
AC_MSG_RESULT(trying select) |
AC_MSG_RESULT(trying poll) |
18 |
ac_x=0 |
ac_x=0 |
19 |
]) |
]) |
20 |
|
|
21 |
if test $ac_x = 1; then |
if test $ac_x = 0; then |
22 |
AC_CHECK_HEADERS(sys/poll.h) |
AC_CHECK_HEADERS(sys/poll.h) |
23 |
AC_CHECK_FUNCS(poll) |
AC_CHECK_FUNCS(poll) |
24 |
if test "x$ac_cv_func_poll" = "x"; then |
if test "x$ac_cv_func_poll" = "x"; then |
25 |
AC_MSG_ERROR(We attempted to find poll but could not. Please try again with --without-poll) |
AC_MSG_ERROR(We attempted to find poll but could not. Please try again with --with-select) |
26 |
fi |
fi |
27 |
BOA_ASYNC_IO="poll" |
BOA_ASYNC_IO="poll" |
28 |
else |
else |
29 |
AC_CHECK_HEADERS(sys/select.h) |
AC_CHECK_HEADERS(sys/select.h) |
30 |
AC_CHECK_FUNCS(select) |
AC_CHECK_FUNCS(select) |
31 |
if test "x$ac_cv_func_select" = "x"; then |
if test "x$ac_cv_func_select" = "x"; then |
32 |
AC_MSG_ERROR(We attempted to find select but could not. Please try again with --with-poll) |
AC_MSG_ERROR(We attempted to find select but could not. Please try again with --without-select) |
33 |
fi |
fi |
34 |
BOA_ASYNC_IO="select" |
BOA_ASYNC_IO="select" |
35 |
fi |
fi |