Skip to content

Instantly share code, notes, and snippets.

@sustrik
Created July 3, 2011 13:51
Show Gist options
  • Save sustrik/1062237 to your computer and use it in GitHub Desktop.
Save sustrik/1062237 to your computer and use it in GitHub Desktop.
# Force not to use eventfd
AC_ARG_ENABLE([eventfd], [AS_HELP_STRING([--disable-eventfd], [disable eventfd [default=no]])],
[disable_eventfd=yes], [disable_eventfd=no])
eventfd_headers="no"
eventfd_can_run="no"
if test "x$disable_eventfd" != "xyes"; then
# Check if we have eventfd.h header file.
AC_CHECK_HEADERS(sys/eventfd.h, [eventfd_headers=yes])
AC_MSG_CHECKING([for sys/eventfd.h functionality])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([[#include <sys/eventfd.h>
#include <assert.h>]],
[[int fd = eventfd (0, 0); assert (fd != -1);]])],
[eventfd_can_run=yes], [], eventfd_can_run=no)
AC_MSG_RESULT([$eventfd_can_run])
if test "x$eventfd_headers" = "xyes" -a "x$eventfd_can_run" = "xyes"; then
AC_DEFINE(ZMQ_HAVE_EVENTFD, 1,[Have eventfd extension.])
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment