-
Notifications
You must be signed in to change notification settings - Fork 2
/
pkgIndex.tcl.in
32 lines (31 loc) · 1.19 KB
/
pkgIndex.tcl.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#
# Tcl package index file - generated from pkgIndex.tcl.in
#
package ifneeded @PACKAGE_NAME@ @PACKAGE_VERSION@ \
[list apply [list {dir} {
package require platform
set package_ns ::@PACKAGE_NAME@
set initName [string totitle @PACKAGE_NAME@]
if {[package vsatisfies [package require Tcl] 9]} {
set fileName "@PKG_LIB_FILE9@"
} else {
set fileName "@PKG_LIB_FILE8@"
}
set platformId [platform::identify]
set searchPaths [list [file join $dir $platformId] \
{*}[lmap platformId [platform::patterns $platformId] {
file join $dir $platformId
}] \
$dir]
foreach path $searchPaths {
set lib [file join $path $fileName]
if {[file exists $lib]} {
uplevel #0 [list load $lib $initName]
# Load was successful
set ${package_ns}::dll_path $lib
set ${package_ns}::package_dir $dir
return
}
}
error "Could not locate $fileName in directories [join $searchPaths {, }]"
}] $dir]