From: Amos Jeffries Date: Wed, 29 Apr 2009 14:12:05 +0000 (+1200) Subject: Bug 2650: configure requires epoll_ctl in libepoll when --enable-epoll used X-Git-Tag: SQUID_3_2_0_1~1028 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ca8b332c360c41cb6eb88234432649687cc86b0;p=thirdparty%2Fsquid.git Bug 2650: configure requires epoll_ctl in libepoll when --enable-epoll used --- diff --git a/configure.in b/configure.in index e291df894f..a983effc4d 100644 --- a/configure.in +++ b/configure.in @@ -1213,6 +1213,7 @@ esac dnl Enable epoll() disable_epoll= +force_epoll="no" AC_ARG_ENABLE(epoll, AC_HELP_STRING([--disable-epoll],[Disable Linux epoll(2) support.]), [ @@ -1220,11 +1221,7 @@ AC_ARG_ENABLE(epoll, yes) AC_MSG_WARN([Forcing epoll() to be enabled]) SELECT_TYPE="epoll" - dnl epoll requires header file and library to be installed - AC_CHECK_HEADERS([sys/epoll.h],[], - [ AC_MSG_ERROR([required sys/epoll.h header file is missing.]) ]) - AC_CHECK_LIB(epoll, epoll_ctl, [], - [ AC_MSG_ERROR([required libepoll library is missing.]) ]) + force_epoll="yes" ;; no) AC_MSG_WARN([Forcing epoll() to be disabled]) @@ -1232,20 +1229,28 @@ AC_ARG_ENABLE(epoll, ;; esac ]) -dnl epoll requires sys/epoll.h and libepoll +dnl auto-detect and verify epoll header and library present and working if test -z "$disable_epoll"; then + # Check for libepoll EPOLL_LIB= AC_CHECK_LIB(epoll, epoll_ctl, [EPOLL_LIBS="-lepoll"]) AC_SUBST(EPOLL_LIBS) + dnl on some systems it is provided by libc + dnl not to worry, the working test below will catch them + dnl and we don't want to force additional libraries + + # Check for epoll_ctl, may need -lepoll SAVED_LIBS="$LIBS" - LIBS="$LIBS $LIB_EPOLL" + LIBS="$LIBS $EPOLL_LIBS" AC_CHECK_FUNCS(epoll_ctl) LIBS="$SAVED_LIBS" - AC_CHECK_HEADERS([sys/epoll.h]) + dnl epoll requires sys/epoll.h + AC_CHECK_HEADERS([sys/epoll.h],[], + [ AC_MSG_ERROR([required sys/epoll.h header file is missing.]) ]) dnl Verify that epoll really works if test $ac_cv_func_epoll_ctl = yes; then @@ -1265,6 +1270,10 @@ int main(int argc, char **argv) } ], [ac_cv_epoll_works=yes], [ac_cv_epoll_works=no])) fi + + if test "$force_epoll" = "yes" && test "$ac_cv_epoll_works" = "no" ; then + AC_MSG_ERROR([Epoll does not work. Force-enabling it is not going to help.]) + fi fi dnl Disable HTTP violations