From: Ryan Bloom Date: Fri, 24 Dec 1999 18:31:10 +0000 (+0000) Subject: Finish the MPM decision logic. This moves the threads checking stuff into X-Git-Tag: 1.3.10~51 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ef6a9f850c911b5f3a5d84a586694e728ce74993;p=apache Finish the MPM decision logic. This moves the threads checking stuff into the mpm directory where it belongs. It also adds logic so that if threads aren't detected, we automatically choose to use the prefork mpm. Lastly, I also cleaned up a variable name to make it more consistent with the other variables used in our configure script. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84365 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/acinclude.m4 b/acinclude.m4 index 57c8bf78b9..9193a24d22 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -113,10 +113,10 @@ int main() { int data = 1; return pthread_create(&thd, NULL, thread_routine, &data); } ], [ - THREADS_WORKING="yes" + apache_threads_working="yes" ], [ - THREADS_WORKING="no" - ], THREADS_WORKING="no" ) ] ) + apache_threads_working="no" + ], apache_threads_working="no" ) ] ) define(APACHE_CHECK_THREADS, [dnl cflags_orig="$CFLAGS" @@ -126,11 +126,11 @@ define(APACHE_CHECK_THREADS, [dnl CFLAGS="$test_cflag $cflags_orig" LDFLAGS="$test_ldflag $ldflags_orig" THREAD_TEST() - if test "$THREADS_WORKING" = "yes"; then + if test "$apache_threads_working" = "yes"; then break fi done - if test "$THREADS_WORKING" = "yes"; then + if test "$apache_threads_working" = "yes"; then threads_result="Updating CFLAGS and LDFLAGS" break fi diff --git a/configure.in b/configure.in index bdf03dd910..58205e3aa0 100644 --- a/configure.in +++ b/configure.in @@ -73,10 +73,6 @@ AC_TYPE_PID_T dnl ## Check for library functions -AC_MSG_CHECKING([for which threading library to use]) -APACHE_CHECK_THREADS('' -pthread -D_REENTRANT, '' -lpthread -lc_r) -AC_MSG_RESULT("$threads_result") - dnl See Comment #Spoon AC_CHECK_FUNCS( \ diff --git a/server/mpm/config.m4 b/server/mpm/config.m4 index 7ab84353e0..57a56bc89e 100644 --- a/server/mpm/config.m4 +++ b/server/mpm/config.m4 @@ -14,6 +14,18 @@ AC_ARG_WITH(mpm, AC_MSG_RESULT(No MPM specified. Using pthread) ]) +AC_MSG_CHECKING([for which threading library to use]) +APACHE_CHECK_THREADS('' -pthread -D_REENTRANT, '' -lpthread -lc_r) +AC_MSG_RESULT("$threads_result") + +AC_MSG_CHECKING([to ensure I can compile the selected MPM]) +if test "$apache_threads_working" = "no" && "$apache_cv_mpm" != "prefork"; then +AC_MSG_RESULT([can't compile selected MPM because there are no threads, defaulting to prefork]) + apache_cv_mpm="prefork" +else +AC_MSG_RESULT([OK]) +fi + APACHE_OUTPUT(modules/mpm/Makefile) MPM_NAME=$apache_cv_mpm MPM_DIR=modules/mpm/$MPM_NAME