]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Change the configure-based MPM build mechanism to support building
authorJeff Trawick <trawick@apache.org>
Tue, 3 Nov 2009 14:36:48 +0000 (14:36 +0000)
committerJeff Trawick <trawick@apache.org>
Tue, 3 Nov 2009 14:36:48 +0000 (14:36 +0000)
an MPM as a shared shared or dynamic module, primarily using the
APACHE_MPM_MODULE() function.

--enable-mpms-shared now builds/installs the MPMs as dynamic modules.
(But no LoadModule directives are added.)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@832434 13f79535-47bb-0310-9956-ffa450edef68

15 files changed:
CHANGES
acinclude.m4
server/mpm/config.m4
server/mpm/event/Makefile.in
server/mpm/event/config3.m4
server/mpm/mpmt_os2/Makefile.in
server/mpm/mpmt_os2/config5.m4
server/mpm/prefork/Makefile.in
server/mpm/prefork/config3.m4
server/mpm/simple/Makefile.in
server/mpm/simple/config3.m4
server/mpm/winnt/Makefile.in
server/mpm/winnt/config3.m4
server/mpm/worker/Makefile.in
server/mpm/worker/config3.m4

diff --git a/CHANGES b/CHANGES
index 4fe5853d7e6e305a1a98971c8e9fff54badef65b..a886f3e028967bb3336a1708ab18b5bee65b223c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -252,9 +252,10 @@ Changes with Apache 2.3.3
   *) mod_proxy_ajp: Forward remote port information by default.
      [Rainer Jung]
 
-  *) Allow MPMs to be loaded dynamically, as with most other modules.  This
-     required changes to the MPM interfaces.  Removed: mpm.h, mpm_default.h
-     (as an installed header), APACHE_MPM_DIR, MPM_NAME, ap_threads_per_child, 
+  *) Allow MPMs to be loaded dynamically, as with most other modules.  Use
+     --enable-mpms-shared={list|"all"} to enable.  This required changes to
+     the MPM interfaces.  Removed: mpm.h, mpm_default.h (as an installed 
+     header), APACHE_MPM_DIR, MPM_NAME, ap_threads_per_child,
      ap_max_daemons_limit, ap_my_generation, etc.  ap_mpm_query() can't be
      called until after the register-hooks phase.  [Jeff Trawick]
 
index e9dcec84253571a2a310e75a7a22b375cbff23d9..5caeecc0694b549352174b7bf456b852c0c524ff 100644 (file)
@@ -200,6 +200,59 @@ EOF
   fi
 ])dnl
 
+dnl
+dnl APACHE_MPM_MODULE(name[, shared[, objects[, config[, path]]]])
+dnl
+dnl Provide information for building the MPM.  (Enablement is handled using
+dnl --with-mpm/--enable-mpms-shared.)
+dnl
+dnl name     -- name of MPM, same as MPM directory name
+dnl shared   -- variable to check for value "shared" to indicate shared module build
+dnl objects  -- one or more .lo files to link into the MPM module (default: mpmname.lo)
+dnl config   -- configuration logic to run if the MPM is enabled
+dnl path     -- relative path to MPM (default: server/mpm/mpmname)
+dnl
+AC_DEFUN(APACHE_MPM_MODULE,[
+    if ap_mpm_is_enabled $1; then
+        if test -z "$3"; then
+            objects="$1.lo"
+        else
+            objects="$3"
+        fi
+
+        if test -z "$5"; then
+            mpmpath="server/mpm/$1"
+        else
+            mpmpath=$5
+        fi
+
+        APACHE_FAST_OUTPUT($mpmpath/Makefile)
+
+        if test -z "$2"; then
+            libname="lib$1.la"
+            cat >$mpmpath/modules.mk<<EOF
+$libname: $objects
+       \$(MOD_LINK) $objects
+DISTCLEAN_TARGETS = modules.mk
+static = $libname
+shared =
+EOF
+        else
+            apache_need_shared=yes
+            libname="mod_mpm_$1.la"
+            shobjects=`echo $objects | sed 's/\.lo/.slo/g'`
+            cat >$mpmpath/modules.mk<<EOF
+$libname: $shobjects
+       \$(SH_LINK) -rpath \$(libexecdir) -module -avoid-version $objects
+DISTCLEAN_TARGETS = modules.mk
+static =
+shared = $libname
+EOF
+        fi
+        $4
+    fi
+])dnl
+
 dnl
 dnl APACHE_MODULE(name, helptext[, objects[, structname[, default[, config]]]])
 dnl
