diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2015-01-09 21:18:04 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2015-01-09 21:18:04 +0000 |
commit | b44fb4c37a4697dfd50c37282c9d2ec2bd3aa95a (patch) | |
tree | e13cc5ba089f13152af01ecac6bf81494a320833 /libgo/go | |
parent | adfac8dfed7bfb048a933241598b003e40b4344c (diff) | |
download | gcc-b44fb4c37a4697dfd50c37282c9d2ec2bd3aa95a.zip gcc-b44fb4c37a4697dfd50c37282c9d2ec2bd3aa95a.tar.gz gcc-b44fb4c37a4697dfd50c37282c9d2ec2bd3aa95a.tar.bz2 |
cmd/go: Adjust finding gccgo to match current upstream sources.
From-SVN: r219406
Diffstat (limited to 'libgo/go')
-rw-r--r-- | libgo/go/cmd/go/build.go | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/libgo/go/cmd/go/build.go b/libgo/go/cmd/go/build.go index 8de7627..36216ce 100644 --- a/libgo/go/cmd/go/build.go +++ b/libgo/go/cmd/go/build.go @@ -1783,15 +1783,22 @@ func (gcToolchain) cc(b *builder, p *Package, objdir, ofile, cfile string) error // The Gccgo toolchain. type gccgoToolchain struct{} -func (gccgoToolchain) compiler() string { - if v := os.Getenv("GOC"); v != "" { - return v +var gccgoName, gccgoBin string + +func init() { + gccgoName = os.Getenv("GCCGO") + if gccgoName == "" { + gccgoName = defaultGCCGO } - return defaultGOC + gccgoBin, _ = exec.LookPath(gccgoName) +} + +func (gccgoToolchain) compiler() string { + return gccgoBin } -func (tools gccgoToolchain) linker() string { - return tools.compiler() +func (gccgoToolchain) linker() string { + return gccgoBin } func (tools gccgoToolchain) gc(b *builder, p *Package, archive, obj string, importArgs []string, gofiles []string) (ofile string, output []byte, err error) { |