]> granicus.if.org Git - apache/blob - server/mpm/config2.m4
mpm_event: worker factor vs pollset.
[apache] / server / mpm / config2.m4
1 AC_MSG_CHECKING(which MPM to use by default)
2 AC_ARG_WITH(mpm,
3 APACHE_HELP_STRING(--with-mpm=MPM,Choose the process model for Apache to use by default.
4                           MPM={simple|motorz|event|worker|prefork|winnt}
5                           This will be statically linked as the only available MPM unless
6                           --enable-mpms-shared is also specified.
7 ),[
8     default_mpm=$withval
9     AC_MSG_RESULT($withval);
10 ],[
11     dnl Order of preference for default MPM: 
12     dnl   The Windows and OS/2 MPMs are used on those platforms.
13     dnl   Everywhere else: event, worker, prefork
14     if ap_mpm_is_supported "winnt"; then
15         default_mpm=winnt
16         AC_MSG_RESULT(winnt)
17     elif ap_mpm_is_supported "mpmt_os2"; then
18         default_mpm=mpmt_os2
19         AC_MSG_RESULT(mpmt_os2)
20     elif ap_mpm_is_supported "event"; then
21         default_mpm=event
22         AC_MSG_RESULT(event)
23     elif ap_mpm_is_supported "worker"; then
24         default_mpm=worker
25         AC_MSG_RESULT(worker - event is not supported)
26     else
27         default_mpm=prefork
28         AC_MSG_RESULT(prefork - event and worker are not supported)
29     fi
30 ])
31
32 APACHE_MPM_ENABLED($default_mpm)
33
34 AC_ARG_ENABLE(mpms-shared,
35 APACHE_HELP_STRING(--enable-mpms-shared=MPM-LIST,Space-separated list of MPM modules to enable for dynamic loading.  MPM-LIST=list | "all"),[
36     if test "$enableval" = "no"; then
37         mpm_build=static
38     else
39         mpm_build=shared
40 dnl     Build just the default MPM if --enable-mpms-shared has no argument.
41         if test "$enableval" = "yes"; then
42             enableval=$default_mpm
43         fi
44         for i in $enableval; do
45             if test "$i" = "all"; then
46                 for j in $ap_supported_shared_mpms; do
47                     eval "enable_mpm_$j=shared"
48                     APACHE_MPM_ENABLED($j)
49                 done
50             else
51                 i=`echo $i | sed 's/-/_/g'`
52                 if ap_mpm_supports_shared $i; then
53                     eval "enable_mpm_$i=shared"
54                     APACHE_MPM_ENABLED($i)
55                 else
56                     AC_MSG_ERROR([MPM $i does not support dynamic loading.])
57                 fi
58             fi
59         done
60     fi
61 ], [mpm_build=static])
62
63 for i in $ap_enabled_mpms; do
64     if ap_mpm_is_supported $i; then
65         :
66     else
67         AC_MSG_ERROR([MPM $i is not supported on this platform.])
68     fi
69 done
70
71 if test $mpm_build = "shared"; then
72     eval "tmp=\$enable_mpm_$default_mpm"
73     if test "$tmp" != "shared"; then
74         AC_MSG_ERROR([The default MPM ($default_mpm) must be included in --enable-mpms-shared.  Use --with-mpm to change the default MPM.])
75     fi
76 fi
77
78 APACHE_FAST_OUTPUT(server/mpm/Makefile)
79
80 if test $mpm_build = "shared"; then
81     MPM_LIB=""
82 else
83     MPM_LIB=server/mpm/$default_mpm/lib${default_mpm}.la
84     MODLIST="$MODLIST mpm_${default_mpm}"
85 fi
86
87 MPM_SUBDIRS=$ap_enabled_mpms
88 APACHE_SUBST(MPM_SUBDIRS)
89 APACHE_SUBST(MPM_LIB)