From 47f570652208215b90091c0b2124eabc6858850f Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 21 Jun 1995 11:04:44 +0000 Subject: [PATCH] Uses GNU autoconf 2.3. Install procedure implemented. boook bitmaps moved to sub directory bitmaps. --- Makefile.in | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ client.tcl | 71 +++++++++++++++++++++++++++++++++++++-------------------- configure.in | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++ tclmain.c | 12 ++++++++-- 4 files changed, 192 insertions(+), 27 deletions(-) create mode 100644 Makefile.in create mode 100644 configure.in diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..b4651cc --- /dev/null +++ b/Makefile.in @@ -0,0 +1,72 @@ +# IR toolkit for tcl/tk +# (c) Index Data 1995 +# See the file LICENSE for details. +# Sebastian Hammer, Adam Dickmeiss +# $Id: Makefile.in,v 1.1 1995-06-21 11:04:44 adam Exp $ +SHELL=/bin/sh + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +BINDIR=$(exec_prefix)/bin +LIBDIR=$(exec_prefix)/lib +MANDIR=$(prefix)/man +IRTCLDIR=$(LIBDIR)/irtcl + +YAZDIR=@YAZDIR@ +MOSIDIR=@MOSIDIR@ +LIBS=@LIBS@ -lm +XLIB=@XLIB@ -lX11 +XINCLUDE=@XINCLUDE@ + +# Enable MOSI by setting MOSI=1 and set MOSILIB to +# $(YAZDIR)/lib/librfc.a $(MOSIDIR)/libmosi.a +MOSILIB=@MOSILIB@ +YAZLIB=$(YAZDIR)/lib/libyaz.a $(MOSILIB) $(YAZDIR)/lib/libutil.a + +INCLUDE=-I$(YAZDIR)/include $(XINCLUDE) -I$(MOSIDIR) -I/usr/local/include +DEFS=-DCCL2RPN=0 @DEFS@ -DMOSI=@MOSI@ -DIRTCLDIR=\"$(IRTCLDIR)\" $(INCLUDE) + +TCLLIB=-ltcl +TKLIB=-ltk + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +RANLIB = @RANLIB@ + +O=ir-tcl.o marc.o +P1=ir-tk +P2=ir-tcl + +all: $(P1) $(P2) + +$(P1): $(O) tkmain.o + $(CC) $(CFLAGS) $(DEFS) $(O) tkmain.o -o $(P1) $(YAZLIB) $(TKLIB) $(TCLLIB) $(XLIB) $(LIBS) + +$(P2): $(O) tclmain.o + $(CC) $(CFLAGS) $(DEFS) $(O) tclmain.o -o $(P2) $(YAZLIB) $(TCLLIB) $(LIBS) + +install-tcl: + -mkdir $(IRTCLDIR) + $(INSTALL_PROGRAM) ir-tcl $(BINDIR) + +install-tk: + -mkdir $(IRTCLDIR) + -mkdir $(IRTCLDIR)/formats + -mkdir $(IRTCLDIR)/bitmaps + sed "s,^set libdir LIBDIR,set libdir $(IRTCLDIR)," client.bak + $(INSTALL_PROGRAM) ir-tk $(BINDIR) + $(INSTALL_DATA) client.bak $(IRTCLDIR)/client.tcl + $(INSTALL_DATA) LICENSE clientrc.tcl $(IRTCLDIR) + $(INSTALL_DATA) formats/*.tcl $(IRTCLDIR)/formats + $(INSTALL_DATA) bitmaps/book? $(IRTCLDIR)/bitmaps + +clean: + rm -f *.[oa] $(P1) $(P2) core gmon.out mon.out *.bak + +.c.o: + $(CC) -c $(CFLAGS) $(DEFS) $< + +$(O) tkmain.o tclmain.o: ir-tcl.h ir-tclp.h + diff --git a/client.tcl b/client.tcl index 9da25e0..dab24f5 100644 --- a/client.tcl +++ b/client.tcl @@ -4,7 +4,12 @@ # Sebastian Hammer, Adam Dickmeiss # # $Log: client.tcl,v $ -# Revision 1.49 1995-06-20 14:16:42 adam +# Revision 1.50 1995-06-21 11:04:48 adam +# Uses GNU autoconf 2.3. +# Install procedure implemented. +# boook bitmaps moved to sub directory bitmaps. +# +# Revision 1.49 1995/06/20 14:16:42 adam # More work on cancel mechanism. # # Revision 1.48 1995/06/20 08:07:23 adam @@ -171,12 +176,15 @@ # First presentRequest attempts. Hot-target list. # # + +set libdir LIBDIR +if {[file readable clientrc.tcl]} { + set libdir . +} set hotTargets {} set hotInfo {} set busy 0 -set libDir "" - set profile(Default) {{} {} {210} {} 16384 8192 tcpip {} 1 {} {} Z39} set hostid Default set settingsChanged 0 @@ -201,11 +209,14 @@ set setMax 0 proc read-formats {} { global displayFormats - set formats [glob -nocomplain formats/*.tcl] + global libdir + set formats [glob -nocomplain ${libdir}/formats/*.tcl] foreach f $formats { - source $f - set l [expr [string length $f] - 5] - lappend displayFormats [string range $f 8 $l] + if {[file readable $f]} { + source $f + set l [expr [string length $f] - 5] + lappend displayFormats [string range $f 8 $l] + } } } @@ -289,12 +300,12 @@ proc toplevelG {w} { bind $w [list destroyGW $w] } -if {[file readable "clientrc.tcl"]} { - source "clientrc.tcl" +if {[file readable "${libdir}/clientrc.tcl"]} { + source "${libdir}/clientrc.tcl" } -if {[file readable "clientg.tcl"]} { - source "clientg.tcl" +if {[file readable "~/.clientrc.tcl"]} { + source "~/.clientrc.tcl" } set queryButtonsFind [lindex $queryButtons 0] @@ -376,17 +387,19 @@ proc show-target {target base} { proc show-logo {v1} { global busy + global libdir + if {$busy != 0} { incr v1 if {$v1==10} { set v1 1 } - .bot.logo configure -bitmap @book${v1} + .bot.logo configure -bitmap @${libdir}/bitmaps/book${v1} after 140 [list show-logo $v1] return } while {1} { - .bot.logo configure -bitmap @book1 + .bot.logo configure -bitmap @${libdir}/bitmaps/book1 tkwait variable busy if {$busy} { show-logo 1 @@ -458,6 +471,7 @@ proc insertWithTags {w text args} { } proc popup-license {} { + global libdir set w .popup-licence toplevel $w @@ -474,12 +488,14 @@ proc popup-license {} { pack $w.top.s -side right -fill y pack $w.top.t -expand yes -fill both - set f [open "LICENSE" r] - while {[gets $f buf] != -1} { - $w.top.t insert end $buf - $w.top.t insert end "\n" - } - close $f + if {[file readable "${libdir}/LICENSE"]} { + set f [open "${libdir}/LICENSE" r] + while {[gets $f buf] != -1} { + $w.top.t insert end $buf + $w.top.t insert end "\n" + } + close $f + } bottom-buttons $w [list {Close} [list destroy $w]] 1 } @@ -517,6 +533,7 @@ proc about-target {} { } proc about-origin-logo {n} { + global libdir set w .about-origin-w if {![winfo exists $w]} { return @@ -525,7 +542,7 @@ proc about-origin-logo {n} { if {$n==10} { set n 1 } - $w.top.a.logo configure -bitmap @book$n + $w.top.a.logo configure -bitmap @${libdir}/bitmaps/book$n after 140 [list about-origin-logo $n] } @@ -548,7 +565,7 @@ proc about-origin {} { label $w.top.a.irtcl -text "IrTcl" \ -font -Adobe-Helvetica-Bold-R-Normal-*-240-* - label $w.top.a.logo -bitmap @book1 + label $w.top.a.logo -bitmap @${libdir}/bitmaps/book1 pack $w.top.a.irtcl $w.top.a.logo -side left -expand yes set i [z39 implementationName] @@ -1872,7 +1889,7 @@ proc save-geometry {} { set windowGeometry(.) [wm geometry .] - set f [open "clientg.tcl" w] + set f [open "~/.clientrc.tcl" w] puts $f "set hotTargets \{ $hotTargets \}" puts $f "set textWrap $textWrap" @@ -1888,12 +1905,16 @@ proc save-geometry {} { proc save-settings {} { global profile + global libdir global settingsChanged global queryTypes global queryButtons global queryInfo - - set f [open "clientrc.tcl" w] + + if {![file writeable "${libdir}/clientrc.tcl"]} { + return + } + set f [open "${libdir}/clientrc.tcl" w] puts $f "# Setup file" foreach n [array names profile] { @@ -2805,7 +2826,7 @@ if {[tk colormodel .] == "color"} { } .data.record tag configure marc-data -foreground black -button .bot.logo -bitmap @book1 -command cancel-operation +button .bot.logo -bitmap @${libdir}/bitmaps/book1 -command cancel-operation frame .bot.a pack .bot.a -side left -fill x pack .bot.logo -side right -padx 2 -pady 2 diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..ea86d56 --- /dev/null +++ b/configure.in @@ -0,0 +1,64 @@ +dnl IR toolkit for tcl/tk +dnl (c) Index Data 1995 +dnl See the file LICENSE for details. +dnl $Id: configure.in,v 1.1 1995-06-21 11:04:53 adam Exp $ +AC_INIT(README) +AC_PROG_CC +AC_PROG_RANLIB +AC_PROG_INSTALL +AC_CHECK_LIB(nsl, ,[LIBS="$LIBS -lnsl"]) +AC_CHECK_LIB(socket, ,[LIBS="$LIBS -lsocket"]) +AC_CHECK_LIB(net, , [LIBS="$LIBS -lnet"]) +AC_STDC_HEADERS +AC_HAVE_HEADERS(sys/select.h) +AC_SUBST(YAZDIR) +AC_SUBST(MOSI) +AC_SUBST(MOSILIB) +AC_SUBST(MOSIDIR) +AC_MSG_CHECKING(for Yaz directory) +AC_ARG_WITH(yazdir,[ --with-yazdir Yaz directory], [YAZDIR=$withval]) +if test "$YAZDIR" = "yes"; then + YAZDIR="../yaz" +elif test "$YAZDIR" = ""; then + YAZDIR="../yaz" + if test -d "../yaz-1.0b"; then + YAZDIR="../yaz-1.0b" + fi +fi +AC_MSG_RESULT($YAZDIR) +if test ! -d $YAZDIR; then + AC_MSG_WARN(Yaz directory doesnt exist) +fi +AC_MSG_CHECKING(for MOSI) +AC_ARG_WITH(mosidir, [ --with-mosidir MOSI directory], [MOSIDIR=$withval]) +if test "$MOSIDIR" = "yes"; then + MOSIDIR="../xtimosi/src" +elif test "$MOSIDIR" = ""; then + MOSIDIR="../xtimosi/src" +fi +if test -r ${YAZDIR}/lib/librfc.a; then + MOSI=1 + MOSIDIR=$MOSIDIR + MOSILIB='$(MOSIDIR)/libmosi.a $(YAZDIR)/lib/librfc.a' + MOSITELL=yes +else + MOSI=0 + MOSIDIR=$MOSIDIR + MOSILIB='' + MOSITELL=no +fi +AC_MSG_RESULT($MOSITELL) +AC_SUBST(XINCLUDE) +AC_SUBST(XLIB) +AC_FIND_X +if test "x$x_includes" != x; then + XINCLUDE=-I$x_includes +else + XINCLUDE="" +fi +if test "x$x_libraries" != x; then + XLIB=-L$x_libraries +else + XLIB="" +fi +AC_OUTPUT(Makefile) diff --git a/tclmain.c b/tclmain.c index 33a3407..92f240d 100644 --- a/tclmain.c +++ b/tclmain.c @@ -5,7 +5,12 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: tclmain.c,v $ - * Revision 1.6 1995-05-29 08:44:28 adam + * Revision 1.7 1995-06-21 11:04:54 adam + * Uses GNU autoconf 2.3. + * Install procedure implemented. + * boook bitmaps moved to sub directory bitmaps. + * + * Revision 1.6 1995/05/29 08:44:28 adam * Work on delete of objects. * * Revision 1.5 1995/03/20 08:53:30 adam @@ -16,10 +21,13 @@ * */ +#include #include #include +#if HAVE_SYS_SELECT_H +#include +#endif #include -#include #include -- 1.7.10.4