Re: Problem building scotty 2.1.0

Greg A. Woods (woods@most.weird.com)
Tue, 25 Jun 96 18:51:06 -0400 (EDT)

[ On Tue, June 25, 1996 at 17:50:37 (+0200), Juergen Schoenwaelder wrote: ]
> Subject: Re: Problem building scotty 2.1.0
>
> Just to make sure that you all understand the issue correctly. The
> TCLLIBPATH is needed so that Tcl can find and load the Tnm extension.

It really irks me when I have to set an environment variable to tell an
application where it has been installed. I told it once, and I don't
want to have to tell it again, esp. not every time I run the program.

However, the TCL manual page pkgMkIndex(3) says, with regard to how an
application should initialize:

[3] Make sure that the directory is in the auto_path global
variable. Auto_path contains a list of directories
that are searched by both the auto-loader and the pack-
age loader. If you want access to files described by a
pkgIndex.tcl file in a directory, that directory must
be present in auto_path. You can add the directory to
auto_path explicitly in your application, or you can
add the directory to your TCLLIBPATH environment vari-
able: if this environment variable is present, Tcl
initializes auto_path from it during application
startup.

Certainly setting auto_path in scotty.c and in the tkined script with
the configured installation pathnames works very well and eliminates the
need for the average user of the out-of-the-box scotty and tkined
packages to set TCLLIBPATH. I'm happy! ;-)

The only potential problem I see with my approach is where the
library(n) page says:

env(TCLLIBPATH)
If set, then it must contain a valid Tcl list giving
directories to search during auto-load operations.
This variable is only used if auto_path is not defined.

this does not appear to be exactly true. All the magic is in Tcl's
"init.tcl" script, and my understanding of Tcl so poor that I'm not sure
I can follow it with 100% comprehension, but it seems to me that what
happens is that auto_path is first initialized with the contents of
TCLLIBPATH (or "" if the varibale is not present), and then that's where
I get lost trying to follow the Tcl code (give me C or lisp! ;-)

In any case it seems that what I did in scotty.c and the tkined script
to initialize auto_path did the trick. I use only the basic package at
this point -- no additional modules, and I don't have to set TCLLIBPATH.

> be changed. You can also complain that there is no standard way to
> install dynamic loadable extensions. But again, you have to talk to
> the Sun people - this problem must be solved in the Tcl core.

I haven't looked at this problem yet, but indeed this may be one of
those issues that can only be solved by the Tcl folks.

-- 
							Greg A. Woods

+1 416 443-1734 VE3TCP robohack!woods Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>