1 dnl find the tevent sources. This is meant to work both for
2 dnl standalone builds, and builds of packages using libtevent
3 if test x"$teventdir" = "x"; then
5 teventpaths="$srcdir $srcdir/../lib/tevent $srcdir/tevent $srcdir/../tevent"
6 for d in $teventpaths; do
7 if test -f "$d/tevent.c"; then
13 if test x"$teventdir" = "x"; then
14 AC_MSG_ERROR([cannot find libtevent source in $teventpaths])
18 TEVENT_OBJ="tevent.o tevent_select.o tevent_signal.o tevent_timed.o tevent_standard.o tevent_debug.o tevent_util.o"
19 AC_LIBREPLACE_NETWORK_CHECKS
21 SMB_ENABLE(TEVENT_EPOLL, NO)
22 SMB_ENABLE(TEVENT_AIO, NO)
23 AC_CHECK_HEADERS(sys/epoll.h)
24 AC_CHECK_FUNCS(epoll_create)
25 if test x"$ac_cv_header_sys_epoll_h" = x"yes" -a x"$ac_cv_func_epoll_create" = x"yes"; then
26 TEVENT_OBJ="$TEVENT_OBJ tevent_epoll.o"
27 SMB_ENABLE(TEVENT_EPOLL,YES)
28 AC_DEFINE(HAVE_EPOLL, 1, [Whether epoll available])
30 # check for native Linux AIO interface
31 AC_CHECK_HEADERS(libaio.h)
32 AC_CHECK_LIB_EXT(aio, AIO_LIBS, io_getevents)
33 if test x"$ac_cv_header_libaio_h" = x"yes" -a x"$ac_cv_lib_ext_aio_io_getevents" = x"yes";then
34 TEVENT_OBJ="$TEVENT_OBJ tevent_aio.o"
35 SMB_ENABLE(TEVENT_AIO,YES)
36 AC_DEFINE(HAVE_LINUX_AIO, 1, [Whether Linux AIO is available])
41 SMB_EXT_LIB(LIBAIO_LINUX, $AIO_LIBS)
43 TEVENT_CFLAGS="-I$teventdir"
44 AC_SUBST(TEVENT_CFLAGS)
46 TEVENT_LIBS="$AIO_LIBS"