1dnl GEANY_CHECK_PLUGINS
2dnl Checks whether to enable plugins support
3dnl AC_DEFINEs HAVE_PLUGINS and AM_CONDITIONALs PLUGINS
4dnl Result is available in the geany_enable_plugins variable
5AC_DEFUN([GEANY_CHECK_PLUGINS],
6[
7	AC_REQUIRE([AC_DISABLE_STATIC])
8	AC_REQUIRE([AM_PROG_LIBTOOL])
9
10	AC_ARG_ENABLE([plugins],
11			[AS_HELP_STRING([--disable-plugins], [compile without plugin support [default=no]])],
12			[geany_enable_plugins=$enableval],
13			[geany_enable_plugins=yes])
14
15	dnl silent libtool if it's not already done
16	AS_CASE(["$LIBTOOL"],
17			[*--silent*], [],
18			[LIBTOOL="$LIBTOOL --silent"
19			 AC_SUBST([LIBTOOL])])
20
21	if test "x$geany_enable_plugins" = "xyes" ; then
22		AC_DEFINE([HAVE_PLUGINS], [1], [Define if plugins are enabled.])
23		AM_CONDITIONAL([PLUGINS], true)
24	else
25		AM_CONDITIONAL([PLUGINS], false)
26	fi
27
28	GEANY_STATUS_ADD([Build with plugin support], [$geany_enable_plugins])
29])
30