|
a |
|
b/pkgdir.tcl |
|
|
1 |
|
|
|
2 |
# Try to find a nice place where to install.
|
|
|
3 |
|
|
|
4 |
# It seems (end 2008) that distributions tend to remove /usr/lib from
|
|
|
5 |
# auto_path, leaving only things like /usr/lib/tcl /usr/lib/tcl8.x
|
|
|
6 |
# /usr/share/tcl
|
|
|
7 |
|
|
|
8 |
# We look at the auto_path, and try to find the best place, ideally
|
|
|
9 |
# the equivalent of $prefix/lib[64]/tcl because like this we don't need a
|
|
|
10 |
# reinstall at each tcl version change, else .../tcl8.x, else
|
|
|
11 |
# whatever is at the beginning of the auto_path
|
|
|
12 |
|
|
|
13 |
set usrlibtcl {}
|
|
|
14 |
set usrlibtclxy {}
|
|
|
15 |
|
|
|
16 |
#test set auto_path {/usr/lib/tcl8.4 /usr/lib/tcl /usr/share/tcl}
|
|
|
17 |
|
|
|
18 |
foreach d $auto_path {
|
|
|
19 |
if {[regexp {lib.*/tcl$} $d]} {
|
|
|
20 |
set usrlibtcl $d
|
|
|
21 |
}
|
|
|
22 |
if {[regexp {lib.*/tcl8\.[0-9]+$} $d]} {
|
|
|
23 |
set usrlibtclxy $d
|
|
|
24 |
}
|
|
|
25 |
}
|
|
|
26 |
if {[string compare $usrlibtcl {}]} {
|
|
|
27 |
puts stdout $usrlibtcl
|
|
|
28 |
exit 0
|
|
|
29 |
}
|
|
|
30 |
if {[string compare $usrlibtclxy {}]} {
|
|
|
31 |
puts stdout $usrlibtclxy
|
|
|
32 |
exit 0
|
|
|
33 |
}
|
|
|
34 |
|
|
|
35 |
puts [lindex $auto_path 0]
|