]> granicus.if.org Git - apache/blob - server/mpm/config.m4
Fix missing space in log message
[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 supports
22 dnl XXX APR_POLLSET_THREADSAFE, and duplicates APR's Darwin version check.
23 dnl A run-time check for
24 dnl     apr_pollset_create(,,APR_POLLSET_THREADSAFE) == APR_SUCCESS
25 dnl would be great but an in-tree apr (srclib/apr) hasn't been built yet.
26
27 AC_CACHE_CHECK([whether APR supports thread-safe pollsets], [ac_cv_have_threadsafe_pollset], [
28     case $host in
29         *-apple-darwin[[1-9]].*)
30             APR_SETIFNULL(ac_cv_func_kqueue, [no])
31             ;;
32     esac
33     AC_CHECK_FUNCS(kqueue port_create epoll_create)
34     if test "$ac_cv_func_kqueue$ac_cv_func_port_create$ac_cv_func_epoll_create" != "nonono"; then
35         ac_cv_have_threadsafe_pollset=yes
36     else
37         ac_cv_have_threadsafe_pollset=no
38     fi
39 ])
40
41 dnl See if APR has skiplist
42 dnl The base httpd prereq is APR 1.4.x, so we don't have to consider
43 dnl earlier versions.
44 case $APR_VERSION in
45     1.4*)
46         apr_has_skiplist=no
47         ;;
48     *)
49         apr_has_skiplist=yes
50 esac
51
52 dnl See if this is a forking platform w.r.t. MPMs
53 case $host in
54     *mingw32* | *os2-emx*)
55         forking_mpms_supported=no
56         ;;
57     *)
58         forking_mpms_supported=yes
59         ;;
60 esac
61
62 dnl APACHE_MPM_SUPPORTED(name, supports-shared, is_threaded)
63 AC_DEFUN([APACHE_MPM_SUPPORTED],[
64     if test "$2" = "yes"; then
65         eval "ap_supported_mpm_$1=shared"
66         ap_supported_shared_mpms="$ap_supported_shared_mpms $1 "
67     else
68         eval "ap_supported_mpm_$1=static"
69     fi
70     if test "$3" = "yes"; then
71         eval "ap_threaded_mpm_$1=yes"
72     fi
73 ])dnl
74
75 dnl APACHE_MPM_ENABLED(name)
76 AC_DEFUN([APACHE_MPM_ENABLED],[
77     if ap_mpm_is_enabled $1; then
78         :
79     else
80         eval "ap_enabled_mpm_$1=yes"
81         ap_enabled_mpms="$ap_enabled_mpms $1 "
82     fi
83 ])dnl
84
85 ap_mpm_is_supported ()
86 {
87     eval "tmp=\$ap_supported_mpm_$1"
88     if test -z "$tmp"; then
89         return 1
90     else
91         return 0
92     fi
93 }
94
95 ap_mpm_supports_shared ()
96 {
97     eval "tmp=\$ap_supported_mpm_$1"
98     if test "$tmp" = "shared"; then
99         return 0
100     else
101         return 1
102     fi
103 }
104
105 ap_mpm_is_threaded ()
106 {
107     if test "$mpm_build" = "shared" -a ac_cv_define_APR_HAS_THREADS = "yes"; then
108         return 0
109     fi
110
111     for mpm in $ap_enabled_mpms; do
112         eval "tmp=\$ap_threaded_mpm_$mpm"
113         if test "$tmp" = "yes"; then
114             return 0
115         fi
116     done
117     return 1
118 }
119
120 ap_mpm_is_enabled ()
121 {
122     eval "tmp=\$ap_enabled_mpm_$1"
123     if test "$tmp" = "yes"; then
124         return 0
125     else
126         return 1
127     fi
128 }