1
0
mirror of https://github.com/golang/go synced 2024-11-18 08:44:43 -07:00

cmd/go: change Package.Shlib to be the absolute path of the shared library

Makes little difference internally but makes go list output more useful.

Change-Id: I1fa1f839107de08818427382b2aef8dc4d765b36
Reviewed-on: https://go-review.googlesource.com/10192
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Michael Hudson-Doyle 2015-05-18 13:03:22 +12:00 committed by Ian Lance Taylor
parent 7eec656bfd
commit ae3e3610d5
2 changed files with 4 additions and 3 deletions

View File

@ -782,8 +782,8 @@ func (b *builder) action1(mode buildMode, depMode buildMode, p *Package, looksha
b.actionCache[key] = a
return a
}
pkgs := readpkglist(filepath.Join(p.build.PkgTargetRoot, shlib))
a = b.libaction(shlib, pkgs, modeInstall, depMode)
pkgs := readpkglist(shlib)
a = b.libaction(filepath.Base(shlib), pkgs, modeInstall, depMode)
b.actionCache[key2] = a
b.actionCache[key] = a
return a

View File

@ -536,7 +536,8 @@ func (p *Package) load(stk *importStack, bp *build.Package, err error) *Package
shlibnamefile := p.target[:len(p.target)-2] + ".shlibname"
shlib, err := ioutil.ReadFile(shlibnamefile)
if err == nil {
p.Shlib = strings.TrimSpace(string(shlib))
libname := strings.TrimSpace(string(shlib))
p.Shlib = filepath.Join(p.build.PkgTargetRoot, libname)
} else if !os.IsNotExist(err) {
fatalf("unexpected error reading %s: %v", shlibnamefile, err)
}