diff options
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/go/go-crosssdk.inc | 55 | ||||
-rw-r--r-- | meta/recipes-devtools/go/go-crosssdk_1.8.bb | 2 |
2 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-devtools/go/go-crosssdk.inc b/meta/recipes-devtools/go/go-crosssdk.inc new file mode 100644 index 0000000000..e9bc677131 --- /dev/null +++ b/meta/recipes-devtools/go/go-crosssdk.inc | |||
@@ -0,0 +1,55 @@ | |||
1 | inherit crosssdk | ||
2 | |||
3 | DEPENDS = "go-native virtual/${TARGET_PREFIX}gcc-crosssdk virtual/nativesdk-${TARGET_PREFIX}compilerlibs virtual/${TARGET_PREFIX}binutils-crosssdk" | ||
4 | PN = "go-crosssdk-${TARGET_ARCH}" | ||
5 | PROVIDES = "virtual/${TARGET_PREFIX}go-crosssdk" | ||
6 | |||
7 | export GOHOSTOS = "${BUILD_GOOS}" | ||
8 | export GOHOSTARCH = "${BUILD_GOARCH}" | ||
9 | export GOOS = "${TARGET_GOOS}" | ||
10 | export GOARCH = "${TARGET_GOARCH}" | ||
11 | export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" | ||
12 | export GOROOT_FINAL = "${libdir}/go" | ||
13 | export CGO_ENABLED = "1" | ||
14 | export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}" | ||
15 | export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}" | ||
16 | CC = "${@d.getVar('BUILD_CC', True).strip()}" | ||
17 | |||
18 | do_configure[noexec] = "1" | ||
19 | |||
20 | do_compile() { | ||
21 | export GOBIN="${B}/bin" | ||
22 | rm -rf ${GOBIN} ${B}/pkg | ||
23 | mkdir ${GOBIN} | ||
24 | cd src | ||
25 | ./make.bash --host-only | ||
26 | cd ${B} | ||
27 | } | ||
28 | |||
29 | make_wrapper() { | ||
30 | rm -f ${D}${bindir}/$2 | ||
31 | cat <<END >${D}${bindir}/$2 | ||
32 | #!/bin/bash | ||
33 | here=\`dirname \$0\` | ||
34 | export GOARCH="${TARGET_GOARCH}" | ||
35 | export GOOS="${TARGET_GOOS}" | ||
36 | \$here/../../lib/${CROSS_TARGET_SYS_DIR}/go/bin/$1 "\$@" | ||
37 | END | ||
38 | chmod +x ${D}${bindir}/$2 | ||
39 | } | ||
40 | |||
41 | do_install() { | ||
42 | install -d ${D}${libdir}/go | ||
43 | install -d ${D}${libdir}/go/bin | ||
44 | install -d ${D}${libdir}/go/pkg/tool | ||
45 | install -d ${D}${bindir} | ||
46 | cp --preserve=mode,timestamps -R ${S}/pkg/tool/${TARGET_GOTUPLE} ${D}${libdir}/go/pkg/tool/ | ||
47 | for f in ${B}/${GO_BUILD_BINDIR}/* | ||
48 | do | ||
49 | base=`basename $f` | ||
50 | install -m755 $f ${D}${libdir}/go/bin | ||
51 | make_wrapper $base ${TARGET_PREFIX}$base | ||
52 | done | ||
53 | } | ||
54 | |||
55 | FILES_${PN}-staticdev = "${libdir}/go/pkg" | ||
diff --git a/meta/recipes-devtools/go/go-crosssdk_1.8.bb b/meta/recipes-devtools/go/go-crosssdk_1.8.bb new file mode 100644 index 0000000000..1857c8a577 --- /dev/null +++ b/meta/recipes-devtools/go/go-crosssdk_1.8.bb | |||
@@ -0,0 +1,2 @@ | |||
1 | require go-crosssdk.inc | ||
2 | require go-${PV}.inc | ||