diff options
Diffstat (limited to 'doc/platform.n')
| -rw-r--r-- | doc/platform.n | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/doc/platform.n b/doc/platform.n index 8b202a3..6abc289 100644 --- a/doc/platform.n +++ b/doc/platform.n @@ -1,20 +1,18 @@ '\" -'\" Copyright (c) 2006 ActiveState Software +'\" Copyright (c) 2006 ActiveState Software Inc '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: platform.n,v 1.2 2007/07/20 16:49:38 andreas_kupries Exp $ -'\" +.TH "platform" n 1.0.4 platform "Tcl Bundled Packages" .so man.macros -.TH "platform" n 1.0.3 platform "Tcl Bundled Packages" .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME platform \- System identification support code and utilities .SH SYNOPSIS .nf -\fBpackage require platform ?1.0.3?\fR +\fBpackage require platform ?1.0.10?\fR .sp \fBplatform::generic\fR \fBplatform::identify\fR @@ -30,7 +28,7 @@ Whilst Tcl provides the \fBtcl_platform\fR array for identifying the current architecture (in particular, the platform and machine elements) this is not always sufficient. This is because (on Unix machines) \fBtcl_platform\fR reflects the values returned by the -\fBuname\fR command and these aren't standardized across platforms and +\fBuname\fR command and these are not standardized across platforms and architectures. In addition, on at least one platform (AIX) the \fBtcl_platform(machine)\fR contains the CPU serial number. .PP @@ -47,6 +45,7 @@ architecture a Tcl program is running on. .SH COMMANDS .TP \fBplatform::identify\fR +. This command returns an identifier describing the platform the Tcl core is running on. The returned identifier has the general format \fIOS\fR-\fICPU\fR. The \fIOS\fR part of the identifier may contain @@ -55,14 +54,33 @@ may contain dashes as well. The \fICPU\fR part will not contain dashes, making the preceding dash the last dash in the result. .TP \fBplatform::generic\fR +. This command returns a simplified identifier describing the platform the Tcl core is running on. In contrast to \fBplatform::identify\fR it leaves out details like kernel version, libc version, etc. The returned identifier has the general format \fIOS\fR-\fICPU\fR. .TP -\fBplatform::patterns \fIidentifier\fR +\fBplatform::patterns \fIidentifier\fR +. This command takes an identifier as returned by \fBplatform::identify\fR and returns a list of identifiers describing compatible architectures. +.SH EXAMPLE +.PP +This can be used to allow an application to be shipped with multiple builds of +a shared library, so that the same package works on many versions of an +operating system. For example: +.PP +.CS +\fBpackage require platform\fR +# Assume that app script is .../theapp/bin/theapp.tcl +set binDir [file dirname [file normalize [info script]]] +set libDir [file join $binDir .. lib] +set platLibDir [file join $libDir [\fBplatform::identify\fR]] +load [file join $platLibDir support[info sharedlibextension]] +.CE .SH KEYWORDS operating system, cpu architecture, platform, architecture +'\" Local Variables: +'\" mode: nroff +'\" End: |
