]> granicus.if.org Git - apache/blob - server/mpm/config.m4
Ack. is the variable
[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 for Apache to use.
4                           MPM={dexter,mpmt_beos,mpmt_pthread,prefork,spmt_os2}],[
5   APACHE_MPM=$withval
6   mpm_explicit="yes"
7 ],[
8   APACHE_MPM=mpmt_pthread
9   PLAT=`$ac_config_guess`
10   PLAT=`$ac_config_sub $PLAT`
11   case "$PLAT" in
12     *beos*)
13       APACHE_MPM=mpmt_beos;;
14     *os2_emx*)
15       APACHE_MPM=spmt_os2;;
16   esac 
17   mpm_explicit="no"
18 ])
19 AC_MSG_RESULT($APACHE_MPM)
20
21 apache_cv_mpm=$APACHE_MPM
22         
23 if test "$apache_cv_mpm" = "mpmt_pthread" -o "$apache_cv_mpm" = "dexter"; then
24   PTHREADS_CHECK
25   AC_MSG_CHECKING([for which threading library to use])
26   AC_MSG_RESULT($threads_result)
27
28   if test "$pthreads_working" = "no"; then
29     AC_MSG_RESULT(The currently selected MPM requires pthreads which your system seems to lack)
30     AC_MSG_CHECKING(checking for replacement)
31     AC_MSG_RESULT(prefork selected)
32     apache_cv_mpm=prefork
33   fi
34 fi
35
36 APACHE_CHECK_SIGWAIT_ONE_ARG
37
38 APACHE_FAST_OUTPUT(modules/mpm/Makefile)
39
40 MPM_NAME=$apache_cv_mpm
41 MPM_DIR=modules/mpm/$MPM_NAME
42 MPM_LIB=$MPM_DIR/lib${MPM_NAME}.la
43
44 if test "$mpm_explicit" = "no"; then
45   if test "$MPM_NAME" = "prefork" ; then
46     MPM_NAME="mpmt_pthread"
47     EXTRA_CFLAGS="$EXTRA_CFLAGS -DNO_THREADS"
48
49     ac_cv_enable_threads="no"
50     AC_CACHE_SAVE
51   fi
52
53   if test "$MPM_NAME" = "mpmt_pthread" ; then
54     EXTRA_CFLAGS="$EXTRA_CFLAGS -DMPMT_PTHREAD"
55   elif test "$MPM_NAME" = "dexter" ; then
56     EXTRA_CFLAGS="$EXTRA_CFLAGS -DDEXTER"
57   fi
58
59   if test "$MPM_NAME" = "dexter" -o "$MPM_NAME" = "mpmt_pthread"; then
60     MPM_DIR=modules/mpm/mpmt;
61     MPM_LIB=$MPM_DIR/libmpmt.la
62     MPM_NAME="mpmt"
63   else
64     MPM_DIR=modules/mpm/$MPM_NAME
65     MPM_LIB=$MPM_DIR/lib${MPM_NAME}.la
66   fi
67 fi
68
69 APACHE_SUBST(MPM_NAME)
70 MODLIST="$MODLIST mpm_${MPM_NAME}"
71
72 dnl Check for pthreads and attempt to support it
73 AC_DEFUN(APACHE_MPM_PTHREAD, [
74   if test "$pthreads_working" != "yes"; then
75     AC_MSG_ERROR(This MPM requires pthreads. Try --with-mpm=prefork.)
76   fi
77
78   dnl User threads libraries need pthread.h included everywhere
79   AC_DEFINE(PTHREAD_EVERYWHERE,,
80     [Define if all code should have #include <pthread.h>])
81 ])