]> granicus.if.org Git - apache/commitdiff
By default, only load those modules that are either required
authorStefan Fritsch <sf@apache.org>
Tue, 8 Nov 2011 00:20:24 +0000 (00:20 +0000)
committerStefan Fritsch <sf@apache.org>
Tue, 8 Nov 2011 00:20:24 +0000 (00:20 +0000)
or explicitly selected by a configure --enable-foo argument. The
LoadModule statements for modules enabled by --enable-mods-shared=most
and friends will be commented out.

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

CHANGES
Makefile.in
acinclude.m4
configure.in

diff --git a/CHANGES b/CHANGES
index 356ec0606c79174f0d29d7e8df147778fa964644..b345992fafe7f57e08671f43a3e451bbf0376260 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -16,6 +16,11 @@ Changes with Apache 2.3.15
      core: Fix integer overflow in ap_pregsub. This can be triggered e.g.
      with mod_setenvif via a malicious .htaccess. [Stefan Fritsch]
 
+  *) configure: By default, only load those modules that are either required
+     or explicitly selected by a configure --enable-foo argument. The
+     LoadModule statements for modules enabled by --enable-mods-shared=most
+     and friends will be commented out. [Stefan Fritsch]
+
   *) mod_lua: Prevent early Lua hooks (LuaHookTranslateName and 
      LuaHookQuickHandler) from being configured in <Directory>, <Files>, 
      and htaccess where the configuration would have been ignored.
index c3b182df1b96d2e243390be67829710d4f4db65a..6a3c7b9684581bdfbfbdc8d7f4963667e246187c 100644 (file)
@@ -60,7 +60,11 @@ install-conf:
                                        < $$i; \
                                for j in $(DSO_MODULES) "^EOL^"; do \
                                        if test $$j != "^EOL^"; then \
-                                               echo "LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \
+                                               if echo "$(ENABLED_DSO_MODULES)"|$(EGREP) "\<$$j\>" > /dev/null ; then \
+                                                       echo "LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \
+                                               else \
+                                                       echo "#LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \
+                                               fi; \
                                        fi; \
                                done; \
                                sed -e '1,/@@LoadModule@@/d' \
index f51d27d9604965fd984407371a4610ed4e8d2f04..984a21d794fac3e048949473fe49519e107017d0 100644 (file)
@@ -89,6 +89,7 @@ AC_DEFUN(APACHE_GEN_CONFIG_VARS,[
   APACHE_SUBST(MKDEP)
   APACHE_SUBST(INSTALL_PROG_FLAGS)
   APACHE_SUBST(DSO_MODULES)
+  APACHE_SUBST(ENABLED_DSO_MODULES)
   APACHE_SUBST(APR_BINDIR)
   APACHE_SUBST(APR_INCLUDEDIR)
   APACHE_SUBST(APR_VERSION)
@@ -255,6 +256,7 @@ EOF
             # add default MPM to LoadModule list
             if test $1 = $default_mpm; then
                 DSO_MODULES="$DSO_MODULES mpm_$1"
+                ENABLED_DSO_MODULES="$ENABLED_DSO_MODULES mpm_$1"
             fi
         fi
         $4
@@ -290,15 +292,15 @@ AC_DEFUN(APACHE_MODULE,[
   dnl its pre-reqs fail.
   case "$enable_$1" in
     yes|static|shared)
-      _apmod_error_fatal="yes"
+      _apmod_required="yes"
       ;;
     *)
       case "$module_selection" in
       reallyall|all|most)
-        _apmod_error_fatal="no"
+        _apmod_required="no"
         ;;
       *)
-        _apmod_error_fatal="yes"
+        _apmod_required="yes"
         ;;
       esac
   esac
@@ -335,7 +337,7 @@ AC_DEFUN(APACHE_MODULE,[
                     $6
                     AC_MSG_CHECKING(whether to enable mod_$1)
                     if test "$enable_$1" = "no"; then
-                      if test "$_apmod_error_fatal" = "no"; then
+                      if test "$_apmod_required" = "no"; then
                         _apmod_extra_msg=" (disabled)"
                       else
                         AC_MSG_ERROR([mod_$1 has been requested but can not be built due to prerequisite failures])
@@ -356,6 +358,9 @@ AC_DEFUN(APACHE_MODULE,[
       sharedobjs=yes
       shared=yes
       DSO_MODULES="$DSO_MODULES $1"
+      if test "$_apmod_required" = "yes" ; then
+        ENABLED_DSO_MODULES="$ENABLED_DSO_MODULES $1"
+      fi
       ;;
     esac
     define([modprefix], [MOD_]translit($1, [a-z-], [A-Z_]))
index 43ecea81e98753ca0c275f48ead7a1a5ce87e8ca..45207e72cc5da49382f73866967e3175740736e6 100644 (file)
@@ -59,6 +59,10 @@ nl='
 dnl Check that mkdir -p works
 APR_MKDIR_P_CHECK($top_srcdir/build/mkdir.sh)
 
+dnl get an EGREP to use in the Makefiles
+AC_PROG_EGREP
+APACHE_SUBST(EGREP)
+
 dnl ## Run configure for packages Apache uses
 
 dnl shared library support for these packages doesn't currently