diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2017-06-14 13:50:53 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2017-06-14 13:50:53 +0000 |
commit | b205ec303fc93ba64c0991f64a44e7773f68c38a (patch) | |
tree | 8c270b890417dda1279a930faebc79f52f967dca /libgo/go | |
parent | 0818233f800920bf4d5c384718b6fb328bba81fe (diff) | |
download | gcc-b205ec303fc93ba64c0991f64a44e7773f68c38a.zip gcc-b205ec303fc93ba64c0991f64a44e7773f68c38a.tar.gz gcc-b205ec303fc93ba64c0991f64a44e7773f68c38a.tar.bz2 |
go/build: use GCCGOTOOLDIR to find gccgo tools
Add the environment variable GCCGOTOOLDIR to permit overriding the default
directory where tools like cgo are found when building with gccgo.
This will be used by the cmd/go tests in a future CL.
Reviewed-on: https://go-review.googlesource.com/45694
From-SVN: r249196
Diffstat (limited to 'libgo/go')
-rw-r--r-- | libgo/go/cmd/go/alldocs.go | 3 | ||||
-rw-r--r-- | libgo/go/cmd/go/help.go | 3 | ||||
-rw-r--r-- | libgo/go/go/build/build.go | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/libgo/go/cmd/go/alldocs.go b/libgo/go/cmd/go/alldocs.go index 3d5dd2b..f946bf6 100644 --- a/libgo/go/cmd/go/alldocs.go +++ b/libgo/go/cmd/go/alldocs.go @@ -1143,6 +1143,9 @@ // Defined by Git. A colon-separated list of schemes that are allowed to be used // with git fetch/clone. If set, any scheme not explicitly mentioned will be // considered insecure by 'go get'. +// GCCGOTOOLDIR +// If set, where to find gccgo tools, such as cgo. +// The default is based on how gccgo was configured. // // // Import path syntax diff --git a/libgo/go/cmd/go/help.go b/libgo/go/cmd/go/help.go index 0c663ad..6b7422c9 100644 --- a/libgo/go/cmd/go/help.go +++ b/libgo/go/cmd/go/help.go @@ -508,6 +508,9 @@ Special-purpose environment variables: Defined by Git. A colon-separated list of schemes that are allowed to be used with git fetch/clone. If set, any scheme not explicitly mentioned will be considered insecure by 'go get'. + GCCGOTOOLDIR + If set, where to find gccgo tools, such as cgo. + The default is based on how gccgo was configured. `, } diff --git a/libgo/go/go/build/build.go b/libgo/go/go/build/build.go index 4e1b29f..cce5d48 100644 --- a/libgo/go/go/build/build.go +++ b/libgo/go/go/build/build.go @@ -1549,7 +1549,7 @@ func init() { func getToolDir() string { if runtime.Compiler == "gccgo" { - return runtime.GCCGOTOOLDIR + return envOr("GCCGOTOOLDIR", runtime.GCCGOTOOLDIR) } else { return filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH) } |