+
+dnl ----- libXSLT
+xsltdir=default
+pkgmodule=""
+AC_ARG_WITH(xslt,[[ --with-xslt[=PREFIX] use libXSLT in PREFIX]],xsltdir=$withval)
+
+dnl -- if no PREFIX or not specified we just search in default locations
+dnl -- try pkg-config. If not found, use xslt-config
+if test "$xsltdir" = "yes" -o "$xsltdir" = "default"; then
+ if test "$pkgconfigpath" != "NONE"; then
+ if $pkgconfigpath --exists libxslt; then
+ pkgmodule="libxslt"
+ fi
+ fi
+ if test -z "$pkgmodule"; then
+ for d in /usr /usr/local; do
+ if test -x $d/bin/xslt-config; then
+ xsltdir=$d
+ fi
+ done
+ fi
+fi
+dnl --- do the real check (pkg-config, xslt-config, not-found)
+if test "$xsltdir" != "no"; then
+ AC_MSG_CHECKING(for libXSLT)
+ if test "$pkgmodule"; then
+ XML2_LIBS=`$pkgconfigpath --libs $pkgmodule`
+ XML2_CFLAGS=`$pkgconfigpath --cflags $pkgmodule`
+ XSLT_VER=`$pkgconfigpath --modversion $pkgmodule`
+ AC_MSG_RESULT($XSLT_VER)
+ AC_DEFINE(HAVE_XSLT)
+ elif test -x $xsltdir/bin/xslt-config; then
+ XML2_LIBS=`$xsltdir/bin/xslt-config --libs`
+ XML2_CFLAGS=`$xsltdir/bin/xslt-config --cflags`
+ XSLT_VER=`$xsltdir/bin/xslt-config --version`
+ AC_MSG_RESULT($XSLT_VER)
+ AC_DEFINE(HAVE_XSLT)
+ else
+ AC_MSG_RESULT(Not found)
+
+ if test "$xsltdir" = "default"; then
+ AC_MSG_WARN([libXSLT development libraries not found.])
+ else
+ AC_MSG_ERROR([libXSLT development libraries not found.])
+ fi
+ fi
+fi
+
+dnl -- get libEXSLT. xslt-config is no good. So use pkg-config only
+exsltdir=default
+pkgmodule=""
+AC_ARG_WITH(exslt,[[ --with-exslt[=PREFIX] use libEXSLT in PREFIX]],exsltdir=$withval)
+if test "$exsltdir" = "yes" -o "$exsltdir" = "default"; then
+ if test "$pkgconfigpath" != "NONE"; then
+ if $pkgconfigpath --exists libexslt; then
+ pkgmodule="libexslt"
+ fi
+ fi
+fi
+if test "$exsltdir" != "no"; then
+ AC_MSG_CHECKING(for libEXSLT)
+ if test "$pkgmodule"; then
+ XML2_LIBS=`$pkgconfigpath --libs $pkgmodule`
+ XML2_CFLAGS=`$pkgconfigpath --cflags $pkgmodule`
+ EXSLT_VER=`$pkgconfigpath --modversion $pkgmodule`
+ AC_MSG_RESULT($EXSLT_VER)
+ AC_DEFINE(HAVE_EXSLT)
+ else
+ AC_MSG_RESULT(Not found)
+
+ if test "$exsltdir" = "default"; then
+ AC_MSG_WARN([libEXSLT development libraries not found.])
+ else
+ AC_MSG_ERROR([libEXSLT development libraries not found.])
+ fi
+ fi
+fi
+
+if test "$XML2_LIBS"; then
+ LIBS="$XML2_LIBS $LIBS"
+fi
+