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
This commit is contained in:
Ryan Bloom
1999-12-24 18:31:10 +00:00
parent 84f9b5d2c6
commit ef6a9f850c
3 changed files with 17 additions and 9 deletions

View 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

View 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( \

View 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