From: Amos Jeffries Date: Sun, 3 May 2009 11:57:25 +0000 (+1200) Subject: Bug 2650: configure requires epoll_ctl in libepoll when --enable-epoll used X-Git-Tag: SQUID_3_1_0_8~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fb892de8c86f39da93ce2c7c9ef28a9ca43dcf86;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 ef499393a5..81b887c7ee 100644 --- a/configure.in +++ b/configure.in @@ -1196,6 +1196,7 @@ esac dnl Enable epoll() disable_epoll= +force_epoll="no" AC_ARG_ENABLE(epoll, AC_HELP_STRING([--disable-epoll],[Disable Linux epoll(2) support.]), [ @@ -1203,11 +1204,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]) @@ -1215,19 +1212,26 @@ 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" + dnl epoll requires sys/epoll.h AC_CHECK_HEADERS([sys/epoll.h]) dnl Verify that epoll really works @@ -1248,6 +1252,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