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