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
@@ -11,6 +11,11 @@ unset LANG
export LC_ALL=C
export LC_CTYPE=C
if test -z "$GOARCH" -o -z "$GOOS"; then
echo 1>&2 "GOARCH or GOOS not defined in environment"
exit 1
fi
CC=${CC:-gcc}
uname=$(uname)
@@ -347,6 +352,8 @@ echo '#include <signal.h>' | $CC -x c - -E -dM $ccflags |
echo '// mkerrors.sh' "$@"
echo '// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT'
echo
echo "// +build ${GOARCH},${GOOS}"
echo
go tool cgo -godefs -- "$@" _const.go >_error.out
cat _error.out | grep -vf _error.grep | grep -vf _signal.grep
echo