]> granicus.if.org Git - apache/commitdiff
Improve hack to "determine" if APR supports thread-safe pollsets by hiding the
authorJeff Trawick <trawick@apache.org>
Sat, 14 Nov 2009 13:01:43 +0000 (13:01 +0000)
committerJeff Trawick <trawick@apache.org>
Sat, 14 Nov 2009 13:01:43 +0000 (13:01 +0000)
presence of kqueue() on Leopard, matching APR's configuration.

Event and Simple no longer report that they are supported on Leopard, resolving
a broken default config file with --enable-mpms-shared=all on that platform.
(Event was loaded by default in httpd.conf, and it failed at startup when it
failed to obtain a thread-safe pollset.)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@836165 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/config.m4
server/mpm/event/config.m4
server/mpm/simple/config.m4

index e7b47aad2495938d71090a2a23ed7f2172e8eb9a..0b263cbc568598758dc7eb66daefeacaf09e4bb7 100644 (file)
@@ -18,16 +18,25 @@ case $host in
 esac
 
 dnl See if APR supports APR_POLLSET_THREADSAFE.
-dnl XXX This hack tests for the underlying functions used by APR when it
-dnl XXX supports APR_POLLSET_THREADSAFE.
-dnl FIXME with a run-time check for
+dnl XXX This hack tests for the underlying functions used by APR when it supports
+dnl XXX APR_POLLSET_THREADSAFE, and duplicates APR's Darwin version check.
+dnl A run-time check for
 dnl     apr_pollset_create(,,APR_POLLSET_THREADSAFE) == APR_SUCCESS
-AC_CHECK_FUNCS(kqueue port_create epoll_create)
-if test "$ac_cv_func_kqueue$ac_cv_func_port_create$ac_cv_func_epoll_create" != "nonono"; then
-    have_threadsafe_pollset=yes
-else
-    have_threadsafe_pollset=no
-fi
+dnl would be great but an in-tree apr (srclib/apr) hasn't been built yet.
+
+AC_CACHE_CHECK([whether APR supports thread-safe pollsets], [ac_cv_have_threadsafe_pollset], [
+    case $host in
+        *-apple-darwin[[1-9]].*)
+            APR_SETIFNULL(ac_cv_func_kqueue, [no])
+            ;;
+    esac
+    AC_CHECK_FUNCS(kqueue port_create epoll_create)
+    if test "$ac_cv_func_kqueue$ac_cv_func_port_create$ac_cv_func_epoll_create" != "nonono"; then
+        ac_cv_have_threadsafe_pollset=yes
+    else
+        ac_cv_have_threadsafe_pollset=no
+    fi
+])
 
 dnl See if this is a forking platform w.r.t. MPMs
 case $host in
index 4b7888e1afb1e09c68069acc2c3a87f97bab4876..351f1acf4bd7b3d3a4087821a57e161a6634cd10 100644 (file)
@@ -5,7 +5,7 @@ elif test $ac_cv_define_APR_HAS_THREADS != yes; then
     AC_MSG_RESULT(no - APR does not support threads)
 elif test $have_threaded_sig_graceful != yes; then
     AC_MSG_RESULT(no - SIG_GRACEFUL cannot be used with a threaded MPM)
-elif test $have_threadsafe_pollset != yes; then
+elif test $ac_cv_have_threadsafe_pollset != yes; then
     AC_MSG_RESULT(no - APR_POLLSET_THREADSAFE is not supported)
 else
     AC_MSG_RESULT(yes)
index caeda79f0a81b32735c78bf57d90466e128686a0..82500d278aa78326de1cf55cd96a80159f83acd4 100644 (file)
@@ -5,7 +5,7 @@ elif test $ac_cv_define_APR_HAS_THREADS != yes; then
     AC_MSG_RESULT(no - APR does not support threads)
 elif test $have_threaded_sig_graceful != yes; then
     AC_MSG_RESULT(no - SIG_GRACEFUL cannot be used with a threaded MPM)
-elif test $have_threadsafe_pollset != yes; then
+elif test $ac_cv_have_threadsafe_pollset != yes; then
     AC_MSG_RESULT(no - APR_POLLSET_THREADSAFE is not supported)
 else
     AC_MSG_RESULT(yes)