From: Russ Cox Date: Wed, 7 Mar 2012 16:44:47 +0000 (-0500) Subject: cmd/cgo: document CGO_LDFLAGS and CGO_CFLAGS X-Git-Tag: weekly.2012-03-13~136 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f4b40d92c812fa71d67a967ef8a813a7dcdf4dd4;p=gostls13.git cmd/cgo: document CGO_LDFLAGS and CGO_CFLAGS Fixes #3203. R=golang-dev, gri CC=golang-dev https://golang.org/cl/5769043 --- diff --git a/src/cmd/cgo/doc.go b/src/cmd/cgo/doc.go index 109b666bdc..2c261b5f45 100644 --- a/src/cmd/cgo/doc.go +++ b/src/cmd/cgo/doc.go @@ -44,6 +44,11 @@ For example: // #include import "C" +The CGO_CFLAGS and CGO_LDFLAGS environment variables are added +to the flags derived from these directives. Package-specific flags should +be set using the directives, not the environment variables, so that builds +work in unmodified environments. + Within the Go file, C identifiers or field names that are keywords in Go can be accessed by prefixing them with an underscore: if x points at a C struct with a field named "type", x._type accesses the field.