summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2010-11-12 07:04:58 +0100
committerPatrick McHardy <kaber@trash.net>2010-11-12 07:04:58 +0100
commitc52d892c62be8ee7bdff4e0af5b11cbf16f65e1c (patch)
tree5a8d54066ca9ab12335bdadd9d3936bd6130b095 /configure.ac
parenta53a5440f94274a67fa94612ce582d272d6840a1 (diff)
build: verify that event.h and event library are compatible
libev contains an libevent compat header file that at least on Debian is only installed optionally. Make sure event.h and the event library match since their respective struct event definitions don't match. Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac27
1 files changed, 27 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index d17dda0..e761c80 100644
--- a/configure.ac
+++ b/configure.ac
@@ -84,6 +84,33 @@ then
fi
AC_SUBST(CONFIG_BACKTRACE)
+CFLAGS_KEEP=$CFLAGS
+CFLAGS=$EVENT_CFLAGS
+if [[ "$EVENT_LDFLAGS" == "-levent" ]]; then
+ AC_MSG_CHECKING([checking whether event.h is compatible with libevent])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([[
+ #ifdef EV_H_
+ #error
+ #endif
+ ]])],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_ERROR([incompatible event.h header for libevent])]
+ )
+else
+ AC_MSG_CHECKING([checking whether event.h is compatible with libev])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([[
+ #ifndef EV_H_
+ #error
+ #endif
+ ]])],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_ERROR([incompatible event.h header for libev])]
+ )
+fi
+CFLAGS=$CFLAGS_KEEP
+
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST