2011-12-20 14:50:13 -07:00
|
|
|
#!/bin/sh
|
|
|
|
# Copyright 2011 The Go Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style
|
|
|
|
# license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
. ./buildinfo.sh
|
|
|
|
|
|
|
|
for sys in $GOOSARCHES
|
|
|
|
do
|
|
|
|
export GOOS=$(echo $sys | sed 's/_.*//')
|
|
|
|
export GOARCH=$(echo $sys | sed 's/.*_//')
|
|
|
|
targ=buildscript_${GOOS}_$GOARCH.sh
|
|
|
|
rm -f $targ
|
|
|
|
|
2011-12-20 19:11:55 -07:00
|
|
|
(echo '#!/usr/bin/env bash
|
2011-12-20 14:50:13 -07:00
|
|
|
# AUTO-GENERATED by buildscript.sh; DO NOT EDIT.
|
|
|
|
# This script builds the go command (written in Go),
|
|
|
|
# and then the go command can build the rest of the tree.
|
|
|
|
|
|
|
|
export GOOS='$GOOS'
|
|
|
|
export GOARCH='$GOARCH'
|
2011-12-20 15:11:16 -07:00
|
|
|
export WORK=$(mktemp -d -t go-build.XXXXXX)
|
2011-12-20 14:50:13 -07:00
|
|
|
trap "rm -rf $WORK" EXIT SIGINT SIGTERM
|
|
|
|
set -e
|
|
|
|
|
|
|
|
'
|
2011-12-21 13:58:05 -07:00
|
|
|
# Save script printed by go install but make shell safe
|
|
|
|
# by quoting variable expansions. On Windows, rewrite
|
|
|
|
# \ paths into / paths. This avoids the \ being interpreted
|
|
|
|
# as a shell escape but also makes sure that we generate the
|
|
|
|
# same scripts on Unix and Windows systems.
|
|
|
|
go install -a -n cmd/go | sed '
|
|
|
|
s/$GOBIN/"$GOBIN"/g
|
|
|
|
s/$GOROOT/"$GOROOT"/g
|
|
|
|
s/$WORK/"$WORK"/g
|
|
|
|
s;\\;/;g
|
|
|
|
'
|
2011-12-20 14:50:13 -07:00
|
|
|
)>$targ
|
|
|
|
chmod +x $targ
|
|
|
|
done
|