diff options
| author | Sergio Luis O. B. Correia <sergio@larces.uece.br> | 2009-11-23 17:32:51 -0800 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2009-11-23 17:32:51 -0800 |
| commit | 6fc820729e96527cfbb6bdd48836edcc1d0e4215 (patch) | |
| tree | 50b343071af83ccc83b323c93a0be3cbe81aa457 /src/make.bash | |
| parent | 2b1133ff863172d669defea18761a84e4a343d80 (diff) | |
| download | go-6fc820729e96527cfbb6bdd48836edcc1d0e4215.tar.xz | |
go: makes it build for the case $GOROOT has whitespaces
the bash scripts and makefiles for building go didn't take into account
the fact $GOROOT / $GOBIN could both be directories containing whitespaces,
and was not possible to build it in such a situation.
this commit adjusts the various makefiles/scripts to make it aware of that
possibility, and now it builds successfully when using a path with whitespaces
as well.
Fixes #115.
R=rsc, dsymonds1
https://golang.org/cl/157067
Diffstat (limited to 'src/make.bash')
| -rwxr-xr-x | src/make.bash | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/make.bash b/src/make.bash index 249a9cee25..c9a812b763 100755 --- a/src/make.bash +++ b/src/make.bash @@ -7,13 +7,13 @@ set -e GOBIN="${GOBIN:-$HOME/bin}" export MAKEFLAGS=-j4 -if ! test -f $GOROOT/include/u.h +if ! test -f "$GOROOT"/include/u.h then echo '$GOROOT is not set correctly or not exported' 1>&2 exit 1 fi -if ! test -d $GOBIN +if ! 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 @@ -36,18 +36,18 @@ darwin | linux | nacl | freebsd) exit 1 esac -rm -f $GOBIN/quietgcc +rm -f "$GOBIN"/quietgcc CC=${CC:-gcc} -sed -e "s|@CC@|$CC|" < quietgcc.bash > $GOBIN/quietgcc -chmod +x $GOBIN/quietgcc +sed -e "s|@CC@|$CC|" < quietgcc.bash > "$GOBIN"/quietgcc +chmod +x "$GOBIN"/quietgcc -rm -f $GOBIN/gomake +rm -f "$GOBIN"/gomake MAKE=make if ! make --version 2>/dev/null | grep 'GNU Make' >/dev/null; then MAKE=gmake fi -(echo '#!/bin/sh'; echo 'exec '$MAKE' "$@"') >$GOBIN/gomake -chmod +x $GOBIN/gomake +(echo '#!/bin/sh'; echo 'exec '$MAKE' "$@"') >"$GOBIN"/gomake +chmod +x "$GOBIN"/gomake if ! (cd lib9 && which quietgcc) >/dev/null 2>&1; then echo "installed quietgcc as $GOBIN/quietgcc but 'which quietgcc' fails" 1>&2 |
