]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2424. [port] configure now probes for a working epoll
authorMark Andrews <marka@isc.org>
Fri, 22 Aug 2008 13:26:42 +0000 (13:26 +0000)
committerMark Andrews <marka@isc.org>
Fri, 22 Aug 2008 13:26:42 +0000 (13:26 +0000)
                        implementation.  Allow the use of kqueue,
                        epoll and /dev/poll to be selected at compile
                        time. [RT #18277]

CHANGES
configure
configure.in

diff --git a/CHANGES b/CHANGES
index 4f0cf8b34392951dd459cc3cc1398f0aa5c0a992..f2f0706f1923421fcd81d4c50184ba4ed95637c1 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+2424.  [port]          configure now probes for a working epoll
+                       implementation.  Allow the use of kqueue,
+                       epoll and /dev/poll to be selected at compile
+                       time. [RT #18277]
+                       
 2422.  [bug]           Handle the special return value of a empty node as
                        if it was a NXRRSET in the validator. [RT #18447]
 
index 62307259bdf56d7ab94dd5653c2b5ea042e2b402..123d3e9034e58a5bb78af0f195d17c864e5692e9 100755 (executable)
--- a/configure
+++ b/configure
@@ -14,7 +14,7 @@
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 #
-# $Id: configure,v 1.284.2.19.2.79 2008/08/05 07:24:40 marka Exp $
+# $Id: configure,v 1.284.2.19.2.80 2008/08/22 13:26:42 marka Exp $
 #
 # Portions Copyright (C) 1996-2001  Nominum, Inc.
 #
@@ -29,7 +29,7 @@
 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
 # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-# From configure.in Revision: 1.294.2.23.2.87 .
+# From configure.in Revision: 1.294.2.23.2.88 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.61.
 #
@@ -1594,6 +1594,9 @@ if test -n "$ac_init_help"; then
 Optional Features:
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-kqueue         use BSD kqueue when available [default=yes]
+  --enable-epoll          use Linux epoll when available [default=yes]
+  --enable-devpoll        use /dev/poll when available [default=yes]
   --enable-openssl-version-check
                           Check OpenSSL Version [default=yes]
   --enable-threads     enable multithreading
@@ -5215,7 +5218,16 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 #
 # check if we have kqueue
 #
-{ echo "$as_me:$LINENO: checking for kqueue" >&5
+# Check whether --enable-kqueue was given.
+if test "${enable_kqueue+set}" = set; then
+  enableval=$enable_kqueue; want_kqueue="$enableval"
+else
+  want_kqueue="yes"
+fi
+
+case $want_kqueue in
+yes)
+       { echo "$as_me:$LINENO: checking for kqueue" >&5
 echo $ECHO_N "checking for kqueue... $ECHO_C" >&6; }
 if test "${ac_cv_func_kqueue+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5302,9 +5314,14 @@ else
   ac_cv_have_kqueue=no
 fi
 
-case $ac_cv_have_kqueue in
-yes)
-       ISC_PLATFORM_HAVEKQUEUE="#define ISC_PLATFORM_HAVEKQUEUE 1"
+       case $ac_cv_have_kqueue in
+       yes)
+               ISC_PLATFORM_HAVEKQUEUE="#define ISC_PLATFORM_HAVEKQUEUE 1"
+               ;;
+       *)
+               ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
+               ;;
+       esac
        ;;
 *)
        ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
@@ -5313,12 +5330,26 @@ esac
 
 
 #
-# check if we have epoll
+# check if we have epoll.  Linux kernel 2.4 has epoll_create() which fails,
+# so we need to try running the code, not just test its existence.
 #
