From f4e5e779697a3a44134b7af483817e83ce8cfcb0 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 29 Nov 2000 14:24:01 +0000 Subject: [PATCH] Script configure uses yaz pthreads options. Added locking for zebra_register_{lock,unlock}. --- Makefile.in | 9 ++- aclocal.m4 | 6 +- bfile/mfile.c | 9 ++- configure | 213 +++++++++++++++------------------------------------- configure.in | 26 +------ index/zebraapi.c | 88 +++++++++++++--------- index/zinfo.c | 13 ++-- index/zserver.h | 8 +- recctrl/regxread.c | 13 ++-- test/Makefile.in | 9 ++- 10 files changed, 152 insertions(+), 242 deletions(-) diff --git a/Makefile.in b/Makefile.in index 622ffb3..1554d63 100644 --- a/Makefile.in +++ b/Makefile.in @@ -116,6 +116,8 @@ $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCI # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. +@SET_MAKE@ + all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive info-recursive dvi-recursive: @@ -142,11 +144,10 @@ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ done; \ - rev="$$rev ."; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ diff --git a/aclocal.m4 b/aclocal.m4 index ad9609b..e44854e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -144,14 +144,14 @@ AC_DEFUN([YAZ_INIT], fi AC_MSG_CHECKING(for YAZ) if $yazconfig --version >/dev/null 2>&1; then - YAZLIB=`$yazconfig --libs` + YAZLIB=`$yazconfig --libs $1` # if this is empty, it's a simple version YAZ 1.6 script # so we have to source it instead... if test "X$YAZLIB" = "X"; then . $yazconfig else - YAZLALIB=`$yazconfig --lalibs` - YAZINC=`$yazconfig --cflags` + YAZLALIB=`$yazconfig --lalibs $1` + YAZINC=`$yazconfig --cflags $1` YAZVERSION=`$yazconfig --version` fi AC_MSG_RESULT($yazconfig) diff --git a/bfile/mfile.c b/bfile/mfile.c index 0d37fde..4fce68e 100644 --- a/bfile/mfile.c +++ b/bfile/mfile.c @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: mfile.c,v $ - * Revision 1.40 2000-10-17 12:37:09 adam + * Revision 1.41 2000-11-29 14:24:01 adam + * Script configure uses yaz pthreads options. Added locking for + * zebra_register_{lock,unlock}. + * + * Revision 1.40 2000/10/17 12:37:09 adam * Fixed notification of live-updates. Fixed minor problem with mf_init * where it didn't handle shadow area file names correctly. * @@ -316,10 +320,7 @@ MFile_area mf_init(const char *name, const char *spec) if (strchr (".-", *dent->d_name)) continue; if (len < 5 || !cp || strcmp (dent->d_name + len - 3, ".mf")) - { - logf (LOG_WARN, "bf: %s is not a part-file.", dent->d_name); continue; - } number = atoi(cp+1); memcpy (metaname, dent->d_name, cp - dent->d_name); metaname[ cp - dent->d_name] = '\0'; diff --git a/configure b/configure index c8dd444..2f67529 100755 --- a/configure +++ b/configure @@ -14,8 +14,6 @@ ac_default_prefix=/usr/local ac_help="$ac_help --with-yazconfig=DIR yaz-config in DIR (example /home/yaz-1.7)" ac_help="$ac_help - --disable-threads disable threads" -ac_help="$ac_help --with-tclconfig=DIR tclConfig.sh in DIR" # Initialize some variables set by options. @@ -528,7 +526,7 @@ fi echo $ac_n "checking for package""... $ac_c" 1>&6 -echo "configure:532: checking for package" >&5 +echo "configure:530: checking for package" >&5 if test -r ${srcdir}/LICENSE.zmbol; then echo "$ac_t""Z'mbol" 1>&6 PROGPREFIX=zmbol @@ -567,7 +565,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:571: checking for a BSD compatible install" >&5 +echo "configure:569: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -620,7 +618,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:624: checking whether build environment is sane" >&5 +echo "configure:622: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -677,7 +675,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:681: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:679: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -723,7 +721,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:727: checking for working aclocal" >&5 +echo "configure:725: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -736,7 +734,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:740: checking for working autoconf" >&5 +echo "configure:738: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -749,7 +747,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:753: checking for working automake" >&5 +echo "configure:751: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -762,7 +760,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:766: checking for working autoheader" >&5 +echo "configure:764: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -775,7 +773,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:779: checking for working makeinfo" >&5 +echo "configure:777: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -815,7 +813,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:819: checking for working aclocal" >&5 +echo "configure:817: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -828,7 +826,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:832: checking for working autoconf" >&5 +echo "configure:830: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -841,7 +839,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:845: checking for working automake" >&5 +echo "configure:843: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -854,7 +852,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:858: checking for working autoheader" >&5 +echo "configure:856: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -867,7 +865,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:871: checking for working makeinfo" >&5 +echo "configure:869: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -909,7 +907,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:913: checking for $ac_word" >&5 +echo "configure:911: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -939,7 +937,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:943: checking for $ac_word" >&5 +echo "configure:941: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -990,7 +988,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:994: checking for $ac_word" >&5 +echo "configure:992: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1022,7 +1020,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1026: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1024: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1033,12 +1031,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1037 "configure" +#line 1035 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1064,12 +1062,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1068: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1066: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1073: checking whether we are using GNU C" >&5 +echo "configure:1071: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1078,7 +1076,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1082: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1097,7 +1095,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1101: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1099: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1129,7 +1127,7 @@ else fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1133: checking how to run the C preprocessor" >&5 +echo "configure:1131: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1144,13 +1142,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1154: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1161,13 +1159,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1171: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1169: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1178,13 +1176,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1188: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1220,7 +1218,7 @@ echo "$ac_t""$CPP" 1>&6 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1224: checking for a BSD compatible install" >&5 +echo "configure:1222: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1275,7 +1273,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1279: checking for $ac_word" >&5 +echo "configure:1277: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1330,7 +1328,7 @@ fi # Extract the first word of "yaz-config", so it can be a program name with args. set dummy yaz-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1334: checking for $ac_word" >&5 +echo "configure:1332: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_yazconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1366,16 +1364,16 @@ fi fi fi echo $ac_n "checking for YAZ""... $ac_c" 1>&6 -echo "configure:1370: checking for YAZ" >&5 +echo "configure:1368: checking for YAZ" >&5 if $yazconfig --version >/dev/null 2>&1; then - YAZLIB=`$yazconfig --libs` + YAZLIB=`$yazconfig --libs threads` # if this is empty, it's a simple version YAZ 1.6 script # so we have to source it instead... if test "X$YAZLIB" = "X"; then . $yazconfig else - YAZLALIB=`$yazconfig --lalibs` - YAZINC=`$yazconfig --cflags` + YAZLALIB=`$yazconfig --lalibs threads` + YAZINC=`$yazconfig --cflags threads` YAZVERSION=`$yazconfig --version` fi echo "$ac_t""$yazconfig" 1>&6 @@ -1384,97 +1382,6 @@ echo "configure:1370: checking for YAZ" >&5 YAZVERSION=NONE fi - -# Check whether --enable-threads or --disable-threads was given. -if test "${enable_threads+set}" = set; then - enableval="$enable_threads" - enable_threads=$enableval -else - enable_threads=yes -fi - -if test "$enable_threads" = "yes"; then - echo $ac_n "checking for main in -lpthread""... $ac_c" 1>&6 -echo "configure:1399: checking for main in -lpthread" >&5 -ac_lib_var=`echo pthread'_'main | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lpthread $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo pthread | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&6 -fi - - echo $ac_n "checking for working POSIX Threads""... $ac_c" 1>&6 -echo "configure:1442: checking for working POSIX Threads" >&5 - cat > conftest.$ac_ext < - int func(void *p) { return 0; } - -int main() { - - pthread_t pthread_id; - int r = pthread_create (&pthread_id, 0, func, 0); -; return 0; } -EOF -if { (eval echo configure:1455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - thread_ok=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - thread_ok=no -fi -rm -f conftest* - if test "$thread_ok" = "yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_PTHREAD_H 1 -EOF - - cat >> confdefs.h <<\EOF -#define _REENTRANT 1 -EOF - - else - echo "$ac_t""no" 1>&6 - fi -fi TCL_LIB="" TCL_INCLUDE="" tclconfig=NONE @@ -1491,7 +1398,7 @@ echo $ac_n "checking for prefix by $ac_c" 1>&6 # Extract the first word of "tclsh", so it can be a program name with args. set dummy tclsh; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1495: checking for $ac_word" >&5 +echo "configure:1402: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_TCLSH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1532,7 +1439,7 @@ fi prefix=${saveprefix} fi echo $ac_n "checking for Tcl""... $ac_c" 1>&6 -echo "configure:1536: checking for Tcl" >&5 +echo "configure:1443: checking for Tcl" >&5 if test -r ${tclconfig}/tclConfig.sh; then . ${tclconfig}/tclConfig.sh if test -r ${tclconfig}/../generic/tcl.h; then @@ -1558,21 +1465,21 @@ else EOF fi -for ac_hdr in sys/times.h +for ac_hdr in sys/times.h pthread.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1566: checking for $ac_hdr" >&5 +echo "configure:1473: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1576: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1483: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1599,7 +1506,7 @@ fi done echo $ac_n "checking for bzCompressInit in -lbz2""... $ac_c" 1>&6 -echo "configure:1603: checking for bzCompressInit in -lbz2" >&5 +echo "configure:1510: checking for bzCompressInit in -lbz2" >&5 ac_lib_var=`echo bz2'_'bzCompressInit | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1607,7 +1514,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbz2 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1650,17 +1557,17 @@ if test "$ac_cv_lib_bz2_bzCompressInit" = "yes"; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1654: checking for $ac_hdr" >&5 +echo "configure:1561: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1664: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1571: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1688,12 +1595,12 @@ done fi echo $ac_n "checking for LFS""... $ac_c" 1>&6 -echo "configure:1692: checking for LFS" >&5 +echo "configure:1599: checking for LFS" >&5 if test "$cross_compiling" = yes; then bits=32 else cat > conftest.$ac_ext < @@ -1713,7 +1620,7 @@ int main(int argc, char **argv) } EOF -if { (eval echo configure:1717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then bits=64 else @@ -1735,12 +1642,12 @@ else echo "$ac_t""no" 1>&6 fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1739: checking for ANSI C header files" >&5 +echo "configure:1646: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1748,7 +1655,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1752: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1659: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1765,7 +1672,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1783,7 +1690,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1804,7 +1711,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1815,7 +1722,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else diff --git a/configure.in b/configure.in index 208e133..28f705e 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl Zebra, Index Data Aps, 1994-2000 -dnl $Id: configure.in,v 1.24 2000-10-17 12:37:09 adam Exp $ +dnl $Id: configure.in,v 1.25 2000-11-29 14:24:01 adam Exp $ dnl AC_INIT(include/zebraver.h) AC_MSG_CHECKING(for package) @@ -39,27 +39,7 @@ AC_PROG_CPP AC_PROG_INSTALL AC_PROG_RANLIB -YAZ_INIT - -dnl ------ Threads -AC_ARG_ENABLE(threads, [ --disable-threads disable threads],[enable_threads=$enableval],[enable_threads=yes]) -if test "$enable_threads" = "yes"; then - AC_CHECK_LIB(pthread,main) - AC_MSG_CHECKING(for working POSIX Threads) - AC_TRY_LINK([#include - int func(void *p) { return 0; } - ],[ - pthread_t pthread_id; - int r = pthread_create (&pthread_id, 0, func, 0);], - thread_ok=yes,thread_ok=no) - if test "$thread_ok" = "yes"; then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_PTHREAD_H) - AC_DEFINE(_REENTRANT) - else - AC_MSG_RESULT(no) - fi -fi +YAZ_INIT(threads) dnl dnl ------ Look for Tcl dnl See if user has specified location of tclConfig.sh; otherwise @@ -97,7 +77,7 @@ else fi dnl dnl ------ times -AC_CHECK_HEADERS(sys/times.h) +AC_CHECK_HEADERS(sys/times.h pthread.h) dnl dnl ------- BZIP2 AC_CHECK_LIB(bz2,bzCompressInit) diff --git a/index/zebraapi.c b/index/zebraapi.c index b54afe1..0b79bc8 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -3,7 +3,11 @@ * All rights reserved. * * $Log: zebraapi.c,v $ - * Revision 1.38 2000-11-08 13:46:58 adam + * Revision 1.39 2000-11-29 14:24:01 adam + * Script configure uses yaz pthreads options. Added locking for + * zebra_register_{lock,unlock}. + * + * Revision 1.38 2000/11/08 13:46:58 adam * Fixed scan: server could break if bad attribute/database was selected. * Work on remote update. * @@ -189,6 +193,8 @@ static int zebra_register_lock (ZebraHandle zh, int rw) times (&zh->tms1); #endif + zebra_mutex_cond_lock (&zh->service->session_lock); + state = zebra_server_lock_get_state(zh->service, &lastChange); zebra_server_lock (zh->service, state); @@ -230,6 +236,7 @@ static void zebra_register_unlock (ZebraHandle zh) { if (zh->service->registerState != -1) zebra_server_unlock (zh->service, zh->service->registerState); + zebra_mutex_cond_unlock (&zh->service->session_lock); #if HAVE_SYS_TIMES_H times (&zh->tms2); logf (LOG_LOG, "user/system: %ld/%ld", @@ -248,6 +255,7 @@ ZebraHandle zebra_open (ZebraService zs) return 0; zh = (ZebraHandle) xmalloc (sizeof(*zh)); + yaz_log (LOG_LOG, "zebra_open zs=%p returns %p", zs, zh); zh->service = zs; zh->sets = 0; @@ -297,7 +305,11 @@ ZebraService zebra_start (const char *configName) static int zebra_register_activate (ZebraService zh, int rw) { if (zh->active > 1) + { + yaz_log (LOG_LOG, "zebra_register_activate (ignored since active=%d)", + zh->active); return 0; + } yaz_log (LOG_LOG, "zebra_register_activate shadow=%s", zh->registerState ? "yes" : "no"); @@ -434,62 +446,68 @@ void zebra_admin_start (ZebraHandle zh) zebra_mutex_cond_unlock (&zs->session_lock); } -static int zebra_register_deactivate (ZebraService zh) +static int zebra_register_deactivate (ZebraService zs) { - zh->stop_flag = 0; - if (zh->active <= 1) + zs->stop_flag = 0; + if (zs->active <= 1) + { + yaz_log(LOG_LOG, "zebra_register_deactivate (ignored since active=%d)", + zs->active); return 0; + } yaz_log(LOG_LOG, "zebra_register_deactivate"); - zebra_chdir (zh); - if (zh->records) + zebra_chdir (zs); + if (zs->records) { - zebraExplain_close (zh->zei, 0); - dict_close (zh->dict); - sortIdx_close (zh->sortIdx); - if (zh->isams) - isams_close (zh->isams); + zebraExplain_close (zs->zei, 0); + dict_close (zs->dict); + sortIdx_close (zs->sortIdx); + if (zs->isams) + isams_close (zs->isams); #if ZMBOL - if (zh->isam) - is_close (zh->isam); - if (zh->isamc) - isc_close (zh->isamc); - if (zh->isamd) - isamd_close (zh->isamd); + if (zs->isam) + is_close (zs->isam); + if (zs->isamc) + isc_close (zs->isamc); + if (zs->isamd) + isamd_close (zs->isamd); #endif - rec_close (&zh->records); + rec_close (&zs->records); } - recTypes_destroy (zh->recTypes); - zebra_maps_close (zh->zebra_maps); - zebraRankDestroy (zh); - bfs_destroy (zh->bfs); - data1_destroy (zh->dh); - - if (zh->passwd_db) - passwd_db_close (zh->passwd_db); - zh->active = 1; + recTypes_destroy (zs->recTypes); + zebra_maps_close (zs->zebra_maps); + zebraRankDestroy (zs); + bfs_destroy (zs->bfs); + data1_destroy (zs->dh); + + if (zs->passwd_db) + passwd_db_close (zs->passwd_db); + zs->active = 1; return 0; } -void zebra_stop(ZebraService zh) +void zebra_stop(ZebraService zs) { - if (!zh) + if (!zs) return ; yaz_log (LOG_LOG, "zebra_stop"); - assert (!zh->sessions); + assert (!zs->sessions); - zebra_mutex_cond_destroy (&zh->session_lock); + zebra_mutex_cond_destroy (&zs->session_lock); - zebra_register_deactivate(zh); - res_close (zh->res); - xfree (zh->configName); - xfree (zh); + zebra_register_deactivate(zs); + res_close (zs->res); + xfree (zs->configName); + xfree (zs); } void zebra_close (ZebraHandle zh) { ZebraService zs = zh->service; struct zebra_session **sp; + + yaz_log (LOG_LOG, "zebra_close zh=%p", zh); if (!zh) return ; resultSetDestroy (zh, -1, 0, 0); diff --git a/index/zinfo.c b/index/zinfo.c index 989cad8..daf64f9 100644 --- a/index/zinfo.c +++ b/index/zinfo.c @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zinfo.c,v $ - * Revision 1.19 2000-07-07 12:49:20 adam + * Revision 1.20 2000-11-29 14:24:01 adam + * Script configure uses yaz pthreads options. Added locking for + * zebra_register_{lock,unlock}. + * + * Revision 1.19 2000/07/07 12:49:20 adam * Optimized resultSetInsert{Rank,Sort}. * * Revision 1.18 2000/03/20 19:08:36 adam @@ -186,16 +190,11 @@ static data1_node *data1_add_tag (data1_handle dh, data1_node *at, const char *tag, NMEM nmem) { data1_node *partag = get_parent_tag(dh, at); - data1_node *res = data1_mk_node (dh, nmem); + data1_node *res = data1_mk_node_type (dh, nmem, DATA1N_tag); data1_element *e = NULL; res->parent = at; - res->which = DATA1N_tag; res->u.tag.tag = data1_insert_string (dh, res, nmem, tag); - res->u.tag.node_selected = 0; - res->u.tag.make_variantlist = 0; - res->u.tag.no_data_requested = 0; - res->u.tag.get_bytes = -1; if (partag) e = partag->u.tag.element; diff --git a/index/zserver.h b/index/zserver.h index 8680d43..a1bee7e 100644 --- a/index/zserver.h +++ b/index/zserver.h @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zserver.h,v $ - * Revision 1.49 2000-05-18 12:01:36 adam + * Revision 1.50 2000-11-29 14:24:01 adam + * Script configure uses yaz pthreads options. Added locking for + * zebra_register_{lock,unlock}. + * + * Revision 1.49 2000/05/18 12:01:36 adam * System call times(2) used again. More 64-bit fixes. * * Revision 1.48 2000/04/05 09:49:35 adam @@ -232,7 +236,7 @@ struct zebra_service { Passwd_db passwd_db; Zebra_mutex_cond session_lock; int stop_flag; - int active; + int active; /* 0=shutdown, 1=enabled and inactive, 2=activated */ }; struct recKeys { diff --git a/recctrl/regxread.c b/recctrl/regxread.c index 32ffdda..299f2ef 100644 --- a/recctrl/regxread.c +++ b/recctrl/regxread.c @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: regxread.c,v $ - * Revision 1.33 1999-11-30 13:48:04 adam + * Revision 1.34 2000-11-29 14:24:01 adam + * Script configure uses yaz pthreads options. Added locking for + * zebra_register_{lock,unlock}. + * + * Revision 1.33 1999/11/30 13:48:04 adam * Improved installation. Updated for inclusion of YAZ header files. * * Revision 1.32 1999/09/07 07:19:21 adam @@ -1049,10 +1053,8 @@ static void tagBegin (struct lexSpec *spec, parent = spec->d1_stack[spec->d1_level -1]; partag = get_parent_tag(spec->dh, parent); - res = data1_mk_node (spec->dh, spec->m); + res = data1_mk_node_type (spec->dh, spec->m, DATA1N_tag); res->parent = parent; - res->which = DATA1N_tag; - res->u.tag.get_bytes = -1; if (len >= DATA1_LOCALDATA) res->u.tag.tag = (char *) nmem_malloc (spec->m, len+1); @@ -1075,9 +1077,6 @@ static void tagBegin (struct lexSpec *spec, spec->d1_stack[0]->u.root.absyn, e, res->u.tag.tag); res->u.tag.element = elem; - res->u.tag.node_selected = 0; - res->u.tag.make_variantlist = 0; - res->u.tag.no_data_requested = 0; res->root = parent->root; parent->last_child = res; diff --git a/test/Makefile.in b/test/Makefile.in index 32d71d6..881e449 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -100,6 +100,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. +@SET_MAKE@ + all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive info-recursive dvi-recursive: @@ -126,11 +128,10 @@ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ done; \ - rev="$$rev ."; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ -- 1.7.10.4