diff -r 433497578ae1 src/make.bash --- a/src/make.bash Tue Nov 10 17:39:01 2009 -0800 +++ b/src/make.bash Tue Nov 10 21:49:40 2009 -0500 @@ -7,12 +7,68 @@ GOBIN="${GOBIN:-$HOME/bin}" export MAKEFLAGS=-j4 +RTFM_MSG="see http://golang.org/doc/install.html section 'Environment Variables' for details" + if ! test -f $GOROOT/include/u.h then echo '$GOROOT is not set correctly or not exported' 1>&2 exit 1 fi +if [ -e $GOBIN ] +then + echo "$GOBIN is empty" + echo $RTFM_MSG + exit 1 +else + if [ ! -d $GOBIN ] + then + echo "$GOBIN references a directory that does not exist" + echo $RTFM_MSG + exit 1 + fi +fi + +if [ -e $GOARCH ] +then + echo 'GOARCH is empty' + echo $RTFM_MSG + exit 1 +else + case "$GOARCH" in + amd64) + ;; + 386) + ;; + arm) + ;; + *) + echo "GOARCH must be one of these values: amd64, 386 or arm" + echo $RTFM_MSG + exit 1 + esac +fi + +if [ -e $GOOS ] +then + echo 'GOOS is empty' + echo $RTFM_MSG + exit 1 +else + case "$GOOS" in + linux) + ;; + darwin) + ;; + nacl) + ;; + *) + echo "GOOS must be one of these values: linux, darwin or nacl" + echo "see http://golang.org/doc/install.html section 'Environment Variables' for details" + exit 1 + esac +fi + bash clean.bash rm -f $GOBIN/quietgcc