From b0a72cd343c9bdb38d01f6dbf0c5ac3d55c769dd Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Sun, 1 Jan 2017 22:21:19 +0000 Subject: go-osarchmap: Skip golang recipes for unsupported architectures Building any recipe for a mips-based machine like arduino-yun currently leads to errors in go_map_arch(). Instead, errors should only be raised if a recipe which uses golang is built. This is achieved using the same error handling seen in recipes-extended/xen. Signed-off-by: Paul Barker Signed-off-by: Bruce Ashfield --- classes/go-osarchmap.bbclass | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/go-osarchmap.bbclass b/classes/go-osarchmap.bbclass index 4e00c7bf..303b30ba 100644 --- a/classes/go-osarchmap.bbclass +++ b/classes/go-osarchmap.bbclass @@ -11,6 +11,11 @@ TARGET_GOARM = "${@go_map_arm(d.getVar('TARGET_ARCH', True), d.getVar('TUNE_FEAT TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}" GO_BUILD_BINDIR = "${@['bin/${HOST_GOTUPLE}','bin'][d.getVar('BUILD_GOTUPLE',True) == d.getVar('HOST_GOTUPLE',True)]}" +python() { + if d.getVar('TARGET_GOARCH') == 'INVALID': + raise bb.parse.SkipPackage('Cannot map `%s` to a go architecture' % d.getVar('TARGET_ARCH', True)) +} + def go_map_arch(a, d): import re if re.match('i.86', a): @@ -24,7 +29,7 @@ def go_map_arch(a, d): elif re.match('p(pc|owerpc)(|64)', a): return 'powerpc' else: - bb.error("cannot map '%s' to a Go architecture" % a) + return 'INVALID' def go_map_arm(a, f, d): import re -- cgit v1.2.3-54-g00ecf