Skip to content

Commit

Permalink
configure: Added support for --enable-<plugin>=force.
Browse files Browse the repository at this point in the history
This may be used to force a plugin to be built, no matter what the dependency
check yielded. I.e. this is basically the same --enable-<plugin> before commit
9276a81 (configure.in: Let configure bail out
on missing dependencies).
  • Loading branch information
tokkee committed May 11, 2009
1 parent 2fd1f72 commit cb62220
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
5 changes: 4 additions & 1 deletion README
Expand Up @@ -553,7 +553,10 @@ Configuring / Compiling / Installing
will be enabled). To enable a plugin, install missing dependencies (see
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
dencies for the specified plugin are not met. In that case you can force the
plugin to be built using the `--enable-<plugin>=force' configure option.
This will most likely fail though unless you're working in a very unusual
setup and you really know what you're doing. If you specify the
`--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.
Expand Down
21 changes: 18 additions & 3 deletions configure.in
Expand Up @@ -3223,14 +3223,19 @@ AC_DEFUN(
[AC_PLUGIN],
[
enable_plugin="no"
force="no"
AC_ARG_ENABLE([$1], AC_HELP_STRING([--enable-$1], [$3]),
[
if test "x$enableval" = "xyes"
then
enable_plugin="yes"
else if test "x$enableval" = "xforce"
then
enable_plugin="yes"
force="yes"
else
enable_plugin="no"
fi
fi; fi
],
[
if test "x$enable_all_plugins" = "xauto"
Expand All @@ -3247,9 +3252,13 @@ AC_DEFUN(
])
if test "x$enable_plugin" = "xyes"
then
if test "x$2" = "xyes"
if test "x$2" = "xyes" || test "x$force" = "xyes"
then
AC_DEFINE([HAVE_PLUGIN_]my_toupper([$1]), 1, [Define to 1 if the $1 plugin is enabled.])
if test "x$2" != "xyes"
then
dependency_warning="yes"
fi
else # User passed "yes" but dependency checking yielded "no" => Dependency problem.
dependency_error="yes"
enable_plugin="no (dependency error)"
Expand All @@ -3267,7 +3276,9 @@ AC_COLLECTD([debug], [enable], [feature], [debugging])
AC_COLLECTD([daemon], [disable], [feature], [daemon mode])
AC_COLLECTD([getifaddrs],[enable], [feature], [getifaddrs under Linux])

dependency_warning="no"
dependency_error="no"

plugin_ascent="no"
plugin_battery="no"
plugin_bind="no"
Expand Down Expand Up @@ -3899,7 +3910,11 @@ Configuration:
EOF

if test "x$dependency_error" = "xyes"; then
AC_MSG_ERROR("Some plugins are missing dependencies - see above summary for details")
AC_MSG_ERROR("Some plugins are missing dependencies - see the summary above for details")
fi

if test "x$dependency_warning" = "xyes"; then
AC_MSG_WARN("Some plugins seem to have missing dependencies but have been enabled forcibly - see the summary above for details")
fi

# vim: set fdm=marker :

0 comments on commit cb62220

Please sign in to comment.