dev-lang/go: add support for cross-compiling
There are a few quirks with Go to deal with when cross-compiling:
- Since DEPEND cannot distinguish cross-architecture dependencies the
current ebuild cannot keyword all architectures it supports. This
could be resolved in the future with a special use flag or other
clever trick to drop go-bootstrap from DEPEND for cross builds.
- GOHOST* and CC variables are CBUILD values.
- GO* and *_FOR_TARGET variables are CHOST values.
- Go can always be used as a cross-compiler so handling the
CHOST!=CTARGET case isn't strictly required. We could provide a
pre-built copy of the std library for CTARGET's architecture but I'm
not sure if that would be useful or not. For now the ebuild just
doesn't allow that case.
- Note from WilliamH: I made some small style changes to this commit.
This is for bug #558216.