]> granicus.if.org Git - apache/blob - server/mpm/config2.m4
more configure-time support for dynamically loadable MPMs:
[apache] / server / mpm / config2.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|event|worker|prefork|winnt}
5 ),[
6     default_mpm=$withval
7     AC_MSG_RESULT($withval);
8 ],[
9     dnl Order of preference for default MPM: 
10     dnl   The Windows and OS/2 MPMs are used on those platforms.
11     dnl   Everywhere else: event, worker, prefork
12     if ap_mpm_is_supported "winnt"; then
13         default_mpm=winnt
14         AC_MSG_RESULT(winnt)
15     elif ap_mpm_is_supported "mpmt_os2"; then
16         default_mpm=mpmt_os2
17         AC_MSG_RESULT(mpmt_os2)
18     elif ap_mpm_is_supported "event"; then
19         default_mpm=event
20         AC_MSG_RESULT(event)
21     elif ap_mpm_is_supported "worker"; then
22         default_mpm=worker
23         AC_MSG_RESULT(worker - event is not supported)
24     else
25         default_mpm=prefork
26         AC_MSG_RESULT(prefork - event and worker are not supported)
27     fi
28 ])
29
30 APACHE_MPM_ENABLED($default_mpm)
31
32 AC_ARG_ENABLE(mpms-shared,
33 APACHE_HELP_STRING(--enable-mpms-shared=MODULE-LIST,Space-separated list of shared MPM modules to enable | "all"),[
34     mpm_build=shared
35     for i in $enableval; do
36         if test "$i" = "all"; then
37             for j in $SUPPORTED_MPMS; do
38                 eval "enable_mpm_$j=shared"
39                 APACHE_MPM_ENABLED($j)
40             done
41         else
42             i=`echo $i | sed 's/-/_/g'`
43             eval "enable_mpm_$i=shared"
44             APACHE_MPM_ENABLED($i)
45         fi
46     done
47 ], [mpm_build=static])
48
49 for i in $ENABLED_MPMS; do
50     if ap_mpm_is_supported $i; then
51         :
52     else
53         AC_MSG_ERROR([MPM $i is not supported on this platform.])
54     fi
55 done
56
57 APACHE_FAST_OUTPUT(server/mpm/Makefile)
58
59 if test $mpm_build = "shared"; then
60     MPM_LIB=""
61 else
62     MPM_LIB=server/mpm/$default_mpm/lib${default_mpm}.la
63     MODLIST="$MODLIST mpm_${default_mpm}"
64 fi
65
66 MPM_SUBDIRS=$ENABLED_MPMS
67 APACHE_SUBST(MPM_SUBDIRS)
68 APACHE_SUBST(MPM_LIB)