-{ echo "$as_me:$LINENO: checking for epoll_create" >&5
-echo $ECHO_N "checking for epoll_create... $ECHO_C" >&6; }
-if test "${ac_cv_func_epoll_create+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+# Check whether --enable-epoll was given.
+if test "${enable_epoll+set}" = set; then
+  enableval=$enable_epoll; want_epoll="$enableval"
+else
+  want_epoll="yes"
+fi
+
+case $want_epoll in
+yes)
+       { echo "$as_me:$LINENO: checking epoll support" >&5
+echo $ECHO_N "checking epoll support... $ECHO_C" >&6; }
+       if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -5326,85 +5357,52 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define epoll_create to an innocuous variant, in case <limits.h> declares epoll_create.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define epoll_create innocuous_epoll_create
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char epoll_create (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
 
-#undef epoll_create
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char epoll_create ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_epoll_create || defined __stub___epoll_create
-choke me
-#endif
-
-int
-main ()
-{
-return epoll_create ();
-  ;
-  return 0;
+#include <sys/epoll.h>
+int main() {
+       if (epoll_create(1) < 0)
+               return (1);
+       return (0);
 }
+
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
+rm -f conftest$ac_exeext
 if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_link") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  ac_cv_func_epoll_create=yes
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+       ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"
 else
-  echo "$as_me: failed program was:" >&5
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_func_epoll_create=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+( exit $ac_status )
+{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+       ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_epoll_create" >&5
-echo "${ECHO_T}$ac_cv_func_epoll_create" >&6; }
-if test $ac_cv_func_epoll_create = yes; then
-  ac_cv_have_epoll=yes
-else
-  ac_cv_have_epoll=no
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
-case $ac_cv_have_epoll in
-yes)
-       ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"
+
        ;;
 *)
        ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"
@@ -5415,6 +5413,15 @@ esac
 #
 # check if we support /dev/poll
 #
+# Check whether --enable-devpoll was given.
+if test "${enable_devpoll+set}" = set; then
+  enableval=$enable_devpoll; want_devpoll="$enableval"
+else
+  want_devpoll="yes"
+fi
+
+case $want_devpoll in
+yes)
 
 for ac_header in sys/devpoll.h
 do
@@ -5559,6 +5566,11 @@ fi
 
 done
 
+       ;;
+*)
+       ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
+       ;;
+esac
 
 
 #
@@ -9513,7 +9525,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 9516 "configure"' > conftest.$ac_ext
+  echo '#line 9528 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -11635,11 +11647,11 @@ else
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11638: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11650: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:11642: \$? = $ac_status" >&5
+   echo "$as_me:11654: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -11878,11 +11890,11 @@ else
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11881: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11893: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:11885: \$? = $ac_status" >&5
+   echo "$as_me:11897: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -11938,11 +11950,11 @@ else
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:11941: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:11953: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:11945: \$? = $ac_status" >&5
+   echo "$as_me:11957: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -14086,7 +14098,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 14089 "configure"
+#line 14101 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -14184,7 +14196,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 14187 "configure"
+#line 14199 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -16377,11 +16389,11 @@ else
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16380: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16392: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:16384: \$? = $ac_status" >&5
+   echo "$as_me:16396: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -16437,11 +16449,11 @@ else
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16440: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16452: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:16444: \$? = $ac_status" >&5
+   echo "$as_me:16456: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -17765,7 +17777,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 17768 "configure"
+#line 17780 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -17863,7 +17875,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 17866 "configure"
+#line 17878 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18700,11 +18712,11 @@ else
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:18703: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:18715: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:18707: \$? = $ac_status" >&5
+   echo "$as_me:18719: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -18760,11 +18772,11 @@ else
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:18763: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:18775: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:18767: \$? = $ac_status" >&5
+   echo "$as_me:18779: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -20794,11 +20806,11 @@ else
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:20797: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:20809: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:20801: \$? = $ac_status" >&5
+   echo "$as_me:20813: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -21037,11 +21049,11 @@ else
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:21040: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:21052: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:21044: \$? = $ac_status" >&5
+   echo "$as_me:21056: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
@@ -21097,11 +21109,11 @@ else
    -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:21100: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:21112: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:21104: \$? = $ac_status" >&5
+   echo "$as_me:21116: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -23245,7 +23257,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 23248 "configure"
+#line 23260 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -23343,7 +23355,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 23346 "configure"
+#line 23358 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index 69b555d9f1c92a70bf660aed6640884fab07dd5b..5b1e209871415b01fc4f44b3018b8f520f60788d 100644 (file)
@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(1)dnl
 esyscmd([sed "s/^/# /" COPYRIGHT])dnl
 AC_DIVERT_POP()dnl
 
