summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandreask <andreask>2011-06-22 16:22:42 (GMT)
committerandreask <andreask>2011-06-22 16:22:42 (GMT)
commita3c70e61193225adc5c6ca5acfb3aea8eaba2ffa (patch)
tree755a8d586d8ee259d76885c24544ba633e6c5270
parent0a5f3d1474167d8574ec5ab7ff4bdbae18036a95 (diff)
parent83da5e73e763a2bf93d98676168b3e5a7a02d014 (diff)
downloadtcl-a3c70e61193225adc5c6ca5acfb3aea8eaba2ffa.zip
tcl-a3c70e61193225adc5c6ca5acfb3aea8eaba2ffa.tar.gz
tcl-a3c70e61193225adc5c6ca5acfb3aea8eaba2ffa.tar.bz2
Merged from core-8-4-branch: Updated to platform 1.0.10. Added handling of the DEB_HOST_MULTIARCH location change for libc.
-rw-r--r--ChangeLog5
-rw-r--r--library/platform/pkgIndex.tcl2
-rw-r--r--library/platform/platform.tcl87
-rw-r--r--unix/Makefile.in4
-rw-r--r--win/Makefile.in4
5 files changed, 71 insertions, 31 deletions
diff --git a/ChangeLog b/ChangeLog
index aff660f..8a1e3d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2011-06-22 Andreas Kupries <andreask@activestate.com>
+ * library/platform/pkgIndex.tcl: Updated to platform 1.0.10. Added
+ * library/platform/platform.tcl: handling of the DEB_HOST_MULTIARCH
+ * unix/Makefile.in: location change for libc.
+ * win/Makefile.in:
+
* generic/tclInt.h: Fixed the inadvertently committed disabling of
stack checks, see my 2010-11-15 commit.
diff --git a/library/platform/pkgIndex.tcl b/library/platform/pkgIndex.tcl
index 35da3b7..220a67b 100644
--- a/library/platform/pkgIndex.tcl
+++ b/library/platform/pkgIndex.tcl
@@ -1,3 +1,3 @@
-package ifneeded platform 1.0.9 [list source [file join $dir platform.tcl]]
+package ifneeded platform 1.0.10 [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 572a8b4..dd2e66b 100644
--- a/library/platform/platform.tcl
+++ b/library/platform/platform.tcl
@@ -194,42 +194,45 @@ proc ::platform::identify {} {
# Do not look into /lib64 even if present, if the cpu
# doesn't fit.
+ # TODO: Determine the prefixes (i386, x86_64, ...) for
+ # other cpus. The path after the generic one is utterly
+ # specific to intel right now. Ok, on Ubuntu, possibly
+ # other Debian systems we may apparently be able to query
+ # the necessary CPU code. If we can't we simply use the
+ # hardwired fallback.
+
switch -exact -- $tcl_platform(wordSize) {
4 {
- set base /lib
+ lappend bases /lib
+ if {[catch {
+ exec dpkg-architecture -qDEB_HOST_MULTIARCH
+ } res]} {
+ lappend bases /lib/i386-linux-gnu
+ } else {
+ # dpkg-arch returns the full tripled, not just cpu.
+ lappend bases /lib/$res
+ }
}
8 {
- set base /lib64
+ lappend bases /lib64
+ if {[catch {
+ exec dpkg-architecture -qDEB_HOST_MULTIARCH
+ } res]} {
+ lappend bases /lib/x86_64-linux-gnu
+ } else {
+ # dpkg-arch returns the full tripled, not just cpu.
+ lappend bases /lib/$res
+ }
}
default {
return -code error "Bad wordSize $tcl_platform(wordSize), expected 4 or 8"
}
}
- set libclist [lsort [glob -nocomplain -directory $base libc*]]
- if {[llength $libclist]} {
- set libc [lindex $libclist 0]
-
- # Try executing the library first. This should suceed
- # for a glibc library, and return the version
- # information.
-
- if {![catch {
- set vdata [lindex [split [exec $libc] \n] 0]
- }]} {
- regexp {([0-9]+(\.[0-9]+)*)} $vdata -> v
- foreach {major minor} [split $v .] break
- set v glibc${major}.${minor}
- } else {
- # We had trouble executing the library. We are now
- # inspecting its name to determine the version
- # number. This code by Larry McVoy.
-
- if {[regexp -- {libc-([0-9]+)\.([0-9]+)} $libc -> major minor]} {
- set v glibc${major}.${minor}
- }
- }
+ foreach base $bases {
+ if {[LibcVersion $base -> v]} break
}
+
append plat -$v
return "${plat}-${cpu}"
}
@@ -238,6 +241,38 @@ proc ::platform::identify {} {
return $id
}
+proc ::platform::LibcVersion {base _->_ vv} {
+ upvar 1 $vv v
+ set libclist [lsort [glob -nocomplain -directory $base libc*]]
+
+ if {![llength $libclist]} { return 0 }
+
+ set libc [lindex $libclist 0]
+
+ # Try executing the library first. This should suceed
+ # for a glibc library, and return the version
+ # information.
+
+ if {![catch {
+ set vdata [lindex [split [exec $libc] \n] 0]
+ }]} {
+ regexp {([0-9]+(\.[0-9]+)*)} $vdata -> v
+ foreach {major minor} [split $v .] break
+ set v glibc${major}.${minor}
+ return 1
+ } else {
+ # We had trouble executing the library. We are now
+ # inspecting its name to determine the version
+ # number. This code by Larry McVoy.
+
+ if {[regexp -- {libc-([0-9]+)\.([0-9]+)} $libc -> major minor]} {
+ set v glibc${major}.${minor}
+ return 1
+ }
+ }
+ return 0
+}
+
# -- platform::patterns
#
# Given an exact platform identifier, i.e. _not_ the generic
@@ -333,7 +368,7 @@ proc ::platform::patterns {id} {
# ### ### ### ######### ######### #########
## Ready
-package provide platform 1.0.9
+package provide platform 1.0.10
# ### ### ### ######### ######### #########
## Demo application
diff --git a/unix/Makefile.in b/unix/Makefile.in
index 82578f6..1ed5484 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -783,8 +783,8 @@ install-libraries: libraries $(INSTALL_TZDATA) install-msgs
@echo "Installing package tcltest 2.3.3 as a Tcl Module";
@$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/tcltest-2.3.3.tm;
- @echo "Installing package platform 1.0.9 as a Tcl Module";
- @$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform-1.0.9.tm;
+ @echo "Installing package platform 1.0.10 as a Tcl Module";
+ @$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform-1.0.10.tm;
@echo "Installing package platform::shell 1.1.4 as a Tcl Module";
@$(INSTALL_DATA) $(TOP_DIR)/library/platform/shell.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform/shell-1.1.4.tm;
diff --git a/win/Makefile.in b/win/Makefile.in
index 6308165..b48f1f4 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -649,8 +649,8 @@ install-libraries: libraries install-tzdata install-msgs
@$(COPY) $(ROOT_DIR)/library/msgcat/msgcat.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/msgcat-1.4.4.tm;
@echo "Installing package tcltest 2.3.3 as a Tcl Module";
@$(COPY) $(ROOT_DIR)/library/tcltest/tcltest.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/tcltest-2.3.3.tm;
- @echo "Installing package platform 1.0.9 as a Tcl Module";
- @$(COPY) $(ROOT_DIR)/library/platform/platform.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform-1.0.9.tm;
+ @echo "Installing package platform 1.0.10 as a Tcl Module";
+ @$(COPY) $(ROOT_DIR)/library/platform/platform.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform-1.0.10.tm;
@echo "Installing package platform::shell 1.1.4 as a Tcl Module";
@$(COPY) $(ROOT_DIR)/library/platform/shell.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform/shell-1.1.4.tm;
@echo "Installing encodings";