diff options
Diffstat (limited to 'meta/recipes-devtools/go/go-cross-canadian.inc')
-rw-r--r-- | meta/recipes-devtools/go/go-cross-canadian.inc | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/meta/recipes-devtools/go/go-cross-canadian.inc b/meta/recipes-devtools/go/go-cross-canadian.inc index 8afda6b2ce..e22914e7aa 100644 --- a/meta/recipes-devtools/go/go-cross-canadian.inc +++ b/meta/recipes-devtools/go/go-cross-canadian.inc | |||
@@ -7,34 +7,33 @@ PN = "go-cross-canadian-${TRANSLATED_TARGET_ARCH}" | |||
7 | 7 | ||
8 | export GOHOSTOS = "${BUILD_GOOS}" | 8 | export GOHOSTOS = "${BUILD_GOOS}" |
9 | export GOHOSTARCH = "${BUILD_GOARCH}" | 9 | export GOHOSTARCH = "${BUILD_GOARCH}" |
10 | export GOHOSTOS_CROSS = "${HOST_GOOS}" | ||
11 | export GOHOSTARCH_CROSS = "${HOST_GOARCH}" | ||
12 | export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" | 10 | export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" |
13 | export GOTOOLDIR_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/${HOST_SYS}/go/pkg/tool/${BUILD_GOTUPLE}" | 11 | export GOTOOLDIR_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/${HOST_SYS}/go/pkg/tool/${BUILD_GOTUPLE}" |
14 | export GOROOT_FINAL = "${libdir}/go" | 12 | export GOROOT_FINAL = "${libdir}/go" |
15 | export CGO_ENABLED = "1" | 13 | export CGO_ENABLED = "1" |
16 | export CC_FOR_TARGET = "${TARGET_PREFIX}gcc" | 14 | export GOCACHE = "off" |
17 | export CXX_FOR_TARGET = "${TARGET_PREFIX}g++" | 15 | export GOTMPDIR ?= "${WORKDIR}/go-tmp" |
18 | CC = "${HOST_PREFIX}gcc" | 16 | GOTMPDIR[vardepvalue] = "" |
19 | export CGO_CFLAGS = "--sysroot=${STAGING_DIR_TARGET} ${HOST_CC_ARCH} ${CFLAGS}" | 17 | export CGO_CFLAGS = "${CFLAGS}" |
20 | export CGO_LDFLAGS = "--sysroot=${STAGING_DIR_TARGET} ${HOST_CC_ARCH} ${LDFLAGS}" | 18 | export CGO_LDFLAGS = "${LDFLAGS}" |
21 | export GO_LDFLAGS = '-linkmode external -extld ${HOST_PREFIX}gcc -extldflags "--sysroot=${STAGING_DIR_TARGET} ${HOST_CC_ARCH} ${LDFLAGS}"' | 19 | export GO_LDFLAGS = '-linkmode external -extld ${HOST_PREFIX}gcc -extldflags "--sysroot=${STAGING_DIR_HOST} ${HOST_CC_ARCH} ${LDFLAGS}"' |
22 | 20 | ||
23 | do_configure[noexec] = "1" | 21 | do_configure[noexec] = "1" |
24 | 22 | ||
25 | do_compile() { | 23 | do_compile() { |
26 | export GOBIN="${B}/bin" | 24 | export CC_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gcc --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}" |
27 | rm -rf ${GOBIN} ${B}/pkg | 25 | export CXX_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gxx --sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}" |
28 | mkdir ${GOBIN} | ||
29 | cd src | 26 | cd src |
30 | ./make.bash --host-only --no-banner | 27 | ./make.bash --host-only --no-banner |
31 | cd ${B} | 28 | cd ${B} |
32 | } | 29 | } |
30 | do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg" | ||
31 | do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg" | ||
33 | 32 | ||
34 | 33 | ||
35 | make_wrapper() { | 34 | make_wrapper() { |
36 | rm -f ${D}${bindir}/$2 | 35 | rm -f ${D}${bindir}/$2 |
37 | cat <<END >${D}${bindir}/$2 | 36 | cat <<END >${D}${bindir}/$2 |
38 | #!/bin/sh | 37 | #!/bin/sh |
39 | here=\`dirname \$0\` | 38 | here=\`dirname \$0\` |
40 | native_goroot=\`readlink -f \$here/../../lib/${TARGET_SYS}/go\` | 39 | native_goroot=\`readlink -f \$here/../../lib/${TARGET_SYS}/go\` |
@@ -46,7 +45,7 @@ export GOTOOLDIR="\$native_goroot/pkg/tool/${HOST_GOTUPLE}" | |||
46 | test -n "\$GOROOT" || export GOROOT="\$OECORE_TARGET_SYSROOT/${target_libdir}/go" | 45 | test -n "\$GOROOT" || export GOROOT="\$OECORE_TARGET_SYSROOT/${target_libdir}/go" |
47 | \$here/../../lib/${TARGET_SYS}/go/bin/$1 "\$@" | 46 | \$here/../../lib/${TARGET_SYS}/go/bin/$1 "\$@" |
48 | END | 47 | END |
49 | chmod +x ${D}${bindir}/$2 | 48 | chmod +x ${D}${bindir}/$2 |
50 | } | 49 | } |
51 | 50 | ||
52 | do_install() { | 51 | do_install() { |