| 1 |
# From https://github.com/collectd/collectd/blob/master/configure.ac |
| 2 |
# Dependency handling currently unused |
| 3 |
|
| 4 |
define([enadis], [ifelse([$1], [yes], [disable], [enable])]) |
| 5 |
|
| 6 |
# AC_PLUGIN(name, default, info) |
| 7 |
# ------------------------------------------------------------ |
| 8 |
AC_DEFUN([AC_PLUGIN],[ |
| 9 |
m4_divert_once([HELP_ENABLE], [ |
| 10 |
Optional Plugins:]) |
| 11 |
define(PLUGGY, m4_translit([$1],[a-z-][A-Z-]))dnl |
| 12 |
AC_ARG_ENABLE([$1-plugin], AS_HELP_STRING([--enadis($2)-$1-plugin], [$3]), [ |
| 13 |
if test "x$enableval" = "xyes"; then |
| 14 |
enable_plugin="yes" |
| 15 |
else |
| 16 |
enable_plugin="no" |
| 17 |
fi], [ |
| 18 |
if test "x$enable_all_plugins" = "xauto"; then |
| 19 |
if test "x$2" = "xyes"; then |
| 20 |
enable_plugin="yes" |
| 21 |
else |
| 22 |
enable_plugin="no" |
| 23 |
fi |
| 24 |
else |
| 25 |
enable_plugin="$enable_all_plugins" |
| 26 |
fi]) |
| 27 |
if test "x$enable_plugin" = "xyes"; then |
| 28 |
AC_DEFINE(HAVE_[]m4_translit($1,[-a-z],[_A-Z])_PLUGIN, 1, [Define to 1 if the $1 plugin is enabled.]) |
| 29 |
plugins="$1 $plugins" |
| 30 |
fi |
| 31 |
|
| 32 |
AM_CONDITIONAL(BUILD_[]m4_translit($1,[-a-z],[_A-Z])_PLUGIN, test "x$enable_plugin" = "xyes")]) |