From: Jeff Hodges Date: Mon, 6 Feb 2012 16:26:15 +0000 (-0500) Subject: cmd/go: pass env CGO_CFLAGS to cgo X-Git-Tag: weekly.2012-02-07~40 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=eac86fd3f0edb3a82d51c3ced90a73fd17e22d81;p=gostls13.git cmd/go: pass env CGO_CFLAGS to cgo Passing the CGO_CFLAGS to cgo is required to make alternative include directories work when building a cgo project. R=rsc CC=golang-dev https://golang.org/cl/5635048 --- diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go index f6f8de5606..0956a35eae 100644 --- a/src/cmd/go/build.go +++ b/src/cmd/go/build.go @@ -1183,7 +1183,7 @@ func (b *builder) cgo(p *Package, cgoExe, obj string, gccfiles []string) (outGo, if _, ok := buildToolchain.(gccgoToolchain); ok { cgoflags = append(cgoflags, "-gccgo") } - if err := b.run(p.Dir, p.ImportPath, cgoExe, "-objdir", obj, cgoflags, "--", p.CgoFiles); err != nil { + if err := b.run(p.Dir, p.ImportPath, cgoExe, "-objdir", obj, cgoflags, "--", cgoCFLAGS, p.CgoFiles); err != nil { return nil, nil, err } outGo = append(outGo, gofiles...)