]> granicus.if.org Git - apache/blob - server/mpm/config.m4
properly merge directory configs in mod_include
[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 this is a forking platform w.r.t. MPMs
42 case $host in
43     *mingw32* | *os2-emx*)
44         forking_mpms_supported=no
45         ;;
46     *)
47         forking_mpms_supported=yes
48         ;;
49 esac
50
51 dnl APACHE_MPM_SUPPORTED(name, supports-shared, is_threaded)
52 AC_DEFUN(APACHE_MPM_SUPPORTED,[
53     if test "$2" = "yes"; then
54         eval "ap_supported_mpm_$1=shared"
55         ap_supported_shared_mpms="$ap_supported_shared_mpms $1 "
56     else
57         eval "ap_supported_mpm_$1=static"
58     fi
59     if test "$3" = "yes"; then
60         eval "ap_threaded_mpm_$1=yes"
61     fi
62 ])dnl
63
64 dnl APACHE_MPM_ENABLED(name)
65 AC_DEFUN(APACHE_MPM_ENABLED,[
66     if ap_mpm_is_enabled $1; then
67         :
68     else
69         eval "ap_enabled_mpm_$1=yes"
70         ap_enabled_mpms="$ap_enabled_mpms $1 "
71     fi
72 ])dnl
73
74 ap_mpm_is_supported ()
75 {
76     eval "tmp=\$ap_supported_mpm_$1"
77     if test -z "$tmp"; then
78         return 1
79     else
80         return 0
81     fi
82 }
83
84 ap_mpm_supports_shared ()
85 {
86     eval "tmp=\$ap_supported_mpm_$1"
87     if test "$tmp" = "shared"; then
88         return 0
89     else
90         return 1
91     fi
92 }
93
94 ap_mpm_is_threaded ()
95 {
96     if test "$mpm_build" = "shared" -a ac_cv_define_APR_HAS_THREADS = "yes"; then
97         return 0
98     fi
99
100     for mpm in $ap_enabled_mpms; do
101         eval "tmp=\$ap_threaded_mpm_$mpm"
102         if test "$tmp" = "yes"; then
103             return 0
104         fi
105     done
106     return 1
107 }
108
109 ap_mpm_is_enabled ()
110 {
111     eval "tmp=\$ap_enabled_mpm_$1"
112     if test "$tmp" = "yes"; then
113         return 0
114     else
115         return 1
116     fi
117 }