]> granicus.if.org Git - apache/blob - server/mpm/config.m4
963bb18e7a1d80311d505b3d634ddd40b84a2d82
[apache] / server / mpm / config.m4
1 dnl common platform checks needed by MPMs, methods for MPMs to state
2 dnl their support for the platform, functions to query MPM properties
3
4 APR_CHECK_APR_DEFINE(APR_HAS_THREADS)
5
6 have_threaded_sig_graceful=yes
7 case $host in
8     *-linux-*)
9         case `uname -r` in
10           2.0* )
11             dnl Threaded MPM's are not supported on Linux 2.0
12             dnl as on 2.0 the linuxthreads library uses SIGUSR1
13             dnl and SIGUSR2 internally
14             have_threaded_sig_graceful=no
15           ;;
16         esac
17     ;;
18 esac
19
20 dnl See if APR supports APR_POLLSET_THREADSAFE.
21 dnl XXX This hack tests for the underlying functions used by APR when it
22 dnl XXX supports APR_POLLSET_THREADSAFE.
23 dnl FIXME with a run-time check for
24 dnl     apr_pollset_create(,,APR_POLLSET_THREADSAFE) == APR_SUCCESS
25 AC_CHECK_FUNCS(kqueue port_create epoll_create)
26 if test "$ac_cv_func_kqueue$ac_cv_func_port_create$ac_cv_func_epoll_create" != "nonono"; then
27     have_threadsafe_pollset=yes
28 else
29     have_threadsafe_pollset=no
30 fi
31
32 dnl See if this is a forking platform w.r.t. MPMs
33 case $host in
34     *mingw32*)
35         forking_mpms_supported=no
36         ;;
37     *)
38         forking_mpms_supported=yes
39         ;;
40 esac
41
42 dnl APACHE_MPM_SUPPORTED(name, supports-shared, is_threaded)
43 AC_DEFUN(APACHE_MPM_SUPPORTED,[
44     SUPPORTED_MPMS="$SUPPORTED_MPMS $1 "
45     if test "$3" = "yes"; then
46         THREADED_MPMS="$THREADED_MPMS $1 "
47     fi
48 ])dnl
49
50 dnl APACHE_MPM_ENABLED(name)
51 AC_DEFUN(APACHE_MPM_ENABLED,[
52     ENABLED_MPMS="$ENABLED_MPMS $1 "
53 ])dnl
54
55 ap_mpm_is_supported ()
56 {
57     if echo "$SUPPORTED_MPMS" | grep " $1 " >/dev/null; then
58         return 0
59     else
60         return 1
61     fi
62 }
63
64 ap_mpm_is_threaded ()
65 {
66     if test "$mpm_build" = "shared" -a ac_cv_define_APR_HAS_THREADS = "yes"; then
67         return 0
68     fi
69
70     for mpm in $ENABLED_MPMS; do
71         if echo "$THREADED_MPMS" | grep " $mpm " >/dev/null; then
72             return 0
73         fi
74     done
75     return 1
76 }
77
78 ap_mpm_is_enabled ()
79 {
80     if echo "$ENABLED_MPMS" | grep " $1 " >/dev/null; then
81         return 0
82     else
83         return 1
84     fi
85 }