mirror of
https://github.com/golang/go
synced 2024-11-24 18:20:02 -07:00
go: don't clobber command install paths
This fixes a regression that was made when adding support for building with gccgo (in d6a14e6fac0c). External commands (those not from the Go tree) were being installed to the package directory instead of the binary directory. R=golang-dev, rsc, adg, remyoudompheng, rsc CC=golang-dev https://golang.org/cl/5564072
This commit is contained in:
parent
6ebf8a6400
commit
d2599b431e
@ -279,17 +279,20 @@ func scanPackage(ctxt *build.Context, t *build.Tree, arg, importPath, dir string
|
|||||||
p.target += ".exe"
|
p.target += ".exe"
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
p.target = filepath.Join(t.PkgDir(), filepath.FromSlash(importPath)+".a")
|
|
||||||
}
|
|
||||||
|
|
||||||
// For gccgo, rewrite p.target with the expected library name. We won't do
|
|
||||||
// that for the standard library for the moment.
|
|
||||||
if !p.Standard {
|
|
||||||
dir := t.PkgDir()
|
dir := t.PkgDir()
|
||||||
|
// For gccgo, rewrite p.target with the expected library name.
|
||||||
if _, ok := buildToolchain.(gccgoToolchain); ok {
|
if _, ok := buildToolchain.(gccgoToolchain); ok {
|
||||||
dir = filepath.Join(filepath.Dir(dir), "gccgo", filepath.Base(dir))
|
dir = filepath.Join(filepath.Dir(dir), "gccgo", filepath.Base(dir))
|
||||||
}
|
}
|
||||||
p.target = buildToolchain.pkgpath(dir, p)
|
p.target = buildToolchain.pkgpath(dir, p)
|
||||||
|
|
||||||
|
// NB. Currently we have gccgo install the standard libraries
|
||||||
|
// in the "usual" location, where the Go toolchain puts them.
|
||||||
|
if p.Standard {
|
||||||
|
if _, ok := buildToolchain.(gccgoToolchain); ok {
|
||||||
|
p.target = goToolchain{}.pkgpath(dir, p)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var built time.Time
|
var built time.Time
|
||||||
|
Loading…
Reference in New Issue
Block a user