summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/go.bbclass20
1 files changed, 20 insertions, 0 deletions
diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index 720a504cd8..f64b07fd82 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -1,11 +1,31 @@
1inherit goarch 1inherit goarch
2 2
3def get_go_parallel_make(d):
4 pm = (d.getVar('PARALLEL_MAKE') or '').split()
5 # look for '-j' and throw other options (e.g. '-l') away
6 # because they might have a different meaning in golang
7 while pm:
8 opt = pm.pop(0)
9 if opt == '-j':
10 v = pm.pop(0)
11 elif opt.startswith('-j'):
12 v = opt[2:].strip()
13 else:
14 continue
15
16 return '-p %d' % int(v)
17
18 return ""
19
20GO_PARALLEL_BUILD ?= "${@get_go_parallel_make(d)}"
21
3GOROOT_class-native = "${STAGING_LIBDIR_NATIVE}/go" 22GOROOT_class-native = "${STAGING_LIBDIR_NATIVE}/go"
4GOROOT = "${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go" 23GOROOT = "${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
5GOBIN_FINAL_class-native = "${GOROOT_FINAL}/bin" 24GOBIN_FINAL_class-native = "${GOROOT_FINAL}/bin"
6GOBIN_FINAL = "${GOROOT_FINAL}/${GO_BUILD_BINDIR}" 25GOBIN_FINAL = "${GOROOT_FINAL}/${GO_BUILD_BINDIR}"
7 26
8export GOBUILDFLAGS ?= "-v" 27export GOBUILDFLAGS ?= "-v"
28GOBUILDFLAGS_prepend_task-compile = "${GO_PARALLEL_BUILD} "
9 29
10export GOOS = "${TARGET_GOOS}" 30export GOOS = "${TARGET_GOOS}"
11export GOARCH = "${TARGET_GOARCH}" 31export GOARCH = "${TARGET_GOARCH}"