Commit 41a6165c authored by Russ Cox's avatar Russ Cox

build: use go command during build

If something goes wrong, it should suffice to set
USE_GO_TOOL=false in env.bash to fall back to the
makefiles.  I will delete the makefiles in January.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5502047
parent fd1c1b96
#!/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
(echo '#!/bin/bash
# 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'
export WORK=$(mktemp -d -t go-build)
trap "rm -rf $WORK" EXIT SIGINT SIGTERM
set -e
'
go install -a -n cmd/go
)>$targ
chmod +x $targ
done
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -3,6 +3,10 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# Set to false if something breaks, to revert back to Makefiles.
# TODO: This variable will go away when the Makefiles do.
USE_GO_TOOL=${USE_GO_TOOL:-true}
# If set to a Windows-style path convert to an MSYS-Unix
# one using the built-in shell commands.
if [[ "$GOROOT" == *:* ]]; then
......
......@@ -85,10 +85,24 @@ do
done
echo; echo; echo %%%% making runtime generated files %%%%; echo
(cd "$GOROOT"/src/pkg/runtime; ./autogen.sh) || exit 1
echo; echo; echo %%%% making pkg %%%%; echo
gomake -C pkg install
(
cd "$GOROOT"/src/pkg/runtime
./autogen.sh
make install # copy runtime.h to pkg directory
) || exit 1
if $USE_GO_TOOL; then
echo
echo '# Building go command from bootstrap script.'
./buildscript_${GOOS}_$GOARCH.sh
echo '# Building Go code.'
GOPATH="" go install -a all
else
echo; echo; echo %%%% making pkg %%%%; echo
gomake -C pkg install
fi
# Print post-install messages.
# Implemented as a function so that all.bash can repeat the output
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment