summaryrefslogtreecommitdiff
path: root/src/env.bash
diff options
context:
space:
mode:
Diffstat (limited to 'src/env.bash')
-rw-r--r--src/env.bash44
1 files changed, 43 insertions, 1 deletions
diff --git a/src/env.bash b/src/env.bash
index ca3ecebe8..f83012a26 100644
--- a/src/env.bash
+++ b/src/env.bash
@@ -39,13 +39,55 @@ if [ ! -d "$GOBIN" -a "$GOBIN" != "$GOROOT/bin" ]; then
fi
export OLDPATH=$PATH
-export PATH="$GOBIN":/bin:/usr/bin:$PATH
+export PATH="$GOBIN":$PATH
MAKE=make
if ! make --version 2>/dev/null | grep 'GNU Make' >/dev/null; then
MAKE=gmake
fi
+PROGS="
+ ar
+ awk
+ bash
+ bison
+ chmod
+ cp
+ cut
+ echo
+ egrep
+ gcc
+ grep
+ ls
+ mkdir
+ mv
+ pwd
+ rm
+ sed
+ sort
+ tee
+ touch
+ tr
+ true
+ uname
+ uniq
+"
+
+for i in $PROGS; do
+ if ! which $i >/dev/null 2>&1; then
+ echo "Cannot find '$i' on search path." 1>&2
+ echo "See http://golang.org/doc/install.html#ctools" 1>&2
+ exit 1
+ fi
+done
+
+if bison --version 2>&1 | grep 'bison++' >/dev/null 2>&1; then
+ echo "Your system's 'bison' is bison++."
+ echo "Go needs the original bison instead." 1>&2
+ echo "See http://golang.org/doc/install.html#ctools" 1>&2
+ exit 1
+fi
+
# Tried to use . <($MAKE ...) here, but it cannot set environment
# variables in the version of bash that ships with OS X. Amazing.
eval $($MAKE --no-print-directory -f Make.inc go-env | egrep 'GOARCH|GOOS|GOHOSTARCH|GOHOSTOS|GO_ENV')