From: Bruno Prémont Date: Sun, 5 Oct 2008 12:09:08 +0000 (+0200) Subject: configure.in: Let configure bail out on missing dependencies X-Git-Tag: collectd-4.4.4~13 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=9276a81328091fdebc833eb10580d53bc51659db;p=collectd.git configure.in: Let configure bail out on missing dependencies The patch below adds check in AC_PLUGIN() that verifies if the dependencies are met for any enabled plugin. In case some dependency is missing (default is disabled and enabled is selected) configure will fail after dumping summary so all dependency issues are visible in a single configure pass. A later addition would be to list requirements (dependencies, OS/Kernel restrictions) for all plugins in an easily accessible location (e.g. INSTALL file) Signed-off-by: Florian Forster --- diff --git a/configure.in b/configure.in index 8ca5d691..88b13daa 100644 --- a/configure.in +++ b/configure.in @@ -2276,9 +2276,12 @@ AC_DEFUN( enable_plugin="no" fi ]) - if test "x$enable_plugin" = "xyes" + if test "x$enable_plugin" = "xyes" && test "x$2" = "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)" fi AM_CONDITIONAL([BUILD_PLUGIN_]my_toupper([$1]), test "x$enable_plugin" = "xyes") enable_$1="$enable_plugin" @@ -2292,6 +2295,7 @@ AC_COLLECTD([debug], [enable], [feature], [debugging]) AC_COLLECTD([daemon], [disable], [feature], [daemon mode]) AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux]) +dependency_error="no" plugin_ascent="no" plugin_battery="no" plugin_cpu="no" @@ -2677,3 +2681,7 @@ Configuration: xmms . . . . . . . $enable_xmms EOF + +if test "x$dependency_error" = "xyes"; then + AC_MSG_ERROR("Some plugins are missing dependencies - see above summary for details") +fi