From 52766ad785751dc97f689a4cc5407af1895139d2 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 16 Jan 1998 09:24:17 +0000 Subject: [PATCH] Updated doc. --- Makefile.in | 82 ++++----- configure | 494 +++++++++++++++++++++++++++++++++++++++---------------- configure.in | 16 +- doc/Makefile | 6 +- doc/ir-tcl.sgml | 264 ++++++++++++++++++++++------- 5 files changed, 612 insertions(+), 250 deletions(-) diff --git a/Makefile.in b/Makefile.in index 39ca9d1..3a2dd70 100644 --- a/Makefile.in +++ b/Makefile.in @@ -2,7 +2,7 @@ # (c) Index Data 1995-1996 # See the file LICENSE for details. # Sebastian Hammer, Adam Dickmeiss -# $Id: Makefile.in,v 1.44 1997-11-24 11:36:33 adam Exp $ +# $Id: Makefile.in,v 1.45 1998-01-16 09:24:17 adam Exp $ SHELL=/bin/sh # IrTcl Version @@ -62,7 +62,7 @@ RANLIB = @RANLIB@ O=ir-tcl.o marc.o queue.o mem.o grs.o explain.o select.o -all: ir-tcl ir-tk +all: @ALL_SPEC@ ir-tk: libirtcl.a tkmain.o $(CC) $(CFLAGS) tkmain.o -o ir-tk libirtcl.a $(YAZLIB) $(TKLIB) @@ -108,7 +108,7 @@ install.man: done; \ fi -install: ir-tcl +install: @ALL_SPEC@ @for d in $(IRTCLDIR) $(IRTCLDIR)/formats $(IRTCLDIR)/bitmaps; do \ if [ ! -d $$d ]; then \ echo Making $$d; \ @@ -116,8 +116,14 @@ install: ir-tcl chmod 755 $$d; \ fi; \ done; - @echo "Installing ir-tcl" - @$(INSTALL_PROGRAM) ir-tcl $(BINDIR) + @if [ -f ir-tcl ]; then \ + echo "Installing ir-tcl"; \ + $(INSTALL_PROGRAM) ir-tcl $(BINDIR); \ + fi + @if [ -f @SHLIB_IRTCL@ ]; then \ + echo "Installing @SHLIB_IRTCL@"; \ + $(INSTALL_PROGRAM) @SHLIB_IRTCL@ $(IRTCLDIR); \ + fi @echo "Installing libirtcl.a" @$(INSTALL_DATA) libirtcl.a $(LIBDIR) @echo "Installing ir-tcl.h" @@ -125,43 +131,43 @@ install: ir-tcl @if [ -f ir-tk ]; then \ echo "Installing ir-tk"; \ $(INSTALL_PROGRAM) ir-tk $(BINDIR); \ - echo "Installing irclient"; \ - echo "#! $(BINDIR)/ir-tk -f" >head.bak; \ - cat head.bak client.tcl| sed "s,^set libdir LIBDIR,set libdir $(IRTCLDIR)," >client.bak; \ - $(INSTALL_PROGRAM) client.bak $(BINDIR)/irclient; \ - if [ -f $(IRTCLDIR)/clientrc.tcl ]; then \ - echo "clientrc.tcl already exists"; \ - echo "Installing clientrc.tcl.n"; \ - cp clientrc.tcl clientrc.tcl.n; \ - $(INSTALL_DATA) clientrc.tcl.n $(IRTCLDIR); \ - rm clientrc.tcl.n; \ - else \ - echo "Installing clientrc.tcl"; \ - $(INSTALL_DATA) clientrc.tcl $(IRTCLDIR); \ + fi; \ + echo "Installing irclient"; \ + echo "#! $(BINDIR)/@IRCLIENT_SHELL@ -f" >head.bak; \ + cat head.bak client.tcl| sed "s,^set libdir LIBDIR,set libdir $(IRTCLDIR)," >client.bak; \ + $(INSTALL_PROGRAM) client.bak $(BINDIR)/irclient; \ + if [ -f $(IRTCLDIR)/clientrc.tcl ]; then \ + echo "clientrc.tcl already exists"; \ + echo "Installing clientrc.tcl.n"; \ + cp clientrc.tcl clientrc.tcl.n; \ + $(INSTALL_DATA) clientrc.tcl.n $(IRTCLDIR); \ + rm clientrc.tcl.n; \ + else \ + echo "Installing clientrc.tcl"; \ + $(INSTALL_DATA) clientrc.tcl $(IRTCLDIR); \ + fi; \ + for f in *.tcl; do \ + echo "Installing $$f"; \ + $(INSTALL_DATA) $$f $(IRTCLDIR); \ + done; \ + echo "Installing LICENSE" ; \ + $(INSTALL_DATA) LICENSE $(IRTCLDIR); \ + echo "Installing display format scripts"; \ + for b in formats/*.tcl; do \ + if [ -f $$b ]; then \ + $(INSTALL_DATA) $$b $(IRTCLDIR)/formats; \ fi; \ - for f in *.tcl; do \ - echo "Installing $$f"; \ - $(INSTALL_DATA) $$f $(IRTCLDIR); \ - done; \ - echo "Installing LICENSE" ; \ - $(INSTALL_DATA) LICENSE $(IRTCLDIR); \ - echo "Installing display format scripts"; \ - for b in formats/*.tcl; do \ - if [ -f $$b ]; then \ - $(INSTALL_DATA) $$b $(IRTCLDIR)/formats; \ - fi; \ - done; \ - echo "Installing bitmaps"; \ - for b in bitmaps/*; do \ - if [ -f $$b ]; then \ - $(INSTALL_DATA) $$b $(IRTCLDIR)/bitmaps; \ - fi; \ - done; \ - fi; + done; \ + echo "Installing bitmaps"; \ + for b in bitmaps/*; do \ + if [ -f $$b ]; then \ + $(INSTALL_DATA) $$b $(IRTCLDIR)/bitmaps; \ + fi; \ + done clean: rm -f *.[oa] ir-tk ir-tcl wais-tcl core - rm -f gmon.out mon.out *.bak config.cache @SHLIB_IRTCL@ + rm -f *mon.out *.bak config.cache @SHLIB_IRTCL@ autoconf: -rm config.cache diff --git a/configure b/configure index cf10db7..aadd99d 100755 --- a/configure +++ b/configure @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.7 -# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. +# Generated automatically using autoconf version 2.12 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. @@ -55,6 +55,8 @@ mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 ac_prev= for ac_option @@ -336,7 +338,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.7" + echo "configure generated by autoconf version 2.12" exit 0 ;; -with-* | --with-*) @@ -438,11 +440,14 @@ do done # NLS nuisances. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h @@ -501,12 +506,10 @@ fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='echo $CPP $CPPFLAGS 1>&5; -$CPP $CPPFLAGS' -ac_compile='echo ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5; -${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5 2>&5' -ac_link='echo ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5; -${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5' +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. @@ -537,6 +540,8 @@ CC=${CC-cc} + + ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then @@ -567,11 +572,12 @@ 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:576: 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 else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in @@ -594,7 +600,7 @@ else ;; esac done - IFS="$ac_save_ifs" + IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then @@ -616,10 +622,11 @@ test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' if test "x$prefix" = xNONE; then -echo $ac_n "checking for prefix by ""... $ac_c" 1>&6 +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:630: 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 @@ -652,7 +659,88 @@ fi fi fi +if test "x$prefix" = xNONE; then + if test "x$prefix" = xNONE; then +echo $ac_n "checking for prefix by $ac_c" 1>&6 +# Extract the first word of "tclsh8.0", so it can be a program name with args. +set dummy tclsh8.0; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:669: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_TCLSH8.0'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$TCLSH8.0" in + /*) + ac_cv_path_TCLSH8.0="$TCLSH8.0" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_TCLSH8.0="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +TCLSH8.0="$ac_cv_path_TCLSH8.0" +if test -n "$TCLSH8.0"; then + echo "$ac_t""$TCLSH8.0" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -n "$ac_cv_path_TCLSH8.0"; then + prefix=`echo $ac_cv_path_TCLSH8.0|sed 's%/[^/][^/]*//*[^/][^/]*$%%'` + fi +fi + +fi +if test "x$prefix" = xNONE; then + if test "x$prefix" = xNONE; then +echo $ac_n "checking for prefix by $ac_c" 1>&6 +# Extract the first word of "tclsh7.6", so it can be a program name with args. +set dummy tclsh7.6; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:709: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_TCLSH7.6'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$TCLSH7.6" in + /*) + ac_cv_path_TCLSH7.6="$TCLSH7.6" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_TCLSH7.6="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +TCLSH7.6="$ac_cv_path_TCLSH7.6" +if test -n "$TCLSH7.6"; then + echo "$ac_t""$TCLSH7.6" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -n "$ac_cv_path_TCLSH7.6"; then + prefix=`echo $ac_cv_path_TCLSH7.6|sed 's%/[^/][^/]*//*[^/][^/]*$%%'` + fi +fi + +fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:744: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -667,31 +755,37 @@ 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 -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:765: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:782: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi @@ -706,51 +800,29 @@ else fi echo "$ac_t""$CPP" 1>&6 -# If we cannot run a trivial program, we must be cross compiling. -echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - ac_cv_c_cross=yes -else -cat > conftest.$ac_ext </dev/null; then - ac_cv_c_cross=no -else - ac_cv_c_cross=yes -fi -fi -rm -fr conftest* -fi - -echo "$ac_t""$ac_cv_c_cross" 1>&6 -cross_compiling=$ac_cv_c_cross - echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:805: 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 #include #include EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:818: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yes else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_stdc=no fi @@ -759,7 +831,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 @@ -777,7 +849,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 @@ -797,8 +869,8 @@ if test $ac_cv_header_stdc = yes; then if test "$cross_compiling" = yes; then : else -cat > conftest.$ac_ext < conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -809,15 +881,19 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -eval $ac_link -if test -s conftest && (./conftest; exit) 2>/dev/null; then +if { (eval echo configure:885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then : else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* ac_cv_header_stdc=no fi -fi rm -fr conftest* fi + +fi fi echo "$ac_t""$ac_cv_header_stdc" 1>&6 @@ -832,6 +908,7 @@ if test "$ac_cv_header_stdc" = no; then echo "configure: warning: Your system doesn't seem to support ANSI C" 1>&2 fi echo $ac_n "checking for YAZ directory""... $ac_c" 1>&6 +echo "configure:912: checking for YAZ directory" >&5 # Check whether --with-yazdir or --without-yazdir was given. if test "${with_yazdir+set}" = set; then withval="$with_yazdir" @@ -854,6 +931,7 @@ else echo "$ac_t""$YAZDIR" 1>&6 fi echo $ac_n "checking for MOSI""... $ac_c" 1>&6 +echo "configure:935: checking for MOSI" >&5 # Check whether --with-mosidir or --without-mosidir was given. if test "${with_mosidir+set}" = set; then withval="$with_mosidir" @@ -886,6 +964,7 @@ else fi if test -r ${tryprefix}/lib/tclConfig.sh; then echo $ac_n "checking for Tcl""... $ac_c" 1>&6 +echo "configure:968: checking for Tcl" >&5 source ${tryprefix}/lib/tclConfig.sh TCLLIB="${TCL_LIB_SPEC} ${TCL_LIBS}" TCLINC=-I${TCL_PREFIX}/include @@ -895,6 +974,7 @@ if test -r ${tryprefix}/lib/tclConfig.sh; then SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX SHLIB_VERSION=$TCL_SHLIB_VERSION SHLIB_IRTCL=irtcl${TCL_SHLIB_SUFFIX} + ALL_SPEC="irtcl${TCL_SHLIB_SUFFIX} libirtcl.a" echo "$ac_t""$TCL_VERSION" 1>&6 else SHLIB_CFLAGS="" @@ -905,6 +985,7 @@ else # 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:989: 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 @@ -932,20 +1013,22 @@ fi checkBoth=0 echo $ac_n "checking for connect""... $ac_c" 1>&6 +echo "configure:1017: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char connect(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -958,16 +1041,18 @@ connect(); ; return 0; } EOF -if eval $ac_link; then +if { (eval echo configure:1045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_connect=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_connect=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then echo "$ac_t""yes" 1>&6 tk_checkSocket=0 @@ -977,26 +1062,28 @@ tk_checkSocket=1 fi if test "$tk_checkSocket" = 1; then - echo $ac_n "checking for -lsocket""... $ac_c" 1>&6 -ac_lib_var=`echo socket | tr '.-/+' '___p'` + echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6 +echo "configure:1067: checking for main in -lsocket" >&5 +ac_lib_var=`echo socket'_'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="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 @@ -1017,20 +1104,22 @@ fi tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" echo $ac_n "checking for accept""... $ac_c" 1>&6 +echo "configure:1108: checking for accept" >&5 if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char accept(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -1043,16 +1132,18 @@ accept(); ; return 0; } EOF -if eval $ac_link; then +if { (eval echo configure:1136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_accept=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_accept=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'accept`\" = yes"; then echo "$ac_t""yes" 1>&6 : @@ -1063,20 +1154,22 @@ fi fi echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 +echo "configure:1158: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char gethostbyname(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -1089,41 +1182,45 @@ gethostbyname(); ; return 0; } EOF -if eval $ac_link; then +if { (eval echo configure:1186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_gethostbyname=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then echo "$ac_t""yes" 1>&6 : else echo "$ac_t""no" 1>&6 -echo $ac_n "checking for -lnsl""... $ac_c" 1>&6 -ac_lib_var=`echo nsl | tr '.-/+' '___p'` +echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 +echo "configure:1204: checking for main in -lnsl" >&5 +ac_lib_var=`echo nsl'_'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="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 @@ -1141,6 +1238,7 @@ fi fi echo $ac_n "checking for Tcl""... $ac_c" 1>&6 +echo "configure:1242: checking for Tcl" >&5 TCL_VERSION=nope for i in "" 7.4 7.5 7.6 8.0; do if test -r ${tryprefix}/lib/libtcl${i}.a; then @@ -1161,15 +1259,19 @@ fi TCLINC=-I${tryprefix}/include fi TCLLIB="${TCL_LIB_SPEC} ${LIBS} -lm" + ALL_SPEC="ir-tcl ir-tk" fi if test -r ${tryprefix}/lib/tkConfig.sh; then echo $ac_n "checking for Tk""... $ac_c" 1>&6 +echo "configure:1267: checking for Tk" >&5 source ${tryprefix}/lib/tkConfig.sh echo "$ac_t""$TK_VERSION" 1>&6 TKINC=${TK_XINCLUDES} TKLIB="${TK_LIB_SPEC} ${TCL_LIB_SPEC} ${TK_LIBS}" + IRCLIENT_SHELL=wish${TK_VERSION} else echo $ac_n "checking for Tk""... $ac_c" 1>&6 +echo "configure:1275: checking for Tk" >&5 TK_VERSION=nope for i in "" 4.0 4.1 4.2 8.0; do if test -r ${tryprefix}/lib/libtk${i}.a; then @@ -1192,6 +1294,7 @@ else # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 +echo "configure:1298: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -1199,17 +1302,20 @@ if test "${with_x+set}" = set; then : fi +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then - no_x=yes + # The user explicitly disabled X. + have_x=disabled else if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then - no_x= + # Both variables are already set. + have_x=yes else -if eval "test \"`echo '$''{'ac_cv_path_x'+set}'`\" = set"; then +if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # One or both of the vars are not set, and there is no cached value. -no_x=yes +ac_x_includes=NO ac_x_libraries=NO rm -fr conftestdir if mkdir conftestdir; then cd conftestdir @@ -1219,7 +1325,6 @@ acfindx: @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' EOF if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then - no_x= # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. @@ -1229,7 +1334,9 @@ EOF ac_im_usrlibdir=$ac_im_libdir; break fi done - # Screen out bogus values from the imake configuration. + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. case "$ac_im_incroot" in /usr/include) ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;; @@ -1243,45 +1350,51 @@ EOF rm -fr conftestdir fi -if test "$no_x" = yes; then -test -z "$x_direct_test_library" && x_direct_test_library=Xt -test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc -test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h +if test "$ac_x_includes" = NO; then + # Guess where to find include files, by looking for this one X11 .h file. + test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h + + # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1365: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* - no_x= ac_x_includes= + # We can compile using X headers with no special include directory. +ac_x_includes= else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* - for ac_dir in \ + # Look for the header file in a standard set of common directories. +# Check X11 before X11Rn because it is often a symlink to the current release. + for ac_dir in \ + /usr/X11/include \ /usr/X11R6/include \ /usr/X11R5/include \ /usr/X11R4/include \ \ + /usr/include/X11 \ /usr/include/X11R6 \ /usr/include/X11R5 \ /usr/include/X11R4 \ \ + /usr/local/X11/include \ /usr/local/X11R6/include \ /usr/local/X11R5/include \ /usr/local/X11R4/include \ \ + /usr/local/include/X11 \ /usr/local/include/X11R6 \ /usr/local/include/X11R5 \ /usr/local/include/X11R4 \ \ - /usr/X11/include \ - /usr/include/X11 \ - /usr/local/X11/include \ - /usr/local/include/X11 \ - \ /usr/X386/include \ /usr/x386/include \ /usr/XFree86/include/X11 \ @@ -1298,56 +1411,65 @@ else ; \ do if test -r "$ac_dir/$x_direct_test_include"; then - no_x= ac_x_includes=$ac_dir + ac_x_includes=$ac_dir break fi done fi rm -f conftest* +fi # $ac_x_includes = NO + +if test "$ac_x_libraries" = NO; then + # Check for the libraries. + + test -z "$x_direct_test_library" && x_direct_test_library=Xt + test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc -# Check for the libraries. -# See if we find them without any special options. -# Don't add to $LIBS permanently. -ac_save_LIBS="$LIBS" -LIBS="-l$x_direct_test_library $LIBS" + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS="$LIBS" + LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - LIBS="$ac_save_LIBS" no_x= ac_x_libraries= + LIBS="$ac_save_LIBS" +# We can link X programs with no special library path. +ac_x_libraries= else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* LIBS="$ac_save_LIBS" # First see if replacing the include by lib works. +# Check X11 before X11Rn because it is often a symlink to the current release. for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ + /usr/X11/lib \ /usr/X11R6/lib \ /usr/X11R5/lib \ /usr/X11R4/lib \ \ + /usr/lib/X11 \ /usr/lib/X11R6 \ /usr/lib/X11R5 \ /usr/lib/X11R4 \ \ + /usr/local/X11/lib \ /usr/local/X11R6/lib \ /usr/local/X11R5/lib \ /usr/local/X11R4/lib \ \ + /usr/local/lib/X11 \ /usr/local/lib/X11R6 \ /usr/local/lib/X11R5 \ /usr/local/lib/X11R4 \ \ - /usr/X11/lib \ - /usr/lib/X11 \ - /usr/local/X11/lib \ - /usr/local/lib/X11 \ - \ /usr/X386/lib \ /usr/x386/lib \ /usr/XFree86/lib/X11 \ @@ -1358,6 +1480,7 @@ for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ /usr/athena/lib \ /usr/local/x11r5/lib \ /usr/lpp/Xamples/lib \ + /lib/usr/lib/X11 \ \ /usr/openwin/lib \ /usr/openwin/share/lib \ @@ -1365,31 +1488,38 @@ for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ do for ac_extension in a so sl; do if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then - no_x= ac_x_libraries=$ac_dir + ac_x_libraries=$ac_dir break 2 fi done done fi rm -f conftest* +fi # $ac_x_libraries = NO -fi -if test "$no_x" = yes; then - ac_cv_path_x="no_x=yes" +if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then + # Didn't find X anywhere. Cache the known absence of X. + ac_cv_have_x="have_x=no" else - ac_cv_path_x="no_x= ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" fi fi fi - eval "$ac_cv_path_x" + eval "$ac_cv_have_x" fi # $with_x != no -if test "$no_x" = yes; then - echo "$ac_t""no" 1>&6 +if test "$have_x" != yes; then + echo "$ac_t""$have_x" 1>&6 + no_x=yes else + # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries - ac_cv_path_x="no_x= ac_x_includes=$x_includes ac_x_libraries=$x_libraries" + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$x_includes ac_x_libraries=$x_libraries" echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6 fi @@ -1397,16 +1527,19 @@ fi if test "$no_x" = ""; then if test "$x_includes" = ""; then cat > conftest.$ac_ext < EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1536: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* not_really_there="yes" fi @@ -1421,16 +1554,19 @@ rm -f conftest* echo checking for X11 header files XINCLUDES="# no special path needed" cat > conftest.$ac_ext < EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1563: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* XINCLUDES="nope" fi @@ -1471,26 +1607,32 @@ rm -f conftest* fi fi if test "$XLIBSW" = nope ; then - echo $ac_n "checking for -lXwindow""... $ac_c" 1>&6 -ac_lib_var=`echo Xwindow | tr '.-/+' '___p'` + echo $ac_n "checking for XCreateWindow in -lXwindow""... $ac_c" 1>&6 +echo "configure:1612: checking for XCreateWindow in -lXwindow" >&5 +ac_lib_var=`echo Xwindow'_'XCreateWindow | 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="-lXwindow $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; 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 @@ -1512,6 +1654,7 @@ fi fi TKINC=$XINCLUDES TKLIB="${TKLIB} ${XLIBSW} ${TCLLIB}" + IRCLIENT_SHELL=ir-tk fi trap '' 1 2 15 cat > confcache <<\EOF @@ -1530,11 +1673,25 @@ cat > confcache <<\EOF # --recheck option to rerun configure. # EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | - sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \ - >> confcache + case `(ac_space=' '; set) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache if cmp -s $cache_file confcache; then : else @@ -1566,7 +1723,7 @@ trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. cat > conftest.defs <<\EOF -s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g s%\[%\\&%g s%\]%\\&%g @@ -1601,7 +1758,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.7" + echo "$CONFIG_STATUS generated by autoconf version 2.12" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -1657,28 +1814,68 @@ s%@SHLIB_LD@%$SHLIB_LD%g s%@SHLIB_SUFFIX@%$SHLIB_SUFFIX%g s%@SHLIB_VERSION@%$SHLIB_VERSION%g s%@SHLIB_IRTCL@%$SHLIB_IRTCL%g +s%@ALL_SPEC@%$ALL_SPEC%g +s%@IRCLIENT_SHELL@%$IRCLIENT_SHELL%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@TCLSH@%$TCLSH%g +s%@TCLSH8.0@%$TCLSH8.0%g +s%@TCLSH7.6@%$TCLSH7.6%g s%@CPP@%$CPP%g s%@RANLIB@%$RANLIB%g CEOF EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile]", defaulting infile="outfile.in". + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac - # Adjust relative srcdir, etc. for subdirectories. + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` @@ -1706,6 +1903,7 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac + echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." @@ -1714,16 +1912,22 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # $configure_input" ;; *) ac_comsub= ;; esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g -" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done -rm -f conftest.subs +rm -f conftest.s* +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF exit 0 EOF diff --git a/configure.in b/configure.in index 2e9b2d3..8dde199 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ dnl IR toolkit for tcl/tk -dnl (c) Index Data 1996-1997 +dnl (c) Index Data 1996-1998 dnl See the file LICENSE for details. -dnl $Id: configure.in,v 1.21 1997-04-30 07:26:07 adam Exp $ +dnl $Id: configure.in,v 1.22 1998-01-16 09:24:17 adam Exp $ AC_INIT(ir-tcl.h) CC=${CC-cc} dnl ------ Substitutions @@ -20,10 +20,18 @@ AC_SUBST(SHLIB_LD) AC_SUBST(SHLIB_SUFFIX) AC_SUBST(SHLIB_VERSION) AC_SUBST(SHLIB_IRTCL) +AC_SUBST(ALL_SPEC) +AC_SUBST(IRCLIENT_SHELL) dnl dnl ------ Preliminary settings AC_PROG_INSTALL AC_PREFIX_PROGRAM(tclsh) +if test "x$prefix" = xNONE; then + AC_PREFIX_PROGRAM(tclsh8.0) +fi +if test "x$prefix" = xNONE; then + AC_PREFIX_PROGRAM(tclsh7.6) +fi AC_STDC_HEADERS if test "$ac_cv_header_stdc" = no; then AC_MSG_WARN(Your system doesn't seem to support ANSI C) @@ -88,6 +96,7 @@ if test -r ${tryprefix}/lib/tclConfig.sh; then SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX SHLIB_VERSION=$TCL_SHLIB_VERSION SHLIB_IRTCL=irtcl${TCL_SHLIB_SUFFIX} + ALL_SPEC="irtcl${TCL_SHLIB_SUFFIX} libirtcl.a" AC_MSG_RESULT($TCL_VERSION) else SHLIB_CFLAGS="" @@ -128,6 +137,7 @@ else TCLINC=-I${tryprefix}/include fi TCLLIB="${TCL_LIB_SPEC} ${LIBS} -lm" + ALL_SPEC="ir-tcl ir-tk" fi dnl dnl ------ look for Tk @@ -138,6 +148,7 @@ if test -r ${tryprefix}/lib/tkConfig.sh; then AC_MSG_RESULT($TK_VERSION) TKINC=${TK_XINCLUDES} TKLIB="${TK_LIB_SPEC} ${TCL_LIB_SPEC} ${TK_LIBS}" + IRCLIENT_SHELL=wish${TK_VERSION} else AC_MSG_CHECKING(for Tk) TK_VERSION=nope @@ -216,5 +227,6 @@ else fi TKINC=$XINCLUDES TKLIB="${TKLIB} ${XLIBSW} ${TCLLIB}" + IRCLIENT_SHELL=ir-tk fi AC_OUTPUT(Makefile) diff --git a/doc/Makefile b/doc/Makefile index fa3e0dc..7eab96c 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.4 1995-10-27 11:16:53 adam Exp $ +# $Id: Makefile,v 1.5 1998-01-16 09:24:17 adam Exp $ all: ir-tcl.ps ir-tcl.txt ir-tcl.html ir-tcl.txt: ir-tcl.sgml @@ -7,8 +7,8 @@ ir-tcl.txt: ir-tcl.sgml ir-tcl.dvi: ir-tcl.sgml sgml2ps -d ir-tcl.sgml -ir-tcl.ps: ir-tcl.sgml - sgml2ps ir-tcl.sgml +ir-tcl.tex: ir-tcl.sgml + sgml2latex ir-tcl.sgml ir-tcl.html: ir-tcl.sgml sgml2html ir-tcl.sgml diff --git a/doc/ir-tcl.sgml b/doc/ir-tcl.sgml index e053776..7a71169 100644 --- a/doc/ir-tcl.sgml +++ b/doc/ir-tcl.sgml @@ -1,14 +1,14 @@
IrTcl User's Guide and Reference <author><htmlurl url="http://www.indexdata.dk/" name="Index Data">, -<tt><htmlurl url="mailto:info@index.ping.dk" name="info@index.ping.dk"></tt> -<date>$Revision: 1.23 $ +<tt><htmlurl url="mailto:info@indexdata.dk" name="info@indexdata.dk"></tt> +<date>$Revision: 1.24 $ <abstract> This document describes IrTcl -- an information retrieval toolkit for Tcl and Tk that provides access to the Z39.50/SR protocol. @@ -36,14 +36,9 @@ However, the mOSI transport is only an option, and hence it is not needed unless you wish to communicate within an OSI environment. See [ref 2] for more information about the XTI/mOSI implementation. -<sf/IrTcl/ provides two system environments: - -<itemize> -<item> A simple command line shell -- useful for -testing purposes. -<item> A simple command line shell which operates within the Tk - environment -- makes it very easy to implement GUI clients. -</itemize> +<sf/IrTcl/ is implemented as a <it/dynamic/ library (DLL) which is +dynamically loaded by using the <tt/load/ command. However, <sf/IrTcl/ +may also be compiled as a traditional <it/static/ library as well. <sect>Compilation and installation @@ -51,16 +46,16 @@ testing purposes. In order to compile you need: <itemize> <item> An ANSI C compiler such as GNU C. -<item> <htmlurl url="http://www.sunlabs.com/research/tcl/" name="Tcl">. - Version 7.3, 7.4 and 7.5 has been tested. +<item> <htmlurl url="http://sunscript.sun.com/TclTkCore/" name="Tcl">. + Version 7.X and 8.0 has been tested. <item> <htmlurl url="http://www.indexdata.dk/yaz.html" name="YAZ"> - version 1.2 or higher. + version 1.4 or higher. </itemize> As an option you may want: <itemize> -<item> <htmlurl url="http://www.sunlabs.com/research/tcl/" name="Tk">. -Version 3.6, 4.0 and 4.1 has been tested. +<item> <htmlurl url="http://sunscript.sun.com/TclTkCore/" name="Tk">. +Version 3.6, 4.X and 8.0 has been tested. <item> XTI/mOSI </itemize> @@ -85,11 +80,14 @@ Compile <sf/IrTcl/ by typing: $ make </verb></tscreen> -If you don't have Tk you will only be able to create the <tt>ir-tcl</tt> -program and you must type <tt>make ir-tcl</tt> instead. +For Tcl versions that support dynamic libraries the command above +will create the shared library, <tt/irtcl.so/, as well as the +normal static library, <tt/libirtcl.a/. -If successful, this will make <tt>ir-tcl</tt>, <tt>ir-tk</tt> (if -Tk is present) and a library called <tt>libirtcl.a</tt>. +For Tcl versions that doesn't support dynamic libraries the +command will create two shells will build-in <sf/IrTcl/ support -- +a Tcl shell called <tt/ir-tcl/ and a Tcl/Tk shell called <tt/ir-tk/. +The traditional static library, <tt/libirtcl.a/, is build as well. To install the programs and support files type: <tscreen><verb> @@ -104,71 +102,97 @@ $ make install.man Summary of files installed (the names refer to the Makefile variables): <descrip> -<tag><tt>ir-tk</tt></tag> The <sf/IrTcl/ shell for Tk. +<tag><tt>irtcl.so</tt></tag> The <sf/IrTcl/ shared dynamic library. +The actual name of this library vary. Installed in <tt>IRTCLDIR</tt>. +This file is only generated when using newer versions of Tcl. + +<tag><tt>ir-tk</tt></tag> The <sf/IrTcl/ shell for Tk. This shell + is not needed when using a Tk that support for shared libraries is present. Installed in <tt>BINDIR</tt> -- defaults to <tt>/usr/local/bin</tt>. <tt>ir-tk</tt> works like <tt>wish</tt> &mdash without arguments it reads commands from stdin. A source file may be specified by option <tt>-f</tt>. <tt>ir-tk</tt> accept the same set of options as <tt>wish</tt>. -<tag><tt>ir-tcl</tt></tag> The <sf/IrTcl/ shell for Tcl. Installed in - <tt>BINDIR</tt> -- defaults to <tt>/usr/local/bin</tt>. + +<tag><tt>ir-tcl</tt></tag> The <sf/IrTcl/ shell for Tcl. This program + is not needed when using a Tcl that supports shared libraries. Installed + in <tt>BINDIR</tt> -- defaults to <tt>/usr/local/bin</tt>. + <tag><tt>client.tcl</tt></tag> A graphical client for <tt>ir-tk</tt>. The client is installed as an executable script called <tt>irclient</tt> in <tt>BINDIR</tt>. This client needs a number of files, bitmaps, etc. The client looks for the files in the current directory &mdash if this fails it tries to look in the directory <tt>IRTCLDIR</tt> -- defaults to <tt>/usr/local/lib/irtcl</tt>. + <tag><tt>libirtcl.a</tt></tag> The <sf/IrTcl/ library. Installed in <tt>LIBDIR</tt> -- defaults to <tt>/usr/local/lib</tt>. + <tag><tt>ir-tcl.h</tt></tag> The <sf/IrTcl/ header file. Installed in <tt>INCDIR</tt> -- defaults to <tt>/usr/local/include</tt>. + <tag><tt>clientrc.tcl</tt></tag> A setup file with definitions of target and queries. Read and updated by <tt>client.tcl</tt>. Installed in <tt>IRTCLDIR</tt> -- defaults to <tt>/usr/local/lib/irtcl</tt>. + <tag><tt>formats/*</tt></tag> Display format files written in Tk. Read by <tt>client.tcl</tt>. Installed in <tt>IRTCLDIR</tt> -- defaults to <tt>/usr/local/lib/irtcl</tt>. + <tag><tt>bitmaps/*</tt></tag> Various bitmap files. Read by <tt>client.tcl</tt>. Installed in <tt>IRTCLDIR</tt> -- defaults to <tt>/usr/local/lib/irtcl</tt>. + <tag><tt>LICENSE</tt></tag> LICENSE file. Read by <tt>client.tcl</tt>. Installed in <tt>IRTCLDIR</tt> -- defaults to <tt>/usr/local/lib/irtcl</tt>. </descrip> -<sect1>ir-tcl +<sect1>Using Tcl <p> -The <tt>ir-tcl</tt> program is a shell like <tt>tclsh</tt> except that -<tt>ir-tcl</tt> features the new set of information retrieval commands. -Normally <tt>ir-tcl</tt> waits on <tt/stdin/ (for you to type commands) and -on sockets events (connected to Z39.50/SR targets). -You simply type the Tcl commands line by line. A filename may be specified as -argument to <tt>ir-tcl</tt> in which case the file specified is evaluated -as a script. +Basic Tcl is handled by the program <tt/tclsh/. The script +must use the <tt/load/ command to load the <sf/IrTcl/ dynamic +library. If dynamic libraries are unsupported the <tt/ir-tcl/ program +should be used instead, since that program is statically linked +with the <sf/IrTcl/ library. -<sect1>ir-tk +So the static, non-dynamic, version goes like this: +<tscreen><verb> + $ ir-tcl + % +</verb></tscreen> +and the dynamic version goes like: +<tscreen><verb> + $ tclsh + % load ./irtcl.tcl + % +</verb></tscreen> + +<sect1>Using Tk <p> -<tt>ir-tk</tt> is a program that works like <tt>wish</tt> except that -<tt>ir-tk</tt> include the new set of commands. All options accepted -by <tt>wish</tt> are also accepted by <tt>ir-tk</tt>. +If your Tcl/Tk supports dynamic libraries you can use the +<tt/load/ command as described in the previous section. If not, +you must use the <tt>ir-tk</tt> shell that acts as <tt>wish</tt> +except that it includes the <sf/IrTcl/ commands. -The enclosed script <tt>client.tcl</tt> for <tt>ir-tk</tt> is a graphical -client which demonstates an example of a user interface for the Z39.50/SR -protocols. +The enclosed script <tt>client.tcl</tt> is a graphical client +which demonstates an example of a user interface for the Z39.50/SR protocols. At first the script was relatively small but it has grown since the beginning. At present it is about 3000 lines. -The client can be started directly from the top level directory -of <sf/IrTcl/ by typing: +To start the client using a dynamic library use: <tscreen><verb> -$ ir-tk -f client.tcl +$ wish -f client.tcl </verb></tscreen> -Or, if you have installed <sf/IrTcl/ you may also type: +Note: some installations a slightly different name for wish, eg. +<tt/wish8.0/. + +To start the client without dynamic library support use: <tscreen><verb> -$ irclient +$ ir-tk -f client.tcl </verb></tscreen> The client lets up define targets and query types within the interface. @@ -1066,12 +1090,131 @@ a SUTRS record use the <tt>getSutrs</tt> followed by an index. <sect1>GRS-1 <p> -To be written. +A GRS-1 record in <sf/IrTcl/ is represented as a list of elements. +Each element specifies a tag as well as data. The data may +be a subtree, which is represented as a list, and so on. + +The method <tt/getGrs/ is followed by a record index and +optional specifiers that selects a specific sub-tree. Each element +consists of 5 elements: + +<descrip> +<tag>tag-set</tag> Tag set number. + +<tag>value-type</tag> Type of tag value. May be either +<tt/numeric/ of <tt/string/. + +<tag>value</tag> The value it self. + +<tag>data-type</tag> May be either <tt/octets/, <tt/numeric/, +<tt/ext/, <tt/string/, <tt/bool/, <tt/intUnit/, <tt/empty/, +<tt/notRequested/, <tt/diagnostic/ or <tt/subtree/. + +<tag>data</tag>The data associated with element of given type as + indicated before. If data-type is <tt/numeric/ or <tt/string/ + then data is encoded as a single Tcl token. The data-type <tt/bool/ + is encoded as 0 or 1 for false and true respectively. If the + data-type is <tt/subtree/ the data is a sub-list. + In all other cases, the data is the empty string. +</descrip> + +<bf/Example/ + +Consider the GRS-1 record below as shown by the Yaz client program: + +<tscreen><verb> +(1,1) OID: GILS-schema +(1,14) 2 +(2,1) UTAH EARTHQUAKE EPICENTERS + class=4,type=1,value=us +(4,52) UTAH GEOLOGICAL AND MINERAL SURVEY +(3,Local-Subject-Index) APPALACHIAN VALLEY; EARTHQUAKE; EPICENTER +(2,6) + (1,19) Five files of epicenter data arranged by ... + (3,Format) DIGITAL DATA SETS + (3,Data-Category) TERRESTRIAL + (3,Comments) Data are supplied by the University of Utah ... +(4,70) + (4,90) + (2,10) UTAH GEOLOGICAL AND MINERAL SURVEY + (4,2) 606 BLACK HAWK WAY + (4,3) SALT LAKE CITY + (3,State) UT + (3,Zip-Code) 84108 + (2,16) USA + (2,14) (801) 581-6831 + (4,7) UTAH EARTHQUAKE EPICENTERS +(4,1) ESDD0006 +(1,16) 198903 +</verb></tscreen> + +The record may be fetched from the result set, <tt/z.1/, at position 1 +by using: +<tscreen><verb> +z.1 getGrs 1 +</verb></tscreen> +which will return: +<tscreen><verb> +{ 1 numeric 1 oid 1.2.840.10003.13.2 } +{ 1 numeric 14 string 2 } +{ 2 numeric 1 string + { UTAH EARTHQUAKE EPICENTERS} } +{ 4 numeric 52 string {UTAH GEOLOGICAL AND MINERAL SURVEY} } +{ 3 string Local-Subject-Index string + {APPALACHIAN VALLEY; EARTHQUAKE; EPICENTER} } +{ 2 numeric 6 subtree + { { 1 numeric 19 string + {Five files of epicenter data arranged by ...} } + { 3 string Format string {DIGITAL DATA SETS} } + { 3 string Data-Category string TERRESTRIAL } + { 3 string Comments string + {Data are supplied by the University of Utah ...} } } } +{ 4 numeric 70 subtree + { { 4 numeric 90 subtree + { { 2 numeric 10 string + {UTAH GEOLOGICAL AND MINERAL SURVEY} } + { 4 numeric 2 string {606 BLACK HAWK WAY} } + { 4 numeric 3 string {SALT LAKE CITY} } + { 3 string State string UT } + { 3 string Zip-Code string 84108 } + { 2 numeric 16 string USA } + { 2 numeric 14 string {(801) 581-6831} } } } + { 4 numeric 7 string {UTAH EARTHQUAKE EPICENTERS} } } } +{ 4 numeric 1 string ESDD0006 } +{ 1 numeric 16 string 198903 } +</verb></tscreen> + +We can choose only to get the path (2,6) by using: + +<tscreen><verb> +z.1 getGrs 1 (2,6) +</verb></tscreen> +and we'll get: +<tscreen><verb> +{ 2 numeric 6 subtree { { 1 numeric 19 string + {Five files of epicenter data arranged by ...} } + { 3 string Format string {DIGITAL DATA SETS} } + { 3 string Data-Category string TERRESTRIAL } + { 3 string Comments + string {Data are supplied by the University of Utah ...} } } } +</verb></tscreen> + +To get the well known (1,19) within the subject (2,6) we use +<tscreen><verb> +z.1 getGrs 1 (2,6) (1,19) +</verb></tscreen> +and get: +<tscreen><verb> +{ 2 numeric 6 subtree + { { 1 numeric 19 string + {Five files of epicenter data arranged by ...} } } } +</verb></tscreen> +<bf/End of example/ <sect1>Explain <p> Explain records are retrieved like other records. The method, -<tt>getExplain</tt> is followed by an index and, and an optional +<tt>getExplain</tt> is followed by an index and and an optional Explain record pattern. The returned record is a canonical representation of the Explain record. @@ -1248,7 +1391,7 @@ been created. <sect>License <p> -Copyright © 1995-1996, Index Data. +Copyright © 1995-1998, Index Data. Permission to use, copy, modify, distribute, and sell this software and its documentation, in whole or in part, for any purpose, is hereby granted, @@ -1289,18 +1432,17 @@ development of quality software for open network communication. We'll be happy to answer questions about the software, and about ourselves in general. -<tscreen> -Index Data&nl -Ryesgade 3&nl -2200 København N&nl -DENMARK -</tscreen> - +<tscreen><verb> +Index Data +Ryesgade 3 +2200 Copenhagen N +Denmark +</verb></tscreen> <p> <tscreen><verb> Phone: +45 3536 3672 Fax : +45 3536 0449 -Email: info@index.ping.dk +Email: info@indexdata.dk </verb></tscreen> <sect>References @@ -1311,16 +1453,14 @@ Email: info@index.ping.dk <tag>1 Ousterhout, John K.:</tag> Tcl and the Tk Toolkit. Addison-Wesley Company Inc (ISBN 0-201-63337-X). The Tcl/Tk toolkit home page is -<tt><htmlurl url="http://www.sunlabs.com/research/tcl/" - name="http://www.sunlabs.com/research/tcl"></tt>. +<tt><htmlurl url="http://www.sunscript.com" + name="http://www.sunscript.com"></tt>. The primary ftp site is <tt><htmlurl url="ftp://ftp.smli.com/pub/tcl/" name="ftp://ftp.smli.com/pub/tcl/"></tt>. -A mirror site can be found at <tt> -<htmlurl url="ftp://ftp.neosoft.com/pub/tcl/mirror/ftp.smli.com" -name="ftp://ftp.neosoft.com/pub/tcl/mirror/ftp.smli.com"></tt>. -<tag>2 Furniss, Peter:</tag> -RFC 1698: Octet Sequences for Upper-Layer OSI to Support -Basic Communications Applications. +<tag>2 Welch, Brent B.:</tag> +Practical Programming in Tcl and Tk. Prentice Hall +(ISBN 0-13-616830-2). + </descrip> </article> -- 1.7.10.4