From 2307ad473adbfc75d7b56ea34232717459737b63 Mon Sep 17 00:00:00 2001 From: Fathi Boudra Date: Tue, 20 Dec 2016 11:25:34 +0200 Subject: docker: use a switch to set GOARCH based on TARGET_ARCH value It allows to: * easily extend future architecture added/supported * tune arm architecture and set GOARM as appropriate Signed-off-by: Fathi Boudra Signed-off-by: Bruce Ashfield --- recipes-containers/docker/docker_git.bb | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/recipes-containers/docker/docker_git.bb b/recipes-containers/docker/docker_git.bb index 2d27c628..7b12ec24 100644 --- a/recipes-containers/docker/docker_git.bb +++ b/recipes-containers/docker/docker_git.bb @@ -64,14 +64,29 @@ DOCKER_PKG="github.com/docker/docker" do_configure[noexec] = "1" do_compile() { - export GOARCH="${TARGET_ARCH}" - # supported amd64, 386, arm arm64 - if [ "${TARGET_ARCH}" = "x86_64" ]; then - export GOARCH="amd64" - fi - if [ "${TARGET_ARCH}" = "aarch64" ]; then - export GOARCH="arm64" - fi + case "${TARGET_ARCH}" in + arm) + GOARCH=arm + case "${TUNE_PKGARCH}" in + cortexa*) + export GOARM=7 + ;; + esac + ;; + aarch64) + GOARCH=arm64 + ;; + i586|i686) + GOARCH=386 + ;; + x86_64) + GOARCH=amd64 + ;; + *) + GOARCH="${TARGET_ARCH}" + ;; + esac + export GOARCH # Set GOPATH. See 'PACKAGERS.md'. Don't rely on # docker to download its dependencies but rather -- cgit v1.2.3-54-g00ecf