1 dnl Copyright (C) 2009 Sun Microsystems
2 dnl This file is free software; Sun Microsystems
3 dnl gives unlimited permission to copy and/or distribute it,
4 dnl with or without modifications, as long as this notice is preserved.
6 #--------------------------------------------------------------------
8 #--------------------------------------------------------------------
11 AC_DEFUN([_PANDORA_SEARCH_LIBEVENT],[
12 AC_REQUIRE([AC_LIB_PREFIX])
14 AC_LIB_HAVE_LINKFLAGS(event,,
16 #include <sys/types.h>
21 struct bufferevent bev;
22 bufferevent_settimeout(&bev, 1, 1);
24 event_loop(EVLOOP_ONCE);
27 AM_CONDITIONAL(HAVE_LIBEVENT, [test "x${ac_cv_libevent}" = "xyes"])
29 AS_IF([test "x${ac_cv_libevent}" = "xyes"],[
31 LIBS="${LIBS} ${LTLIBEVENT}"
32 AC_CHECK_FUNCS(event_base_new)
33 AC_CHECK_FUNCS(event_base_free)
34 AC_CHECK_FUNCS(event_base_get_method)
39 AC_DEFUN([_PANDORA_HAVE_LIBEVENT],[
41 AC_ARG_ENABLE([libevent],
42 [AS_HELP_STRING([--disable-libevent],
43 [Build with libevent support @<:@default=on@:>@])],
44 [ac_enable_libevent="$enableval"],
45 [ac_enable_libevent="yes"])
47 _PANDORA_SEARCH_LIBEVENT
51 AC_DEFUN([PANDORA_HAVE_LIBEVENT],[
52 AC_REQUIRE([_PANDORA_HAVE_LIBEVENT])
55 AC_DEFUN([_PANDORA_REQUIRE_LIBEVENT],[
56 ac_enable_libevent="yes"
57 _PANDORA_SEARCH_LIBEVENT
59 AS_IF([test x$ac_cv_libevent = xno],[
60 AC_MSG_ERROR([libevent is required for ${PACKAGE}. On Debian this can be found in libevent-dev. On RedHat this can be found in libevent-devel.])
64 AC_DEFUN([PANDORA_REQUIRE_LIBEVENT],[
65 AC_REQUIRE([_PANDORA_REQUIRE_LIBEVENT])