summaryrefslogtreecommitdiffstats
path: root/doc/platform.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-04-19 10:28:34 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-04-19 10:28:34 (GMT)
commitbcd88b005a09280f4b9725d611fd3763fd07241f (patch)
tree8e981954477ca030ecaa28a71ac51c658db9bd51 /doc/platform.n
parent785345954a294575ff372b0e35a18dac4367dc84 (diff)
downloadtcl-bcd88b005a09280f4b9725d611fd3763fd07241f.zip
tcl-bcd88b005a09280f4b9725d611fd3763fd07241f.tar.gz
tcl-bcd88b005a09280f4b9725d611fd3763fd07241f.tar.bz2
Added example to platform(n) manpage
Diffstat (limited to 'doc/platform.n')
-rw-r--r--doc/platform.n24
1 files changed, 22 insertions, 2 deletions
diff --git a/doc/platform.n b/doc/platform.n
index 053448d..1553698 100644
--- a/doc/platform.n
+++ b/doc/platform.n
@@ -12,7 +12,7 @@
platform \- System identification support code and utilities
.SH SYNOPSIS
.nf
-\fBpackage require platform ?1.0.4?\fR
+\fBpackage require platform ?1.0.10?\fR
.sp
\fBplatform::generic\fR
\fBplatform::identify\fR
@@ -45,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
@@ -53,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: