Add missing checks in m4/ and update configure.ac.
[tinc] / m4 / libevent.m4
1 dnl Check to find the libevent headers/libraries
2
3 AC_DEFUN([tinc_LIBEVENT],
4 [
5   AC_ARG_WITH(libevent,
6     AS_HELP_STRING([--with-libevent=DIR], [libevent base directory, or:]),
7     [libevent="$withval"
8      CPPFLAGS="$CPPFLAGS -I$withval/include"
9      LDFLAGS="$LDFLAGS -L$withval/lib"]
10   )
11
12   AC_ARG_WITH(libevent-include,
13     AS_HELP_STRING([--with-libevent-include=DIR], [libevent headers directory]),
14     [libevent_include="$withval"
15      CPPFLAGS="$CPPFLAGS -I$withval"]
16   )
17
18   AC_ARG_WITH(libevent-lib,
19     AS_HELP_STRING([--with-libevent-lib=DIR], [libevent library directory]),
20     [libevent_lib="$withval"
21      LDFLAGS="$LDFLAGS -L$withval"]
22   )
23
24   AC_CHECK_HEADERS(event.h,
25     [],
26     [AC_MSG_ERROR("libevent headers files not found."); break]
27   )
28
29   AC_CHECK_LIB(event, event_init,
30     [LIBS="$LIBS -levent"],
31     [AC_MSG_ERROR("libevent library not found."); break]
32   )
33 ])