From 3e6398d15008d68aa36b0b985a18f142fcfa9a8f Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 16 Apr 2010 12:26:25 +0200 Subject: [PATCH] libyaz.la (whole source) is compiled with threads If thread support is enabled enabled, all source of YAZ is compiled with treading support. This allows core utilities such as yaz_log to use thread facilities. Previously (YAZ 3 and YAZ 4 releases), only libyaz_server.la was using thread utilities. This commit moves mutex utilities (mutex.c) from libyaz_server.la to libyaz.la. --- configure.ac | 5 +++-- src/Makefile.am | 5 ++--- test/Makefile.am | 3 --- yaz-config.in | 6 +----- ztest/Makefile.am | 2 +- 5 files changed, 7 insertions(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac index 7c98b6c..5cff7c5 100644 --- a/configure.ac +++ b/configure.ac @@ -333,8 +333,9 @@ if test "$enable_threads" = "yes" -a "$HAVETHREADS" = "0"; then done LIBS=$OLIBS fi - CFLAGS=$OCFLAGS - PTHREAD_CFLAGS="$PTHREAD_CFLAGS -DYAZ_POSIX_THREADS=1" + LIBS=$PTHREAD_LIBS + CFLAGS="$CFLAGS -DYAZ_POSIX_THREADS=1" + YAZ_CONFIG_CFLAGS="$YAZ_CONFIG_CFLAGS -DYAZ_POSIX_THREADS=1" ]) fi diff --git a/src/Makefile.am b/src/Makefile.am index b8fe503..e43e84a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -27,7 +27,6 @@ YAZCOMP_I = $(YAZCOMP) -d $(srcdir)/ill.tcl -i yaz -I$(top_srcdir)/include AM_CPPFLAGS=-I$(top_srcdir)/include $(XML2_CFLAGS) $(SSL_CFLAGS) libyaz_la_LIBADD = $(SSL_LIBS) -libyaz_server_la_CFLAGS = $(PTHREAD_CFLAGS) libyaz_server_la_LIBADD = libyaz.la libyaz_icu_la_CPPFLAGS = $(AM_CPPFLAGS) $(ICU_CPPFLAGS) libyaz_icu_la_LIBADD = libyaz.la $(ICU_LIBS) @@ -103,12 +102,12 @@ libyaz_la_SOURCES=version.c options.c log.c \ copy_types.c match_glob.c poll.c daemon.c \ iconv_encode_marc8.c iconv_encode_iso_8859_1.c iconv_encode_wchar.c \ iconv_decode_marc8.c iconv_decode_iso5426.c iconv_decode_danmarc.c sc.c \ - json.c xml_include.c file_glob.c dirent.c + json.c xml_include.c file_glob.c dirent.c mutex.c libyaz_la_LDFLAGS=-version-info $(YAZ_VERSION_INFO) libyaz_server_la_SOURCES = statserv.c seshigh.c eventl.c \ - requestq.c eventl.h session.h mutex.c + requestq.c eventl.h session.h libyaz_server_la_LDFLAGS=-version-info $(YAZ_VERSION_INFO) diff --git a/test/Makefile.am b/test/Makefile.am index 2723753..762e372 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -48,9 +48,6 @@ test_odrcodec.c test_odrcodec.h: tstodr.asn $(YAZCOMP) LDADD = ../src/libyaz.la test_icu_LDADD = ../src/libyaz_icu.la ../src/libyaz.la $(ICU_LIBS) -test_mutex_LDADD = ../src/libyaz_server.la ../src/libyaz.la $(PTHREAD_LIBS) -AM_CFLAGS = $(PTHREAD_CFLAGS) - CONFIG_CLEAN_FILES=*.log diff --git a/yaz-config.in b/yaz-config.in index 57886b6..89a2fcb 100644 --- a/yaz-config.in +++ b/yaz-config.in @@ -11,8 +11,6 @@ yaz_echo_lalibs=no yaz_echo_comp=no yaz_src_root=@YAZ_SRC_ROOT@ yaz_build_root=@YAZ_BUILD_ROOT@ -PTHREAD_LIBS="@PTHREAD_LIBS@" -PTHREAD_CFLAGS="@PTHREAD_CFLAGS@" ICU_LIBS="@ICU_LIBS@" ICU_CPPFLAGS="@ICU_CPPFLAGS@" SSL_LIBS="@SSL_LIBS@" @@ -147,9 +145,7 @@ else fi if test "$lib_thread" = "yes"; then - YAZINC="$PTHREAD_CFLAGS $YAZINC" - YAZLIB="$YAZLIB $PTHREAD_LIBS" - YAZLALIB="$YAZLALIB $PTHREAD_LIBS" + : fi if test "$lib_icu" = "yes"; then diff --git a/ztest/Makefile.am b/ztest/Makefile.am index 38ed590..55713fd 100644 --- a/ztest/Makefile.am +++ b/ztest/Makefile.am @@ -9,6 +9,6 @@ gfs_example_SOURCES=gfs-example.c EXTRA_DIST=dummy-words dummy-grs ztest.pem config1.xml -LDADD=../src/libyaz_server.la ../src/libyaz.la $(PTHREAD_LIBS) +LDADD=../src/libyaz_server.la ../src/libyaz.la AM_CPPFLAGS=-I$(top_srcdir)/include $(XML2_CFLAGS) -- 1.7.10.4