-AC_REVISION($Revision: 1.294.2.23.2.87 $)
+AC_REVISION($Revision: 1.294.2.23.2.88 $)
 
 AC_INIT(lib/dns/name.c)
 AC_PREREQ(2.13)
@@ -312,10 +312,20 @@ AC_SUBST(ISC_PLATFORM_HAVELIFCONF)
 #
 # check if we have kqueue
 #
-AC_CHECK_FUNC(kqueue, ac_cv_have_kqueue=yes, ac_cv_have_kqueue=no)
-case $ac_cv_have_kqueue in
+AC_ARG_ENABLE(kqueue,
+       [  --enable-kqueue         use BSD kqueue when available [[default=yes]]],
+             want_kqueue="$enableval",  want_kqueue="yes")
+case $want_kqueue in
 yes)
-       ISC_PLATFORM_HAVEKQUEUE="#define ISC_PLATFORM_HAVEKQUEUE 1"
+       AC_CHECK_FUNC(kqueue, ac_cv_have_kqueue=yes, ac_cv_have_kqueue=no)
+       case $ac_cv_have_kqueue in
+       yes)
+               ISC_PLATFORM_HAVEKQUEUE="#define ISC_PLATFORM_HAVEKQUEUE 1"
+               ;;
+       *)
+               ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
+               ;;
+       esac
        ;;
 *)
        ISC_PLATFORM_HAVEKQUEUE="#undef ISC_PLATFORM_HAVEKQUEUE"
@@ -324,12 +334,27 @@ esac
 AC_SUBST(ISC_PLATFORM_HAVEKQUEUE)
 
 #
-# check if we have epoll
+# check if we have epoll.  Linux kernel 2.4 has epoll_create() which fails,
+# so we need to try running the code, not just test its existence.
 #
-AC_CHECK_FUNC(epoll_create, ac_cv_have_epoll=yes, ac_cv_have_epoll=no)
-case $ac_cv_have_epoll in
+AC_ARG_ENABLE(epoll,
+       [  --enable-epoll          use Linux epoll when available [[default=yes]]],
+             want_epoll="$enableval",  want_epoll="yes")
+case $want_epoll in
 yes)
-       ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"
+       AC_MSG_CHECKING(epoll support)
+       AC_TRY_RUN([
+#include <sys/epoll.h>
+int main() {
+       if (epoll_create(1) < 0)
+               return (1);
+       return (0);
+}
+],
+       [AC_MSG_RESULT(yes)
+       ISC_PLATFORM_HAVEEPOLL="#define ISC_PLATFORM_HAVEEPOLL 1"],
+       [AC_MSG_RESULT(no)
+       ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"])
        ;;
 *)
        ISC_PLATFORM_HAVEEPOLL="#undef ISC_PLATFORM_HAVEEPOLL"
@@ -340,11 +365,21 @@ AC_SUBST(ISC_PLATFORM_HAVEEPOLL)
 #
 # check if we support /dev/poll
 #
-AC_CHECK_HEADERS(sys/devpoll.h,
-ISC_PLATFORM_HAVEDEVPOLL="#define ISC_PLATFORM_HAVEDEVPOLL 1"
-,
-ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
-)
+AC_ARG_ENABLE(devpoll,
+       [  --enable-devpoll        use /dev/poll when available [[default=yes]]],
+             want_devpoll="$enableval",  want_devpoll="yes")
+case $want_devpoll in
+yes)
+       AC_CHECK_HEADERS(sys/devpoll.h,
+       ISC_PLATFORM_HAVEDEVPOLL="#define ISC_PLATFORM_HAVEDEVPOLL 1"
+       ,
+       ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
+       )
+       ;;
+*)
+       ISC_PLATFORM_HAVEDEVPOLL="#undef ISC_PLATFORM_HAVEDEVPOLL"
+       ;;
+esac
 AC_SUBST(ISC_PLATFORM_HAVEDEVPOLL)
 
 #