]> granicus.if.org Git - apache/blob - server/mpm/config.m4
Initial version of the mpmt MPM. This MPM can emulate dexter, mpmt_pthread,
[apache] / server / mpm / config.m4
1 AC_MSG_CHECKING(which MPM to use)
2 AC_ARG_WITH(mpm,
3 [  --with-mpm=MPM          Choose the process model for Apache to use.
4                           MPM={dexter,mpmt_beos,mpmt_pthread,prefork,spmt_os2}],[
5   APACHE_MPM=$withval
6 ],[
7   APACHE_MPM=mpmt_pthread
8   case "`uname -sr`" in
9     "BeOS"*)
10       APACHE_MPM=mpmt_beos;;
11     "OS/2"*)
12       APACHE_MPM=spmt_os2;;
13   esac 
14 ])
15 AC_MSG_RESULT($APACHE_MPM)
16
17 apache_cv_mpm=$APACHE_MPM
18         
19 if test "$apache_cv_mpm" = "mpmt_pthread" -o "$apache_cv_mpm" = "dexter"; then
20   PTHREADS_CHECK
21   AC_MSG_CHECKING([for which threading library to use])
22   AC_MSG_RESULT($threads_result)
23
24   if test "$apache_threads_working" = "no"; then
25     AC_MSG_RESULT(The currently selected MPM requires pthreads which your system seems to lack)
26     AC_MSG_CHECKING(checking for replacement)
27     AC_MSG_RESULT(prefork selected)
28     apache_cv_mpm=prefork
29   fi
30 fi
31
32 APACHE_CHECK_SIGWAIT_ONE_ARG
33
34 APACHE_FAST_OUTPUT(modules/mpm/Makefile)
35
36 MPM_NAME=$apache_cv_mpm
37 if test "$MPM_NAME" = "prefork" ; then
38     MPM_NAME="mpmt_pthread"
39     EXTRA_CFLAGS="$EXTRA_CFLAGS -DNO_THREADS"
40
41     ac_cv_enable_threads="no"
42     AC_CACHE_SAVE
43 fi
44
45 if test "$MPM_NAME" = "mpmt_pthread" ; then
46     EXTRA_CFLAGS="$EXTRA_CFLAGS -DMPMT_PTHREAD"
47 elif test "$MPM_NAME" = "dexter" ; then
48     EXTRA_CFLAGS="$EXTRA_CFLAGS -DDEXTER"
49 fi
50
51 if test "$MPM_NAME" = "dexter" -o "$MPM_NAME" = "mpmt_pthread"; then
52     MPM_DIR=modules/mpm/mpmt;
53     MPM_LIB=$MPM_DIR/libmpmt.la
54     MPM_NAME="mpmt"
55 else
56     MPM_DIR=modules/mpm/$MPM_NAME
57     MPM_LIB=$MPM_DIR/lib${MPM_NAME}.la
58 fi
59
60 APACHE_SUBST(MPM_NAME)
61 MODLIST="$MODLIST mpm_${MPM_NAME}"
62
63 dnl Check for pthreads and attempt to support it
64 AC_DEFUN(APACHE_MPM_PTHREAD, [
65   if test "$pthreads_working" != "yes"; then
66     AC_MSG_ERROR(This MPM requires pthreads. Try --with-mpm=prefork.)
67   fi
68
69   dnl User threads libraries need pthread.h included everywhere
70   AC_DEFINE(PTHREAD_EVERYWHERE,,
71     [Define if all code should have #include <pthread.h>])
72 ])