]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: pass env CGO_CFLAGS to cgo
authorJeff Hodges <jeff@somethingsimilar.com>
Mon, 6 Feb 2012 16:26:15 +0000 (11:26 -0500)
committerRuss Cox <rsc@golang.org>
Mon, 6 Feb 2012 16:26:15 +0000 (11:26 -0500)
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

src/cmd/go/build.go

index f6f8de56061e89b3d164df5b6acf28315c59cdf4..0956a35eae9183a890cfcc73a9556066c034caeb 100644 (file)
@@ -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...)