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