]> granicus.if.org Git - apache/blob - server/mpm/config2.m4
--with-mpm and --enable-mpms-shared:
[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|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     mpm_build=shared
37     for i in $enableval; do
38         if test "$i" = "all"; then
39             for j in $SUPPORTED_MPMS; do
40                 eval "enable_mpm_$j=shared"
41                 APACHE_MPM_ENABLED($j)
42             done
43         else
44             i=`echo $i | sed 's/-/_/g'`
45             eval "enable_mpm_$i=shared"
46             APACHE_MPM_ENABLED($i)
47         fi
48     done
49 ], [mpm_build=static])
50
51 for i in $ENABLED_MPMS; do
52     if ap_mpm_is_supported $i; then
53         :
54     else
55         AC_MSG_ERROR([MPM $i is not supported on this platform.])
56     fi
57 done
58
59 if test $mpm_build = "shared"; then
60     eval "tmp=\$enable_mpm_$default_mpm"
61     if test "$tmp" != "shared"; then
62         AC_MSG_ERROR([The default MPM ($default_mpm) must be included in --enable-mpms-shared.  Use --with-mpm to change the default MPM.])
63     fi
64 fi
65
66 APACHE_FAST_OUTPUT(server/mpm/Makefile)
67
68 if test $mpm_build = "shared"; then
69     MPM_LIB=""
70 else
71     MPM_LIB=server/mpm/$default_mpm/lib${default_mpm}.la
72     MODLIST="$MODLIST mpm_${default_mpm}"
73 fi
74
75 MPM_SUBDIRS=$ENABLED_MPMS
76 APACHE_SUBST(MPM_SUBDIRS)
77 APACHE_SUBST(MPM_LIB)