Next Previous Contents

2. Compilation and installation

2.1 UNIX

In order to compile the software on UNIX you need:

Unpack the IrTcl package at the same directory level as YAZ.

Type:

$ ./configure

This command tries to configure IrTcl for your system and creates a Makefile.

The configure script tries to locate the file tclConfig.sh which should be generated by Tcl's installation script. Configure looks for ther Tcl shell on your system in order to locate this file. For example if tclsh is located in /home/joe/bin, configure will assume that tclConfig.sh is installed in /home/joe/lib, in which case the prefix is /home/joe. If you have more than one Tcl version installed on your system, or if configure cannot find the tclConfig.sh, you can specify in which directory it is, by supplying option --with-tclconfig - for example:

$ ./configure --with-tclconfig=/home/joe/lib

The IrTcl executables are installed in prefix/bin and libraries and support files are installed in prefix/irtcl.

Compile IrTcl by typing:

$ make

For Tcl versions that support dynamic libraries the command above will create the shared library, irtcl.so, as well as the normal static library, libirtcl.a.

For Tcl versions that doesn't support dynamic libraries the make command will create two shells will build-in IrTcl support -- a Tcl shell called ir-tcl. The traditional static library, libirtcl.a, is build as well.

To install the programs and support files type:

$ make install

If you wish to install man pages type:

$ make install.man

Summary of files installed (the names refer to the Makefile variables):

irtcl.so

The IrTcl shared dynamic library. The actual name of this library vary. Installed in IRTCLDIR. This file is only generated when using newer versions of Tcl/Tk.

ir-tcl

The IrTcl shell for Tcl. This program is not needed when using a Tcl that supports shared libraries. Installed in BINDIR -- defaults to /usr/local/bin.

client.tcl

A graphical client for Tk. The client is installed as an executable script called irclient in BINDIR. This client needs a number of files, bitmaps, etc. The client looks for the files in the current directory — if this fails it tries to look in the directory IRTCLDIR -- defaults to /usr/local/lib/irtcl.

libirtcl.a

The IrTcl library. Installed in LIBDIR -- defaults to /usr/local/lib.

ir-tcl.h

The IrTcl header file. Installed in INCDIR -- defaults to /usr/local/include.

irtdb.tcl

A setup file with definitions of target and queries. Read and updated by client.tcl. Installed in IRTCLDIR -- defaults to /usr/local/lib/irtcl.

formats/*

Display format files written in Tk. Read by client.tcl. Installed in IRTCLDIR -- defaults to /usr/local/lib/irtcl.

bitmaps/*

Various bitmap files. Read by client.tcl. Installed in IRTCLDIR -- defaults to /usr/local/lib/irtcl.

LICENSE

LICENSE file. Read by client.tcl. Installed in IRTCLDIR -- defaults to /usr/local/lib/irtcl.

IrTcl can be used either from the Tcl interpreter tclsh or the statically linked program ir-tcl. Using tclsh is the preferred method. You must load the IrTcl library by using the load command.

A static, non-dynamic, version goes like this:

   $ ir-tcl
   % 
and the dynamic version (preferred) goes like:
   $ tclsh
   % load ./irtcl.tcl
   %

2.2 WIN32

IrTcl is shipped with a "makefile" for the NMAKE tool part of with Microsoft Visual C++.

Start an MS-DOS prompt and switch the sub directory WIN where the file makefile is located. Customize the installation by editing the makefile file (for example by using wordpad).

The following summarises the most important settings in that file.

YAZDIR

Specifies where YAZ is located.

DEBUG

If set to 1, the software is compiled with debugging libraries. If set to 0, the software is compiled with release (non-debugging) libraries.

When satisfied with the settings in the makefile type

nmake

If compilation was successful the executables irtcl.dll is put in directory BIN.

To start the test client that comes with IrTcl make sure both YAZ.DLL and IRTCL.DLL are in current directory or in your PATH. Go to the top-level directory of IrTcl and type "wish -f client.tcl". You might want to make a short-cut to start this.

2.3 Using Tk

If your Tcl/Tk supports dynamic libraries you can use the load command from within wish as described in the previous section.

The enclosed script client.tcl is a graphical client which demonstates an example of a user interface for the Z39.50 protocol. At first the script was relatively small but it has grown since the beginning. At present it is about 3000 lines.

To start the client with dynamic library support use:

$ wish -f client.tcl

Note: Substitute the real name for the wish interpreter above, for version 8.0 it is probably called wish8.0.

The client lets up define targets and query types within the interface. Hence, you will not need to modify configuration files.

Stuff regarding targets can be found in the pull down menu 'Target' with the following options:

Connect

Establishes connection to a target.

Disconnect

Closes a target connection.

About

Shows implementation Id, implementation Version, etc for the current target.

Setup

Pops up a target definition window. You may alter a target definition.

Setup new

Lets you define a new target.

The term query type refers to a collection of search fields. The pull down menu Options|Query deals with queries. You may insert/modify/remove query types.


Next Previous Contents