Sybtcl

INSTALLATION

Sybtcl can be added to standard Tcl's tclsh and wish, or to Extended Tcl's
tcl and wishx.  I recommend using Extended Tcl, as the sample programs
require Extended Tcl.

First, I would recommend that you start from a working Tcl/TclX/Tk base.
Compile all the code, run the 'test' targets, try out the tcl and wishx
interpreters.  Install tcl and wish into public directories (e.g.
/usr/local/bin) and the Tcl, TclX, and Tk library code (e.g., /usr/local/lib)
Also try out the widget demos from the Tk package.  Everything works? Good,
now you can start on Sybtcl.

Un-tar the sybtcl-2.2 distribution in a sibling directory to tcl7.3, tk3.6,
and tclX7.3b (or the most current versions of each distribution.)

Sybtcl uses GNU Autoconf to build a Makefile.  Run "./configure" in the
sybtcl directory.  Configure recognizes the following options:

  --prefix=<path>      where to install in bin/ and man/ (default=/usr/local)
  --exec-prefix=<path> where to install in bin/  (default=/usr/local/bin)

  CC=gcc ./configure   to set a specific compiler 
		       (csh users: setenv CC gcc; configure)

  package options:     tclx (aka Extended Tcl)

  --without-tclx       if you don't have TclX installed, 
		       default is "--with-tclx"

  the following maybe specified, but configure tries to find the
  paths on its own if not specified:

  --with-tcl-directory=<path>    where to find Tcl toplevel source files
  --with-tcl-library=<path>      where to find Tcl library (libtcl.a)
  --with-tk-directory=<path>     where to find Tk toplevel source files
  --with-tk-library=<path>       where to find Tk library (libtk.a)

  --with-tclx-directory=<path>   where to find TclX toplevel source directory 
  --with-tclx-library=<path>     where to find TclX libs (libtclx.a libtkx.a)
   
  --with-sybase-directory=<path> where to find the Sybase home directory,
				 include/sybdb.h  lib/libsybdb.a  

If configure cannot find the paths to Tcl, Tk, TclX, or Sybase, configure
will halt with a message.  Re-run configure using one or more of the
directory path flags.  Also, try running configure with "--verbose" to examine
the order of checking for directories.

Configure will also build the file "tclflags.mk", a make include file that
contains compile-time flags from Tcl and Tk makefiles.

After configure runs, examine 'Makefile' and 'tclflags.mk'.

The default executables are `tcl' and `wishx', or `tclsh' and `wish' if
--without-tclx is specified.  If different executable names are desired,
you should edit the Makefile.

"make" will copy the AppInit files from Tcl or TclX and add a call to Sybtcl's
initialization function via a sed(1) script.  The sybtcl.c and AppInit c
files will them be compiled, and executables produced.

"make tests" will run a small script to make sure the resulting
interpreter can access the database.

"make install" will copy the resulting executables and man page into the
specified directories.

"make get-tcl-flags" will rebuild the tclflags.mk file without running 
configure again.

Optionally, you can "make install-wisqlite" to copy the wisqlite program to
a directory, and change the #! interpreter line to reflect the Makefile
values.  Wisql requires TclX features.

To install the full-blown UCO Wisql, see the source tree ./samples/uco

"make clean" will delete the .o files, executables, formatted man page.

You can add Sybtcl to other Tcl/Tk interpreters.  Add a call to
"Sybtcl_Init(interp)" to your tclAppInit.c or tkAppInit.c module, and link
with libSybtcl.a.  If you are linking several extensions you may consider
using Make-a-Wish, a small package I wrote to aid this task.  See
ftp://ftp.aud.alcatel.com/tcl/code/make-a-wish-1.2.tar.gz

Try out the sample Sybtcl scripts.  It's also fun to start the tcl
interpreter, and just type in code on the fly.  Try benign SQL commands
at first, say:
	$ tcl
	tcl> sybconnect userid passwd   ** use a valid userid and passwd **
	tcl> sybsql sybtcl0 sp_who
	tcl> sybnext sybtcl0
	tcl> sybnext sybtcl0
	tcl> sybcols sybtcl0
	tcl> parray sybmsg

Sybtcl seems to fit in to the rest of Tcl/Extended Tcl/Tk without
name conflicts;  it does add about 150kb worth of Sybase DB-Library to
the tcl and wishx binaries on my machine.

The man page was written using -man macros.  Use your favorite nroff/troff
formatter, e.g. 
	nroff -man sybtcl.man > sybtcl.nr
	troff -Talw -man sybtcl.man | alw > sybtcl.ps
	psroff -Tdtps -t -man sybtcl.man > sybtcl.ps
	whatever


Tom Poindexter
tpoindex@nyx.cs.du.edu
