diff options
author | Alex Kube <alexander.j.kube@gmail.com> | 2019-10-25 23:49:15 +0430 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-11-25 17:57:22 +0000 |
commit | d4aa1998364f2cac1419b442da4c39699e42391a (patch) | |
tree | 810b0f6a073feb954bbf0bfb1a50f780c8ad732c /meta/recipes-devtools/go/go-runtime.inc | |
parent | 0dd3a42c3d79ca63248fbbab6ba19dd42f11b03f (diff) | |
download | poky-d4aa1998364f2cac1419b442da4c39699e42391a.tar.gz |
go: Extract common environment setup.
Add default values for go environment variables to go-common.inc.
Override where appropriate in other go*.inc files, and use
host/target tuples from goarch for setting CC flags.
(From OE-Core rev: 1e3f040b1f68fa1f808851ecd9623544e935e9ad)
Signed-off-by: Alex Kube <alexander.j.kube@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/go/go-runtime.inc')
-rw-r--r-- | meta/recipes-devtools/go/go-runtime.inc | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/meta/recipes-devtools/go/go-runtime.inc b/meta/recipes-devtools/go/go-runtime.inc index 9731e164e9..21179a83a0 100644 --- a/meta/recipes-devtools/go/go-runtime.inc +++ b/meta/recipes-devtools/go/go-runtime.inc | |||
@@ -2,15 +2,6 @@ DEPENDS = "virtual/${TUNE_PKGARCH}-go go-native" | |||
2 | DEPENDS_class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk" | 2 | DEPENDS_class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk" |
3 | PROVIDES = "virtual/${TARGET_PREFIX}go-runtime" | 3 | PROVIDES = "virtual/${TARGET_PREFIX}go-runtime" |
4 | 4 | ||
5 | export GOHOSTOS = "${BUILD_GOOS}" | ||
6 | export GOHOSTARCH = "${BUILD_GOARCH}" | ||
7 | export GOOS = "${TARGET_GOOS}" | ||
8 | export GOARCH = "${TARGET_GOARCH}" | ||
9 | export GOARM = "${TARGET_GOARM}" | ||
10 | export GO386 = "${TARGET_GO386}" | ||
11 | export GOMIPS = "${TARGET_GOMIPS}" | ||
12 | export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" | ||
13 | export GOROOT_FINAL = "${libdir}/go" | ||
14 | export CGO_CFLAGS = "${CFLAGS}" | 5 | export CGO_CFLAGS = "${CFLAGS}" |
15 | export CGO_CPPFLAGS = "${CPPFLAGS}" | 6 | export CGO_CPPFLAGS = "${CPPFLAGS}" |
16 | export CGO_CXXFLAGS = "${CXXFLAGS}" | 7 | export CGO_CXXFLAGS = "${CXXFLAGS}" |
@@ -29,14 +20,14 @@ do_configure_libc-musl() { | |||
29 | } | 20 | } |
30 | 21 | ||
31 | do_compile() { | 22 | do_compile() { |
32 | export CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CC}" | 23 | export CC_FOR_${TARGET_GOTUPLE}="${CC}" |
33 | export CXX_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CXX}" | 24 | export CXX_FOR_${TARGET_GOTUPLE}="${CXX}" |
34 | 25 | ||
35 | cd src | 26 | cd src |
36 | ./make.bash --target-only --no-banner std | 27 | ./make.bash --target-only --no-banner std |
37 | if [ -n "${GO_DYNLINK}" ]; then | 28 | if [ -n "${GO_DYNLINK}" ]; then |
38 | export GOTOOLDIR="${B}/pkg/tool/native_native" | 29 | export GOTOOLDIR="${B}/pkg/tool/native_native" |
39 | CC="$CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}" GOARCH="${TARGET_GOARCH}" GOOS="${TARGET_GOOS}" GOROOT=${B} \ | 30 | CC="$CC_FOR_${TARGET_GOTUPLE}" GOARCH="${TARGET_GOARCH}" GOOS="${TARGET_GOOS}" GOROOT=${B} \ |
40 | $GOTOOLDIR/go_bootstrap install -linkshared -buildmode=shared ${GO_SHLIB_LDFLAGS} std | 31 | $GOTOOLDIR/go_bootstrap install -linkshared -buildmode=shared ${GO_SHLIB_LDFLAGS} std |
41 | fi | 32 | fi |
42 | cd ${B} | 33 | cd ${B} |