]> granicus.if.org Git - apache/blob - server/mpm/config.m4
Introduce a new set of APIs to allow MPMs to be proper modules instead
[apache] / server / mpm / config.m4
1 AC_MSG_CHECKING(which MPM to use)
2 AC_ARG_WITH(mpm,
3 APACHE_HELP_STRING(--with-mpm=MPM,Choose the process model for Apache to use.
4                           MPM={simple|beos|event|worker|prefork|mpmt_os2|perchild|leader|threadpool|winnt}),[
5   APACHE_MPM=$withval
6 ],[
7   if test "x$APACHE_MPM" = "x"; then
8     APACHE_MPM=prefork
9   fi
10 ])
11 AC_MSG_RESULT($APACHE_MPM)
12
13 apache_cv_mpm=$APACHE_MPM
14         
15 ap_mpm_is_threaded ()
16 {
17     if test "$apache_cv_mpm" = "worker" -o "$apache_cv_mpm" = "event" -o "$apache_cv_mpm" = "simple" -o "$apache_cv_mpm" = "perchild" -o "$apache_cv_mpm" = "leader" -o "$apache_cv_mpm" = "winnt" -o "$apache_cv_mpm" = "threadpool" ; then
18         return 0
19     else
20         return 1
21     fi
22 }
23
24 ap_mpm_is_experimental ()
25 {
26     if test "$apache_cv_mpm" = "event" -o "$apache_cv_mpm" = "perchild" -o "$apache_cv_mpm" = "leader" -o "$apache_cv_mpm" = "threadpool" ; then
27         return 0
28     else
29         return 1
30     fi
31 }
32
33 if ap_mpm_is_threaded; then
34   APR_CHECK_APR_DEFINE(APR_HAS_THREADS)
35
36   if test "x$ac_cv_define_APR_HAS_THREADS" = "xno"; then
37     AC_MSG_RESULT(The currently selected MPM requires threads which your system seems to lack)
38     AC_MSG_CHECKING(checking for replacement)
39     AC_MSG_RESULT(prefork selected)
40     apache_cv_mpm=prefork
41   else
42     case $host in
43       *-linux-*)
44         case `uname -r` in
45           2.0* )
46             dnl Threaded MPM's are not supported on Linux 2.0
47             dnl as on 2.0 the linuxthreads library uses SIGUSR1
48             dnl and SIGUSR2 internally
49             echo "Threaded MPM's are not supported on this platform"
50             AC_MSG_CHECKING(checking for replacement)
51             AC_MSG_RESULT(prefork selected)
52             apache_cv_mpm=prefork
53           ;;
54         esac
55       ;;
56     esac
57   fi
58 fi
59
60 APACHE_FAST_OUTPUT(server/mpm/Makefile)
61
62 MPM_NAME=$apache_cv_mpm
63 if ap_mpm_is_experimental; then
64   AC_MSG_WARN(You have selected an EXPERIMENTAL MPM.  Be warned!)
65   MPM_SUBDIR_NAME=experimental/$MPM_NAME
66 else
67   MPM_SUBDIR_NAME=$MPM_NAME
68 fi
69 MPM_DIR=server/mpm/$MPM_SUBDIR_NAME
70 MPM_LIB=$MPM_DIR/lib${MPM_NAME}.la
71
72 APACHE_SUBST(MPM_NAME)
73 APACHE_SUBST(MPM_SUBDIR_NAME)
74 MODLIST="$MODLIST mpm_${MPM_NAME}"
75