From 69fd2a4ab74f1e11111f67a04ebd9cd4b31ea6d8 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 31 Mar 2010 19:48:33 -0700 Subject: build script tweaks factor out environment variable checks. infer $GOROOT etc during build if not set. it's still necessary to set them for yourself to use the standard Makefiles. when running all.bash, don't recompile all the go packages in run.bash, since make.bash already did. R=r CC=golang-dev https://golang.org/cl/609042 --- src/make.bash | 39 +-------------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) (limited to 'src/make.bash') diff --git a/src/make.bash b/src/make.bash index c2a350af7f..d8638145ea 100755 --- a/src/make.bash +++ b/src/make.bash @@ -4,48 +4,11 @@ # license that can be found in the LICENSE file. set -e +. ./env.bash -if test -z "$GOBIN"; then - if ! test -d "$HOME"/bin; then - echo '$GOBIN is not set and $HOME/bin is not a directory or does not exist.' 1>&2 - echo 'mkdir $HOME/bin or set $GOBIN to a directory where binaries should' 1>&2 - echo 'be installed.' 1>&2 - exit 1 - fi - GOBIN="$HOME/bin" -elif ! test -d "$GOBIN"; then - echo '$GOBIN is not a directory or does not exist' 1>&2 - echo 'create it or set $GOBIN differently' 1>&2 - exit 1 -fi - -GOBIN="${GOBIN:-$HOME/bin}" export MAKEFLAGS=-j4 - unset CDPATH # in case user has it set -if ! test -f "$GOROOT"/include/u.h -then - echo '$GOROOT is not set correctly or not exported' 1>&2 - 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 | freebsd | linux | mingw | nacl) - ;; -*) - echo '$GOOS is set to <'$GOOS'>, must be darwin, freebsd, linux, mingw, or nacl' 1>&2 - exit 1 -esac - rm -f "$GOBIN"/quietgcc CC=${CC:-gcc} sed -e "s|@CC@|$CC|" < "$GOROOT"/src/quietgcc.bash > "$GOBIN"/quietgcc -- cgit v1.3