From a067450a1fb8a60e1f1d3a7a7ca67120f567e7cb Mon Sep 17 00:00:00 2001 From: "Devon H. O'Dell" Date: Fri, 11 Dec 2009 15:14:09 -0800 Subject: Remove GOBIN in PATH dependency; don't assume cwd is $GOROOT/src This change removes the necessity to have GOBIN in $PATH, and also doesn't assume that the build is being run from $GOROOT/src. This is a minimal set of necessary changes to get Go to build happily from the FreeBSD ports collection. R=rsc CC=golang-dev http://codereview.appspot.com/171044 Committer: Russ Cox --- doc/progs/run | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'doc/progs') diff --git a/doc/progs/run b/doc/progs/run index 71999ece9..c0e4b53e0 100755 --- a/doc/progs/run +++ b/doc/progs/run @@ -3,6 +3,8 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. +GOBIN="${GOBIN:-$HOME/bin}" + . "$GOROOT"/src/Make.$GOARCH if [ -z "$O" ]; then @@ -30,11 +32,11 @@ for i in \ ; do BASE=$(basename $i .go) - $GC $i + "$GOBIN"/$GC $i done function testit { - $LD $1.$O + "$GOBIN"/$LD $1.$O x=$(echo $(./$O.out $2 2>&1)) # extra echo canonicalizes if [ "$x" != "$3" ] then @@ -43,7 +45,7 @@ function testit { } function testitpipe { - $LD $1.$O + "$GOBIN"/$LD $1.$O x=$(echo $(./$O.out | $2 2>&1)) # extra echo canonicalizes if [ "$x" != "$3" ] then @@ -72,7 +74,7 @@ testitpipe sieve "sed 10q" "2 3 5 7 11 13 17 19 23 29" testitpipe sieve "sed 10q" "2 3 5 7 11 13 17 19 23 29" # server hangs; don't run it, just compile it -$GC server.go +"$GOBIN"/$GC server.go testit server1 "" "" rm -f $O.out *.$O -- cgit v1.2.3