]> granicus.if.org Git - apache/blob - server/mpm/config.m4
Eliminate the .h.stub files; AC_DEFINE can generate the necessary
[apache] / server / mpm / config.m4
1 AC_MSG_CHECKING(which MPM to use)
2 AC_ARG_WITH(mpm,
3 [  --with-mpm=MPM          Choose the process model, etc. for Apache to use.],
4 [
5   if test "$withval" != "no" ; then
6     apache_cv_mpm=$withval
7     AC_MSG_RESULT($apache_cv_mpm)
8   else
9     apache_cv_mpm="mpmt_pthread"
10     AC_MSG_RESULT(No MPM specified.  Using pthread)
11   fi
12 ],[
13   apache_cv_mpm="mpmt_pthread"
14   AC_MSG_RESULT(No MPM specified.  Using pthread)
15 ])
16
17 APACHE_OUTPUT(modules/mpm/Makefile)
18 MPM_NAME=$apache_cv_mpm
19 MPM_DIR=modules/mpm/$MPM_NAME
20 MPM_LIB=$MPM_DIR/lib${MPM_NAME}.la
21
22 AC_SUBST(MPM_NAME)
23 MODLIST="$MODLIST mpm_${MPM_NAME}"
24
25 dnl All the unix MPMs use shared memory; save a little duplication
26 AC_DEFUN(APACHE_MPM_CHECK_SHMEM, [
27     AC_CHECK_FUNCS(shmget)
28     AC_FUNC_MMAP
29     
30     AC_MSG_CHECKING(which shared memory mechanism to use)
31     if test "$ac_cv_func_shmget" = "yes" ; then
32         AC_DEFINE(USE_SHMGET_SCOREBOARD,,
33             [Define if MPMs should use shmget to implement their shared memory])
34         AC_MSG_RESULT(shmget)
35     elif test "$ac_cv_func_mmap" = "yes" ; then
36         AC_DEFINE(USE_MMAP_SCOREBOARD,,
37             [Define if MPMs should use mmap to implement their shared memory])
38         AC_MSG_RESULT(mmap)
39     else
40         AC_MSG_ERROR(No known shared memory system)
41     fi
42 ])
43
44 dnl Check for pthreads and attempt to support it
45 AC_DEFUN(APACHE_MPM_PTHREAD, [
46
47 dnl XXX - We should be checking for the proper flags to use on a particular 
48 dnl platform. This will cover a couple of them, anyway
49     CFLAGS="-pthread $CFLAGS"
50     CXXFLAGS="-pthread $CXXFLAGS"
51
52     AC_CHECK_HEADER(pthread.h, [ ],[
53         AC_MSG_ERROR(This MPM requires pthreads. Try --with-mpm=prefork.)
54     ])
55     AC_CHECK_FUNC(pthread_create, [ ],[
56         AC_MSG_ERROR(Can't compile pthread code.)
57     ])
58
59     dnl User threads libraries need pthread.h included everywhere
60     AC_DEFINE(PTHREAD_EVERYWHERE,,
61         [Define if all code should have #include <pthread.h>])
62 ])