diff options
| author | Matt Madison <matt@madison.systems> | 2017-09-12 09:50:26 -0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-09-12 23:55:29 +0100 |
| commit | 242318fa2879c11d7b727eeada2e84087a0cecbc (patch) | |
| tree | 9fe158e9575e75c923cf4aaac6b50d28b18a3730 /meta/recipes-devtools/go/go-target.inc | |
| parent | 4c6ce2b64763e0f586f198c03644befa55017396 (diff) | |
| download | poky-242318fa2879c11d7b727eeada2e84087a0cecbc.tar.gz | |
go: rename go.inc -> go-target.inc
to make it clearer that it is only used for building
the toolchain for the target.
(From OE-Core rev: 780aa334f8614c80ce5b9cb77b0cea2fcd482614)
Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/go/go-target.inc')
| -rw-r--r-- | meta/recipes-devtools/go/go-target.inc | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/meta/recipes-devtools/go/go-target.inc b/meta/recipes-devtools/go/go-target.inc new file mode 100644 index 0000000000..5984a60c28 --- /dev/null +++ b/meta/recipes-devtools/go/go-target.inc | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | inherit goarch | ||
| 2 | DEPENDS = "virtual/${TARGET_PREFIX}go go-native" | ||
| 3 | |||
| 4 | export GOHOSTOS = "${BUILD_GOOS}" | ||
| 5 | export GOHOSTARCH = "${BUILD_GOARCH}" | ||
| 6 | export GOOS = "${TARGET_GOOS}" | ||
| 7 | export GOARCH = "${TARGET_GOARCH}" | ||
| 8 | export GOARM = "${TARGET_GOARM}" | ||
| 9 | export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" | ||
| 10 | export GOROOT_FINAL = "${libdir}/go" | ||
| 11 | export CGO_ENABLED = "1" | ||
| 12 | export CC_FOR_TARGET = "${CC}" | ||
| 13 | export CXX_FOR_TARGET = "${CXX}" | ||
| 14 | export GO_TARGET_INSTALL = "cmd" | ||
| 15 | export GO_FLAGS = "-a" | ||
| 16 | |||
| 17 | do_configure[noexec] = "1" | ||
| 18 | |||
| 19 | do_compile() { | ||
| 20 | export GOBIN="${B}/bin" | ||
| 21 | export CC="${@d.getVar('BUILD_CC', True).strip()}" | ||
| 22 | rm -rf ${GOBIN} ${B}/pkg | ||
| 23 | mkdir ${GOBIN} | ||
| 24 | |||
| 25 | export TMPDIR=${WORKDIR}/build-tmp | ||
| 26 | mkdir -p ${WORKDIR}/build-tmp | ||
| 27 | |||
| 28 | cd src | ||
| 29 | ./make.bash | ||
| 30 | cd ${B} | ||
| 31 | } | ||
| 32 | |||
| 33 | do_install() { | ||
| 34 | install -d ${D}${libdir}/go/pkg/tool | ||
| 35 | cp --preserve=mode,timestamps -R ${B}/pkg/tool/${TARGET_GOTUPLE} ${D}${libdir}/go/pkg/tool/ | ||
| 36 | install -d ${D}${libdir}/go/src | ||
| 37 | cp --preserve=mode,timestamps -R ${S}/src/cmd ${D}${libdir}/go/src/ | ||
| 38 | install -d ${D}${libdir}/go/bin | ||
| 39 | install -d ${D}${bindir} | ||
| 40 | for f in ${B}/${GO_BUILD_BINDIR}/*; do | ||
| 41 | name=`basename $f` | ||
| 42 | install -m 0755 $f ${D}${libdir}/go/bin/ | ||
| 43 | ln -sf ../${BASELIB}/go/bin/$name ${D}${bindir}/ | ||
| 44 | done | ||
| 45 | } | ||
| 46 | |||
| 47 | PACKAGES = "${PN} ${PN}-dev" | ||
| 48 | FILES_${PN} = "${libdir}/go/bin ${libdir}/go/pkg/tool/${TARGET_GOTUPLE} ${bindir}" | ||
| 49 | FILES_${PN}-dev = "${libdir}/go" | ||
| 50 | RDEPENDS_${PN}-dev = "perl bash" | ||
| 51 | INSANE_SKIP_${PN} = "ldflags" | ||
