1
0
mirror of https://github.com/golang/go synced 2024-10-04 09:21:21 -06:00
go/src/cmd/gc/mkbuiltin
Russ Cox 30f2799f88 disable "any" except during canned imports.
new flag -A enables it during mkbuiltin.
avoids mysterious errors in programs
that refer to any accidentally.

R=ken
OCL=30763
CL=30763
2009-06-25 16:22:46 -07:00

41 lines
963 B
Bash
Executable File

#!/bin/sh
# Copyright 2009 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
. $GOROOT/src/Make.$GOARCH
if [ -z "$GC" ]; then
echo 'missing $GC - maybe no Make.$GOARCH?' 1>&2
exit 1
fi
gcc -o mkbuiltin1 mkbuiltin1.c
rm -f _builtin.c
for i in sys unsafe
do
$GC -A $i.go
./mkbuiltin1 $i >>_builtin.c
done
# If _builtin.c has changed vs builtin.c.boot,
# check in the new change if being run by
# one of the people who tends to work on
# the compiler. This makes sure that changes
# don't get forgotten, without causing problems
# in end user Go repositories.
case "$USER" in
ken | r | rsc)
if ! cmp _builtin.c builtin.c.boot >/dev/null 2>/dev/null
then
PATH=$PATH:/usr/local/bin # find p4 on OS X
p4 open builtin.c.boot >/dev/null 2>/dev/null || true # if p4 is missing, so be it
cp _builtin.c builtin.c.boot
fi
esac
cat _builtin.c
rm -f _builtin.c