From: Jeff Trawick Date: Sat, 14 Nov 2009 13:01:43 +0000 (+0000) Subject: Improve hack to "determine" if APR supports thread-safe pollsets by hiding the X-Git-Tag: 2.3.4~52 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=330b3351d68a1c3d04a23e9be642712af0f1a1db;p=apache Improve hack to "determine" if APR supports thread-safe pollsets by hiding the 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 --- diff --git a/server/mpm/config.m4 b/server/mpm/config.m4 index e7b47aad24..0b263cbc56 100644 --- a/server/mpm/config.m4 +++ b/server/mpm/config.m4 @@ -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 diff --git a/server/mpm/event/config.m4 b/server/mpm/event/config.m4 index 4b7888e1af..351f1acf4b 100644 --- a/server/mpm/event/config.m4 +++ b/server/mpm/event/config.m4 @@ -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) diff --git a/server/mpm/simple/config.m4 b/server/mpm/simple/config.m4 index caeda79f0a..82500d278a 100644 --- a/server/mpm/simple/config.m4 +++ b/server/mpm/simple/config.m4 @@ -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)