jsong@nlc.com (James Song) said:
James> It seems to me that tkined is using the path defined at the
James> compiling time to find where the library files are. The
James> problem I can think of is that when you need to change the
James> library directory, you will have to recompile the tkined. In
James> Tcl/Tk, the environment variables are used to specify where
James> the libraries are so that when you make a location change,
James> there is no need to recompile the program. I wonder why this
James> approach is not used in tkined. Or I just don't understand
James> how to use the environment varialbes in tkined. I have tried
James> TKINED_PATH, TKINEDLIB, tkined_lib, etc. None of them worked
James> for me. I would appreciate any help.
Tkined should honour the environment variable TKINED_PATH. For
example, if you move the library directory from /usr/local/lib/tkined
to /some/place/tkined, you should set TKINED_PATH to something like
set newdir=/some/place/tkined
TKINED_PATH=.:$newdir/site:$newdir/apps:$newdir
export TKINED_PATH
This should bring up Tkined again. Unfortunately, there is a bug in
the ined.c module of scotty. Below is a patch relative to
scotty-1.2.5. scotty-1.99.5 needs a very similar patch (just replace
xstrdup() with ckstrdup() and free() with ckfree()).
Juergen
*** ined.c-broken Wed Dec 7 11:44:12 1994
--- ined.c Tue May 9 01:54:57 1995
***************
*** 373,378 ****
--- 373,379 ----
if (! initialized) {
+ char *path, *tmp;
initialized = 1;
/*
***************
*** 387,408 ****
inedFlush (interp);
/*
! * Adjust the auto_path to take care of $HOME/.tkined
! * and TKINED_PATH.
*/
! Tcl_Eval (interp,
! "set auto_path \"/usr/local/lib/tkined [info library]\"");
! Tcl_VarEval (interp, "set auto_path \"", TKINEDLIB, " $auto_path\"",
! (char *) NULL);
! Tcl_VarEval (interp, "set auto_path \"", TKINEDLIB,
! "/apps $auto_path\"", (char *) NULL);
! Tcl_VarEval (interp, "if [info exists env(HOME)] { ",
! "set auto_path \"$env(HOME)/.tkined $auto_path\"}",
! (char *) NULL);
! Tcl_VarEval (interp, "if [info exists env(TKINED_PATH)] {",
! "set auto_path \"$env(TKINED_PATH) $auto_path\"}",
! (char *) NULL);
}
if (argc < 2) {
--- 388,442 ----
inedFlush (interp);
/*
! * Adjust the auto_path to take care of the environment variable
! * TKINED_PATH, $HOME/.tkined and TKINEDLIB.
*/
! path = Tcl_GetVar (interp, "auto_path", TCL_GLOBAL_ONLY);
! if (path) {
! path = xstrdup (path);
! }
!
! Tcl_SetVar (interp, "auto_path", "", TCL_GLOBAL_ONLY);
!
! if ((p = getenv ("TKINED_PATH"))) {
! tmp = xstrdup (p);
! for (p = tmp; *p; p++) {
! if (*p == ':') {
! *p = ' ';
! }
! }
! Tcl_SetVar (interp, "auto_path", tmp, TCL_GLOBAL_ONLY);
! free (tmp);
! }
!
! if ((p = getenv("HOME"))) {
! tmp = ckalloc (strlen (p) + 20);
! sprintf (tmp, "%s/.tkined", p);
! Tcl_SetVar (interp, "auto_path", tmp,
! TCL_APPEND_VALUE | TCL_LIST_ELEMENT | TCL_GLOBAL_ONLY);
! free (tmp);
! }
!
! tmp = xmalloc (strlen (TKINEDLIB) + 20);
! sprintf (tmp, "%s/site", TKINEDLIB);
! Tcl_SetVar (interp, "auto_path", tmp,
! TCL_APPEND_VALUE| TCL_LIST_ELEMENT | TCL_GLOBAL_ONLY);
! sprintf (tmp, "%s/apps", TKINEDLIB);
! Tcl_SetVar (interp, "auto_path", tmp,
! TCL_APPEND_VALUE| TCL_LIST_ELEMENT | TCL_GLOBAL_ONLY);
! free (tmp);
!
! Tcl_SetVar (interp, "auto_path", TKINEDLIB,
! TCL_APPEND_VALUE | TCL_LIST_ELEMENT | TCL_GLOBAL_ONLY);
!
! if (path) {
! Tcl_SetVar (interp, "auto_path", " ",
! TCL_APPEND_VALUE | TCL_GLOBAL_ONLY);
! Tcl_SetVar (interp, "auto_path", path,
! TCL_APPEND_VALUE | TCL_GLOBAL_ONLY);
! free (path);
! }
}
if (argc < 2) {