Reviewers: golang-dev_googlegroups.com,
Message:
Hello golang-dev@googlegroups.com,
I'd like you to review this change to
https://go.googlecode.com/hg/
Description:
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 runtime/cgo does not compile, debian/kFreeBSD users should
export CGO_ENABLED=0 to disable cgo.
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
Please review this at https://codereview.appspot.com/6868046/
Affected files:
M src/cmd/dist/unix.c
Index: src/cmd/dist/unix.c
===================================================================
--- a/src/cmd/dist/unix.c
+++ b/src/cmd/dist/unix.c
@@ -670,6 +670,10 @@
gohostos = "linux";
#elif defined(__FreeBSD__)
gohostos = "freebsd";
+#elif defined(__FreeBSD_kernel__)
+ // detect debian/kFreeBSD.
+ //
http://wiki.debian.org/Debian_GNU/kFreeBSD_FAQ#Q._How_do_I_detect_kfreebsd_with_preprocessor_directives_in_a_C_program.3F
+ gohostos = "freebsd";
#elif defined(__OpenBSD__)
gohostos = "openbsd";
#elif defined(__NetBSD__)