summaryrefslogtreecommitdiffstats
path: root/library/platform
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2010-04-29 21:19:31 (GMT)
committerandreas_kupries <akupries@shaw.ca>2010-04-29 21:19:31 (GMT)
commit0e49426c4049bd6eead59a349cb52adfaa82e5d2 (patch)
treeee20404622942a52119a56aa0c7258a67b1de64a /library/platform
parentc5d929adcd1df608a55410c2dc8c01c5f1dcb967 (diff)
downloadtcl-0e49426c4049bd6eead59a349cb52adfaa82e5d2.zip
tcl-0e49426c4049bd6eead59a349cb52adfaa82e5d2.tar.gz
tcl-0e49426c4049bd6eead59a349cb52adfaa82e5d2.tar.bz2
* library/platform/platform.tcl: Another stab at getting the /lib,
* library/platform/pkgIndex.tcl: /lib674 difference right for * unix/Makefile.in: linux. Package updated to version 1.0.7. * win/Makefile.in:
Diffstat (limited to 'library/platform')
-rw-r--r--library/platform/pkgIndex.tcl2
-rw-r--r--library/platform/platform.tcl33
2 files changed, 26 insertions, 9 deletions
diff --git a/library/platform/pkgIndex.tcl b/library/platform/pkgIndex.tcl
index 5678e04..69ca721 100644
--- a/library/platform/pkgIndex.tcl
+++ b/library/platform/pkgIndex.tcl
@@ -1,3 +1,3 @@
-package ifneeded platform 1.0.6 [list source [file join $dir platform.tcl]]
+package ifneeded platform 1.0.7 [list source [file join $dir platform.tcl]]
package ifneeded platform::shell 1.1.4 [list source [file join $dir shell.tcl]]
diff --git a/library/platform/platform.tcl b/library/platform/platform.tcl
index d132c6f..838ceec 100644
--- a/library/platform/platform.tcl
+++ b/library/platform/platform.tcl
@@ -175,13 +175,30 @@ proc ::platform::identify {} {
set v unknown
- if {[file exists /lib64] &&
- [file isdirectory /lib64] &&
- [llength [glob -nocomplain -directory /lib64 libc*]]
- } {
- set base /lib64
- } else {
- set base /lib
+ # Determine in which directory to look. /lib, or /lib64.
+ # For that we use the tcl_platform(wordSize).
+ #
+ # We could use the 'cpu' info, per the equivalence below,
+ # that however would be restricted to intel. And this may
+ # be a arm, mips, etc. system. The wordsize is more
+ # fundamental.
+ #
+ # ix86 <=> (wordSize == 4) <=> 32 bit ==> /lib
+ # x86_64 <=> (wordSize == 8) <=> 64 bit ==> /lib64
+ #
+ # Do not look into /lib64 even if present, if the cpu
+ # doesn't fit.
+
+ switch -exact -- $tcl_platform(wordSize) {
+ 4 {
+ set base /lib
+ }
+ 8 {
+ set base /lib64
+ }
+ default {
+ return -code error "Bad wordSize $tcl_platform(wordSize), expected 4 or 8"
+ }
}
set libclist [lsort [glob -nocomplain -directory $base libc*]]
@@ -292,7 +309,7 @@ proc ::platform::patterns {id} {
# ### ### ### ######### ######### #########
## Ready
-package provide platform 1.0.6
+package provide platform 1.0.7
# ### ### ### ######### ######### #########
## Demo application