Index: generic/vfs.c =================================================================== RCS file: /cvsroot/tclvfs/tclvfs/generic/vfs.c,v retrieving revision 1.52 diff -u -p -u -p -r1.52 vfs.c --- generic/vfs.c 10 May 2004 11:00:40 -0000 1.52 +++ generic/vfs.c 18 May 2004 14:02:07 -0000 @@ -22,6 +22,7 @@ #include /* Required to access the 'stat' structure fields, and TclInExit() */ #include "tclInt.h" +#include "tclPort.h" /* * Windows needs to know which symbols to export. Unix does not. Index: library/starkit.tcl =================================================================== RCS file: /cvsroot/tclvfs/tclvfs/library/starkit.tcl,v retrieving revision 1.8 diff -u -p -u -p -r1.8 starkit.tcl --- library/starkit.tcl 21 Oct 2003 09:25:18 -0000 1.8 +++ library/starkit.tcl 18 May 2004 14:02:07 -0000 @@ -61,16 +61,16 @@ namespace eval starkit { # 2003/02/11: new behavior, if starkit::topdir exists, don't disturb it if {![info exists starkit::topdir]} { variable topdir } - set script [file normalize [info script]] + set script [resolvelink [file normalize [info script]]] set topdir [file dirname $script] - if {$topdir eq [file normalize [info nameofexe]]} { return starpack } + if {$topdir eq [resolvelink [file normalize [info nameofexe]]]} { return starpack } # pkgs live in the $topdir/lib/ directory set lib [file join $topdir lib] if {[file isdir $lib]} { autoextend $lib } - set a0 [file normalize $argv0] + set a0 [resolvelink [file normalize $argv0]] if {$topdir eq $a0} { return starkit } if {$script eq $a0} { return unwrapped } @@ -151,4 +151,15 @@ namespace eval starkit { set f [file join $dir [platform] $name[info sharedlibext]] uplevel 1 [linsert $args 0 load $f] } + + proc resolvelink {f} { + catch { + if {[file exists $f]} { + while {[file type $f] eq "link"} { + set f [file readlink $f] + } + } + } + return $f + } }