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