summaryrefslogtreecommitdiff
path: root/src/make.bash
diff options
context:
space:
mode:
authorSergio Luis O. B. Correia <sergio@larces.uece.br>2009-11-23 17:32:51 -0800
committerSergio Luis O. B. Correia <sergio@larces.uece.br>2009-11-23 17:32:51 -0800
commita3d65354b47d85f8316f1011597b3935bead2a7b (patch)
treeb739091738e77c3d0fdbd27f77d22ed0e281dc32 /src/make.bash
parent722bfe36428db141c167450fe50d6d0e18d59039 (diff)
downloadgo-a3d65354b47d85f8316f1011597b3935bead2a7b.tar.gz
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 issue 115. R=rsc, dsymonds1 http://codereview.appspot.com/157067 Committer: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/make.bash')
-rwxr-xr-xsrc/make.bash16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/make.bash b/src/make.bash
index 249a9cee2..c9a812b76 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