Commit 991c85a7 authored by Joel Sing's avatar Joel Sing Committed by Tobias Klauser

cmd/dist: sort gohostos switch entries

Sort gohostos switch entries for readability/maintainability.

Change-Id: I565b0aee33e8463502faa68eaceea6f7dccca66b
Reviewed-on: https://go-review.googlesource.com/c/go/+/154379
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarTobias Klauser <tobias.klauser@gmail.com>
parent 916e861f
...@@ -56,6 +56,9 @@ func main() { ...@@ -56,6 +56,9 @@ func main() {
gohostos = runtime.GOOS gohostos = runtime.GOOS
switch gohostos { switch gohostos {
case "aix":
// uname -m doesn't work under AIX
gohostarch = "ppc64"
case "darwin": case "darwin":
// Even on 64-bit platform, darwin uname -m prints i386. // Even on 64-bit platform, darwin uname -m prints i386.
// We don't support any of the OS X versions that run on 32-bit-only hardware anymore. // We don't support any of the OS X versions that run on 32-bit-only hardware anymore.
...@@ -72,6 +75,11 @@ func main() { ...@@ -72,6 +75,11 @@ func main() {
if runtime.GOARCH == "arm" { if runtime.GOARCH == "arm" {
defaultclang = true defaultclang = true
} }
case "plan9":
gohostarch = os.Getenv("objtype")
if gohostarch == "" {
fatalf("$objtype is unset")
}
case "solaris": case "solaris":
// Even on 64-bit platform, solaris uname -m prints i86pc. // Even on 64-bit platform, solaris uname -m prints i86pc.
out := run("", CheckExit, "isainfo", "-n") out := run("", CheckExit, "isainfo", "-n")
...@@ -81,16 +89,8 @@ func main() { ...@@ -81,16 +89,8 @@ func main() {
if strings.Contains(out, "i386") { if strings.Contains(out, "i386") {
gohostarch = "386" gohostarch = "386"
} }
case "plan9":
gohostarch = os.Getenv("objtype")
if gohostarch == "" {
fatalf("$objtype is unset")
}
case "windows": case "windows":
exe = ".exe" exe = ".exe"
case "aix":
// uname -m doesn't work under AIX
gohostarch = "ppc64"
} }
sysinit() sysinit()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment