diff options
Diffstat (limited to 'extra/go/build')
-rwxr-xr-x | extra/go/build | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/extra/go/build b/extra/go/build index c051bc2d..db14aea2 100755 --- a/extra/go/build +++ b/extra/go/build @@ -7,13 +7,19 @@ patch -p1 < no-bash.patch # This breaks Go. :> nostrip +case $3 in + x86_64) export GOARCH=amd64 ;; + i?86) export GOARCH=386 ;; + *) printf 'unsupported architecture: %s\n' "$3" + exit 1 +esac + export CC="${CC:-cc}" -export GOARCH=amd64 export GO_LDFLAGS="-w -s" [ -f "$CPT_ROOT/var/db/cpt/installed/go/manifest" ] || { - export GOROOT=$PWD/go1.4-bootstrap - export GOROOT_FINAL=$PWD/lib/go-bootstrap + export GOROOT="$PWD/go1.4-bootstrap" + export GOROOT_FINAL="$PWD/lib/go-bootstrap" mkdir -p lib/go-bootstrap @@ -29,10 +35,10 @@ export GOROOT_FINAL=/usr/lib/go if [ -f "$CPT_ROOT/var/db/cpt/go/manifest" ]; then export GOROOT_BOOTSTRAP=/usr/lib/go else - export GOROOT_BOOTSTRAP=$PWD/lib/go-bootstrap + export GOROOT_BOOTSTRAP="$PWD/lib/go-bootstrap" fi -export GOROOT=$PWD/go-current +export GOROOT="$PWD/go-current" ( cd "$GOROOT/src" |