Move configure logic for enabling plugins to its own file

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@6004 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Colomban Wendling 2011-10-06 00:44:06 +00:00
parent c7b57e24e2
commit ff3ad0e642
3 changed files with 30 additions and 18 deletions

View File

@ -3,7 +3,7 @@
* autogen.sh, configure.ac:
Modernize configure.ac a bit.
* configure.ac, m4/geany-revision.m4, m4/geany-binreloc.m4,
m4/geany-gnu-regex.m4:
m4/geany-gnu-regex.m4, m4/geany-plugins.m4:
Extract some configure logic to separate files for better
readability.

View File

@ -28,11 +28,6 @@ AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_INTLTOOL
# for plugins
AC_DISABLE_STATIC
AM_PROG_LIBTOOL
LIBTOOL="$LIBTOOL --silent"
# autoscan start
# Checks for header files.
@ -78,17 +73,7 @@ AC_ARG_ENABLE([deprecated],
# Plugins support
AC_ARG_ENABLE([plugins],
[AS_HELP_STRING([--disable-plugins], [compile without plugin support [default=no]])],
,
[enable_plugins=yes])
if test "x$enable_plugins" = "xyes" ; then
AC_DEFINE([HAVE_PLUGINS], [1], [Define if plugins are enabled.])
AM_CONDITIONAL([PLUGINS], true)
else
AM_CONDITIONAL([PLUGINS], false)
fi
GEANY_CHECK_PLUGINS
# check whether to use included GNU regex library
@ -238,7 +223,7 @@ if test -n "${build}" -a -n "${target}"; then
echo "Building Geany for : ${target}"
fi
echo "Using GTK version : ${GTK_VERSION}"
echo "Build with plugin support : ${enable_plugins}"
echo "Build with plugin support : ${geany_enable_plugins}"
echo "Use virtual terminal support : ${want_vte}"
echo "Use (UNIX domain) socket support : ${want_socket}"
if test "x$enable_gnu_regex" = "xyes" ; then

27
m4/geany-plugins.m4 Normal file
View File

@ -0,0 +1,27 @@
dnl GEANY_CHECK_PLUGINS
dnl Checks whether to enable plugins support
dnl AC_DEFINEs HAVE_PLUGINS and AM_CONDITIONALs PLUGINS
dnl Result is available in the geany_enable_plugins variable
AC_DEFUN([GEANY_CHECK_PLUGINS],
[
AC_REQUIRE([AC_DISABLE_STATIC])
AC_REQUIRE([AM_PROG_LIBTOOL])
AC_ARG_ENABLE([plugins],
[AS_HELP_STRING([--disable-plugins], [compile without plugin support [default=no]])],
[geany_enable_plugins=$enableval],
[geany_enable_plugins=yes])
dnl silent libtool if it's not already done
AS_CASE(["$LIBTOOL"],
[*--silent*], [],
[LIBTOOL="$LIBTOOL --silent"
AC_SUBST([LIBTOOL])])
if test "x$geany_enable_plugins" = "xyes" ; then
AC_DEFINE([HAVE_PLUGINS], [1], [Define if plugins are enabled.])
AM_CONDITIONAL([PLUGINS], true)
else
AM_CONDITIONAL([PLUGINS], false)
fi
])