summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/go/go-target.inc
diff options
context:
space:
mode:
authorMatt Madison <matt@madison.systems>2017-09-12 09:50:26 -0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-09-12 23:55:29 +0100
commit242318fa2879c11d7b727eeada2e84087a0cecbc (patch)
tree9fe158e9575e75c923cf4aaac6b50d28b18a3730 /meta/recipes-devtools/go/go-target.inc
parent4c6ce2b64763e0f586f198c03644befa55017396 (diff)
downloadpoky-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.inc51
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 @@
1inherit goarch
2DEPENDS = "virtual/${TARGET_PREFIX}go go-native"
3
4export GOHOSTOS = "${BUILD_GOOS}"
5export GOHOSTARCH = "${BUILD_GOARCH}"
6export GOOS = "${TARGET_GOOS}"
7export GOARCH = "${TARGET_GOARCH}"
8export GOARM = "${TARGET_GOARM}"
9export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
10export GOROOT_FINAL = "${libdir}/go"
11export CGO_ENABLED = "1"
12export CC_FOR_TARGET = "${CC}"
13export CXX_FOR_TARGET = "${CXX}"
14export GO_TARGET_INSTALL = "cmd"
15export GO_FLAGS = "-a"
16
17do_configure[noexec] = "1"
18
19do_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
33do_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
47PACKAGES = "${PN} ${PN}-dev"
48FILES_${PN} = "${libdir}/go/bin ${libdir}/go/pkg/tool/${TARGET_GOTUPLE} ${bindir}"
49FILES_${PN}-dev = "${libdir}/go"
50RDEPENDS_${PN}-dev = "perl bash"
51INSANE_SKIP_${PN} = "ldflags"