aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/dist
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/dist')
-rw-r--r--src/cmd/dist/build.go37
1 files changed, 33 insertions, 4 deletions
diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
index ba09ce9a7b..4dfaf83ef7 100644
--- a/src/cmd/dist/build.go
+++ b/src/cmd/dist/build.go
@@ -976,12 +976,41 @@ func packagefile(pkg string) string {
return pathf("%s/pkg/%s_%s/%s.a", goroot, goos, goarch, pkg)
}
+// unixOS is the set of GOOS values matched by the "unix" build tag.
+// This is the same list as in go/build/syslist.go.
+var unixOS = map[string]bool{
+ "aix": true,
+ "android": true,
+ "darwin": true,
+ "dragonfly": true,
+ "freebsd": true,
+ "hurd": true,
+ "illumos": true,
+ "ios": true,
+ "linux": true,
+ "netbsd": true,
+ "openbsd": true,
+ "solaris": true,
+}
+
// matchtag reports whether the tag matches this build.
func matchtag(tag string) bool {
- return tag == "gc" || tag == goos || tag == goarch || tag == "cmd_go_bootstrap" || tag == "go1.1" ||
- (goos == "android" && tag == "linux") ||
- (goos == "illumos" && tag == "solaris") ||
- (goos == "ios" && tag == "darwin")
+ switch tag {
+ case "gc", "cmd_go_bootstrap", "go1.1":
+ return true
+ case "linux":
+ return goos == "linux" || goos == "android"
+ case "solaris":
+ return goos == "solaris" || goos == "illumos"
+ case "darwin":
+ return goos == "darwin" || goos == "ios"
+ case goos, goarch:
+ return true
+ case "unix":
+ return unixOS[goos]
+ default:
+ return false
+ }
}
// shouldbuild reports whether we should build this file.