mirror of
https://github.com/apache/httpd.git
synced 2025-08-03 16:33:59 +00:00
more configure-time support for dynamically loadable MPMs:
. axe --with-mpm="shared" hack, replace with --enable-mpms-shared={all|list} . replace singular MPM_NAME with access to the list of enabled MPMs . replace singular MPM_SUBDIR with list MPM_SUBDIRS . enable OS/2 MPM in same manner as others with configure support instead of hard-coding in configure.in Current state: MPMs are built as static archives (but not linked to httpd) with --enable-mpms-shared, so they still have to be built with apxs to load dynamically. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@832228 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@ -60,7 +60,7 @@ exec sed "
|
|||||||
/^OS_DIR/d
|
/^OS_DIR/d
|
||||||
/^AP_LIBS/d
|
/^AP_LIBS/d
|
||||||
/^OS_SPECIFIC_VARS/d
|
/^OS_SPECIFIC_VARS/d
|
||||||
/^MPM_SUBDIR_NAME/d
|
/^MPM_SUBDIRS/d
|
||||||
/^EXTRA_INCLUDES/{
|
/^EXTRA_INCLUDES/{
|
||||||
s, = , = -I\$(includedir) ,
|
s, = , = -I\$(includedir) ,
|
||||||
s, -I\$(top_srcdir)/[^ ]*,,g
|
s, -I\$(top_srcdir)/[^ ]*,,g
|
||||||
|
@ -273,7 +273,6 @@ case $host in
|
|||||||
APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1])
|
APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1])
|
||||||
;;
|
;;
|
||||||
*os2-emx*)
|
*os2-emx*)
|
||||||
APR_SETVAR(APACHE_MPM, [mpmt_os2])
|
|
||||||
APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1])
|
APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1])
|
||||||
;;
|
;;
|
||||||
*-linux-*)
|
*-linux-*)
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
|
|
||||||
APACHE_MODPATH_INIT(arch/unix)
|
APACHE_MODPATH_INIT(arch/unix)
|
||||||
|
|
||||||
if test "$APACHE_MPM" = "simple" -o "$APACHE_MPM" = "worker" \
|
if ap_mpm_is_enabled "simple" \
|
||||||
-o "$APACHE_MPM" = "event" -o "$APACHE_MPM" = "prefork" \
|
|| ap_mpm_is_enabled "worker" \
|
||||||
-o "$APACHE_MPM" = "shared"; then
|
|| ap_mpm_is_enabled "event" \
|
||||||
|
|| ap_mpm_is_enabled "prefork"; then
|
||||||
unixd_mods_enable=yes
|
unixd_mods_enable=yes
|
||||||
else
|
else
|
||||||
unixd_mods_enable=no
|
unixd_mods_enable=no
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
|
|
||||||
SUBDIRS = $(MPM_SUBDIR_NAME)
|
SUBDIRS = $(MPM_SUBDIRS)
|
||||||
|
|
||||||
include $(top_builddir)/build/rules.mk
|
include $(top_builddir)/build/rules.mk
|
||||||
|
@ -63,9 +63,7 @@ ap_mpm_is_supported ()
|
|||||||
|
|
||||||
ap_mpm_is_threaded ()
|
ap_mpm_is_threaded ()
|
||||||
{
|
{
|
||||||
dnl Special support for --with-mpm=shared
|
if test "$mpm_build" = "shared" -a ac_cv_define_APR_HAS_THREADS = "yes"; then
|
||||||
dnl Assume a threaded MPM can be used.
|
|
||||||
if test "x$MPM_NAME" = "xshared"; then
|
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -76,3 +74,12 @@ ap_mpm_is_threaded ()
|
|||||||
done
|
done
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ap_mpm_is_enabled ()
|
||||||
|
{
|
||||||
|
if echo "$ENABLED_MPMS" | grep " $1 " >/dev/null; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
@ -2,54 +2,67 @@ AC_MSG_CHECKING(which MPM to use)
|
|||||||
AC_ARG_WITH(mpm,
|
AC_ARG_WITH(mpm,
|
||||||
APACHE_HELP_STRING(--with-mpm=MPM,Choose the process model for Apache to use.
|
APACHE_HELP_STRING(--with-mpm=MPM,Choose the process model for Apache to use.
|
||||||
MPM={simple|event|worker|prefork|winnt}
|
MPM={simple|event|worker|prefork|winnt}
|
||||||
Specify "shared" instead of an MPM name to load MPMs dynamically.
|
|
||||||
),[
|
),[
|
||||||
APACHE_MPM=$withval
|
default_mpm=$withval
|
||||||
AC_MSG_RESULT($withval);
|
AC_MSG_RESULT($withval);
|
||||||
],[
|
],[
|
||||||
dnl Order of preference for default MPM:
|
dnl Order of preference for default MPM:
|
||||||
dnl Windows: WinNT
|
dnl The Windows and OS/2 MPMs are used on those platforms.
|
||||||
dnl Everywhere else: event, worker, prefork
|
dnl Everywhere else: event, worker, prefork
|
||||||
if ap_mpm_is_supported "winnt"; then
|
if ap_mpm_is_supported "winnt"; then
|
||||||
APACHE_MPM=winnt
|
default_mpm=winnt
|
||||||
AC_MSG_RESULT(winnt)
|
AC_MSG_RESULT(winnt)
|
||||||
|
elif ap_mpm_is_supported "mpmt_os2"; then
|
||||||
|
default_mpm=mpmt_os2
|
||||||
|
AC_MSG_RESULT(mpmt_os2)
|
||||||
elif ap_mpm_is_supported "event"; then
|
elif ap_mpm_is_supported "event"; then
|
||||||
APACHE_MPM=event
|
default_mpm=event
|
||||||
AC_MSG_RESULT(event)
|
AC_MSG_RESULT(event)
|
||||||
elif ap_mpm_is_supported "worker"; then
|
elif ap_mpm_is_supported "worker"; then
|
||||||
APACHE_MPM=worker
|
default_mpm=worker
|
||||||
AC_MSG_RESULT(worker - event is not supported)
|
AC_MSG_RESULT(worker - event is not supported)
|
||||||
else
|
else
|
||||||
APACHE_MPM=prefork
|
default_mpm=prefork
|
||||||
AC_MSG_RESULT(prefork - event and worker are not supported)
|
AC_MSG_RESULT(prefork - event and worker are not supported)
|
||||||
fi
|
fi
|
||||||
])
|
])
|
||||||
|
|
||||||
if test $APACHE_MPM = "shared"; then
|
APACHE_MPM_ENABLED($default_mpm)
|
||||||
:
|
|
||||||
elif ap_mpm_is_supported $APACHE_MPM; then
|
|
||||||
:
|
|
||||||
else
|
|
||||||
AC_MSG_ERROR([The specified MPM, $APACHE_MPM, is not supported on this platform.])
|
|
||||||
fi
|
|
||||||
|
|
||||||
apache_cv_mpm=$APACHE_MPM
|
AC_ARG_ENABLE(mpms-shared,
|
||||||
APACHE_MPM_ENABLED($APACHE_MPM)
|
APACHE_HELP_STRING(--enable-mpms-shared=MODULE-LIST,Space-separated list of shared MPM modules to enable | "all"),[
|
||||||
|
mpm_build=shared
|
||||||
|
for i in $enableval; do
|
||||||
|
if test "$i" = "all"; then
|
||||||
|
for j in $SUPPORTED_MPMS; do
|
||||||
|
eval "enable_mpm_$j=shared"
|
||||||
|
APACHE_MPM_ENABLED($j)
|
||||||
|
done
|
||||||
|
else
|
||||||
|
i=`echo $i | sed 's/-/_/g'`
|
||||||
|
eval "enable_mpm_$i=shared"
|
||||||
|
APACHE_MPM_ENABLED($i)
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
], [mpm_build=static])
|
||||||
|
|
||||||
|
for i in $ENABLED_MPMS; do
|
||||||
|
if ap_mpm_is_supported $i; then
|
||||||
|
:
|
||||||
|
else
|
||||||
|
AC_MSG_ERROR([MPM $i is not supported on this platform.])
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
APACHE_FAST_OUTPUT(server/mpm/Makefile)
|
APACHE_FAST_OUTPUT(server/mpm/Makefile)
|
||||||
|
|
||||||
if test "$apache_cv_mpm" = "shared"; then
|
if test $mpm_build = "shared"; then
|
||||||
MPM_NAME=""
|
|
||||||
MPM_SUBDIR_NAME=""
|
|
||||||
MPM_LIB=""
|
MPM_LIB=""
|
||||||
else
|
else
|
||||||
MPM_NAME=$apache_cv_mpm
|
MPM_LIB=server/mpm/$default_mpm/lib${default_mpm}.la
|
||||||
MPM_SUBDIR_NAME=$MPM_NAME
|
MODLIST="$MODLIST mpm_${default_mpm}"
|
||||||
MPM_LIB=server/mpm/$MPM_SUBDIR_NAME/lib${MPM_NAME}.la
|
|
||||||
|
|
||||||
MODLIST="$MODLIST mpm_${MPM_NAME}"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
APACHE_SUBST(MPM_NAME)
|
MPM_SUBDIRS=$ENABLED_MPMS
|
||||||
APACHE_SUBST(MPM_SUBDIR_NAME)
|
APACHE_SUBST(MPM_SUBDIRS)
|
||||||
APACHE_SUBST(MPM_LIB)
|
APACHE_SUBST(MPM_LIB)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
dnl ## XXX - Need a more thorough check of the proper flags to use
|
dnl ## XXX - Need a more thorough check of the proper flags to use
|
||||||
|
|
||||||
if test "$MPM_NAME" = "event" ; then
|
if ap_mpm_is_enabled "event"; then
|
||||||
AC_CHECK_FUNCS(pthread_kill)
|
AC_CHECK_FUNCS(pthread_kill)
|
||||||
APACHE_FAST_OUTPUT(server/mpm/$MPM_SUBDIR_NAME/Makefile)
|
APACHE_FAST_OUTPUT(server/mpm/event/Makefile)
|
||||||
fi
|
fi
|
||||||
|
10
server/mpm/mpmt_os2/config.m4
Normal file
10
server/mpm/mpmt_os2/config.m4
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
AC_MSG_CHECKING(if mpmt_os2 MPM supports this platform)
|
||||||
|
case $host in
|
||||||
|
*os2-emx*)
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
APACHE_MPM_SUPPORTED(mpmt_os2, no, yes)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
;;
|
||||||
|
esac
|
@ -1,5 +1,5 @@
|
|||||||
if test "$MPM_NAME" = "mpmt_os2" ; then
|
if ap_mpm_is_enabled "mpmt_os2"; then
|
||||||
AC_CACHE_SAVE
|
AC_CACHE_SAVE
|
||||||
APACHE_FAST_OUTPUT(server/mpm/$MPM_NAME/Makefile)
|
APACHE_FAST_OUTPUT(server/mpm/mpmt_os2/Makefile)
|
||||||
APR_ADDTO(CFLAGS,-Zmt)
|
APR_ADDTO(CFLAGS,-Zmt)
|
||||||
fi
|
fi
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
if test "$MPM_NAME" = "prefork" ; then
|
if ap_mpm_is_enabled "prefork"; then
|
||||||
APACHE_FAST_OUTPUT(server/mpm/$MPM_NAME/Makefile)
|
APACHE_FAST_OUTPUT(server/mpm/prefork/Makefile)
|
||||||
fi
|
fi
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
if test "$MPM_NAME" = "simple" ; then
|
if ap_mpm_is_enabled "simple"; then
|
||||||
APACHE_FAST_OUTPUT(server/mpm/$MPM_NAME/Makefile)
|
APACHE_FAST_OUTPUT(server/mpm/simple/Makefile)
|
||||||
fi
|
fi
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
if test "$MPM_NAME" = "winnt" ; then
|
if ap_mpm_is_enabled "winnt"; then
|
||||||
APACHE_FAST_OUTPUT(server/mpm/$MPM_NAME/Makefile)
|
APACHE_FAST_OUTPUT(server/mpm/winnt/Makefile)
|
||||||
fi
|
fi
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
dnl ## XXX - Need a more thorough check of the proper flags to use
|
dnl ## XXX - Need a more thorough check of the proper flags to use
|
||||||
|
|
||||||
if test "$MPM_NAME" = "worker" ; then
|
if ap_mpm_is_enabled "worker"; then
|
||||||
AC_CHECK_FUNCS(pthread_kill)
|
AC_CHECK_FUNCS(pthread_kill)
|
||||||
APACHE_FAST_OUTPUT(server/mpm/$MPM_NAME/Makefile)
|
APACHE_FAST_OUTPUT(server/mpm/worker/Makefile)
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user