1 dnl Check to see if we should use the included tevent
4 AC_ARG_WITH(included-tevent,
5 [AC_HELP_STRING([--with-included-tevent], [use bundled tevent library, not from system])],
6 [ INCLUDED_TEVENT=$withval ])
9 AC_SUBST(TEVENT_CFLAGS)
11 if test x"$INCLUDED_TEVENT" != x"yes" ; then
12 AC_CHECK_HEADERS(tevent.h)
13 AC_CHECK_LIB(tevent, tevent_context_init, [ TEVENT_LIBS="-ltevent" ])
14 AC_CHECK_DECLS([TEVENT_TRACE_BEFORE_WAIT],,, [[#include <tevent.h>]])
15 if test x"$ac_cv_header_tevent_h" = x"no" -o \
16 x"$ac_cv_lib_tevent_tevent_context_init" = x"no" -o \
17 x"$ac_cv_have_decl_TEVENT_TRACE_BEFORE_WAIT" = x"no" ; then
25 AC_MSG_CHECKING(whether to use included tevent)
26 AC_MSG_RESULT($INCLUDED_TEVENT)
27 if test x"$INCLUDED_TEVENT" != x"no" ; then
28 dnl find the tevent sources. This is meant to work both for
29 dnl standalone builds, and builds of packages using libtevent
31 teventpaths="$srcdir $srcdir/lib/tevent $srcdir/tevent $srcdir/../tevent"
32 for d in $teventpaths; do
33 if test -f "$d/tevent.c"; then
39 if test x"$teventdir" = "x"; then
40 AC_MSG_ERROR([cannot find tevent source in $teventpaths])
42 TEVENT_OBJ="tevent.o tevent_debug.o tevent_util.o"
43 TEVENT_OBJ="$TEVENT_OBJ tevent_fd.o tevent_timed.o tevent_immediate.o tevent_signal.o"
44 TEVENT_OBJ="$TEVENT_OBJ tevent_req.o tevent_wakeup.o tevent_queue.o"
45 TEVENT_OBJ="$TEVENT_OBJ tevent_standard.o tevent_select.o tevent_poll.o"
48 TEVENT_CFLAGS="-I$teventdir"
49 AC_SUBST(TEVENT_CFLAGS)
54 AC_CHECK_HEADERS(sys/epoll.h)
55 AC_CHECK_FUNCS(epoll_create)
56 if test x"$ac_cv_header_sys_epoll_h" = x"yes" -a x"$ac_cv_func_epoll_create" = x"yes"; then
57 TEVENT_OBJ="$TEVENT_OBJ tevent_epoll.o"
58 AC_DEFINE(HAVE_EPOLL, 1, [Whether epoll available])
61 tevent_num_signals_includes="$ac_includes_default
65 AC_CHECK_VALUEOF(NSIG, [$tevent_num_signals_includes])
67 test -n "$v" && test "$v" -gt "$tevent_num_signals" && {
70 AC_CHECK_VALUEOF(_NSIG, [$tevent_num_signals_includes])
71 v=$ac_cv_valueof__NSIG
72 test -n "$v" && test "$v" -gt "$tevent_num_signals" && {
75 AC_CHECK_VALUEOF(SIGRTMAX, [$tevent_num_signals_includes])
76 v=$ac_cv_valueof_SIGRTMAX
77 test -n "$v" && test "$v" -gt "$tevent_num_signals" && {
80 AC_CHECK_VALUEOF(SIGRTMIN, [$tevent_num_signals_includes])
81 v=$ac_cv_valueof_SIGRTMIN
85 test -n "$v" && test "$v" -gt "$tevent_num_signals" && {
88 AC_DEFINE_UNQUOTED(TEVENT_NUM_SIGNALS, $tevent_num_signals, [Max signal number value])
90 if test x"$VERSIONSCRIPT" != "x"; then
91 EXPORTSFILE=tevent.exports