From 455798a3154b5c08c872ca0fb90607ddea575038 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 9 Sep 2005 10:34:09 +0000 Subject: [PATCH] Do not build the separate Multi-threaded (MT) library libyazthread.la. Instead make the library libyaz.la multi-threaded. Threading as a whole can still be disabled by configure option --disable-threads. Previosly, with older GLIBCs there were problems with MT libs under Apache. This has now been fixed a long time ago. --- NEWS | 9 +++++++++ client/Makefile.am | 4 +++- configure.in | 18 ++++++++---------- src/Makefile.am | 27 +++++---------------------- test/Makefile.am | 10 +++------- yaz-config.in | 12 ++---------- yaz.m4 | 3 ++- ztest/Makefile.am | 10 +++------- 8 files changed, 35 insertions(+), 58 deletions(-) diff --git a/NEWS b/NEWS index 1a3547c..e54c687 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,15 @@ Added 'exit' as synonym for 'quit' in yaz-client Possible compatibility problems with earlier versions marked with '*'. +Do not build the separate Multi-threaded (MT) library libyazthread.la. +Instead make the library libyaz.la multi-threaded. Threading as a whole +can still be disabled by configure option --disable-threads. Previosly, +with older GLIBCs there were problems with MT libs under Apache. This +has now been fixed a long time ago. + +Fixed bugs in yaz_log that occurred on Sparc Solaris in Multi-threaded +applications. + CQL module modified to be case insensitive for relations/indexes/operations. Fixed bug in CQL transform code: incorrect value relationModifieder diff --git a/client/Makefile.am b/client/Makefile.am index c5bae5b..4a40dd5 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -1,6 +1,6 @@ ## Copyright (C) 1995-2004, Index Data ## All rights reserved. -## $Id: Makefile.am,v 1.25 2004-10-10 22:44:34 adam Exp $ +## $Id: Makefile.am,v 1.26 2005-09-09 10:34:09 adam Exp $ bin_PROGRAMS=yaz-client @@ -11,6 +11,8 @@ EXTRA_DIST = default.bib COMMON=admin.c admin.h tabcomplete.c tabcomplete.h yaz_client_SOURCES=client.c $(COMMON) +AM_CFLAGS=$(THREAD_CFLAGS) + AM_CPPFLAGS=-I$(top_srcdir)/include $(SSL_CFLAGS) yaz_client_LDADD = ../src/libyaz.la $(READLINE_LIBS) diff --git a/configure.in b/configure.in index b5b96e3..4745ad3 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl YAZ Toolkit, Index Data 1994-2005 dnl See the file LICENSE for details. -dnl $Id: configure.in,v 1.184 2005-08-25 12:44:24 adam Exp $ +dnl $Id: configure.in,v 1.185 2005-09-09 10:34:09 adam Exp $ AC_INIT(include/yaz/yaz-version.h) AM_INIT_AUTOMAKE(yaz, 2.1.9) AM_MAINTAINER_MODE @@ -244,10 +244,9 @@ if test "$enable_tcpd" -a "$enable_tcpd" != "no"; then fi fi dnl -AC_SUBST(LIBTHREAD) -AC_SUBST(CFLAGSTHREADS) +AC_SUBST(THREAD_CFLAGS) HAVETHREADS=0 -CFLAGSTHREADS="" +THREAD_CFLAGS="" LIBTHREAD="" dnl dnl ------ GNU threads @@ -260,11 +259,11 @@ if test "$enable_pth" = "yes"; then AC_CHECK_HEADERS(pth.h) if test "$ac_cv_header_pth_h" = "yes"; then LIBTHREAD="-lpth" - CFLAGSTHREADS="-DYAZ_GNU_THREADS=1" + THREAD_CFLAGS="-DYAZ_GNU_THREADS=1" HAVETHREADS=1 fi fi - LIBS=$OLIBS + LIBS="$OLIBS $LIBTHREAD" fi dnl dnl ------ POSIX Threads @@ -283,7 +282,7 @@ if test "$enable_threads" = "yes" -a "$HAVETHREADS" = "0"; then if test "$thread_ok" = "yes"; then AC_MSG_RESULT(yes) LIBTHREAD="-lpthread" - CFLAGSTHREADS="-DYAZ_POSIX_THREADS=1 -D_REENTRANT" + THREAD_CFLAGS="-DYAZ_POSIX_THREADS=1 -D_REENTRANT" HAVETHREADS=1 else CC="$CC -pthread" @@ -295,7 +294,7 @@ if test "$enable_threads" = "yes" -a "$HAVETHREADS" = "0"; then thread_ok=yes,thread_ok=no) if test "$thread_ok" = "yes"; then AC_MSG_RESULT([yes,BSD]) - CFLAGSTHREADS="-pthread -DYAZ_POSIX_THREADS=1 -D_REENTRANT" + THREAD_CFLAGS="-pthread -DYAZ_POSIX_THREADS=1 -D_REENTRANT" LIBTHREAD="-pthread" HAVETHREADS=1 fi @@ -304,9 +303,8 @@ if test "$enable_threads" = "yes" -a "$HAVETHREADS" = "0"; then AC_MSG_RESULT(no) fi CC=$OCC - LIBS=$OLIBS + LIBS="$OLIBS $LIBTHREAD" fi -AM_CONDITIONAL(ISTHR, test $HAVETHREADS = "1") dnl dnl ----- libXML2 AC_SUBST(XML2_LIBS) diff --git a/src/Makefile.am b/src/Makefile.am index 8938132..9373358 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,14 +1,10 @@ ## This file is part of the YAZ toolkit. ## Copyright (C) 1994-2005, Index Data, All rights reserved. -## $Id: Makefile.am,v 1.22 2005-04-22 15:09:36 adam Exp $ - -if ISTHR -thrlib=libyazthread.la -endif +## $Id: Makefile.am,v 1.23 2005-09-09 10:34:09 adam Exp $ YAZ_VERSION_INFO=2:0:0 -lib_LTLIBRARIES = libyaz.la $(thrlib) +lib_LTLIBRARIES = libyaz.la dist-hook: test -f $(srcdir)/cql.c || exit 1 @@ -27,9 +23,10 @@ EXTRA_DIST=$(tabdata_DATA) $(illdata_DATA) \ YAZCOMP = ../util/yaz-asncomp YAZCOMPLINE = $(YAZCOMP) -d z.tcl -i yaz -I../include $(YCFLAGS) -AM_CPPFLAGS=-I$(top_srcdir)/include $(XML2_CFLAGS) $(SSL_CFLAGS) +AM_CFLAGS=$(THREAD_CFLAGS) +AM_CPPFLAGS=-I$(top_srcdir)/include $(XML2_CFLAGS) $(SSL_CFLAGS) + AM_YFLAGS=-p cql_ -THREADED_FLAGS = @CFLAGSTHREADS@ # MARC8 conversion is generated from codetables.xml $(srcdir)/marc8.c: charconv.tcl codetables.xml @@ -70,10 +67,6 @@ libyaz_la_SOURCES=version.c options.c log.c marcdisp.c oid.c wrbuf.c \ eventl.h service.c service.h session.h libyaz_la_LDFLAGS=-version-info $(YAZ_VERSION_INFO) -libyazthread_la_SOURCES= -libyazthread_la_LIBADD=thr-nmem.lo thr-statserv.lo thr-eventl.lo -libyazthread_la_LDFLAGS=-version-info $(YAZ_VERSION_INFO) - # Rules for Z39.50 V3 $(srcdir)/z-accdes1.c \ $(srcdir)/z-accform1.c \ @@ -149,13 +142,3 @@ $(top_srcdir)/include/yaz/item-req.h: \ $(srcdir)/ill.tcl $(srcdir)/item-req.asn $(YAZCOMP) cd $(srcdir); $(YAZCOMP) -d ill.tcl -i yaz -I ../include $(YCFLAGS) item-req.asn -# Threaded versions of objects. -thr-nmem.lo: nmem.c - $(LTCOMPILE) $(THREADED_FLAGS) -c $(srcdir)/nmem.c -o thr-nmem.lo - -thr-statserv.lo: statserv.c - $(LTCOMPILE) $(THREADED_FLAGS) -c $(srcdir)/statserv.c -o thr-statserv.lo -thr-eventl.lo: eventl.c - $(LTCOMPILE) $(THREADED_FLAGS) -c $(srcdir)/eventl.c -o thr-eventl.lo - - diff --git a/test/Makefile.am b/test/Makefile.am index b64cc22..102f4e9 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,6 +1,6 @@ ## Copyright (C) 1994-2004, Index Data ## All rights reserved. -## $Id: Makefile.am,v 1.8 2005-09-08 13:25:33 adam Exp $ +## $Id: Makefile.am,v 1.9 2005-09-09 10:34:09 adam Exp $ check_PROGRAMS = tsticonv tstnmem tstmatchstr tstwrbuf tstodr tstccl tstlog \ tstsoap1 tstsoap2 tstodrstack tstlogthread @@ -12,14 +12,10 @@ EXTRA_DIST = tstodr.asn tstodrcodec.c tstodrcodec.h cqlsample \ $(check_SCRIPTS) \ marc1 marc1.xml marc2 marc2.xml marc3 marc3.xml marc4 marc4.xml -if ISTHR -extra=../src/libyazthread.la -endif - YAZCOMP = $(top_srcdir)/util/yaz-asncomp YAZCOMPLINE = $(YAZCOMP) -d z.tcl -i yaz -I../include $(YCFLAGS) -AM_CFLAGS=@CFLAGSTHREADS@ +AM_CFLAGS=$(THREAD_CFLAGS) AM_CPPFLAGS=-I$(top_srcdir)/include $(XML2_CFLAGS) @@ -32,7 +28,7 @@ dist-hook: tstodrcodec.c tstodrcodec.h: tstodr.asn $(YAZCOMP) cd $(srcdir); $(YAZCOMP) tstodr.asn -LDADD = $(extra) ../src/libyaz.la $(LIBTHREAD) +LDADD = ../src/libyaz.la tsticonv_SOURCES = tsticonv.c diff --git a/yaz-config.in b/yaz-config.in index e1b7cd6..1b2560f 100644 --- a/yaz-config.in +++ b/yaz-config.in @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: yaz-config.in,v 1.22 2004-10-27 08:18:55 adam Exp $ +# $Id: yaz-config.in,v 1.23 2005-09-09 10:34:09 adam Exp $ yazprefix=@prefix@ yaz_echo_cflags=no yaz_echo_libs=no @@ -79,18 +79,10 @@ done lyaz="-lyaz" -if test "$lib_thread" = "yes" -a -n "@CFLAGSTHREADS@"; then - yazextralibs="@LIBTHREAD@ $yazextralibs" - lyaz="-lyazthread $lyaz" -fi - if test "$yaz_echo_source" = "yes"; then YAZBIN=${yaz_build_root}/bin YAZLIB="-L${yaz_build_root}/src/.libs $lyaz $yazextralibs" YAZLALIB="${yaz_build_root}/src/libyaz.la $yazextralibs" - if test "$lib_thread" = "yes" -a -n "@CFLAGSTHREADS@"; then - YAZLALIB="${yaz_build_root}/src/libyazthread.la $YAZLALIB" - fi YAZINC="-I${yaz_src_root}/include" YAZCOMP=${yaz_src_root}/util/yaz-asncomp else @@ -113,7 +105,7 @@ fi YAZINC="$YAZINC @YAZ_CONF_CFLAGS@" if test "$lib_thread" = "yes"; then - YAZINC="$YAZINC @CFLAGSTHREADS@" + YAZINC="$YAZINC @THREAD_CFLAGS@" fi if test "$yaz_echo_help" = "yes"; then diff --git a/yaz.m4 b/yaz.m4 index 645d872..2782a1d 100644 --- a/yaz.m4 +++ b/yaz.m4 @@ -19,12 +19,13 @@ AC_ARG_WITH(docbook-dtd,[[ --with-docbook-dtd=DIR use docbookx.dtd in DIR]], /usr/share/sgml/docbook/xml-dtd-4.* do if test -f $d/docbookx.dtd; then - AC_MSG_RESULT($d) DTD_DIR=$d fi done if test -z "$DTD_DIR"; then AC_MSG_RESULT(Not found) + else + AC_MSG_RESULT($d) fi ]) AC_SUBST(DSSSL_DIR) diff --git a/ztest/Makefile.am b/ztest/Makefile.am index 2c276f2..a9fd6e8 100644 --- a/ztest/Makefile.am +++ b/ztest/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.19 2005-03-01 20:37:01 adam Exp $ +## $Id: Makefile.am,v 1.20 2005-09-09 10:34:09 adam Exp $ bin_PROGRAMS=yaz-ztest @@ -6,12 +6,8 @@ yaz_ztest_SOURCES=ztest.c read-grs.c read-marc.c EXTRA_DIST=dummy-records dummy-words dummy-grs ztest.pem config1.xml -if ISTHR -extra=../src/libyazthread.la -endif +yaz_ztest_LDADD=../src/libyaz.la -yaz_ztest_LDADD=$(extra) ../src/libyaz.la $(LIBTHREAD) - -AM_CFLAGS=@CFLAGSTHREADS@ +AM_CFLAGS=$(THREAD_CFLAGS) AM_CPPFLAGS=-I$(top_srcdir)/include $(XML2_CFLAGS) -- 1.7.10.4