From 6d42b6697bc5293f77999df5552bbfa9760bd167 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 9 Oct 2014 21:18:24 +0900 Subject: [PATCH] examples: Disable tiny-nghttpd if timerfd_create is not available --- configure.ac | 10 +++++++++- examples/Makefile.am | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 21cc32b5..f78aef77 100644 --- a/configure.ac +++ b/configure.ac @@ -477,10 +477,18 @@ AC_CHECK_FUNCS([ \ timegm \ ]) +# timerfd_create was added in linux kernel 2.6.25 + +AC_CHECK_FUNC([timerfd_create], + [have_timerfd_create=yes], [have_timerfd_create=no]) + + # Checks for epoll availability, primarily for examples/tiny-nghttpd AX_HAVE_EPOLL([have_epoll=yes], [have_epoll=no]) -AM_CONDITIONAL([HAVE_EPOLL], [ test "x${have_epoll}" = "xyes" ]) +AM_CONDITIONAL([ENABLE_TINY_NGHTTPD], + [ test "x${have_epoll}" = "xyes" && + test "x${have_timerfd_create}" = "xyes"]) dnl Windows library for winsock2 case "${host}" in diff --git a/examples/Makefile.am b/examples/Makefile.am index 11715c60..0dc4dfb7 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -49,13 +49,13 @@ libevent_server_SOURCES = libevent-server.c deflate_SOURCES = deflate.c -if HAVE_EPOLL +if ENABLE_TINY_NGHTTPD noinst_PROGRAMS += tiny-nghttpd tiny_nghttpd_SOURCES = tiny-nghttpd.c -endif # HAVE_EPOLL +endif # ENABLE_TINY_NGHTTPD if ENABLE_ASIO_LIB