Commit 961f96b5 authored by Russ Cox's avatar Russ Cox

build: delete buildscripts, runtime scripts

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5620059
parent 82905368
#!/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 '#!/usr/bin/env 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.XXXXXX)
trap "rm -rf $WORK" EXIT SIGINT SIGTERM
set -e
'
# 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 -t cmd_go_bootstrap cmd/go | sed '
s;\\;/;g
s;\$GOBIN/[a-z0-9]*_[a-z0-9]*/;\$GOBIN/;g
s/\$GOBIN/"$GOBIN"/g
s/\$GOROOT/"$GOROOT"/g
s/\$WORK/"$WORK"/g
s;"\$GOBIN"/go;&_bootstrap;g
s;"\$GOBIN"/tool;"$GOROOT"/bin/tool;g
s; \./; ;g
'
)>$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.
#!/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.
# This script generates the various derived files involved in
# building package runtime.
#
# autogen.sh rebuilds everything
# autogen.sh -clean deletes the generated files
. ../../buildinfo.sh
HELPERS="goc2c mkversion"
rm -f $HELPERS z*
if [ "$1" = "-clean" ]; then
exit 0
fi
set -e
if [ "$GOROOT" = "" ]; then
echo "$0"': $GOROOT must be set' >&2
exit 2
fi
# Use goc2c to translate .goc files into arch-specific .c files.
"$GOROOT"/bin/tool/quietgcc -o goc2c -I "$GOROOT/include" goc2c.c "$GOROOT/lib/lib9.a"
for file in *.goc
do
for arch in $GOARCHES
do
base=$(echo $file | sed 's/\.goc$//')
GOARCH=$arch ./goc2c $file >z.tmp
mv -f z.tmp z${base}_$arch.c
done
done
# Version constants.
"$GOROOT"/bin/tool/quietgcc -o mkversion -I "$GOROOT/include" mkversion.c "$GOROOT/lib/lib9.a"
GOROOT="$GOROOT_FINAL" ./mkversion >z.tmp
mv z.tmp zversion.go
for arch in $GOARCHES
do
(
echo '// AUTO-GENERATED by autogen.sh; DO NOT EDIT'
echo
echo 'package runtime'
echo
echo 'const theGoarch = "'$arch'"'
) >zgoarch_$arch.go
done
for os in $GOOSES
do
(
echo '// AUTO-GENERATED by autogen.sh; DO NOT EDIT'
echo
echo 'package runtime'
echo
echo 'const theGoos = "'$os'"'
) >zgoos_$os.go
done
# Definitions of runtime structs, translated from C to Go.
for osarch in $GOOSARCHES
do
./mkgodefs.sh $osarch proc.c iface.c hashmap.c chan.c >z.tmp
mv -f z.tmp zruntime_defs_$osarch.go
done
# Struct field offsets, for use by assembly files.
for osarch in $GOOSARCHES
do
./mkasmh.sh $osarch proc.c defs.h >z.tmp
mv -f z.tmp zasm_$osarch.h
done
rm -f $HELPERS
#!/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.
set -e
SYS=$1
export GOOS=$(echo $SYS | sed 's/_.*//')
export GOARCH=$(echo $SYS | sed 's/.*_//')
shift
case "$GOARCH" in
386) CC=8c;;
amd64) CC=6c;;
arm) CC=5c;;
esac
CC="$GOROOT/bin/tool/$CC"
export CC
export CFLAGS="-DGOOS_$GOOS -DGOARCH_$GOARCH"
cp arch_$GOARCH.h arch_GOARCH.h
cp defs_${GOOS}_$GOARCH.h defs_GOOS_GOARCH.h
cp os_$GOOS.h os_GOOS.h
cp signals_$GOOS.h signals_GOOS.h
cat <<EOF
// Go definitions for C variables and types.
// AUTO-GENERATED by autogen.sh; DO NOT EDIT
EOF
if [ ! -x "$CC" ]; then
echo "// dummy file for cmd/go to correctly generate buildscript"
echo "package runtime"
exit
fi
cat <<EOF
package runtime
import "unsafe"
var _ unsafe.Pointer
EOF
for i in "$@"; do
"$CC" $CFLAGS -q $i
done | awk '
/^func/ { next }
/^const/ { next }
/^\/\/.*type/ { next }
/^(const|func|type|var) / {
if(seen[$2]++) {
skip = /{[^}]*$/;
next;
}
}
skip {
skip = !/^}/
next;
}
{print}
'
rm -f arch_GOARCH.h defs_GOOS_GOARCH.h os_GOOS.h signals_GOOS.h
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