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:54:06 +0000 |
commit | 1e3f040b1f68fa1f808851ecd9623544e935e9ad (patch) | |
tree | 9e71dc12f2e6cbefc26579fa5afcb0f6e662be42 /meta/recipes-devtools/go/go-runtime.inc | |
parent | 2b76e904a5f7d6479974a179d6d17d6ee9af94e7 (diff) | |
download | openembedded-core-contrib-1e3f040b1f68fa1f808851ecd9623544e935e9ad.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.
Signed-off-by: Alex Kube <alexander.j.kube@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
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" DEPENDS_class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk" PROVIDES = "virtual/${TARGET_PREFIX}go-runtime" -export GOHOSTOS = "${BUILD_GOOS}" -export GOHOSTARCH = "${BUILD_GOARCH}" -export GOOS = "${TARGET_GOOS}" -export GOARCH = "${TARGET_GOARCH}" -export GOARM = "${TARGET_GOARM}" -export GO386 = "${TARGET_GO386}" -export GOMIPS = "${TARGET_GOMIPS}" -export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" -export GOROOT_FINAL = "${libdir}/go" export CGO_CFLAGS = "${CFLAGS}" export CGO_CPPFLAGS = "${CPPFLAGS}" export CGO_CXXFLAGS = "${CXXFLAGS}" @@ -29,14 +20,14 @@ do_configure_libc-musl() { } do_compile() { - export CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CC}" - export CXX_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CXX}" + export CC_FOR_${TARGET_GOTUPLE}="${CC}" + export CXX_FOR_${TARGET_GOTUPLE}="${CXX}" cd src ./make.bash --target-only --no-banner std if [ -n "${GO_DYNLINK}" ]; then export GOTOOLDIR="${B}/pkg/tool/native_native" - CC="$CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}" GOARCH="${TARGET_GOARCH}" GOOS="${TARGET_GOOS}" GOROOT=${B} \ + CC="$CC_FOR_${TARGET_GOTUPLE}" GOARCH="${TARGET_GOARCH}" GOOS="${TARGET_GOOS}" GOROOT=${B} \ $GOTOOLDIR/go_bootstrap install -linkshared -buildmode=shared ${GO_SHLIB_LDFLAGS} std fi cd ${B} |