From 2d70d603925955b7184a0ab22dea24b561949b32 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 10 Nov 2009 19:12:22 -0800 Subject: [PATCH] sanity check environment variables better. Fixes #12. R=agl1 CC=golang-dev https://golang.org/cl/152055 --- src/make.bash | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/make.bash b/src/make.bash index 9f7c80c48c..6135bef043 100755 --- a/src/make.bash +++ b/src/make.bash @@ -20,6 +20,23 @@ then exit 1 fi +case "$GOARCH" in +amd64 | 386 | arm) + ;; +*) + echo '$GOARCH is set to <'$GOARCH'>, must be amd64, 386, or arm' 1>&2 + exit 1 +esac + +case "$GOOS" in +darwin | linux | nacl) + ;; +*) + echo '$GOOS is set to <'$GOOS'>, must be darwin, linux, or nacl' 1>&2 + exit 1 +esac + + bash clean.bash rm -f $GOBIN/quietgcc