summaryrefslogtreecommitdiff
path: root/src/make.bash
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2012-03-26 16:50:58 +0200
committerOndřej Surý <ondrej@sury.org>2012-03-26 16:50:58 +0200
commit519725bb3c075ee2462c929f5997cb068e18466a (patch)
tree5b162e8488ad147a645048c073577821b4a2bee9 /src/make.bash
parent842623c5dd2819d980ca9c58048d6bc6ed82475f (diff)
downloadgolang-upstream-weekly/2012.03.22.tar.gz
Imported Upstream version 2012.03.22upstream-weekly/2012.03.22
Diffstat (limited to 'src/make.bash')
-rwxr-xr-xsrc/make.bash19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/make.bash b/src/make.bash
index aaee75e46..b2de37b72 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -21,10 +21,11 @@
# building the packages and commands.
#
# GO_LDFLAGS: Additional 5l/6l/8l arguments to use when
-# building the packages and commands.
+# building the commands.
#
-# CGO_ENABLED: Setting this to 0 disables the use of cgo
-# in the built and installed packages and tools.
+# CGO_ENABLED: Controls cgo usage during the build. Set it to 1
+# to include all cgo related files, .c and .go file with "cgo"
+# build directive, in the build. Set it to 0 to ignore them.
set -e
if [ ! -f run.bash ]; then
@@ -76,6 +77,9 @@ do
fi
done
+# Clean old generated file that will cause problems in the build.
+rm -f ./pkg/runtime/runtime_defs.go
+
# Finally! Run the build.
echo '# Building C bootstrap tool.'
@@ -83,7 +87,14 @@ echo cmd/dist
export GOROOT="$(cd .. && pwd)"
GOROOT_FINAL="${GOROOT_FINAL:-$GOROOT}"
DEFGOROOT='-DGOROOT_FINAL="'"$GOROOT_FINAL"'"'
-gcc -O2 -Wall -Werror -ggdb -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c
+
+mflag=""
+case "$GOHOSTARCH" in
+386) mflag=-m32;;
+amd64) mflag=-m64;;
+esac
+gcc $mflag -O2 -Wall -Werror -ggdb -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c
+
eval $(./cmd/dist/dist env -p)
echo