pkgIndex.tcl 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # -*- tcl -*-
  2. # Tcl package index file, version 1.1
  3. #
  4. if {![package vsatisfies [package provide Tcl] 8.4]} {
  5. # Pre-8.4 Tcl interps we dont support at all. Bye!
  6. # 9.0+ Tcl interps are only supported on 32-bit platforms.
  7. if {![package vsatisfies [package provide Tcl] 9.0]
  8. || ($::tcl_platform(pointerSize) != 4)} {
  9. return
  10. }
  11. }
  12. # All Tcl 8.4+ interps can [load] Thread 2.8.7
  13. #
  14. # For interps that are not thread-enabled, we still call [package ifneeded].
  15. # This is contrary to the usual convention, but is a good idea because we
  16. # cannot imagine any other version of Thread that might succeed in a
  17. # thread-disabled interp. There's nothing to gain by yielding to other
  18. # competing callers of [package ifneeded Thread]. On the other hand,
  19. # deferring the error has the advantage that a script calling
  20. # [package require Thread] in a thread-disabled interp gets an error message
  21. # about a thread-disabled interp, instead of the message
  22. # "can't find package Thread".
  23. package ifneeded Thread 2.8.7 [list load [file join $dir libthread2.8.7.so] [string totitle thread]]
  24. # package Ttrace uses some support machinery.
  25. # In Tcl 8.4 interps we use some older interfaces
  26. if {![package vsatisfies [package provide Tcl] 8.5]} {
  27. package ifneeded Ttrace 2.8.7 "
  28. [list proc thread_source {dir} {
  29. if {[info exists ::env(TCL_THREAD_LIBRARY)] &&
  30. [file readable $::env(TCL_THREAD_LIBRARY)/ttrace.tcl]} {
  31. source $::env(TCL_THREAD_LIBRARY)/ttrace.tcl
  32. } elseif {[file readable [file join $dir .. lib ttrace.tcl]]} {
  33. source [file join $dir .. lib ttrace.tcl]
  34. } elseif {[file readable [file join $dir ttrace.tcl]]} {
  35. source [file join $dir ttrace.tcl]
  36. }
  37. if {[namespace which ::ttrace::update] ne ""} {
  38. ::ttrace::update
  39. }
  40. }]
  41. [list thread_source $dir]
  42. [list rename thread_source {}]"
  43. return
  44. }
  45. # In Tcl 8.5+ interps; use [::apply]
  46. package ifneeded Ttrace 2.8.7 [list ::apply {{dir} {
  47. if {[info exists ::env(TCL_THREAD_LIBRARY)] &&
  48. [file readable $::env(TCL_THREAD_LIBRARY)/ttrace.tcl]} {
  49. source $::env(TCL_THREAD_LIBRARY)/ttrace.tcl
  50. } elseif {[file readable [file join $dir .. lib ttrace.tcl]]} {
  51. source [file join $dir .. lib ttrace.tcl]
  52. } elseif {[file readable [file join $dir ttrace.tcl]]} {
  53. source [file join $dir ttrace.tcl]
  54. }
  55. if {[namespace which ::ttrace::update] ne ""} {
  56. ::ttrace::update
  57. }
  58. }} $dir]