You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2009/11/03 01:38:07 UTC
svn commit: r832228 - in /httpd/httpd/trunk: ./ build/ modules/arch/unix/
server/mpm/ server/mpm/event/ server/mpm/mpmt_os2/ server/mpm/prefork/
server/mpm/simple/ server/mpm/winnt/ server/mpm/worker/
Author: trawick
Date: Tue Nov 3 00:38:06 2009
New Revision: 832228
URL: http://svn.apache.org/viewvc?rev=832228&view=rev
Log:
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.
Added:
httpd/httpd/trunk/server/mpm/mpmt_os2/config.m4
Modified:
httpd/httpd/trunk/build/config_vars.sh.in
httpd/httpd/trunk/configure.in
httpd/httpd/trunk/modules/arch/unix/config5.m4
httpd/httpd/trunk/server/mpm/Makefile.in
httpd/httpd/trunk/server/mpm/config.m4
httpd/httpd/trunk/server/mpm/config2.m4
httpd/httpd/trunk/server/mpm/event/config3.m4
httpd/httpd/trunk/server/mpm/mpmt_os2/config5.m4
httpd/httpd/trunk/server/mpm/prefork/config3.m4
httpd/httpd/trunk/server/mpm/simple/config3.m4
httpd/httpd/trunk/server/mpm/winnt/config3.m4
httpd/httpd/trunk/server/mpm/worker/config3.m4
Modified: httpd/httpd/trunk/build/config_vars.sh.in
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/build/config_vars.sh.in?rev=832228&r1=832227&r2=832228&view=diff
==============================================================================
--- httpd/httpd/trunk/build/config_vars.sh.in (original)
+++ httpd/httpd/trunk/build/config_vars.sh.in Tue Nov 3 00:38:06 2009
@@ -60,7 +60,7 @@
/^OS_DIR/d
/^AP_LIBS/d
/^OS_SPECIFIC_VARS/d
-/^MPM_SUBDIR_NAME/d
+/^MPM_SUBDIRS/d
/^EXTRA_INCLUDES/{
s, = , = -I\$(includedir) ,
s, -I\$(top_srcdir)/[^ ]*,,g
Modified: httpd/httpd/trunk/configure.in
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/configure.in?rev=832228&r1=832227&r2=832228&view=diff
==============================================================================
--- httpd/httpd/trunk/configure.in (original)
+++ httpd/httpd/trunk/configure.in Tue Nov 3 00:38:06 2009
@@ -273,7 +273,6 @@
APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1])
;;
*os2-emx*)
- APR_SETVAR(APACHE_MPM, [mpmt_os2])
APR_SETVAR(SINGLE_LISTEN_UNSERIALIZED_ACCEPT, [1])
;;
*-linux-*)
Modified: httpd/httpd/trunk/modules/arch/unix/config5.m4
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/arch/unix/config5.m4?rev=832228&r1=832227&r2=832228&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/arch/unix/config5.m4 (original)
+++ httpd/httpd/trunk/modules/arch/unix/config5.m4 Tue Nov 3 00:38:06 2009
@@ -1,12 +1,13 @@
APACHE_MODPATH_INIT(arch/unix)
-if test "$APACHE_MPM" = "simple" -o "$APACHE_MPM" = "worker" \
- -o "$APACHE_MPM" = "event" -o "$APACHE_MPM" = "prefork" \
- -o "$APACHE_MPM" = "shared"; then
- unixd_mods_enable=yes
+if ap_mpm_is_enabled "simple" \
+ || ap_mpm_is_enabled "worker" \
+ || ap_mpm_is_enabled "event" \
+ || ap_mpm_is_enabled "prefork"; then
+ unixd_mods_enable=yes
else
- unixd_mods_enable=no
+ unixd_mods_enable=no
fi
APACHE_MODULE(unixd, unix specific support, , , $unixd_mods_enable)
Modified: httpd/httpd/trunk/server/mpm/Makefile.in
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/Makefile.in?rev=832228&r1=832227&r2=832228&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/Makefile.in (original)
+++ httpd/httpd/trunk/server/mpm/Makefile.in Tue Nov 3 00:38:06 2009
@@ -1,4 +1,4 @@
-SUBDIRS = $(MPM_SUBDIR_NAME)
+SUBDIRS = $(MPM_SUBDIRS)
include $(top_builddir)/build/rules.mk
Modified: httpd/httpd/trunk/server/mpm/config.m4
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/config.m4?rev=832228&r1=832227&r2=832228&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/config.m4 (original)
+++ httpd/httpd/trunk/server/mpm/config.m4 Tue Nov 3 00:38:06 2009
@@ -63,9 +63,7 @@
ap_mpm_is_threaded ()
{
- dnl Special support for --with-mpm=shared
- dnl Assume a threaded MPM can be used.
- if test "x$MPM_NAME" = "xshared"; then
+ if test "$mpm_build" = "shared" -a ac_cv_define_APR_HAS_THREADS = "yes"; then
return 0
fi
@@ -76,3 +74,12 @@
done
return 1
}
+
+ap_mpm_is_enabled ()
+{
+ if echo "$ENABLED_MPMS" | grep " $1 " >/dev/null; then
+ return 0
+ else
+ return 1
+ fi
+}
Modified: httpd/httpd/trunk/server/mpm/config2.m4
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/config2.m4?rev=832228&r1=832227&r2=832228&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/config2.m4 (original)
+++ httpd/httpd/trunk/server/mpm/config2.m4 Tue Nov 3 00:38:06 2009
@@ -2,54 +2,67 @@
AC_ARG_WITH(mpm,
APACHE_HELP_STRING(--with-mpm=MPM,Choose the process model for Apache to use.
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);
],[
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
if ap_mpm_is_supported "winnt"; then
- APACHE_MPM=winnt
+ default_mpm=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
- APACHE_MPM=event
+ default_mpm=event
AC_MSG_RESULT(event)
elif ap_mpm_is_supported "worker"; then
- APACHE_MPM=worker
+ default_mpm=worker
AC_MSG_RESULT(worker - event is not supported)
else
- APACHE_MPM=prefork
+ default_mpm=prefork
AC_MSG_RESULT(prefork - event and worker are not supported)
fi
])
-if test $APACHE_MPM = "shared"; then
- :
-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_MPM_ENABLED($default_mpm)
-apache_cv_mpm=$APACHE_MPM
-APACHE_MPM_ENABLED($APACHE_MPM)
+AC_ARG_ENABLE(mpms-shared,
+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)
-if test "$apache_cv_mpm" = "shared"; then
- MPM_NAME=""
- MPM_SUBDIR_NAME=""
+if test $mpm_build = "shared"; then
MPM_LIB=""
else
- MPM_NAME=$apache_cv_mpm
- MPM_SUBDIR_NAME=$MPM_NAME
- MPM_LIB=server/mpm/$MPM_SUBDIR_NAME/lib${MPM_NAME}.la
-
- MODLIST="$MODLIST mpm_${MPM_NAME}"
+ MPM_LIB=server/mpm/$default_mpm/lib${default_mpm}.la
+ MODLIST="$MODLIST mpm_${default_mpm}"
fi
-APACHE_SUBST(MPM_NAME)
-APACHE_SUBST(MPM_SUBDIR_NAME)
+MPM_SUBDIRS=$ENABLED_MPMS
+APACHE_SUBST(MPM_SUBDIRS)
APACHE_SUBST(MPM_LIB)
Modified: httpd/httpd/trunk/server/mpm/event/config3.m4
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/config3.m4?rev=832228&r1=832227&r2=832228&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/event/config3.m4 (original)
+++ httpd/httpd/trunk/server/mpm/event/config3.m4 Tue Nov 3 00:38:06 2009
@@ -1,6 +1,6 @@
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)
- APACHE_FAST_OUTPUT(server/mpm/$MPM_SUBDIR_NAME/Makefile)
+ APACHE_FAST_OUTPUT(server/mpm/event/Makefile)
fi
Added: httpd/httpd/trunk/server/mpm/mpmt_os2/config.m4
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/mpmt_os2/config.m4?rev=832228&view=auto
==============================================================================
--- httpd/httpd/trunk/server/mpm/mpmt_os2/config.m4 (added)
+++ httpd/httpd/trunk/server/mpm/mpmt_os2/config.m4 Tue Nov 3 00:38:06 2009
@@ -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
Modified: httpd/httpd/trunk/server/mpm/mpmt_os2/config5.m4
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/mpmt_os2/config5.m4?rev=832228&r1=832227&r2=832228&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/mpmt_os2/config5.m4 (original)
+++ httpd/httpd/trunk/server/mpm/mpmt_os2/config5.m4 Tue Nov 3 00:38:06 2009
@@ -1,5 +1,5 @@
-if test "$MPM_NAME" = "mpmt_os2" ; then
+if ap_mpm_is_enabled "mpmt_os2"; then
AC_CACHE_SAVE
- APACHE_FAST_OUTPUT(server/mpm/$MPM_NAME/Makefile)
+ APACHE_FAST_OUTPUT(server/mpm/mpmt_os2/Makefile)
APR_ADDTO(CFLAGS,-Zmt)
fi
Modified: httpd/httpd/trunk/server/mpm/prefork/config3.m4
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/prefork/config3.m4?rev=832228&r1=832227&r2=832228&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/prefork/config3.m4 (original)
+++ httpd/httpd/trunk/server/mpm/prefork/config3.m4 Tue Nov 3 00:38:06 2009
@@ -1,3 +1,3 @@
-if test "$MPM_NAME" = "prefork" ; then
- APACHE_FAST_OUTPUT(server/mpm/$MPM_NAME/Makefile)
+if ap_mpm_is_enabled "prefork"; then
+ APACHE_FAST_OUTPUT(server/mpm/prefork/Makefile)
fi
Modified: httpd/httpd/trunk/server/mpm/simple/config3.m4
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/simple/config3.m4?rev=832228&r1=832227&r2=832228&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/simple/config3.m4 (original)
+++ httpd/httpd/trunk/server/mpm/simple/config3.m4 Tue Nov 3 00:38:06 2009
@@ -1,3 +1,3 @@
-if test "$MPM_NAME" = "simple" ; then
- APACHE_FAST_OUTPUT(server/mpm/$MPM_NAME/Makefile)
+if ap_mpm_is_enabled "simple"; then
+ APACHE_FAST_OUTPUT(server/mpm/simple/Makefile)
fi
Modified: httpd/httpd/trunk/server/mpm/winnt/config3.m4
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/winnt/config3.m4?rev=832228&r1=832227&r2=832228&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/winnt/config3.m4 (original)
+++ httpd/httpd/trunk/server/mpm/winnt/config3.m4 Tue Nov 3 00:38:06 2009
@@ -1,3 +1,3 @@
-if test "$MPM_NAME" = "winnt" ; then
- APACHE_FAST_OUTPUT(server/mpm/$MPM_NAME/Makefile)
+if ap_mpm_is_enabled "winnt"; then
+ APACHE_FAST_OUTPUT(server/mpm/winnt/Makefile)
fi
Modified: httpd/httpd/trunk/server/mpm/worker/config3.m4
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/worker/config3.m4?rev=832228&r1=832227&r2=832228&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/worker/config3.m4 (original)
+++ httpd/httpd/trunk/server/mpm/worker/config3.m4 Tue Nov 3 00:38:06 2009
@@ -1,6 +1,6 @@
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)
- APACHE_FAST_OUTPUT(server/mpm/$MPM_NAME/Makefile)
+ APACHE_FAST_OUTPUT(server/mpm/worker/Makefile)
fi