cross compile support
This commit is contained in:
parent
b6e9552845
commit
94bc968fe8
1 changed files with 11 additions and 0 deletions
11
build-go.sh
11
build-go.sh
|
|
@ -1,6 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
if [ ${EUID} -ne 0 ]; then
|
||||
echo "error: this script must be run as root" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
GITHUB="https://github.com/golang/go/archive/"
|
||||
|
||||
|
|
@ -31,6 +35,12 @@ cd ${INSTALL}/${V14}/src
|
|||
|
||||
export GOROOT_BOOTSTRAP=${INSTALL}/${V14}
|
||||
|
||||
if [ "$(uname -m)" == "x86_64" ]; then
|
||||
export GOARCH=386
|
||||
else
|
||||
export GOARCH=amd64
|
||||
fi
|
||||
|
||||
cd ${INSTALL}/${Vnew}/src
|
||||
./make.bash &> /dev/null
|
||||
|
||||
|
|
@ -45,6 +55,7 @@ echo "add this to your .bashrc/.profile:"
|
|||
echo ""
|
||||
echo "export CGO_ENABLED=0"
|
||||
echo "export GOPATH=~/go"
|
||||
echo "export GOROOT=/usr/local/go"
|
||||
echo "export PATH=\${PATH}:${GOROOT}"
|
||||
echo ""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue