diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2017-09-08 18:04:36 -0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-09-11 17:30:30 +0100 |
commit | 7a7f0e846f46c4067be63f9f72e61380f32050ac (patch) | |
tree | dffd700d39caf5cbc09a467d120d2d40d2ae18b9 | |
parent | 8738f2bfb6a4a3eb97a3c6e0a07c554fabad3052 (diff) | |
download | poky-7a7f0e846f46c4067be63f9f72e61380f32050ac.tar.gz |
go.bbclass: Use a global Go build flags
We now use a GOBUILDFLAGS to provide a global variable to control the
build flags to be given to Go.
This change is based on the meta-golang[1] layer. Thanks to Matt
Madison <matt@madison.systems> for his work on this.
1. https://github.com/madisongh/meta-golang
(From OE-Core rev: d6b8e7e94ba6dae44907c5a65bc0bdf0ccebdb15)
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/go.bbclass | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass index e073cb91b5..720a504cd8 100644 --- a/meta/classes/go.bbclass +++ b/meta/classes/go.bbclass | |||
@@ -5,6 +5,8 @@ GOROOT = "${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go" | |||
5 | GOBIN_FINAL_class-native = "${GOROOT_FINAL}/bin" | 5 | GOBIN_FINAL_class-native = "${GOROOT_FINAL}/bin" |
6 | GOBIN_FINAL = "${GOROOT_FINAL}/${GO_BUILD_BINDIR}" | 6 | GOBIN_FINAL = "${GOROOT_FINAL}/${GO_BUILD_BINDIR}" |
7 | 7 | ||
8 | export GOBUILDFLAGS ?= "-v" | ||
9 | |||
8 | export GOOS = "${TARGET_GOOS}" | 10 | export GOOS = "${TARGET_GOOS}" |
9 | export GOARCH = "${TARGET_GOARCH}" | 11 | export GOARCH = "${TARGET_GOARCH}" |
10 | export GOARM = "${TARGET_GOARM}" | 12 | export GOARM = "${TARGET_GOARM}" |
@@ -32,7 +34,7 @@ GO_INSTALL ?= "${GO_IMPORT}/..." | |||
32 | do_go_compile() { | 34 | do_go_compile() { |
33 | GOPATH=${S}:${STAGING_LIBDIR}/${TARGET_SYS}/go go env | 35 | GOPATH=${S}:${STAGING_LIBDIR}/${TARGET_SYS}/go go env |
34 | if [ -n "${GO_INSTALL}" ]; then | 36 | if [ -n "${GO_INSTALL}" ]; then |
35 | GOPATH=${S}:${STAGING_LIBDIR}/${TARGET_SYS}/go go install -v ${GO_INSTALL} | 37 | GOPATH=${S}:${STAGING_LIBDIR}/${TARGET_SYS}/go go install ${GOBUILDFLAGS} ${GO_INSTALL} |
36 | fi | 38 | fi |
37 | } | 39 | } |
38 | 40 | ||