cmd/dist: support goos,goarch build tags

This is necessary to submit netpoll for linux,386 linux,amd64

R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/7470050
This commit is contained in:
Dmitriy Vyukov 2013-03-14 19:04:47 +04:00
parent f84d5dd475
commit 4dd1b8999a
1 changed files with 10 additions and 1 deletions

11
src/cmd/dist/build.c vendored
View File

@ -1046,7 +1046,16 @@ out:
static bool
matchfield(char *f)
{
return streq(f, goos) || streq(f, goarch) || streq(f, "cmd_go_bootstrap") || streq(f, "go1.1");
char *p;
bool res;
p = xstrrchr(f, ',');
if(p == nil)
return streq(f, goos) || streq(f, goarch) || streq(f, "cmd_go_bootstrap") || streq(f, "go1.1");
*p = 0;
res = matchfield(f) && matchfield(p+1);
*p = ',';
return res;
}
// shouldbuild reports whether we should build this file.