]> Cypherpunks repositories - gostls13.git/commit
go/build: add variable expansion to cgo lines
authorCarlos Castillo <cookieo9@gmail.com>
Mon, 8 Dec 2014 15:28:40 +0000 (07:28 -0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 23 Dec 2014 20:35:49 +0000 (20:35 +0000)
commit131758183f7dc2610af489da3a7fcc4d30c6bc48
tree06df2cf7288d217af8d642d69aa599a3fc9a6443
parent108dbd0dc759181ac31513a855d1e77c5df37d9d
go/build: add variable expansion to cgo lines

When go parses #cgo lines, expand ${SRCDIR} into the path to the
source directory. This allows options to be passed to the
compiler and linker that involve file paths relative to the
source code directory. Without the expansion the paths would be
invalid when the current working directory changes.

Fixes #7891
Fixes #5428

Change-Id: I343a145a9771a5ccbaa958e4a1ecd1716fcae52d
Reviewed-on: https://go-review.googlesource.com/1756
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/cgo/doc.go
src/go/build/build.go
src/go/build/build_test.go