]> granicus.if.org Git - apache/commitdiff
Make APACHE_MODULE() accept an optional prerequisite module for configure.
authorStefan Fritsch <sf@apache.org>
Fri, 20 Jan 2012 22:14:31 +0000 (22:14 +0000)
committerStefan Fritsch <sf@apache.org>
Fri, 20 Jan 2012 22:14:31 +0000 (22:14 +0000)
Introduce the following configure time dependencies:
  mod_proxy_* (except proxy_html) require mod_proxy
  mod_dav_* require mod_dav
  mod_session_* require mod_session

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

acinclude.m4
modules/dav/fs/config6.m4
modules/dav/lock/config6.m4
modules/proxy/config.m4
modules/session/config.m4

index 621a0ad7ba70e9a5c5797791d845728168e192d6..7d498a1b72f91ce1183172158c7f0d24806eab53 100644 (file)
@@ -267,7 +267,7 @@ EOF
 ])dnl
 
 dnl
-dnl APACHE_MODULE(name, helptext[, objects[, structname[, default[, config]]]])
+dnl APACHE_MODULE(name, helptext[, objects[, structname[, default[, config[, prereq_module]]]]])
 dnl
 dnl default is one of:
 dnl   yes    -- enabled by default. user must explicitly disable.
@@ -284,6 +284,15 @@ dnl            setting. otherwise, fall under the "all" setting.
 dnl            explicit yes/no always overrides, except if the user selects
 dnl            "reallyall".
 dnl
