LEFT | RIGHT |
1 #!/usr/bin/env bash | 1 #!/usr/bin/env bash |
2 # Copyright 2009 The Go Authors. All rights reserved. | 2 # Copyright 2009 The Go Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style | 3 # Use of this source code is governed by a BSD-style |
4 # license that can be found in the LICENSE file. | 4 # license that can be found in the LICENSE file. |
5 | 5 |
6 set -e | 6 set -e |
7 GOBIN="${GOBIN:-$HOME/bin}" | 7 GOBIN="${GOBIN:-$HOME/bin}" |
8 export MAKEFLAGS=-j4 | 8 export MAKEFLAGS=-j4 |
9 | 9 |
10 if ! test -f $GOROOT/include/u.h | 10 if ! test -f $GOROOT/include/u.h |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 case "$GOARCH" in | 23 case "$GOARCH" in |
24 amd64 | 386 | arm) | 24 amd64 | 386 | arm) |
25 ;; | 25 ;; |
26 *) | 26 *) |
27 echo '$GOARCH is set to <'$GOARCH'>, must be amd64, 386, or arm' 1>&2 | 27 echo '$GOARCH is set to <'$GOARCH'>, must be amd64, 386, or arm' 1>&2 |
28 exit 1 | 28 exit 1 |
29 esac | 29 esac |
30 | 30 |
31 case "$GOOS" in | 31 case "$GOOS" in |
32 darwin | linux | nacl) | 32 darwin | linux | nacl | freebsd) |
33 » MAKE=make | |
34 » ;; | |
35 freebsd) | |
36 » MAKE=gmake | |
37 ;; | 33 ;; |
38 *) | 34 *) |
39 echo '$GOOS is set to <'$GOOS'>, must be darwin, linux, or nacl' 1>&2 | 35 echo '$GOOS is set to <'$GOOS'>, must be darwin, linux, or nacl' 1>&2 |
40 exit 1 | 36 exit 1 |
41 esac | 37 esac |
42 | 38 |
43 rm -f $GOBIN/quietgcc | 39 rm -f $GOBIN/quietgcc |
44 CC=${CC:-gcc} | 40 CC=${CC:-gcc} |
45 sed -e "s|@CC@|$CC|" < quietgcc.bash > $GOBIN/quietgcc | 41 sed -e "s|@CC@|$CC|" < quietgcc.bash > $GOBIN/quietgcc |
46 chmod +x $GOBIN/quietgcc | 42 chmod +x $GOBIN/quietgcc |
47 | 43 |
48 rm -f $GOBIN/gomake | 44 rm -f $GOBIN/gomake |
49 MAKE=${MAKE:-make} | 45 MAKE=make |
50 sed -e "s|@MAKE@|$MAKE|" < gomake.bash > $GOBIN/gomake | 46 if ! make --version 2>/dev/null | grep 'GNU Make' >/dev/null; then |
| 47 » MAKE=gmake |
| 48 fi |
| 49 (echo '#!/bin/sh'; echo 'exec '$MAKE' "$@"') >$GOBIN/gomake |
51 chmod +x $GOBIN/gomake | 50 chmod +x $GOBIN/gomake |
52 | 51 |
53 if ! (cd lib9 && which quietgcc) >/dev/null 2>&1; then | 52 if ! (cd lib9 && which quietgcc) >/dev/null 2>&1; then |
54 echo "installed quietgcc as $GOBIN/quietgcc but 'which quietgcc' fails"
1>&2 | 53 echo "installed quietgcc as $GOBIN/quietgcc but 'which quietgcc' fails"
1>&2 |
55 echo "double-check that $GOBIN is in your "'$PATH' 1>&2 | 54 echo "double-check that $GOBIN is in your "'$PATH' 1>&2 |
56 exit 1 | 55 exit 1 |
57 fi | 56 fi |
58 | 57 |
59 if [ -d /selinux -a -f /selinux/booleans/allow_execstack ] ; then | 58 if [ -d /selinux -a -f /selinux/booleans/allow_execstack ] ; then |
60 if ! cat /selinux/booleans/allow_execstack | grep -c '^1 1$' >> /dev/nul
l ; then | 59 if ! cat /selinux/booleans/allow_execstack | grep -c '^1 1$' >> /dev/nul
l ; then |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 ) || exit 1 | 96 ) || exit 1 |
98 esac | 97 esac |
99 done | 98 done |
100 | 99 |
101 case "`uname`" in | 100 case "`uname`" in |
102 Darwin) | 101 Darwin) |
103 echo; | 102 echo; |
104 echo %%% run sudo.bash to install debuggers | 103 echo %%% run sudo.bash to install debuggers |
105 echo | 104 echo |
106 esac | 105 esac |
LEFT | RIGHT |