index b855368492c727b18d7c9bd998ad5b52d86b3d7c..08541b0932b0a86ff586c29cb402266968208c53 100644 (file)
@@ -49,7 +49,11 @@ AC_DEFUN(APACHE_MPM_SUPPORTED,[
 
 dnl APACHE_MPM_ENABLED(name)
 AC_DEFUN(APACHE_MPM_ENABLED,[
-    ENABLED_MPMS="$ENABLED_MPMS $1 "
+    if ap_mpm_is_enabled $1; then
+        :
+    else
+        ENABLED_MPMS="$ENABLED_MPMS $1 "
+    fi
 ])dnl
 
 ap_mpm_is_supported ()
index 7c2a1a7a6df8afe0692b4b6b935cc18e427be6ba..f34af9cbd660c1d26b7605f82f4c945ab7fa5b28 100644 (file)
@@ -1,5 +1 @@
-
-LTLIBRARY_NAME    = libevent.la
-LTLIBRARY_SOURCES = event.c fdqueue.c pod.c
-
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/special.mk
index d4378cf3ab80ef4934e4df8d45e33ca471f796f2..649d863874670081060422fde0aec03e632e790c 100644 (file)
@@ -1,6 +1,5 @@
 dnl ## XXX - Need a more thorough check of the proper flags to use
 
-if ap_mpm_is_enabled "event"; then
+APACHE_MPM_MODULE(event, $enable_mpm_event, event.lo fdqueue.lo pod.lo,[
     AC_CHECK_FUNCS(pthread_kill)
-    APACHE_FAST_OUTPUT(server/mpm/event/Makefile)
-fi
+])
index 38e598edf3aa14d48e2e271d2122b493215e169a..f34af9cbd660c1d26b7605f82f4c945ab7fa5b28 100644 (file)
@@ -1,5 +1 @@
-
-LTLIBRARY_NAME    = libmpmt_os2.la
-LTLIBRARY_SOURCES = mpmt_os2.c mpmt_os2_child.c
-
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/special.mk
index 51bc4cb61c88bbbbbe679918700cb54855bc9a44..c74f1452bbc24125b90dab4d594cf1a8ff974479 100644 (file)
@@ -1,5 +1,3 @@
-if ap_mpm_is_enabled "mpmt_os2"; then
-    AC_CACHE_SAVE
-    APACHE_FAST_OUTPUT(server/mpm/mpmt_os2/Makefile)
+APACHE_MPM_MODULE(mpmt_os2, $enable_mpm_mpmt_os2, mpmt_os2.lo mpmt_os2_child.lo,[
     APR_ADDTO(CFLAGS,-Zmt)
-fi
+])
index 034bf5ce84c074dad1b5c9cb31e85c1664948db6..f34af9cbd660c1d26b7605f82f4c945ab7fa5b28 100644 (file)
@@ -1,5 +1 @@
-
-LTLIBRARY_NAME    = libprefork.la
-LTLIBRARY_SOURCES = prefork.c
-
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/special.mk
index 9cafecbd3fc6e17854ac2bc446109e30ecd1e0a1..25fd8df3397d8e1681628364e091e5e988ab757c 100644 (file)
@@ -1,3 +1 @@
-if ap_mpm_is_enabled "prefork"; then
-    APACHE_FAST_OUTPUT(server/mpm/prefork/Makefile)
-fi
+APACHE_MPM_MODULE(prefork, $enable_mpm_prefork)
index 4c9dee07fdc848b88ff9495e8acbf5da082e688d..f34af9cbd660c1d26b7605f82f4c945ab7fa5b28 100644 (file)
@@ -1,4 +1 @@
-LTLIBRARY_NAME    = libsimple.la
-LTLIBRARY_SOURCES = simple_api.c simple_children.c simple_core.c simple_event.c simple_run.c simple_io.c
-
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/special.mk
index fcdc9b03273e6142adfbbe3435c8950dd00654b7..e518119518cc6fe5ba5ae3d6a5365a1b50349ca2 100644 (file)
@@ -1,3 +1,3 @@
-if ap_mpm_is_enabled "simple"; then
-    APACHE_FAST_OUTPUT(server/mpm/simple/Makefile)
-fi
+simple_objects="simple_api.lo simple_children.lo simple_core.lo \
+simple_event.lo simple_run.lo simple_io.lo"
+APACHE_MPM_MODULE(simple, $enable_mpm_simple, $simple_objects)
index d28a5ea58736cfcafc112f62b5404e63c56fbda7..f34af9cbd660c1d26b7605f82f4c945ab7fa5b28 100644 (file)
@@ -1,5 +1 @@
-
-LTLIBRARY_NAME    = libwinnt.la
-LTLIBRARY_SOURCES = child.c mpm_winnt.c nt_eventlog.c service.c
-
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/special.mk
index 8486288092ff203fc57ef28f6a47b12430278fe5..f937e404950be9aace5dfeda9039d5d20046ed55 100644 (file)
@@ -1,3 +1,2 @@
-if ap_mpm_is_enabled "winnt"; then
-    APACHE_FAST_OUTPUT(server/mpm/winnt/Makefile)
-fi
+winnt_objects="child.lo mpm_winnt.lo nt_eventlog.lo service.lo"
+APACHE_MPM_MODULE(winnt, $enable_mpm_winnt, $winnt_objects)
index b45b848341f4d5687e9960763821614f32787e0c..e32210f185139c3056f9db99d43a2bae426aa69a 100644 (file)
@@ -1,5 +1,2 @@
 
-LTLIBRARY_NAME    = libworker.la
-LTLIBRARY_SOURCES = worker.c fdqueue.c pod.c
-
-include $(top_srcdir)/build/ltlib.mk
+include $(top_srcdir)/build/special.mk
index be55625909372f67fb1343fd211258afd8f665c3..dc2bccb554292bfaf810ea31edc9d25cb42a46ae 100644 (file)
@@ -1,6 +1,5 @@
 dnl ## XXX - Need a more thorough check of the proper flags to use
 
-if ap_mpm_is_enabled "worker"; then
+APACHE_MPM_MODULE(worker, $enable_mpm_worker, worker.lo fdqueue.lo pod.lo,[
     AC_CHECK_FUNCS(pthread_kill)
-    APACHE_FAST_OUTPUT(server/mpm/worker/Makefile)
-fi
+])