Code

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 83e431ea9b613640ca2ed6113cd43341e513cdbc..8deaf0eb0adbc52e400c1f8110fd6e0c75b5f059 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 e37a8ab2be64e8487e29bda1be404de299016cd8..a62914d350c6276c6c19db45aee7ba1664df2e8b 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])