unix: emit +build comments in generator scripts

Change-Id: I8ed64dcb1c1a2119ce6f15fa1be55fbe0b0c637e
Reviewed-on: https://go-review.googlesource.com/10087
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
This commit is contained in:
Ian Lance Taylor
2015-05-15 01:18:51 +00:00
parent 8bcc2dbee4
commit 85f6155b9e
11 changed files with 71 additions and 1 deletions
+7
View File
@@ -63,6 +63,11 @@ if($ARGV[0] =~ /^-/) {
exit 1;
}
if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") {
print STDERR "GOARCH or GOOS not defined in environment\n";
exit 1;
}
sub parseparamlist($) {
my ($list) = @_;
$list =~ s/^\s*//;
@@ -302,6 +307,8 @@ print <<EOF;
// $cmdline
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// +build $ENV{'GOARCH'},$ENV{'GOOS'}
package unix
import (