+dnl prereq_module is a module (without the "mod_" prefix) that must be enabled
+dnl   if the current module is enabled.  If the current module is built
+dnl   statically, prereq_module must be built statically, too.  If these
+dnl   conditions are not fulfilled, configure will abort if the current module
+dnl   has been enabled explicitly. Otherwise, configure will disable the
+dnl   current module.
+dnl   prereq_module's APACHE_MODULE() statement must have been processed
+dnl   before the current APACHE_MODULE() statement.
+dnl
 AC_DEFUN(APACHE_MODULE,[
   AC_MSG_CHECKING(whether to enable mod_$1)
   define([optname],[--]ifelse($5,yes,disable,enable)[-]translit($1,_,-))dnl
@@ -336,8 +345,16 @@ AC_DEFUN(APACHE_MODULE,[
   if test "$enable_$1" != "no"; then
     dnl If we plan to enable it, allow the module to run some autoconf magic
     dnl that may disable it because of missing dependencies.
-    ifelse([$6],,:,[AC_MSG_RESULT([checking dependencies])
-                    $6
+    ifelse([$6$7],,:,[AC_MSG_RESULT([checking dependencies])
+                      ifelse([$7],,:,[if test "$enable_$7" = "no" ; then
+                                        enable_$1=no
+                                        AC_MSG_WARN("mod_$7 is disabled but required for mod_$1")
+                                      elif test "$enable_$1" = "static" && test "$enable_$7" != "static" ; then
+                                        enable_$1=no
+                                        AC_MSG_WARN("cannot build mod_$1 statically if mod_$7 is built shared")
+                                      else])
+                                        ifelse([$6],,:,[$6])
+                      ifelse([$7],,:,[fi])
                     AC_MSG_CHECKING(whether to enable mod_$1)
                     if test "$enable_$1" = "no"; then
                       if test "$_apmod_required" = "no"; then
index 235d0d7fcd407e6fd607a038e4fddb3cd48b3ef8..dd26ec8bab960a60ad038d81b776d62e9d7b4dee 100644 (file)
@@ -18,6 +18,6 @@ case "$host" in
     ;;
 esac
 
-APACHE_MODULE(dav_fs, DAV provider for the filesystem.  --enable-dav also enables mod_dav_fs., $dav_fs_objects, , $dav_fs_enable)
+APACHE_MODULE(dav_fs, DAV provider for the filesystem.  --enable-dav also enables mod_dav_fs., $dav_fs_objects, , $dav_fs_enable,,dav)
 
 APACHE_MODPATH_FINISH
index 75f7c5bf24d6b96108577e749f8e61ad0e515f4e..02a05e5e18c1d4beefafc095e9092ac525536df9 100644 (file)
@@ -12,6 +12,6 @@ case "$host" in
     ;;
 esac
 
-APACHE_MODULE(dav_lock, DAV provider for generic locking - requires --enable-dav, $dav_lock_objects, , )
+APACHE_MODULE(dav_lock, DAV provider for generic locking, $dav_lock_objects, ,,,dav)
 
 APACHE_MODPATH_FINISH
index 53144e8066326df8cb1cd4eab6c95e024cf2673c..a5535a2d8f5a0e52e97685691acbf2175e6283b7 100644 (file)
@@ -37,11 +37,11 @@ case "$host" in
     ;;
 esac
 
-APACHE_MODULE(proxy_connect, Apache proxy CONNECT module.  Requires and is enabled by --enable-proxy., $proxy_connect_objs, , $proxy_mods_enable)
-APACHE_MODULE(proxy_ftp, Apache proxy FTP module.  Requires and is enabled by --enable-proxy., $proxy_ftp_objs, , $proxy_mods_enable)
-APACHE_MODULE(proxy_http, Apache proxy HTTP module.  Requires and is enabled by --enable-proxy., $proxy_http_objs, , $proxy_mods_enable)
-APACHE_MODULE(proxy_fcgi, Apache proxy FastCGI module.  Requires and is enabled by --enable-proxy., $proxy_fcgi_objs, , $proxy_mods_enable)
-APACHE_MODULE(proxy_scgi, Apache proxy SCGI module.  Requires and is enabled by --enable-proxy., $proxy_scgi_objs, , $proxy_mods_enable)
+APACHE_MODULE(proxy_connect, Apache proxy CONNECT module.  Requires and is enabled by --enable-proxy., $proxy_connect_objs, , $proxy_mods_enable,, proxy)
+APACHE_MODULE(proxy_ftp, Apache proxy FTP module.  Requires and is enabled by --enable-proxy., $proxy_ftp_objs, , $proxy_mods_enable,, proxy)
+APACHE_MODULE(proxy_http, Apache proxy HTTP module.  Requires and is enabled by --enable-proxy., $proxy_http_objs, , $proxy_mods_enable,, proxy)
+APACHE_MODULE(proxy_fcgi, Apache proxy FastCGI module.  Requires and is enabled by --enable-proxy., $proxy_fcgi_objs, , $proxy_mods_enable,, proxy)
+APACHE_MODULE(proxy_scgi, Apache proxy SCGI module.  Requires and is enabled by --enable-proxy., $proxy_scgi_objs, , $proxy_mods_enable,, proxy)
 APACHE_MODULE(proxy_fdpass, Apache proxy to Unix Daemon Socket module.  Requires --enable-proxy., $proxy_fdpass_objs, , , [
   AC_CHECK_DECL(CMSG_DATA,,, [
     #include <sys/types.h>
@@ -51,9 +51,9 @@ APACHE_MODULE(proxy_fdpass, Apache proxy to Unix Daemon Socket module.  Requires
     AC_MSG_WARN([Your system does not support CMSG_DATA.])
     enable_proxy_fdpass=no
   fi
-])
-APACHE_MODULE(proxy_ajp, Apache proxy AJP module.  Requires and is enabled by --enable-proxy., $proxy_ajp_objs, , $proxy_mods_enable)
-APACHE_MODULE(proxy_balancer, Apache proxy BALANCER module.  Requires and is enabled by --enable-proxy., $proxy_balancer_objs, , $proxy_mods_enable)
+],proxy)
+APACHE_MODULE(proxy_ajp, Apache proxy AJP module.  Requires and is enabled by --enable-proxy., $proxy_ajp_objs, , $proxy_mods_enable,, proxy)
+APACHE_MODULE(proxy_balancer, Apache proxy BALANCER module.  Requires and is enabled by --enable-proxy., $proxy_balancer_objs, , $proxy_mods_enable,, proxy)
 
 APACHE_MODULE(serf, [Reverse proxy module using Serf], , , no, [
     APACHE_CHECK_SERF
@@ -64,7 +64,7 @@ APACHE_MODULE(serf, [Reverse proxy module using Serf], , , no, [
     fi
 ])
 
-APACHE_MODULE(proxy_express, mass reverse-proxy module. Requires --enable-proxy., , , $proxy_mods_enable)
+APACHE_MODULE(proxy_express, mass reverse-proxy module. Requires --enable-proxy., , , $proxy_mods_enable,, proxy)
 
 APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/$modpath_current])
 
index 373df4761a647a884e6c68656f2716987133cbe2..719fe9152ce83dfcbb90bf4aaf5ae0c39e015574 100644 (file)
@@ -30,7 +30,7 @@ case "$host" in
 esac
 
 APACHE_MODULE(session, session module, , , most)
-APACHE_MODULE(session_cookie, session cookie module, $session_cookie_objects, , $session_mods_enable)
+APACHE_MODULE(session_cookie, session cookie module, $session_cookie_objects, , $session_mods_enable,,session)
 
 if test "$enable_session_crypto" != ""; then
   session_mods_enable_crypto=$enable_session_crypto
@@ -58,9 +58,9 @@ APACHE_MODULE(session_crypto, session crypto module, $session_crypto_objects, ,
 if test "$session_mods_enable_crypto" = "no" ; then
   enable_session_crypto=no
 fi
-])
+],session)
 
-APACHE_MODULE(session_dbd, session dbd module, $session_dbd_objects, , $session_mods_enable)
+APACHE_MODULE(session_dbd, session dbd module, $session_dbd_objects, , $session_mods_enable,,session)
 
 APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/$modpath_current])