OLD | NEW |
1 #!/usr/bin/env bash | 1 #!/usr/bin/env bash |
2 # Copyright 2009 The Go Authors. All rights reserved. | 2 # Copyright 2009 The Go Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style | 3 # Use of this source code is governed by a BSD-style |
4 # license that can be found in the LICENSE file. | 4 # license that can be found in the LICENSE file. |
5 | 5 |
6 # Environment variables that control make.bash: | 6 # Environment variables that control make.bash: |
7 # | 7 # |
8 # GOROOT_FINAL: The expected final Go root, baked into binaries. | 8 # GOROOT_FINAL: The expected final Go root, baked into binaries. |
9 # The default is the location of the Go tree during the build. | 9 # The default is the location of the Go tree during the build. |
10 # | 10 # |
11 # GOHOSTARCH: The architecture for host tools (compilers and | 11 # GOHOSTARCH: The architecture for host tools (compilers and |
12 # binaries). Binaries of this type must be executable on the current | 12 # binaries). Binaries of this type must be executable on the current |
13 # system, so the only common reason to set this is to set | 13 # system, so the only common reason to set this is to set |
14 # GOHOSTARCH=386 on an amd64 machine. | 14 # GOHOSTARCH=386 on an amd64 machine. |
15 # | 15 # |
16 # GOARCH: The target architecture for installed packages and tools. | 16 # GOARCH: The target architecture for installed packages and tools. |
17 # | 17 # |
18 # GOOS: The target operating system for installed packages and tools. | 18 # GOOS: The target operating system for installed packages and tools. |
19 # | 19 # |
20 # GO_GCFLAGS: Additional 5g/6g/8g arguments to use when | 20 # GO_GCFLAGS: Additional 5g/6g/8g arguments to use when |
21 # building the packages and commands. | 21 # building the packages and commands. |
22 # | 22 # |
23 # GO_LDFLAGS: Additional 5l/6l/8l arguments to use when | 23 # GO_LDFLAGS: Additional 5l/6l/8l arguments to use when |
24 # building the commands. | 24 # building the commands. |
25 # | 25 # |
| 26 # GO_FLAGS: Additional go_bootstrap arguments to use when |
| 27 # building. |
| 28 # |
26 # CGO_ENABLED: Controls cgo usage during the build. Set it to 1 | 29 # CGO_ENABLED: Controls cgo usage during the build. Set it to 1 |
27 # to include all cgo related files, .c and .go file with "cgo" | 30 # to include all cgo related files, .c and .go file with "cgo" |
28 # build directive, in the build. Set it to 0 to ignore them. | 31 # build directive, in the build. Set it to 0 to ignore them. |
29 | 32 |
30 set -e | 33 set -e |
31 if [ ! -f run.bash ]; then | 34 if [ ! -f run.bash ]; then |
32 echo 'make.bash must be run from $GOROOT/src' 1>&2 | 35 echo 'make.bash must be run from $GOROOT/src' 1>&2 |
33 exit 1 | 36 exit 1 |
34 fi | 37 fi |
35 | 38 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 fi | 125 fi |
123 ./cmd/dist/dist bootstrap $buildall -v # builds go_bootstrap | 126 ./cmd/dist/dist bootstrap $buildall -v # builds go_bootstrap |
124 # Delay move of dist tool to now, because bootstrap may clear tool directory. | 127 # Delay move of dist tool to now, because bootstrap may clear tool directory. |
125 mv cmd/dist/dist "$GOTOOLDIR"/dist | 128 mv cmd/dist/dist "$GOTOOLDIR"/dist |
126 "$GOTOOLDIR"/go_bootstrap clean -i std | 129 "$GOTOOLDIR"/go_bootstrap clean -i std |
127 echo | 130 echo |
128 | 131 |
129 if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then | 132 if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then |
130 echo "# Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH." | 133 echo "# Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH." |
131 GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH \ | 134 GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH \ |
132 » » "$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflag
s "$GO_LDFLAGS" -v std | 135 » » "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAG
S" -ldflags "$GO_LDFLAGS" -v std |
133 echo | 136 echo |
134 fi | 137 fi |
135 | 138 |
136 echo "# Building packages and commands for $GOOS/$GOARCH." | 139 echo "# Building packages and commands for $GOOS/$GOARCH." |
137 "$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS"
-v std | 140 "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO
_LDFLAGS" -v std |
138 echo | 141 echo |
139 | 142 |
140 rm -f "$GOTOOLDIR"/go_bootstrap | 143 rm -f "$GOTOOLDIR"/go_bootstrap |
141 | 144 |
142 if [ "$1" != "--no-banner" ]; then | 145 if [ "$1" != "--no-banner" ]; then |
143 "$GOTOOLDIR"/dist banner | 146 "$GOTOOLDIR"/dist banner |
144 fi | 147 fi |
OLD | NEW |