summaryrefslogtreecommitdiff
path: root/src/make.bash
diff options
context:
space:
mode:
authorDave Cheney <dave@cheney.net>2012-12-04 08:27:30 +1100
committerDave Cheney <dave@cheney.net>2012-12-04 08:27:30 +1100
commit8037fc14045d7156ad47c9def0cb71e342c008e7 (patch)
tree898fec4b2fc528ae23e72ccf8caaf37009247480 /src/make.bash
parent6abda09e535a51b5e50137a065247978e4c39900 (diff)
downloadgo-8037fc14045d7156ad47c9def0cb71e342c008e7.tar.gz
cmd/dist: support building on debian/kFreeBSD
The debian/kFreeBSD project uses the FreeBSD kernel and the debian userspace. From our point of view, this is freebsd not linux as GOOS talks about the kernel syscall interface, not the userspace (although cgo alters that). As debian/kFreeBSD is experimental at this time, I do not think it is worth the effort of duplicating all the freebsd specific code so this is proposal represents a reasonable workaround. Currently cgo is not supported, make.bash will detect this and disable cgo automatically during the build. dfc@debian:~/go/src$ uname -a GNU/kFreeBSD debian 8.1-1-686 #0 Sat Jul 21 17:02:04 UTC 2012 i686 i386 Intel(R) Core(TM) i5-2415M CPU @ 2.30GHz GNU/kFreeBSD dfc@debian:~/go/src$ ../bin/go version go version devel +d05272f402ec Sat Dec 01 15:15:14 2012 -0800 Tested with GOOS=freebsd GOARCH=386 R=golang-dev CC=golang-dev https://codereview.appspot.com/6868046
Diffstat (limited to 'src/make.bash')
-rwxr-xr-xsrc/make.bash7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/make.bash b/src/make.bash
index b2de37b72..1190b93ff 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -77,6 +77,13 @@ do
fi
done
+# Test for debian/kFreeBSD.
+# cmd/dist will detect kFreeBSD as freebsd/$GOARCH, but we need to
+# disable cgo manually.
+if [ "$(uname -s)" == "GNU/kFreeBSD" ]; then
+ export CGO_ENABLED=0
+fi
+
# Clean old generated file that will cause problems in the build.
rm -f ./pkg/runtime/runtime_defs.go