From: Florian Forster Date: Mon, 6 Oct 2008 13:35:42 +0000 (+0200) Subject: configure.in: Correct the `--enable-' code. X-Git-Tag: collectd-4.4.4~12 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=452db816211a3a5322caaedc28fa17ffff72161d;p=collectd.git configure.in: Correct the `--enable-' code. The new behavior is documented in the `README' file, too. --- diff --git a/README b/README index 904e7c73..97b66f79 100644 --- a/README +++ b/README @@ -389,9 +389,11 @@ Configuring / Compiling / Installing disable all plugins whose requirements cannot be fulfilled (any other plugin will be enabled). To enable a plugin, install missing dependencies (see section `Prerequisites' above) and rerun `configure'. If you specify the - `--enable-' configure option, you can force the plugin to be built. - This will most likely fail though unless you're working in a very unusual - setup and you really know what you're doing. + `--enable-' configure option, the script will fail if the depen- + dencies for the specified plugin are not met. If you specify the + `--disable-' configure option, the plugin will not be built. Both + 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 diff --git a/configure.in b/configure.in index 88b13daa..bc4d3213 100644 --- a/configure.in +++ b/configure.in @@ -2276,12 +2276,15 @@ AC_DEFUN( enable_plugin="no" fi ]) - if test "x$enable_plugin" = "xyes" && test "x$2" = "xyes" + if test "x$enable_plugin" = "xyes" then - AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.]) - else - dependency_error="yes" - test "x$enable_plugin" = "xyes" && enable_plugin="failed (missing dependency)" + if test "x$2" = "xyes" + then + AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.]) + else # User passed "yes" but dependency checking yielded "no" => Dependency problem. + dependency_error="yes" + enable_plugin="no (dependency error)" + fi fi AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes") enable_$1="$enable_plugin"