configure: Don't build python or perl plugin when plugins are disabled

This commit is contained in:
TingPing 2014-01-16 00:12:06 -05:00
parent 37d92dd69c
commit 6f6070b8c8
1 changed files with 78 additions and 66 deletions

View File

@ -226,6 +226,8 @@ dnl ** PERL *************************************************************
dnl ********************************************************************* dnl *********************************************************************
if test "$perl" = yes; then if test "$perl" = yes; then
AC_MSG_CHECKING(for plugin interface used by Perl)
if test "$plugin" = yes; then
AC_PATH_PROG(perlpath, perl) AC_PATH_PROG(perlpath, perl)
AC_MSG_CHECKING(for Perl compile flags) AC_MSG_CHECKING(for Perl compile flags)
PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null` PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null`
@ -251,7 +253,7 @@ if test "$perl" = yes; then
CFLAGS="$PERL_CFLAGS" CFLAGS="$PERL_CFLAGS"
LDFLAGS="$PERL_LDFLAGS" LDFLAGS="$PERL_LDFLAGS"
AC_TRY_LINK([#include <EXTERN.h> AC_TRY_LINK([#include <EXTERN.h>
#include <perl.h>], [], perl_is_usable=yes, perl_is_usable=no) #include <perl.h>], [], perl_is_usable=yes, perl_is_usable=no)
CFLAGS="$original_cflags" CFLAGS="$original_cflags"
LDFLAGS="$original_ldflags" LDFLAGS="$original_ldflags"
if test x$perl_is_usable = xno ; then if test x$perl_is_usable = xno ; then
@ -273,6 +275,10 @@ if test "$perl" = yes; then
perl=no perl=no
fi fi
fi fi
else
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for Perl])
perl=no
fi
fi fi
dnl ********************************************************************* dnl *********************************************************************
@ -280,6 +286,8 @@ dnl ** PYTHON ***********************************************************
dnl ********************************************************************* dnl *********************************************************************
if test "x$python" != xno ; then if test "x$python" != xno ; then
AC_MSG_CHECKING(for plugin interface used by Python)
if test "$plugin" = yes; then
case $python in case $python in
dnl set python2 default here dnl set python2 default here
python2) python2)
@ -302,6 +310,10 @@ if test "x$python" != xno ; then
AC_MSG_CHECKING(Python version) AC_MSG_CHECKING(Python version)
AC_MSG_RESULT($PY_VER) AC_MSG_RESULT($PY_VER)
python="python-${PY_VER}" python="python-${PY_VER}"
else
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for Python])
python=no
fi
fi fi
dnl ********************************************************************* dnl *********************************************************************