On Monday 07 June 2010, Rainer Jung wrote:
> - build "most" module set by default.
>    Alternatives are:
>    - all
>    - few (same set as was default before the change)
>    - none

I would like to have an option for developers/testers that builds 
every module that can be built with the currently installed libraries. 
The attached patch adds a "reallyall" set. My auto-fu could be better 
but the patch works for me (tm). Of course, I am open for better names 
than reallyall.

The patch also removes the --enable-distcache option. If the user 
requested mod_socache_dc we already know he wants distcache. No need 
for a special option (unless it allowed to select the prefix, which it 
didn't).

And it also makes the --with-serf option default to /usr. Same 
reasoning: If the user requested mod_serf, he wants --with-serf.
diff --git a/acinclude.m4 b/acinclude.m4
index 6f7fe74..e49ac78 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -282,7 +282,8 @@ AC_DEFUN(APACHE_MODULE,[
   _apmod_extra_msg=""
   dnl When --enable-modules=most is set and the module was not explicitly
   dnl requested, allow a module to disable itself if its pre-reqs fail.
-  if test "$module_selection" = "most" -a "$enable_$1" = "most"; then
+  if test "$module_selection" = "most" -a "$enable_$1" = "most" ||
+     test "$module_selection" = "reallyall"; then
     _apmod_error_fatal="no"
   else
     _apmod_error_fatal="yes"
@@ -292,19 +293,21 @@ AC_DEFUN(APACHE_MODULE,[
   elif test "$enable_$1" = "yes"; then
     enable_$1=$module_default
   elif test "$enable_$1" = "most"; then
-    if test "$module_selection" = "most" -o "$module_selection" = "all"; then
+    if test "$module_selection" = "most" -o "$module_selection" = "all" -o "$module_selection" = "reallyall"; then
       enable_$1=$module_default
     elif test "$module_selection" = "few" -o "$module_selection" = "none"; then
       enable_$1=no
     fi
     _apmod_extra_msg=" ($module_selection)"
   elif test "$enable_$1" = "maybe-all"; then
-    if test "$module_selection" = "all"; then
+    if test "$module_selection" = "all" -o "$module_selection" = "reallyall"; then
       enable_$1=$module_default
       _apmod_extra_msg=" (all)"
     else
       enable_$1=no
     fi
+  elif test "$enable_$1" = "no" -a "$module_selection" = "reallyall"; then
+      enable_$1=$module_default
   fi
   if test "$enable_$1" != "no"; then
     dnl If we plan to enable it, allow the module to run some autoconf magic
@@ -361,14 +364,15 @@ AC_DEFUN(APACHE_ENABLE_MODULES,[
 
 
   AC_ARG_ENABLE(modules,
-  APACHE_HELP_STRING(--enable-modules=MODULE-LIST,Space-separated list of modules to enable | "all" | "most" | "few" | "none"),[
+  APACHE_HELP_STRING(--enable-modules=MODULE-LIST,Space-separated list of modules to enable | "all" | "most" | "few" | "none"| "reallyall"),[
     if test "$enableval" = "none"; then
        module_default=no
        module_selection=none
     else
       for i in $enableval; do
-        if test "$i" = "all" -o "$i" = "most" -o "$i" = "few"; then
+        if test "$i" = "all" -o "$i" = "most" -o "$i" = "few" -o "$i" = "reallyall"; then
           module_selection=$i
+		echo module_selection: $module_selection
         else
           i=`echo $i | sed 's/-/_/g'`
           eval "enable_$i=shared"
@@ -378,9 +382,9 @@ AC_DEFUN(APACHE_ENABLE_MODULES,[
   ])
   
   AC_ARG_ENABLE(mods-shared,
-  APACHE_HELP_STRING(--enable-mods-shared=MODULE-LIST,Space-separated list of shared modules to enable | "all" | "most" | "few"),[
+  APACHE_HELP_STRING(--enable-mods-shared=MODULE-LIST,Space-separated list of shared modules to enable | "all" | "most" | "few"| "reallyall"),[
     for i in $enableval; do
-      if test "$i" = "all" -o "$i" = "most" -o "$i" = "few"; then
+      if test "$i" = "all" -o "$i" = "most" -o "$i" = "few" -o "$i" = "reallyall"; then
         module_selection=$i
         module_default=shared
       else
diff --git a/modules/cache/config.m4 b/modules/cache/config.m4
index a750b96..f2461ce 100644
--- a/modules/cache/config.m4
+++ b/modules/cache/config.m4
@@ -16,43 +16,11 @@ APACHE_MODULE(cache, dynamic file caching, $cache_objs, , most)
 APACHE_MODULE(disk_cache, disk caching module, , , most)
 
 AC_DEFUN([CHECK_DISTCACHE], [
-  AC_MSG_CHECKING(whether Distcache is required)
-  ap_ssltk_dc="no"
-  tmp_nomessage=""
-  tmp_forced="no"
-  AC_ARG_ENABLE(distcache,
-    APACHE_HELP_STRING(--enable-distcache,Enable distcache support),
-    ap_ssltk_dc="$enableval"
-    tmp_nomessage=""
-    tmp_forced="yes"
-    if test "x$ap_ssltk_dc" = "x"; then
-      ap_ssltk_dc="yes"
-      dnl our "error"s become "tests revealed that..."
-      tmp_forced="no"
-    fi
-    if test "$ap_ssltk_dc" != "yes" -a "$ap_ssltk_dc" != "no"; then
-      tmp_nomessage="--enable-distcache had illegal syntax - disabling"
-      ap_ssltk_dc="no"
-    fi)
-  if test "$tmp_forced" = "no"; then
-    AC_MSG_RESULT($ap_ssltk_dc (default))
-  else
-    AC_MSG_RESULT($ap_ssltk_dc (specified))
-  fi
-  if test "$tmp_forced" = "yes" -a "x$ap_ssltk_dc" = "xno" -a "x$tmp_nomessage" != "x"; then
-    AC_MSG_ERROR(distcache support failed: $tmp_nomessage)
-  fi
-  if test "$ap_ssltk_dc" = "yes"; then
-    AC_CHECK_HEADER(
-      [distcache/dc_client.h],
-      [],
-      [tmp_nomessage="can't include distcache headers"
-      ap_ssltk_dc="no"])
-    if test "$tmp_forced" = "yes" -a "x$ap_ssltk_dc" = "xno"; then
-      AC_MSG_ERROR(distcache support failed: $tmp_nomessage)
-    fi
-  fi
-  if test "$ap_ssltk_dc" = "yes"; then
+  AC_CHECK_HEADER(
+    [distcache/dc_client.h],
+    [have_distcache=yes],
+    [have_distcache=no])
+  if test "$have_distcache" = "yes"; then
     AC_MSG_CHECKING(for Distcache version)
     AC_TRY_COMPILE(
 [#include <distcache/dc_client.h>],
@@ -60,14 +28,10 @@ AC_DEFUN([CHECK_DISTCACHE], [
 #error "distcache API version is unrecognised"
 #endif],
 [],
-[tmp_nomessage="distcache has an unsupported API version"
-ap_ssltk_dc="no"])
-    AC_MSG_RESULT($ap_ssltk_dc)
-    if test "$tmp_forced" = "yes" -a "x$ap_ssltk_dc" = "xno"; then
-      AC_MSG_ERROR(distcache support failed: $tmp_nomessage)
-    fi
+[have_distcache=no])
+    AC_MSG_RESULT($have_distcache)
   fi
-  if test "$ap_ssltk_dc" = "yes"; then
+  if test "$have_distcache" = "yes"; then
     AC_MSG_CHECKING(for Distcache libraries)
     save_libs=$LIBS
     LIBS="$LIBS -ldistcache -lnal"
@@ -75,16 +39,15 @@ ap_ssltk_dc="no"])
       [#include <distcache/dc_client.h>],
       [DC_CTX *foo = DC_CTX_new((const char *)0,0);],
       [],
-      [tmp_no_message="failed to link with distcache libraries"
-      ap_ssltk_dc="no"])
+      [have_distcache=no])
     LIBS=$save_libs
-    AC_MSG_RESULT($ap_ssltk_dc)
-    if test "$tmp_forced" = "yes" -a "x$ap_ssltk_dc" = "xno"; then
-      AC_MSG_ERROR(distcache support failed: $tmp_nomessage)
-    else
-      APR_ADDTO(MOD_SOCACHE_LDADD, [-ldistcache -lnal])
-      AC_DEFINE(HAVE_DISTCACHE, 1, [Define if distcache support is enabled])
-    fi
+    AC_MSG_RESULT($have_distcache)
+  fi
+  if test "$have_distcache" = "yes"; then
+    APR_ADDTO(MOD_SOCACHE_LDADD, [-ldistcache -lnal])
+    AC_DEFINE(HAVE_DISTCACHE, 1, [Define if distcache support is enabled])
+  else
+    enable_socache_dc=no
   fi
 ])
 
diff --git a/modules/proxy/config.m4 b/modules/proxy/config.m4
index f382dde..f830945 100644
--- a/modules/proxy/config.m4
+++ b/modules/proxy/config.m4
@@ -62,29 +62,32 @@ APACHE_MODULE(proxy_balancer, Apache proxy BALANCER module, $proxy_balancer_objs
 
 AC_DEFUN([CHECK_SERF], [
   serf_found="no"
+  serf_prefix=/usr
   AC_ARG_WITH(serf, APACHE_HELP_STRING([--with-serf=PREFIX],
                                   [Serf client library]),
   [
-    if test "$withval" = "yes" ; then
-      AC_MSG_ERROR([--with-serf requires an argument.])
-    else
-      serf_prefix=$withval
-      save_cppflags="$CPPFLAGS"
-      CPPFLAGS="$CPPFLAGS $APR_INCLUDES $APU_INCLUDES -I$serf_prefix/include/serf-0"
-      AC_CHECK_HEADERS(serf.h,[
-        save_ldflags="$LDFLAGS"
-        LDFLAGS="$LDFLAGS -L$serf_prefix/lib"
-        AC_CHECK_LIB(serf-0, serf_context_create,[serf_found="yes"])
-        LDFLAGS="$save_ldflags"])
-      CPPFLAGS="$save_cppflags"
-    fi
+      if test "$withval" != "yes" ; then
+        serf_prefix=$withval
+      fi
   ])
 
+  if test "$serf_prefix" != "no" ; then
+    save_cppflags="$CPPFLAGS"
+    CPPFLAGS="$CPPFLAGS $APR_INCLUDES $APU_INCLUDES -I$serf_prefix/include/serf-0"
+    AC_CHECK_HEADERS(serf.h,[
+      save_ldflags="$LDFLAGS"
+      LDFLAGS="$LDFLAGS -L$serf_prefix/lib"
+      AC_CHECK_LIB(serf-0, serf_context_create,[serf_found="yes"])
+      LDFLAGS="$save_ldflags"])
+    CPPFLAGS="$save_cppflags"
+  fi
+
   if test "$serf_found" = "yes"; then
     MOD_SERF_LDADD="-L$serf_prefix/lib -lserf-0"
     APR_ADDTO(INCLUDES, ["-I$serf_prefix/include/serf-0"])
   else
-    AC_MSG_ERROR(unable to find serf)
+    AC_MSG_WARN(unable to find serf)
+    enable_serf="no"
   fi
 ])
 

Reply via email to