configure: Added the --enable-all-plugins option.
authorSebastian Harl <sh@tokkee.org>
Sun, 10 May 2009 16:47:41 +0000 (18:47 +0200)
committerSebastian Harl <sh@tokkee.org>
Mon, 11 May 2009 09:36:55 +0000 (11:36 +0200)
This option may be used to enable or disable all plugins by default. The
default may be overwritten by explicitly enabling or disabling a plugin using
the --enable-<plugin> option.

README
configure.in

diff --git a/README b/README
index 83e431e..8deaf0e 100644 (file)
--- a/README
+++ b/README
@@ -554,9 +554,12 @@ Configuring / Compiling / Installing
   section `Prerequisites' above) and rerun `configure'. If you specify the
   `--enable-<plugin>' configure option, the script will fail if the depen-
   dencies for the specified plugin are not met. If you specify the
-  `--disable-<plugin>' configure option, the plugin will not be built. Both
-  options are meant for package maintainers and should not be used in everyday
-  situations.
+  `--disable-<plugin>' configure option, the plugin will not be built. If you
+  specify the `--enable-all-plugins' or `--disable-all-plugins' configure
+  options, all plugins will be enabled or disabled respectively by default.
+  Explicitly enabling or disabling a plugin overwrites the default for the
+  specified plugin. These options are meant for package maintainers and should
+  not be used in everyday situations.
 
   By default, collectd will be installed into `/opt/collectd'. You can adjust
   this setting by specifying the `--prefix' configure option - see INSTALL for
index e37a8ab..a62914d 100644 (file)
@@ -3233,12 +3233,17 @@ AC_DEFUN(
      fi
     ],
     [
-     if test "x$2" = "xyes"
-     then
-            enable_plugin="yes"
-     else
-            enable_plugin="no"
-     fi
+        if test "x$enable_all_plugins" = "xauto"
+        then
+            if test "x$2" = "xyes"
+            then
+                    enable_plugin="yes"
+            else
+                    enable_plugin="no"
+            fi
+        else
+            enable_plugin="$enable_all_plugins"
+        fi
     ])
     if test "x$enable_plugin" = "xyes"
     then
@@ -3506,6 +3511,24 @@ fi
 m4_divert_once([HELP_ENABLE], [
 collectd plugins:])
 
+AC_ARG_ENABLE([all-plugins],
+               AC_HELP_STRING([--enable-all-plugins],
+                               [enable all plugins (auto by def)]),
+               [
+                if test "x$enableval" = "xyes"
+                then
+                        enable_all_plugins="yes"
+                else if test "x$enableval" = "xauto"
+                then
+                        enable_all_plugins="auto"
+                else
+                        enable_all_plugins="no"
+                fi; fi
+               ],
+               [enable_all_plugins="auto"])
+
+m4_divert_once([HELP_ENABLE], [])
+
 AC_PLUGIN([apache],      [$with_libcurl],      [Apache httpd statistics])
 AC_PLUGIN([apcups],      [yes],                [Statistics of UPSes by APC])
 AC_PLUGIN([apple_sensors], [$with_libiokit],   [Apple's hardware sensors])