Commit 0ae6084f authored by Shenghou Ma's avatar Shenghou Ma Committed by Russ Cox

build: do not build all C compilers

        In order to allow buildscript.sh to generate buildscripts for all
        $GOOS/$GOARCH combinations, we have to generate dummy files for cmd/go.
        Fixes #2586.

R=rsc, golang-dev
CC=golang-dev
https://golang.org/cl/5557050
parent 37d2f819
......@@ -8,12 +8,9 @@ all: install
# Only build tools for current architecture, and only tools written in C.
# The tools written in Go are managed by ../pkg/Makefile.
# We need all the C compilers for rebuilding generated files in runtime.
DIRS=\
$(O)a\
5c\
6c\
8c\
$(O)c\
$(O)g\
$(O)l\
cc\
......
......@@ -29,6 +29,10 @@ cat <<'EOF'
// AUTO-GENERATED by autogen.sh; DO NOT EDIT
EOF
if [ ! -x "${GOBIN:=$GOROOT/bin}/$CC" ]; then
echo "// dummy file for cmd/go to correctly generate buildscript"
exit
fi
case "$GOARCH" in
386)
......@@ -110,7 +114,7 @@ arm)
esac
echo
$CC $CFLAGS -a proc.c |
$GOBIN/$CC $CFLAGS -a proc.c |
awk '
{ gsub(/\r/, ""); }
/^aggr G$/ { aggr="g" }
......
......@@ -27,7 +27,14 @@ 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 "${GOBIN:=$GOROOT/bin}/$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
......@@ -35,7 +42,7 @@ var _ unsafe.Pointer
EOF
for i in "$@"; do
$CC $CFLAGS -q $i
$GOBIN/$CC $CFLAGS -q $i
done | awk '
/^func/ { next }
/^const/ { next }
......
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