From 789def370a1ed54daee69faaa3814ab7a8bdf47e Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 3 Nov 2006 23:17:08 +0000 Subject: [PATCH] Fixed bug #723: Enable EXSLT for alvis. We use whatever YAZ finds out for Unix confiugre (YAZ_HAVE_EXSLT & YAZ_HAVE_XSLT). --- configure.ac | 52 +++++++++++++++------------------------------------- index/Makefile.am | 6 +++--- index/alvis.c | 10 +++++++++- 3 files changed, 27 insertions(+), 41 deletions(-) diff --git a/configure.ac b/configure.ac index 8728649..0b5ccde 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ dnl Zebra, Index Data ApS, 1995-2006 -dnl $Id: configure.ac,v 1.34 2006-10-16 11:03:47 adam Exp $ +dnl $Id: configure.ac,v 1.35 2006-11-03 23:17:08 adam Exp $ dnl AC_PREREQ(2.59) AC_INIT([idzebra],[2.0.4],[adam@indexdata.dk]) @@ -46,37 +46,6 @@ if test "$YAZVERSION" = "NONE"; then AC_MSG_ERROR([YAZ development libraries required]) fi YAZ_DOC -dnl ----- libXSLT -AC_SUBST(XSLT_LIBS) -AC_SUBST(XSLT_CFLAGS) -xsltdir=yes -AC_ARG_WITH(xslt,[[ --with-xslt[=PREFIX] use libxslt in PREFIX]],xsltdir=$withval) -if test "$xsltdir" = "yes"; then - for d in /usr /usr/local; do - if test -x $d/bin/xslt-config; then - xsltdir=$d - fi - done -fi -if test "$xsltdir" != "no"; then - AC_MSG_CHECKING(for libXSLT) - - if test -x $xsltdir/bin/xslt-config; then - XSLT_VER=`$xsltdir/bin/xslt-config --version` - AC_MSG_RESULT($XSLT_VER) - have_xslt_version=`echo "$XSLT_VER" | awk 'BEGIN { FS = "."; } { printf "%d", ([$]1 * 1000 + [$]2) * 1000 + [$]3;}'` - if test $have_xslt_version -lt 1001011; then - AC_MSG_WARN([libXSLT too old. Use 1.1.11 or later.]) - XSLT_VER="" - else - XSLT_LIBS=`$xsltdir/bin/xslt-config --libs` - XSLT_CFLAGS=`$xsltdir/bin/xslt-config --cflags` - AC_DEFINE(HAVE_XSLT) - fi - else - AC_MSG_RESULT(Not found) - fi -fi dnl ------ Look for Tcl dnl See if user has specified location of tclConfig.sh; otherwise dnl see if tclConfig.sh exists in same prefix lcoation as tclsh; otherwise @@ -331,11 +300,20 @@ else def="disabled" fi ZEBRA_MODULE(grs-xml,[$def], [ --enable-mod-grs-xml XML filter (Expat based)]) -if test "$XSLT_VER"; then - def="shared" -else - def="disabled" -fi +oldCPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS $YAZINC" +AC_PREPROC_IFELSE( + [AC_LANG_PROGRAM([[#include ]], + [[ +#if YAZ_HAVE_XSLT +#else +#error no xslt +#endif +]])], + [def="shared"], + [def="disabled"]) +CPPFLAGS=$oldCPPFLAGS + ZEBRA_MODULE(alvis,[$def], [ --enable-mod-alvis ALVIS filter (Requires libxslt)]) dnl ------ ANSI C Header files AC_STDC_HEADERS diff --git a/index/Makefile.am b/index/Makefile.am index 78b0596..bf0c6bb 100644 --- a/index/Makefile.am +++ b/index/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.55 2006-09-22 10:18:08 adam Exp $ +## $Id: Makefile.am,v 1.56 2006-11-03 23:17:08 adam Exp $ aux_libs = \ ../rset/libidzebra-rset.la \ @@ -42,7 +42,7 @@ mod_safari_la_LIBADD = $(zebralib) $(mod_safari_la_LADD) mod_alvis_la_SOURCES = alvis.c mod_alvis_la_LDFLAGS = -rpath $(modlibdir) -module -avoid-version -mod_alvis_la_LADD = $(XSLT_LIBS) +mod_alvis_la_LADD = mod_alvis_la_LIBADD = $(zebralib) $(mod_alvis_la_LADD) modlib_LTLIBRARIES = $(SHARED_MODULE_LA) @@ -94,7 +94,7 @@ kdump_SOURCES = kdump.c AM_CPPFLAGS = -I$(srcdir)/../include $(YAZINC) \ -DDEFAULT_PROFILE_PATH=\"$(pkgdatadir)/tab\" \ - $(TCL_INCLUDE) $(XSLT_FLAGS) $(XSLT_CFLAGS) + $(TCL_INCLUDE) LDADD = $(zebralib) $(YAZLALIB) diff --git a/index/alvis.c b/index/alvis.c index 40405e1..3f4754e 100644 --- a/index/alvis.c +++ b/index/alvis.c @@ -1,4 +1,4 @@ -/* $Id: alvis.c,v 1.3 2006-08-22 13:39:26 adam Exp $ +/* $Id: alvis.c,v 1.4 2006-11-03 23:17:08 adam Exp $ Copyright (C) 1995-2006 Index Data ApS @@ -35,6 +35,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include +#if YAZ_HAVE_EXSLT +#include +#endif + #include #include @@ -140,6 +144,10 @@ static void *filter_init(Res res, RecType recType) tinfo->doc = 0; tinfo->schemas = 0; +#if YAZ_HAVE_EXSLT + exsltRegisterAll(); +#endif + #if ENABLE_INPUT_CALLBACK xmlRegisterDefaultInputCallbacks(); xmlRegisterInputCallbacks(zebra_xmlInputMatchCallback, -- 1.7.10.4