diff options
Diffstat (limited to 'recipes-devtools/go-cross/go-cross.inc')
| -rw-r--r-- | recipes-devtools/go-cross/go-cross.inc | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/recipes-devtools/go-cross/go-cross.inc b/recipes-devtools/go-cross/go-cross.inc new file mode 100644 index 00000000..eea1b2ce --- /dev/null +++ b/recipes-devtools/go-cross/go-cross.inc | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | inherit cross | ||
| 2 | |||
| 3 | DEPENDS += "go-native" | ||
| 4 | |||
| 5 | export GOHOSTOS = "${BUILD_GOOS}" | ||
| 6 | export GOHOSTARCH = "${BUILD_GOARCH}" | ||
| 7 | export GOOS = "${TARGET_GOOS}" | ||
| 8 | export GOARCH = "${TARGET_GOARCH}" | ||
| 9 | export GOARM = "${TARGET_GOARM}" | ||
| 10 | export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" | ||
| 11 | export GOROOT_FINAL = "${libdir}/go" | ||
| 12 | export CGO_ENABLED = "1" | ||
| 13 | export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}" | ||
| 14 | export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}" | ||
| 15 | CC = "${@d.getVar('BUILD_CC', True).strip()}" | ||
| 16 | |||
| 17 | do_configure[noexec] = "1" | ||
| 18 | |||
| 19 | do_compile() { | ||
| 20 | export GOBIN="${B}/bin" | ||
| 21 | rm -rf ${GOBIN} ${B}/pkg | ||
| 22 | mkdir ${GOBIN} | ||
| 23 | cd src | ||
| 24 | ./make.bash --host-only | ||
| 25 | } | ||
| 26 | |||
| 27 | do_install() { | ||
| 28 | install -d ${D}${libdir}/go | ||
| 29 | cp -a ${B}/pkg ${D}${libdir}/go/ | ||
| 30 | install -d ${D}${libdir}/go/src | ||
| 31 | (cd ${S}/src; for d in *; do \ | ||
| 32 | [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \ | ||
| 33 | done) | ||
| 34 | install -d ${D}${bindir} | ||
| 35 | for f in ${B}/bin/* | ||
| 36 | do | ||
| 37 | install -m755 $f ${D}${bindir} | ||
| 38 | done | ||
| 39 | } | ||
| 40 | |||
| 41 | do_package[noexec] = "1" | ||
| 42 | do_packagedata[noexec] = "1" | ||
| 43 | do_package_write_ipk[noexec] = "1" | ||
| 44 | do_package_write_deb[noexec] = "1" | ||
| 45 | do_package_write_rpm[noexec] = "1" | ||
