Skip to content

Commit

Permalink
Merge pull request moovweb#116 from tianon/go1.4-cross
Browse files Browse the repository at this point in the history
Fix "gvm cross" for Go 1.4
  • Loading branch information
gregorygtseng committed Feb 4, 2015
2 parents c6850e2 + ece4351 commit 670008e
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions scripts/cross
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ if [ ! -f "$GOROOT/pkg/tool/cross" ]; then
display_message "Installing x86, x86-64, and ARM commands"
set -e
for arch in 8 6 5; do
for cmd in a c g l; do
go tool dist install -v cmd/$arch$cmd ||
display_fatal "Couldn't compile tool: $arch$cmd"
done
for cmd in a c g l; do
go tool dist install -v cmd/$arch$cmd ||
display_fatal "Couldn't compile tool: $arch$cmd"
done
done
touch "$GOROOT/pkg/tool/cross"
fi
Expand All @@ -44,11 +44,17 @@ export GOARCH=$1
if [ ! -d "$GOROOT/pkg/${GOOS}_${GOARCH}" ]; then
display_message "Installing $GOOS $GOARCH runtime library"
if [ "$GOOS" = "windows" ]; then
export CGO_ENABLED=0
export CGO_ENABLED=0
fi

cd "$GOROOT/src"
go tool dist install -v pkg/runtime ||
if [ -d pkg/runtime ]; then
runtime='pkg/runtime'
else
# Go 1.4 moved pkg/ up a level
runtime='runtime'
fi
go tool dist install -v "$runtime" ||
display_fatal "Couldn't compile runtime library for $GOOS $GOARCH"
go install -v -a std ||
display_fatal "Install runtime library for $GOOS $GOARCH"
Expand Down

0 comments on commit 670008e

Please sign in to comment.