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.

Alternatively, Sybtcl supports building a shared library that can be
loaded using Tcl's 'package require' or 'load' commands.

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 distribution in a sibling directory to tcl7.5, tk4.1,
and tclX7.5.1 (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 man, bin, and lib
  --exec-prefix=<path> where to install bin and lib, if different than --prefix


  package options:     tk tclx enable-shared

  --without-tk         use "--without-tk" if you don't have Tk installed,
                       default is "--with-tk"
  --without-tclx       use "--without-tclx" if you don't have TclX installed,
                       default is "--with-tclx"
 
  --enable-shared      enable building shared library, if your cpu/os allows
                       shared libraries.  The default is to build static
                       libraries and executables.
                       if you use "--enable-shared", configure sets
                       "--without-tk" and "--without-tclx", since the shared
                       library can be loaded into tclsh, tcl, wish, and/or
                       wishx as needed.

                       NOTE: --enable-shared can only be specified if your
                       Sybase distribution includes a shared library object,
                       e.g $SYBASE/lib/libsybdb.so (or appropriate
                       shared library extension).


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

  --with-sybase-directory=<path> where to find the Sybase home directory,
				 include/sybdb.h  lib/libsybdb.a  


The configure script tries to find Tcl, Tk, and TclX installations
in the same locations as specified with --prefix and --exec-prefix.
 
If configure cannot find the paths to Tcl, Tk, TclX, or Sybase, configure
will halt with a message.  

Manual editing of the Makefile may be necessary if configure reports a warning.

After configure runs, examine 'Makefile', or just 'make' and see what happens.

If you specified '--enable-shared' while running configure, a shared 
library will be built.  Otherwise, a static library will be built and
executables created.  If a static library is built, the Makefile gathers
up the Sybase library and bundles the objects into libSybtcl.a along
with sybtcl.o.

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 tests" will run a small script to make sure the resulting
interpreter can access the database.

"make install" will copy the resulting executables, library and man page into 
the specified directories.  If you specified '--enable-shared', a 
pkgIndex.tcl file is built or modified in the tcl library directory.

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 Tcl-my-fancy, a small package I wrote to aid this task.  See
ftp://ftp.neosoft.com/pub/tcl/NEW/tcl-my-fancy-2.0.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.

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.net
