]> granicus.if.org Git - apache/commitdiff
Finish the MPM decision logic. This moves the threads checking stuff into
authorRyan Bloom <rbb@apache.org>
Fri, 24 Dec 1999 18:31:10 +0000 (18:31 +0000)
committerRyan Bloom <rbb@apache.org>
Fri, 24 Dec 1999 18:31:10 +0000 (18:31 +0000)
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

acinclude.m4
configure.in
server/mpm/config.m4

index 57c8bf78b9b45bda5b5d83e93308d9a800e45d15..9193a24d22d3f7c2a957279f0477de578913bc7a 100644 (file)
@@ -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
index bdf03dd91071505edd8b7e3a46822ca6e7ff0020..58205e3aa0fa1a870b80678f41675d81e3751422 100644 (file)
@@ -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( \
index 7ab84353e07c8d95f18708ed796be1b8b0faafa9..57a56bc89e766b1080d8f4f5bb72902f115f2a86 100644 (file)
@@ -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