From 9276a81328091fdebc833eb10580d53bc51659db Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bruno=20Pr=C3=A9mont?= Date: Sun, 5 Oct 2008 14:09:08 +0200 Subject: [PATCH] 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 --- configure.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- 2.30.2