summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/go-cross/go-cross.inc
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/go-cross/go-cross.inc')
-rw-r--r--recipes-devtools/go-cross/go-cross.inc64
1 files changed, 0 insertions, 64 deletions
diff --git a/recipes-devtools/go-cross/go-cross.inc b/recipes-devtools/go-cross/go-cross.inc
deleted file mode 100644
index a7117bcd..00000000
--- a/recipes-devtools/go-cross/go-cross.inc
+++ /dev/null
@@ -1,64 +0,0 @@
1inherit cross
2
3# Produces target arch specific code so we should reflect this in the PN
4PN = "go-cross-${TARGET_ARCH}"
5
6# libgcc is required for the target specific libraries to build properly
7DEPENDS += "go-initial-native libgcc virtual/${TARGET_PREFIX}gcc"
8
9do_compile[depends] += "go-initial-native:do_populate_sysroot"
10
11# Prevent runstrip from running because you get errors when the host arch != target arch
12#INHIBIT_PACKAGE_STRIP = "1"
13STRIP = "echo"
14
15export GOHOSTOS = "${BUILD_GOOS}"
16export GOHOSTARCH = "${BUILD_GOARCH}"
17export GOOS = "${TARGET_GOOS}"
18export GOARCH = "${TARGET_GOARCH}"
19export GOARM = "${TARGET_GOARM}"
20export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
21export GOROOT_FINAL = "${libdir}/go"
22export CGO_ENABLED = "1"
23export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
24export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
25CC = "${@d.getVar('BUILD_CC').strip()}"
26
27do_configure[noexec] = "1"
28
29do_compile() {
30 export GOBIN="${B}/bin"
31 rm -rf ${GOBIN} ${B}/pkg
32 mkdir ${GOBIN}
33
34 export TMPDIR=${WORKDIR}/build-tmp
35 mkdir -p ${WORKDIR}/build-tmp
36
37 cd src
38 ./make.bash --host-only
39 # Ensure cgo.a is built with the target toolchain
40 export GOBIN="${B}/target/bin"
41 rm -rf ${GOBIN}
42 mkdir -p ${GOBIN}
43 GO_FLAGS="-a" ./make.bash
44}
45
46do_install() {
47 install -d ${D}${libdir}/go
48 cp -a ${B}/pkg ${D}${libdir}/go/
49 install -d ${D}${libdir}/go/src
50 (cd ${S}/src; for d in *; do \
51 [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \
52 done)
53 install -d ${D}${bindir}
54 for f in ${B}/bin/*
55 do
56 install -m755 $f ${D}${bindir}
57 done
58}
59
60do_package[noexec] = "1"
61do_packagedata[noexec] = "1"
62do_package_write_ipk[noexec] = "1"
63do_package_write_deb[noexec] = "1"
64do_package_write_rpm[noexec] = "1"