]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cgo: document CGO_LDFLAGS and CGO_CFLAGS
authorRuss Cox <rsc@golang.org>
Wed, 7 Mar 2012 16:44:47 +0000 (11:44 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 7 Mar 2012 16:44:47 +0000 (11:44 -0500)
Fixes #3203.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5769043

src/cmd/cgo/doc.go

index 109b666bdc953d4dacec50af49fec35e2337c892..2c261b5f459113cbfa6053e5084b0aa056c83583 100644 (file)
@@ -44,6 +44,11 @@ For example:
        // #include <png.h>
        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.