diff options
author | Michael Stapelberg <stapelberg@debian.org> | 2013-12-03 09:43:15 +0100 |
---|---|---|
committer | Michael Stapelberg <stapelberg@debian.org> | 2013-12-03 09:43:15 +0100 |
commit | 64d2a7c8945ba05af859901f5e248f1befdd8621 (patch) | |
tree | 013fcb7e9e3296ecdda876012252c36bd6bcb063 /doc/install-source.html | |
parent | b901efe83e212f0c34c769c079e41373da12d723 (diff) | |
download | golang-64d2a7c8945ba05af859901f5e248f1befdd8621.tar.gz |
Imported Upstream version 1.2upstream/1.2
Diffstat (limited to 'doc/install-source.html')
-rw-r--r-- | doc/install-source.html | 120 |
1 files changed, 102 insertions, 18 deletions
diff --git a/doc/install-source.html b/doc/install-source.html index ee7b39b7e..b99360c71 100644 --- a/doc/install-source.html +++ b/doc/install-source.html @@ -57,7 +57,7 @@ architectures. <code>arm</code> (a.k.a. <code>ARM</code>); <code>5g,5l,5c,5a</code> </dt> <dd> - Supports only Linux binaries. Less widely used than the other ports and therefore not as thoroughly tested. + Supports Linux, FreeBSD and NetBSD binaries. Less widely used than the other ports. </dd> </dl> @@ -69,7 +69,7 @@ goroutines, such as stacks that grow and shrink on demand. </p> <p> -The compilers can target the FreeBSD, Linux, NetBSD, OpenBSD, OS X (Darwin), +The compilers can target the FreeBSD, Linux, NetBSD, OpenBSD, OS X (Darwin), Plan 9, and Windows operating systems. The full set of supported combinations is listed in the discussion of <a href="#environment">environment variables</a> below. @@ -216,8 +216,61 @@ If you see the "hello, world" message then Go is installed correctly. <h2 id="gopath">Set up your work environment</h2> <p> -The document <a href="/doc/code.html">How to Write Go Code</a> explains how to -set up a work environment in which to build and test Go code. +You're almost done. +You just need to do a little more setup. +</p> + +<p> +<a href="/doc/code.html" class="download" id="start"> +<span class="big">How to Write Go Code</span> +<span class="desc">Learn how to set up and use the Go tools</span> +</a> +</p> + +<p> +The <a href="/doc/code.html">How to Write Go Code</a> document +provides <b>essential setup instructions</b> for using the Go tools. +</p> + + +<h2 id="tools">Install additional tools</h2> + +<p> +The source code for several Go tools (including <a href="/cmd/godoc/">godoc</a>) +is kept in <a href="https://code.google.com/p/go.tools">the go.tools repository</a>. +To install all of them, run the <code>go</code> <code>get</code> command: +</p> + +<pre> +$ go get code.google.com/p/go.tools/cmd/... +</pre> + +<p> +Or if you just want to install a specific command (<code>godoc</code> in this case): +</p> + +<pre> +$ go get code.google.com/p/go.tools/cmd/godoc +</pre> + +<p> +To install these tools, the <code>go</code> <code>get</code> command requires +that <a href="#mercurial">Mercurial</a> be installed locally. +</p> + +<p> +You must also have a workspace (<code>GOPATH</code>) set up; +see <a href="/doc/code.html">How to Write Go Code</a> for the details. +</p> + +<p> +<b>Note</b>: The <code>go</code> command will install the <code>godoc</code> +binary to <code>$GOROOT/bin</code> (or <code>$GOBIN</code>) and the +<code>cover</code> and <code>vet</code> binaries to +<code>$GOROOT/pkg/tool/$GOOS_$GOARCH</code>. +You can access the latter commands with +"<code>go</code> <code>tool</code> <code>cover</code>" and +"<code>go</code> <code>tool</code> <code>vet</code>". </p> <h2 id="community">Community resources</h2> @@ -273,9 +326,8 @@ The Go compilation environment can be customized by environment variables. to override the defaults. </p> -<blockquote> - -<p><code>$GOROOT</code></p> +<ul> +<li><code>$GOROOT</code> <p> The root of the Go tree, often <code>$HOME/go</code>. Its value is built into the tree when it is compiled, and @@ -284,7 +336,7 @@ There is no need to set this unless you want to switch between multiple local copies of the repository. </p> -<p><code>$GOROOT_FINAL</code></p> +<li><code>$GOROOT_FINAL</code> <p> The value assumed by installed binaries and scripts when <code>$GOROOT</code> is not set explicitly. @@ -294,7 +346,7 @@ but move it elsewhere after the build, set <code>$GOROOT_FINAL</code> to the eventual location. </p> -<p><code>$GOOS</code> and <code>$GOARCH</code></p> +<li><code>$GOOS</code> and <code>$GOARCH</code> <p> The name of the target operating system and compilation architecture. These default to the values of <code>$GOHOSTOS</code> and @@ -311,7 +363,7 @@ Choices for <code>$GOARCH</code> are The valid combinations of <code>$GOOS</code> and <code>$GOARCH</code> are: <table cellpadding="0"> <tr> -<th width="50"><th align="left" width="100"><code>$GOOS</code></th> <th align="left" width="100"><code>$GOARCH</code></th> <th align="left"></th> +<th width="50"></th><th align="left" width="100"><code>$GOOS</code></th> <th align="left" width="100"><code>$GOARCH</code></th> </tr> <tr> <td></td><td><code>darwin</code></td> <td><code>386</code></td> @@ -326,6 +378,9 @@ The valid combinations of <code>$GOOS</code> and <code>$GOARCH</code> are: <td></td><td><code>freebsd</code></td> <td><code>amd64</code></td> </tr> <tr> +<td></td><td><code>freebsd</code></td> <td><code>arm</code></td> +</tr> +<tr> <td></td><td><code>linux</code></td> <td><code>386</code></td> </tr> <tr> @@ -341,6 +396,9 @@ The valid combinations of <code>$GOOS</code> and <code>$GOARCH</code> are: <td></td><td><code>netbsd</code></td> <td><code>amd64</code></td> </tr> <tr> +<td></td><td><code>netbsd</code></td> <td><code>arm</code></td> +</tr> +<tr> <td></td><td><code>openbsd</code></td> <td><code>386</code></td> </tr> <tr> @@ -350,6 +408,9 @@ The valid combinations of <code>$GOOS</code> and <code>$GOARCH</code> are: <td></td><td><code>plan9</code></td> <td><code>386</code></td> </tr> <tr> +<td></td><td><code>plan9</code></td> <td><code>amd64</code></td> +</tr> +<tr> <td></td><td><code>windows</code></td> <td><code>386</code></td> </tr> <tr> @@ -357,7 +418,7 @@ The valid combinations of <code>$GOOS</code> and <code>$GOARCH</code> are: </tr> </table> -<p><code>$GOHOSTOS</code> and <code>$GOHOSTARCH</code></p> +<li><code>$GOHOSTOS</code> and <code>$GOHOSTARCH</code> <p> The name of the host operating system and compilation architecture. These default to the local system's operating system and @@ -372,7 +433,7 @@ For example, you should not set <code>$GOHOSTARCH</code> to <code>arm</code> on an x86 system. </p> -<p><code>$GOBIN</code> +<li><code>$GOBIN</code> <p> The location where Go binaries will be installed. The default is <code>$GOROOT/bin</code>. @@ -382,15 +443,38 @@ If <code>$GOBIN</code> is set, the <a href="/cmd/go">go command</a> installs all commands there. </p> -<p><code>$GOARM</code> (arm, default=6)</p> +<li><code>$GO386</code> (for <code>386</code> only, default is auto-detected +if built natively, <code>387</code> if not) +<p> +This controls the code generated by 8g to use either the 387 floating-point unit +(set to <code>387</code>) or SSE2 instructions (set to <code>sse2</code>) for +floating point computations. +</p> +<ul> + <li><code>GO386=387</code>: use x87 for floating point operations; should support all x86 chips (Pentium MMX or later). + <li><code>GO386=sse2</code>: use SSE2 for floating point operations; has better performance than 387, but only available on Pentium 4/Opteron/Athlon 64 or later. +</ul> + +<li><code>$GOARM</code> (for <code>arm</code> only; default is auto-detected if building +on the target processor, 6 if not) +<p> +This sets the ARM floating point co-processor architecture version the run-time +should target. If you are compiling on the target system, its value will be auto-detected. +</p> +<ul> + <li><code>GOARM=5</code>: use software floating point; when CPU doesn't have VFP co-processor + <li><code>GOARM=6</code>: use VFPv1 only; default if cross compiling; usually ARM11 or better cores (VFPv2 or better is also supported) + <li><code>GOARM=7</code>: use VFPv3; usually Cortex-A cores +</ul> <p> -The ARM architecture version the run-time libraries should target. -Setting <code>$GOARM</code> to 5 causes the linker to emit calls -to a software floating point implementation instead of using -hardware floating point support. +If in doubt, leave this variable unset, and adjust it if required +when you first run the Go executable. +The <a href="http://code.google.com/p/go-wiki/wiki/GoArm">GoARM</a> page +on the <a href="http://code.google.com/p/go-wiki/w/list">Go community wiki</a> +contains further details regarding Go's ARM support. </p> -</blockquote> +</ul> <p> Note that <code>$GOARCH</code> and <code>$GOOS</code> identify the |