jpayne@69: # -*- tcl -*- jpayne@69: # Tcl package index file, version 1.1 jpayne@69: # jpayne@69: jpayne@69: if {![package vsatisfies [package provide Tcl] 8.4]} { jpayne@69: # Pre-8.4 Tcl interps we dont support at all. Bye! jpayne@69: # 9.0+ Tcl interps are only supported on 32-bit platforms. jpayne@69: if {![package vsatisfies [package provide Tcl] 9.0] jpayne@69: || ($::tcl_platform(pointerSize) != 4)} { jpayne@69: return jpayne@69: } jpayne@69: } jpayne@69: jpayne@69: # All Tcl 8.4+ interps can [load] Thread 2.8.8 jpayne@69: # jpayne@69: # For interps that are not thread-enabled, we still call [package ifneeded]. jpayne@69: # This is contrary to the usual convention, but is a good idea because we jpayne@69: # cannot imagine any other version of Thread that might succeed in a jpayne@69: # thread-disabled interp. There's nothing to gain by yielding to other jpayne@69: # competing callers of [package ifneeded Thread]. On the other hand, jpayne@69: # deferring the error has the advantage that a script calling jpayne@69: # [package require Thread] in a thread-disabled interp gets an error message jpayne@69: # about a thread-disabled interp, instead of the message jpayne@69: # "can't find package Thread". jpayne@69: jpayne@69: package ifneeded Thread 2.8.8 [list load [file join $dir libthread2.8.8.so] [string totitle thread]] jpayne@69: jpayne@69: # package Ttrace uses some support machinery. jpayne@69: jpayne@69: # In Tcl 8.4 interps we use some older interfaces jpayne@69: if {![package vsatisfies [package provide Tcl] 8.5]} { jpayne@69: package ifneeded Ttrace 2.8.8 " jpayne@69: [list proc thread_source {dir} { jpayne@69: if {[info exists ::env(TCL_THREAD_LIBRARY)] && jpayne@69: [file readable $::env(TCL_THREAD_LIBRARY)/ttrace.tcl]} { jpayne@69: source $::env(TCL_THREAD_LIBRARY)/ttrace.tcl jpayne@69: } elseif {[file readable [file join $dir .. lib ttrace.tcl]]} { jpayne@69: source [file join $dir .. lib ttrace.tcl] jpayne@69: } elseif {[file readable [file join $dir ttrace.tcl]]} { jpayne@69: source [file join $dir ttrace.tcl] jpayne@69: } jpayne@69: if {[namespace which ::ttrace::update] ne ""} { jpayne@69: ::ttrace::update jpayne@69: } jpayne@69: }] jpayne@69: [list thread_source $dir] jpayne@69: [list rename thread_source {}]" jpayne@69: return jpayne@69: } jpayne@69: jpayne@69: # In Tcl 8.5+ interps; use [::apply] jpayne@69: jpayne@69: package ifneeded Ttrace 2.8.8 [list ::apply {{dir} { jpayne@69: if {[info exists ::env(TCL_THREAD_LIBRARY)] && jpayne@69: [file readable $::env(TCL_THREAD_LIBRARY)/ttrace.tcl]} { jpayne@69: source $::env(TCL_THREAD_LIBRARY)/ttrace.tcl jpayne@69: } elseif {[file readable [file join $dir .. lib ttrace.tcl]]} { jpayne@69: source [file join $dir .. lib ttrace.tcl] jpayne@69: } elseif {[file readable [file join $dir ttrace.tcl]]} { jpayne@69: source [file join $dir ttrace.tcl] jpayne@69: } jpayne@69: if {[namespace which ::ttrace::update] ne ""} { jpayne@69: ::ttrace::update jpayne@69: } jpayne@69: }} $dir] jpayne@69: jpayne@69: jpayne@69: