summaryrefslogtreecommitdiff
path: root/doc/progs
diff options
context:
space:
mode:
authorDevon H. O'Dell <devon.odell@gmail.com>2009-12-11 15:14:09 -0800
committerDevon H. O'Dell <devon.odell@gmail.com>2009-12-11 15:14:09 -0800
commita067450a1fb8a60e1f1d3a7a7ca67120f567e7cb (patch)
tree2983280de546e6fd900fb4e74550f80fe688acaf /doc/progs
parent1d0e078f040c63587ea347ab8e8e73bd534bdee1 (diff)
downloadgolang-a067450a1fb8a60e1f1d3a7a7ca67120f567e7cb.tar.gz
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 <rsc@golang.org>
Diffstat (limited to 'doc/progs')
-rwxr-xr-xdoc/progs/run10
1 files changed, 6 insertions, 4 deletions
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