From 076514f3ac7bf90aa63bc25c36d1c5883d060f76 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Tue, 24 Mar 2009 20:23:42 +0000 Subject: [PATCH] Allow building httpd without a built-in MPM by specifying --with-mpm=shared on configure. When built thusly, an MPM should be loaded via LoadModule. (Currently you need to build the MPM with apxs.) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@757999 13f79535-47bb-0310-9956-ffa450edef68 --- modules/arch/unix/config5.m4 | 4 ++-- server/mpm/config.m4 | 37 ++++++++++++++++++++++++------------ 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/modules/arch/unix/config5.m4 b/modules/arch/unix/config5.m4 index 7013e7f7b6..e4831b49e5 100644 --- a/modules/arch/unix/config5.m4 +++ b/modules/arch/unix/config5.m4 @@ -1,9 +1,9 @@ APACHE_MODPATH_INIT(arch/unix) - if test "$APACHE_MPM" = "simple" -o "$APACHE_MPM" = "worker" \ - -o "$APACHE_MPM" = "event" -o "$APACHE_MPM" = "prefork" ; then + -o "$APACHE_MPM" = "event" -o "$APACHE_MPM" = "prefork" \ + -o "$APACHE_MPM" = "shared"; then unixd_mods_enable=yes else unixd_mods_enable=no diff --git a/server/mpm/config.m4 b/server/mpm/config.m4 index 98e31020e1..1fc922db2d 100644 --- a/server/mpm/config.m4 +++ b/server/mpm/config.m4 @@ -1,7 +1,9 @@ AC_MSG_CHECKING(which MPM to use) AC_ARG_WITH(mpm, APACHE_HELP_STRING(--with-mpm=MPM,Choose the process model for Apache to use. - MPM={simple|beos|event|worker|prefork|mpmt_os2|perchild|leader|threadpool|winnt}),[ + MPM={simple|beos|event|worker|prefork|mpmt_os2|perchild|leader|threadpool|winnt} + Specify "shared" instead of an MPM name to load MPMs dynamically. +),[ APACHE_MPM=$withval ],[ if test "x$APACHE_MPM" = "x"; then @@ -11,16 +13,18 @@ APACHE_HELP_STRING(--with-mpm=MPM,Choose the process model for Apache to use. AC_MSG_RESULT($APACHE_MPM) apache_cv_mpm=$APACHE_MPM - + +dnl Note that a build with an explicitly loaded MPM must support threaded MPMs. ap_mpm_is_threaded () { - if test "$apache_cv_mpm" = "worker" -o "$apache_cv_mpm" = "event" -o "$apache_cv_mpm" = "simple" -o "$apache_cv_mpm" = "perchild" -o "$apache_cv_mpm" = "leader" -o "$apache_cv_mpm" = "winnt" -o "$apache_cv_mpm" = "threadpool" ; then + if test "$apache_cv_mpm" = "shared" -o "$apache_cv_mpm" = "worker" -o "$apache_cv_mpm" = "event" -o "$apache_cv_mpm" = "simple" -o "$apache_cv_mpm" = "perchild" -o "$apache_cv_mpm" = "leader" -o "$apache_cv_mpm" = "winnt" -o "$apache_cv_mpm" = "threadpool" ; then return 0 else return 1 fi } +dnl No such check for a shared MPM. ap_mpm_is_experimental () { if test "$apache_cv_mpm" = "event" -o "$apache_cv_mpm" = "perchild" -o "$apache_cv_mpm" = "leader" -o "$apache_cv_mpm" = "threadpool" ; then @@ -59,17 +63,26 @@ fi APACHE_FAST_OUTPUT(server/mpm/Makefile) -MPM_NAME=$apache_cv_mpm -if ap_mpm_is_experimental; then - AC_MSG_WARN(You have selected an EXPERIMENTAL MPM. Be warned!) - MPM_SUBDIR_NAME=experimental/$MPM_NAME +if test "$apache_cv_mpm" = "shared"; then + MPM_NAME="" + MPM_SUBDIR_NAME="" + MPM_LIB="" + MPM_DIR="" else - MPM_SUBDIR_NAME=$MPM_NAME + MPM_NAME=$apache_cv_mpm + if ap_mpm_is_experimental; then + AC_MSG_WARN(You have selected an EXPERIMENTAL MPM. Be warned!) + MPM_SUBDIR_NAME=experimental/$MPM_NAME + else + MPM_SUBDIR_NAME=$MPM_NAME + fi + MPM_DIR=server/mpm/$MPM_SUBDIR_NAME + MPM_LIB=$MPM_DIR/lib${MPM_NAME}.la + + APACHE_SUBST(MPM_NAME) + APACHE_SUBST(MPM_SUBDIR_NAME) + MODLIST="$MODLIST mpm_${MPM_NAME}" fi -MPM_DIR=server/mpm/$MPM_SUBDIR_NAME -MPM_LIB=$MPM_DIR/lib${MPM_NAME}.la APACHE_SUBST(MPM_NAME) APACHE_SUBST(MPM_SUBDIR_NAME) -MODLIST="$MODLIST mpm_${MPM_NAME}" - -- 2.40.0