summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2010-07-24 03:49:03 +0200
committerPatrick McHardy <kaber@trash.net>2010-07-24 03:49:03 +0200
commit292ac38165c3594505a2491dea0a5efeee0c7bd9 (patch)
tree69a2001308e1c5a2fc49b66a99c6dc8b7c05d57b /configure.ac
parent89bb432a5e985dcb952774bbdfd76aad1d8f0d3b (diff)
examples: support libev and fix build on Fedora
Check for and prefer libev over libevent and check for the location of the event.h file, which is contained in libev/event.h on Fedora. Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac16
1 files changed, 16 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index e8cc903..ab12a40 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,6 +32,14 @@ AC_CHECK_LIB([nl], [nl_socket_alloc], ,
AC_CHECK_LIB([nl-dect], [nl_dect_cluster_alloc], ,
AC_MSG_ERROR([No suitable version of libnl-dect found]))
+AC_CHECK_LIB(ev, event_init,
+ [EVENTLIB="-lev"],
+ AC_CHECK_LIB(event, event_init,
+ [EVENTLIB="-levent"],
+ AC_ERROR(libev or libevent not found)))
+EVENT_LDFLAGS=$EVENTLIB
+AC_SUBST(EVENT_LDFLAGS)
+
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_ASSERT
@@ -43,6 +51,14 @@ AC_CHECK_HEADERS([linux/dect.h linux/dect_netlink.h], ,
AC_MSG_ERROR([DECT kernel header files not found]),
[#include <sys/socket.h>])
+AC_CHECK_HEADER(event.h,
+ [EVENTINC="-include event.h"],
+ AC_CHECK_HEADER(libev/event.h,
+ [EVENTINC="-include libev/event.h"],
+ AC_MSG_ERROR([event.h not found])))
+EVENT_CFLAGS=$EVENTINC
+AC_SUBST(EVENT_CFLAGS)
+
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST