1 AC_MSG_CHECKING(which MPM to use)
3 [ --with-mpm=MPM Choose the process model for Apache to use.
4 MPM={dexter,mpmt_beos,mpmt_pthread,prefork,spmt_os2}],[
8 APACHE_MPM=mpmt_pthread
9 PLAT=`$ac_config_guess`
10 PLAT=`$ac_config_sub $PLAT`
13 APACHE_MPM=mpmt_beos;;
19 AC_MSG_RESULT($APACHE_MPM)
21 apache_cv_mpm=$APACHE_MPM
23 if test "$apache_cv_mpm" = "mpmt_pthread" -o "$apache_cv_mpm" = "dexter"; then
25 AC_MSG_CHECKING([for which threading library to use])
26 AC_MSG_RESULT($threads_result)
28 if test "$pthreads_working" = "no"; then
29 AC_MSG_RESULT(The currently selected MPM requires pthreads which your system seems to lack)
30 AC_MSG_CHECKING(checking for replacement)
31 AC_MSG_RESULT(prefork selected)
36 APACHE_CHECK_SIGWAIT_ONE_ARG
38 APACHE_FAST_OUTPUT(modules/mpm/Makefile)
40 MPM_NAME=$apache_cv_mpm
41 MPM_DIR=modules/mpm/$MPM_NAME
42 MPM_LIB=$MPM_DIR/lib${MPM_NAME}.la
44 if test "$mpm_explicit" = "no"; then
45 if test "$MPM_NAME" = "prefork" ; then
47 MPM_FAKE_NAME=prefork.c
48 EXTRA_CFLAGS="$EXTRA_CFLAGS -DPREFORK"
50 ac_cv_enable_threads="no"
54 dnl The MPM_FAKE_NAME allow the mpmt MPM to emulate all of the MPMs without
55 dnl Apache actually knowing it. The problem is IfModule. IfModule uses
56 dnl the C file's name to know if the module is loaded. Without this change
57 dnl mpmt always shows up as mpmt.c, and we can't distinguish between all
58 dnl of the emulated MPMs.
60 dnl This fixes that by creating a soft link that has the name of the
61 dnl desired MPM to mpmt.c. Now, Apache can search for the specified MPM
62 dnl and actually find it.
63 test -d modules/mpm/mpmt || $srcdir/helpers/mkdir.sh modules/mpm/mpmt
64 if test "$MPM_NAME" = "mpmt_pthread" ; then
65 EXTRA_CFLAGS="$EXTRA_CFLAGS -DMPMT_PTHREAD"
66 MPM_FAKE_NAME=mpmt_pthread.c
67 $LN_S $abs_srcdir/modules/mpm/mpmt/mpmt.c modules/mpm/mpmt/mpmt_pthread.c
68 elif test "$MPM_NAME" = "dexter" ; then
69 EXTRA_CFLAGS="$EXTRA_CFLAGS -DDEXTER"
70 MPM_FAKE_NAME=dexter.c
71 $LN_S $abs_srcdir/modules/mpm/mpmt/mpmt.c modules/mpm/mpmt/dexter.c
74 if test "$MPM_NAME" = "dexter" -o "$MPM_NAME" = "mpmt_pthread" -o "$MPM_NAME" = "prefork"; then
75 MPM_DIR=modules/mpm/mpmt;
76 MPM_LIB=$MPM_DIR/libmpmt.la
79 MPM_DIR=modules/mpm/$MPM_NAME
80 MPM_LIB=$MPM_DIR/lib${MPM_NAME}.la
84 APACHE_SUBST(MPM_NAME)
85 APACHE_SUBST(MPM_FAKE_NAME)
86 MODLIST="$MODLIST mpm_${MPM_NAME}"
88 dnl Check for pthreads and attempt to support it
89 AC_DEFUN(APACHE_MPM_PTHREAD, [
90 if test "$pthreads_working" != "yes"; then
91 AC_MSG_ERROR(This MPM requires pthreads. Try --with-mpm=prefork.)
94 dnl User threads libraries need pthread.h included everywhere
95 AC_DEFINE(PTHREAD_EVERYWHERE,,
96 [Define if all code should have #include <pthread.h>])