Differences From Artifact [05bce6a79b]:
- File
kitdll/buildsrc/kitdll-0.0/boot.tcl
— part of check-in
[8fde0c7fbf]
at
2010-09-30 05:35:48
on branch trunk
— Fixed test driver to call initialization routine -- changed to tclsh.
Updated to support determing encoding from environment
Removed debugging printfs/puts (user: rkeene, size: 2242) [annotate] [blame] [check-ins using]
To Artifact [31a964e643]:
- File
kitdll/buildsrc/kitdll-0.0/boot.tcl
— part of check-in
[e98c176999]
at
2010-10-01 20:20:09
on branch trunk
— Updated to mount vfs::zip VFS from DLL into /.KITDLL_USER
Updated to mount vfs::zip VFS from application into /.KITDLL_APP
Minor cleanup and added comments (user: rkeene, size: 3116) [annotate] [blame] [check-ins using]
1 2 3 4 |
proc tclInit {} {
rename tclInit {}
global auto_path tcl_library tcl_libPath
| | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
proc tclInit {} {
rename tclInit {}
global auto_path tcl_library tcl_libPath
global tcl_version
# Set path where to mount VFS
set tcl_mountpoint "/.KITDLL_TCL"
set tcl_library [file join $tcl_mountpoint lib tcl$tcl_version]
set tcl_libPath [list $tcl_library [file join $tcl_mountpoint lib]]
# get rid of a build residue
unset -nocomplain ::tclDefaultLibrary
# the following code only gets executed once on startup
if {[info exists ::initVFS]} {
set vfsHandler [list ::vfs::kitdll::vfshandler tcl]
# alter path to find encodings
if {[info tclversion] eq "8.4"} {
load {} pwb
librarypath [info library]
} else {
|
| ︙ | ︙ | |||
46 47 48 49 50 51 52 | } } # now remount the executable with the correct encoding vfs::filesystem unmount [lindex [::vfs::filesystem info] 0] # Resolve symlinks | | | | | | | > | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
}
}
# now remount the executable with the correct encoding
vfs::filesystem unmount [lindex [::vfs::filesystem info] 0]
# Resolve symlinks
set tcl_mountpoint [file dirname [file normalize [file join $tcl_mountpoint __dummy__]]]
set tcl_library [file join $tcl_mountpoint lib tcl$tcl_version]
set tcl_libPath [list $tcl_library [file join $tcl_mountpoint lib]]
vfs::filesystem mount $tcl_mountpoint $vfsHandler
}
# load config settings file if present
namespace eval ::vfs { variable tclkit_version 1 }
catch { uplevel #0 [list source [file join $tcl_mountpoint config.tcl]] }
uplevel #0 [list source [file join $tcl_library init.tcl]]
# reset auto_path, so that init.tcl's search outside of tclkit is cancelled
set auto_path $tcl_libPath
# This loads everything needed for "clock scan" to work
# "clock scan" is used within "vfs::zip", which may be
# loaded before this is run causing the root VFS to break
catch { clock scan }
# Load these, the original Tclkit does so it should be safe.
uplevel #0 [list source [file join $tcl_mountpoint lib vfs vfsUtils.tcl]]
# Now that the initialization is complete, mount the user VFS if needed
## Mount the VFS from the Shared Object
if {[info exists ::initVFS] && [info exists ::tclKitFilename]} {
catch {
package require vfs::zip
vfs::zip::Mount $::tclKitFilename "/.KITDLL_USER"
lappend auto_path [file normalize "/.KITDLL_USER/lib"]
}
}
## Mount the VFS from executable
if {[info exists ::initVFS]} {
catch {
package require vfs::zip
vfs::zip::Mount [info nameofexecutable] "/.KITDLL_APP"
lappend auto_path [file normalize "/.KITDLL_APP/lib"]
}
}
# Clean up after the kitInit.c:preInitCmd
unset -nocomplain ::initVFS ::tclKitFilename
}
|