summaryrefslogtreecommitdiff
path: root/src/make.bash
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2012-03-01 12:12:22 -0500
committerRuss Cox <rsc@golang.org>2012-03-01 12:12:22 -0500
commit438c01c9df007e7bdcad92440d2b797949458b32 (patch)
treea236521b211c3fb0ef8611a1c249304b2c096cd0 /src/make.bash
parent23fd40c4cc7bd06d9d86067d20597613975cb239 (diff)
downloadgo-438c01c9df007e7bdcad92440d2b797949458b32.tar.gz
cmd/go: fixes
* Install tools into tool dir always (Fixes issue 3049. Fixes issue 2868. Fixes issue 2925.) * Make packages depend on compiler, linker (Fixes issue 3036.) * Do not recompile packages across roots (Fixes issue 3149.) * Allow use of binary-only packages (Fixes issue 2775.) * Avoid duplicate cgo dependencies (Fixes issue 3001.) * Show less in go get -x. (Fixes issue 2926.) * Do not force repo root for existing checkout (Fixes issue 2969.) * Show full syntax error list always (Fixes issue 2811.) * Clean arguments before processing (Fixes issue 3034.) * Add flags for compiler, linker arguments (Fixes issue 2996.) * Pass flags in make.bash (Fixes issue 3091.) * Unify build flags, defined in one place. * Clean up error messages (Fixes issue 3075. Fixes issue 2923.) * Support local import paths (Fixes issue 3118.) * Allow top-level package outside $GOPATH (Fixes issue 3009.) In addition to these fixes, all commands now take a list of go files as a way to specify a single package, just as go build and go run always have. This means you can: go list -json x.go go fix x.go go vet x.go go test x_test.go Preliminary tests in test.bash. Mainly testing things that the ordinary build does not. I don't mind if the script doesn't run on Windows. I expect that gccgo support is now broken, and I hope that people will feel free to file issues and/or send CLs to fix it. :-) R=golang-dev, dsymonds, r, rogpeppe CC=golang-dev http://codereview.appspot.com/5708054
Diffstat (limited to 'src/make.bash')
-rwxr-xr-xsrc/make.bash27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/make.bash b/src/make.bash
index cb7051bab..8b249ca3b 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -3,6 +3,29 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
+# Environment variables that control make.bash:
+#
+# GOROOT_FINAL: The expected final Go root, baked into binaries.
+# The default is the location of the Go tree during the build.
+#
+# GOHOSTARCH: The architecture for host tools (compilers and
+# binaries). Binaries of this type must be executable on the current
+# system, so the only common reason to set this is to set
+# GOHOSTARCH=386 on an amd64 machine.
+#
+# GOARCH: The target architecture for installed packages and tools.
+#
+# GOOS: The target operating system for installed packages and tools.
+#
+# GCFLAGS: Additional 5g/6g/8g arguments to use when
+# building the packages and commands.
+#
+# LDFLAGS: Additional 5l/6l/8l arguments to use when
+# building the packages and commands.
+#
+# CGO_ENABLED: Setting this to 0 disables the use of cgo
+# in the built and installed packages and tools.
+
set -e
if [ ! -f run.bash ]; then
echo 'make.bash must be run from $GOROOT/src' 1>&2
@@ -88,12 +111,12 @@ echo
if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
echo "# Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH \
- $GOTOOLDIR/go_bootstrap install -v std
+ $GOTOOLDIR/go_bootstrap install -gcflags "$GCFLAGS" -ldflags "$LDFLAGS" -v std
echo
fi
echo "# Building packages and commands for $GOOS/$GOARCH."
-$GOTOOLDIR/go_bootstrap install -v std
+$GOTOOLDIR/go_bootstrap install -gcflags "$GCFLAGS" -ldflags "$LDFLAGS" -v std
echo
rm -f $GOTOOLDIR/go_bootstrap