From 88510217a59150b1c3812213099ddef2a3d2846e Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 6 Jul 2006 11:50:26 +0000 Subject: [PATCH] Use YAZ_HAVE_XSLT because yaz-config 2.1.23 or later defines it --- configure.ac | 33 ++--------------------------- src/mod_helsinki.cpp | 6 +++--- src/mod_sample.cpp | 6 +++--- src/proxyp.h | 4 ++-- src/yaz-proxy-config.cpp | 52 +++++++++++++++++++++++----------------------- src/yaz-proxy-main.cpp | 10 ++++----- src/yaz-proxy.cpp | 14 ++++++------- win/makefile | 6 +++--- 8 files changed, 51 insertions(+), 80 deletions(-) diff --git a/configure.ac b/configure.ac index bc1df77..77ad60d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl yazproxy, Index Data 1994-2006 dnl See the file LICENSE for details. -dnl $Id: configure.ac,v 1.12 2006-06-09 09:37:27 adam Exp $ +dnl $Id: configure.ac,v 1.13 2006-07-06 11:50:26 adam Exp $ AC_PREREQ(2.59) AC_INIT([yazproxy],[1.2.1.1],[adam@indexdata.dk]) AC_CONFIG_SRCDIR(configure.ac) @@ -14,7 +14,7 @@ AC_HEADER_STDC AM_DISABLE_SHARED AM_PROG_LIBTOOL -YAZPP_INIT(threads,1.0) +YAZPP_INIT(threads,1.0.1) if test -z "$YAZPPLIB"; then AC_MSG_ERROR([YAZ++ development libraries missing]) fi @@ -25,35 +25,6 @@ AC_CHECK_FUNCS(setrlimit getrlimit gettimeofday) AC_CHECK_HEADERS(pwd.h sys/resource.h sys/stat.h sys/time.h sys/types.h sys/wait.h unistd.h) AC_CHECK_LIB(dl,dlopen) dnl -dnl ----- libXSLT -AC_SUBST(XSLT_LIBS) -AC_SUBST(XSLT_CFLAGS) -xsltdir=default -AC_ARG_WITH(xslt,[[ --with-xslt[=PREFIX] use libxslt in PREFIX]],xsltdir=$withval) -if test "$xsltdir" = "yes" -o "$xsltdir" = "default"; 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_LIBS=`$xsltdir/bin/xslt-config --libs` - XSLT_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 - AC_SUBST(YAZPROXY_SRC_ROOT) AC_SUBST(YAZPROXY_BUILD_ROOT) YAZPROXY_SRC_ROOT=`cd ${srcdir}; pwd` diff --git a/src/mod_helsinki.cpp b/src/mod_helsinki.cpp index 9de9250..a627945 100644 --- a/src/mod_helsinki.cpp +++ b/src/mod_helsinki.cpp @@ -1,4 +1,4 @@ -/* $Id: mod_helsinki.cpp,v 1.2 2006-06-28 23:38:23 adam Exp $ +/* $Id: mod_helsinki.cpp,v 1.3 2006-07-06 11:50:26 adam Exp $ Copyright (c) 1998-2005, Index Data. This file is part of the yaz-proxy. @@ -29,7 +29,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include -#if HAVE_XSLT +#if YAZ_HAVE_XSLT #include #include #include @@ -125,7 +125,7 @@ int my_authenticate(void *user_handle, { // see if we have an "args" attribute const char *args = 0; -#if HAVE_XSLT +#if YAZ_HAVE_XSLT xmlNodePtr ptr = (xmlNodePtr) element_ptr; struct _xmlAttr *attr; diff --git a/src/mod_sample.cpp b/src/mod_sample.cpp index 276e5b1..c115c80 100644 --- a/src/mod_sample.cpp +++ b/src/mod_sample.cpp @@ -1,4 +1,4 @@ -/* $Id: mod_sample.cpp,v 1.6 2006-03-30 10:31:53 adam Exp $ +/* $Id: mod_sample.cpp,v 1.7 2006-07-06 11:50:26 adam Exp $ Copyright (c) 1998-2006, Index Data. This file is part of the yazproxy. @@ -25,7 +25,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include -#if HAVE_XSLT +#if YAZ_HAVE_XSLT #include #include #include @@ -51,7 +51,7 @@ int my_authenticate(void *user_handle, { // see if we have an "args" attribute const char *args = 0; -#if HAVE_XSLT +#if YAZ_HAVE_XSLT xmlNodePtr ptr = (xmlNodePtr) element_ptr; struct _xmlAttr *attr; diff --git a/src/proxyp.h b/src/proxyp.h index 6e84952..f87ec92 100644 --- a/src/proxyp.h +++ b/src/proxyp.h @@ -1,4 +1,4 @@ -/* $Id: proxyp.h,v 1.18 2006-06-28 23:38:23 adam Exp $ +/* $Id: proxyp.h,v 1.19 2006-07-06 11:50:26 adam Exp $ Copyright (c) 1998-2006, Index Data. This file is part of the yazproxy. @@ -19,7 +19,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if HAVE_XSLT +#if YAZ_HAVE_XSLT #include #include #include diff --git a/src/yaz-proxy-config.cpp b/src/yaz-proxy-config.cpp index e6642a5..0a71115 100644 --- a/src/yaz-proxy-config.cpp +++ b/src/yaz-proxy-config.cpp @@ -1,4 +1,4 @@ -/* $Id: yaz-proxy-config.cpp,v 1.33 2006-06-28 23:38:23 adam Exp $ +/* $Id: yaz-proxy-config.cpp,v 1.34 2006-07-06 11:50:26 adam Exp $ Copyright (c) 1998-2006, Index Data. This file is part of the yazproxy. @@ -31,7 +31,7 @@ class Yaz_ProxyConfigP { int mycmp(const char *hay, const char *item, size_t len); int match_list(int v, const char *m); int atoi_l(const char **cp); -#if HAVE_XSLT +#if YAZ_HAVE_XSLT void load_modules(void); int check_schema(xmlNodePtr ptr, Z_RecordComposition *comp, const char *schema_identifier); @@ -70,7 +70,7 @@ class Yaz_ProxyConfigP { Yaz_ProxyConfigP::Yaz_ProxyConfigP() : m_modules() { -#if HAVE_XSLT +#if YAZ_HAVE_XSLT m_docPtr = 0; m_proxyPtr = 0; #endif @@ -78,7 +78,7 @@ Yaz_ProxyConfigP::Yaz_ProxyConfigP() : m_modules() Yaz_ProxyConfigP::~Yaz_ProxyConfigP() { -#if HAVE_XSLT +#if YAZ_HAVE_XSLT if (m_docPtr) xmlFreeDoc(m_docPtr); #endif @@ -94,7 +94,7 @@ Yaz_ProxyConfig::~Yaz_ProxyConfig() delete m_cp; } -#if HAVE_XSLT +#if YAZ_HAVE_XSLT void Yaz_ProxyConfigP::load_modules() { if (!m_proxyPtr) @@ -115,7 +115,7 @@ void Yaz_ProxyConfigP::load_modules() int Yaz_ProxyConfig::read_xml(const char *fname) { -#if HAVE_XSLT +#if YAZ_HAVE_XSLT xmlDocPtr ndoc = xmlParseFile(fname); if (!ndoc) @@ -150,7 +150,7 @@ int Yaz_ProxyConfig::read_xml(const char *fname) #endif } -#if HAVE_XSLT +#if YAZ_HAVE_XSLT const char *Yaz_ProxyConfigP::get_text(xmlNodePtr ptr) { for(ptr = ptr->children; ptr; ptr = ptr->next) @@ -180,7 +180,7 @@ void Yaz_ProxyConfigP::get_period(xmlNodePtr ptr, int *period) } #endif -#if HAVE_XSLT +#if YAZ_HAVE_XSLT void Yaz_ProxyConfigP::return_limit(xmlNodePtr ptr, int *limit_bw, int *limit_pdu, @@ -221,7 +221,7 @@ void Yaz_ProxyConfigP::return_limit(xmlNodePtr ptr, } #endif -#if HAVE_XSLT +#if YAZ_HAVE_XSLT void Yaz_ProxyConfigP::return_target_info(xmlNodePtr ptr, const char **url, int *limit_bw, @@ -368,7 +368,7 @@ int Yaz_ProxyConfigP::match_list(int v, const char *m) return 0; } -#if HAVE_XSLT +#if YAZ_HAVE_XSLT int Yaz_ProxyConfigP::check_type_1_attributes(ODR odr, xmlNodePtr ptrl, Z_AttributeList *attrs, char **addinfo) @@ -441,7 +441,7 @@ int Yaz_ProxyConfigP::check_type_1_attributes(ODR odr, xmlNodePtr ptrl, } #endif -#if HAVE_XSLT +#if YAZ_HAVE_XSLT int Yaz_ProxyConfigP::check_type_1_structure(ODR odr, xmlNodePtr ptr, Z_RPNStructure *q, char **addinfo) @@ -467,7 +467,7 @@ int Yaz_ProxyConfigP::check_type_1_structure(ODR odr, xmlNodePtr ptr, } #endif -#if HAVE_XSLT +#if YAZ_HAVE_XSLT int Yaz_ProxyConfigP::check_type_1(ODR odr, xmlNodePtr ptr, Z_RPNQuery *query, char **addinfo) { @@ -479,7 +479,7 @@ int Yaz_ProxyConfigP::check_type_1(ODR odr, xmlNodePtr ptr, Z_RPNQuery *query, int Yaz_ProxyConfig::check_query(ODR odr, const char *name, Z_Query *query, char **addinfo) { -#if HAVE_XSLT +#if YAZ_HAVE_XSLT xmlNodePtr ptr; ptr = m_cp->find_target_node(name, 0); @@ -492,7 +492,7 @@ int Yaz_ProxyConfig::check_query(ODR odr, const char *name, Z_Query *query, return 0; } -#if HAVE_XSLT +#if YAZ_HAVE_XSLT int Yaz_ProxyConfigP::check_schema(xmlNodePtr ptr, Z_RecordComposition *comp, const char *schema_identifier) { @@ -572,7 +572,7 @@ const char *Yaz_ProxyConfig::check_mime_type(const char *path) void Yaz_ProxyConfig::target_authentication(const char *name, ODR odr, Z_InitRequest *req) { -#if HAVE_XSLT +#if YAZ_HAVE_XSLT xmlNodePtr ptr = m_cp->find_target_node(name, 0); if (!ptr) return ; @@ -645,7 +645,7 @@ int Yaz_ProxyConfig::client_authentication(const char *name, const char *peer_IP) { int ret = YAZPROXY_RET_NOT_ME; -#if HAVE_XSLT +#if YAZ_HAVE_XSLT xmlNodePtr ptr; ptr = m_cp->find_target_node(name, 0); if (!ptr) @@ -682,7 +682,7 @@ int Yaz_ProxyConfig::global_client_authentication(const char *user, const char *peer_IP) { int ret = YAZPROXY_RET_NOT_ME; -#if HAVE_XSLT +#if YAZ_HAVE_XSLT if (!m_cp->m_proxyPtr) return 1; xmlNodePtr ptr; @@ -754,7 +754,7 @@ int Yaz_ProxyConfig::check_syntax(ODR odr, const char *name, xfree (*usemarcon_ini_stage2); *usemarcon_ini_stage2 = 0; } -#if HAVE_XSLT +#if YAZ_HAVE_XSLT int syntax_has_matched = 0; xmlNodePtr ptr; @@ -891,7 +891,7 @@ int Yaz_ProxyConfig::check_syntax(ODR odr, const char *name, return 0; } -#if HAVE_XSLT +#if YAZ_HAVE_XSLT xmlNodePtr Yaz_ProxyConfigP::find_target_db(xmlNodePtr ptr, const char *db) { xmlNodePtr dptr; @@ -990,7 +990,7 @@ int Yaz_ProxyConfig::get_target_no(int no, const char **target_charset, const char **default_client_query_charset) { -#if HAVE_XSLT +#if YAZ_HAVE_XSLT xmlNodePtr ptr; if (!m_cp->m_proxyPtr) return 0; @@ -1036,7 +1036,7 @@ int Yaz_ProxyConfigP::mycmp(const char *hay, const char *item, size_t len) int Yaz_ProxyConfig::get_file_access_info(const char *path) { -#if HAVE_XSLT +#if YAZ_HAVE_XSLT xmlNodePtr ptr; if (!m_cp->m_proxyPtr) return 0; @@ -1066,7 +1066,7 @@ void Yaz_ProxyConfig::get_generic_info(int *log_mask, *max_connect = 0; *limit_connect = 0; *num_msg_threads = 0; -#if HAVE_XSLT +#if YAZ_HAVE_XSLT xmlNodePtr ptr; if (!m_cp->m_proxyPtr) return; @@ -1168,7 +1168,7 @@ void Yaz_ProxyConfig::get_generic_info(int *log_mask, #endif } -#if HAVE_XSLT +#if YAZ_HAVE_XSLT int Yaz_ProxyConfigP::get_explain_ptr(const char *host, const char *db, xmlNodePtr *ptr_target, xmlNodePtr *ptr_explain) @@ -1225,7 +1225,7 @@ int Yaz_ProxyConfigP::get_explain_ptr(const char *host, const char *db, const char *Yaz_ProxyConfig::get_explain_name(const char *db, const char **backend_db) { -#if HAVE_XSLT +#if YAZ_HAVE_XSLT xmlNodePtr ptr_target, ptr_explain; if (m_cp->get_explain_ptr(0, db, &ptr_target, &ptr_explain) && ptr_target) @@ -1263,7 +1263,7 @@ const char *Yaz_ProxyConfig::get_explain_name(const char *db, char *Yaz_ProxyConfig::get_explain_doc(ODR odr, const char *name, const char *db, int *len) { -#if HAVE_XSLT +#if YAZ_HAVE_XSLT xmlNodePtr ptr_target, ptr_explain; if (m_cp->get_explain_ptr(0 /* host */, db, &ptr_target, &ptr_explain)) { @@ -1304,7 +1304,7 @@ void Yaz_ProxyConfig::get_target_info(const char *name, const char **target_charset, const char **default_client_query_charset) { -#if HAVE_XSLT +#if YAZ_HAVE_XSLT xmlNodePtr ptr; if (!m_cp->m_proxyPtr) { diff --git a/src/yaz-proxy-main.cpp b/src/yaz-proxy-main.cpp index 75d31bc..84bd47c 100644 --- a/src/yaz-proxy-main.cpp +++ b/src/yaz-proxy-main.cpp @@ -1,4 +1,4 @@ -/* $Id: yaz-proxy-main.cpp,v 1.19 2006-03-30 10:32:16 adam Exp $ +/* $Id: yaz-proxy-main.cpp,v 1.20 2006-07-06 11:50:26 adam Exp $ Copyright (c) 1998-2006, Index Data. This file is part of the yazproxy. @@ -49,7 +49,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #include -#if HAVE_XSLT +#if YAZ_HAVE_XSLT #include #include #include @@ -179,7 +179,7 @@ static void sighup_handler(int num) static_yaz_proxy->reconfig(); } -#if HAVE_XSLT +#if YAZ_HAVE_XSLT static void proxy_xml_error_handler(void *ctx, const char *fmt, ...) { char buf[1024]; @@ -205,7 +205,7 @@ static void child_run(SocketManager *m, int run) signal(SIGHUP, sighup_handler); #endif -#if HAVE_XSLT +#if YAZ_HAVE_XSLT xmlSetGenericErrorFunc((void *) "XML", proxy_xml_error_handler); xsltSetGenericErrorFunc((void *) "XSLT", proxy_xml_error_handler); #endif @@ -279,7 +279,7 @@ static void child_run(SocketManager *m, int run) int main(int argc, char **argv) { -#if HAVE_XSLT +#if YAZ_HAVE_XSLT xmlInitMemory(); LIBXML_TEST_VERSION diff --git a/src/yaz-proxy.cpp b/src/yaz-proxy.cpp index 3dfdb00..b1d18c0 100644 --- a/src/yaz-proxy.cpp +++ b/src/yaz-proxy.cpp @@ -1,4 +1,4 @@ -/* $Id: yaz-proxy.cpp,v 1.69 2006-06-28 23:38:23 adam Exp $ +/* $Id: yaz-proxy.cpp,v 1.70 2006-07-06 11:50:26 adam Exp $ Copyright (c) 1998-2006, Index Data. This file is part of the yazproxy. @@ -314,7 +314,7 @@ Yaz_Proxy::~Yaz_Proxy() delete m_charset_converter; xfree(m_optimize); -#if HAVE_XSLT +#if YAZ_HAVE_XSLT if (m_stylesheet_xsp) xsltFreeStylesheet((xsltStylesheetPtr) m_stylesheet_xsp); #endif @@ -877,7 +877,7 @@ int Yaz_Proxy::convert_xsl(Z_NamePlusRecordList *p, Z_APDU *apdu) void Yaz_Proxy::convert_xsl_delay() { -#if HAVE_XSLT +#if YAZ_HAVE_XSLT Z_NamePlusRecord *npr = m_stylesheet_nprl->records[m_stylesheet_offset]; if (npr->which == Z_NamePlusRecord_databaseRecord) { @@ -920,7 +920,7 @@ void Yaz_Proxy::convert_xsl_delay() { m_timeout_mode = timeout_normal; m_stylesheet_nprl = 0; -#if HAVE_XSLT +#if YAZ_HAVE_XSLT if (m_stylesheet_xsp) xsltFreeStylesheet((xsltStylesheetPtr) m_stylesheet_xsp); #endif @@ -1182,7 +1182,7 @@ int Yaz_Proxy::send_srw_response(Z_SRW_PDU *srw_pdu, int http_code /* = 200 */) z_HTTP_header_add(o, &hres->headers, "WWW-Authenticate", "Basic realm=\"YAZ Proxy\""); static Z_SOAP_Handler soap_handlers[2] = { -#if HAVE_XSLT +#if YAZ_HAVE_XSLT {"http://www.loc.gov/zing/srw/", 0, (Z_SOAP_fun) yaz_srw_codec}, #endif @@ -2499,7 +2499,7 @@ Z_APDU *Yaz_Proxy::handle_syntax_validation(Z_APDU *apdu) { m_parent->low_socket_close(); -#if HAVE_XSLT +#if YAZ_HAVE_XSLT if (m_stylesheet_xsp) xsltFreeStylesheet((xsltStylesheetPtr) m_stylesheet_xsp); m_stylesheet_xsp = xsltParseStylesheetFile((const xmlChar*) @@ -2576,7 +2576,7 @@ Z_APDU *Yaz_Proxy::handle_syntax_validation(Z_APDU *apdu) { m_parent->low_socket_close(); -#if HAVE_XSLT +#if YAZ_HAVE_XSLT if (m_stylesheet_xsp) xsltFreeStylesheet((xsltStylesheetPtr) m_stylesheet_xsp); m_stylesheet_xsp = xsltParseStylesheetFile((const xmlChar*) diff --git a/win/makefile b/win/makefile index 9c0d235..3692944 100644 --- a/win/makefile +++ b/win/makefile @@ -1,6 +1,6 @@ # Copyright (C) 1999-2006, Index Data ApS # All rights reserved. -# $Id: makefile,v 1.9 2006-04-30 14:11:32 adam Exp $ +# $Id: makefile,v 1.10 2006-07-06 11:50:27 adam Exp $ ########################################################### ############### Parameters @@ -136,7 +136,7 @@ libxml2: !if $(HAVE_LIBXSLT) LIBXSLT_LIB="$(LIBXSLT_DIR)\lib\libxslt.lib" -LIBXSLT_DEF=/D HAVE_XSLT=1 /I"$(LIBXSLT_DIR)\include" +LIBXSLT_DEF=/D YAZ_HAVE_XSLT=1 /I"$(LIBXSLT_DIR)\include" libxslt: $(BINDIR)\libxslt.dll $(BINDIR)\zlib1.dll $(BINDIR)\libxslt.dll: @@ -144,7 +144,7 @@ $(BINDIR)\libxslt.dll: !else LIBXSLT_LIB= -LIBXSLT_DEF=/D HAVE_XSLT=0 +LIBXSLT_DEF=/D YAZ_HAVE_XSLT=0 libxslt: !endif -- 1.7.10.4