diff options
| author | Amy Fong <amy.fong@windriver.com> | 2015-02-27 15:58:44 -0500 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2015-03-17 09:46:32 -0400 |
| commit | 898e1ecc1eeafff99dff8987bc424542786d7f3f (patch) | |
| tree | 614a22403a0420ed268b16041874ec07be0e5d78 /recipes-devtools/go | |
| parent | 055742a99e9161518f7318a5cd2df1e6d8d9072b (diff) | |
| download | meta-virtualization-898e1ecc1eeafff99dff8987bc424542786d7f3f.tar.gz | |
Add golang-cross
This package is derived from meta-golang:
https://github.com/digitallumens/meta-golang.git
commit 3fa6c8af6b4762de2f4e6740e327a5a71c29e6e1
In the meta-golang version, golang depends on a gcc-cross that causes
conflicts with our toolchain. So the golang-cross recipe was extracted
and then the following changes were made to work in wrlinux:
- our TARGET_ARCH is x86-64, golang-cross wants amd64
- in the former recipe, compile fails because it can't find header files
and libraries because --sysroot is dropped. So I redefined the target
cc and target cxx as cc and cxx at the start of the compile rule since
cc gets redefined in there somewhere.
Signed-off-by: Amy Fong <amy.fong@windriver.com>
Diffstat (limited to 'recipes-devtools/go')
| -rw-r--r-- | recipes-devtools/go/golang-1.3.inc | 4 | ||||
| -rw-r--r-- | recipes-devtools/go/golang-cross.inc | 56 | ||||
| -rw-r--r-- | recipes-devtools/go/golang-cross_1.3.bb | 3 |
3 files changed, 63 insertions, 0 deletions
diff --git a/recipes-devtools/go/golang-1.3.inc b/recipes-devtools/go/golang-1.3.inc new file mode 100644 index 00000000..5c507b45 --- /dev/null +++ b/recipes-devtools/go/golang-1.3.inc | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | LICENSE = "BSD" | ||
| 2 | LIC_FILES_CHKSUM = "file://LICENSE;md5=591778525c869cdde0ab5a1bf283cd81" | ||
| 3 | SRC_URI[md5sum] = "4b66d7249554181c314f139ea78920b1" | ||
| 4 | SRC_URI[sha256sum] = "eb983e6c5b2b9838f482c5442b1ac1856f610f2b21f3c123b3fedb48ffc35382" | ||
diff --git a/recipes-devtools/go/golang-cross.inc b/recipes-devtools/go/golang-cross.inc new file mode 100644 index 00000000..9330572d --- /dev/null +++ b/recipes-devtools/go/golang-cross.inc | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | DESCRIPTION = "Go Programming Language Cross Compiler." | ||
| 2 | HOMEPAGE = "golang.org" | ||
| 3 | # DEPENDS = "virtual/${TARGET_PREFIX}gcc libgcc" | ||
| 4 | DEPENDS = "libgcc" | ||
| 5 | PROVIDES = "virtual/${TARGET_PREFIX}golang" | ||
| 6 | SRC_URI = "http://golang.org/dl/go${PV}.src.tar.gz" | ||
| 7 | S="${WORKDIR}/go" | ||
| 8 | |||
| 9 | do_compile () { | ||
| 10 | export CC_FOR_TARGET="${CC}" | ||
| 11 | export CXX_FOR_TARGET="${CXX}" | ||
| 12 | # the above should set the right sysroot option, else...: | ||
| 13 | # export CGO_CFLAGS="--sysroot=${STAGING_DIR_HOST}" | ||
| 14 | # export CGO_LDFLAGS="--sysroot=${STAGING_DIR_HOST}" | ||
| 15 | |||
| 16 | export CC="${BUILD_CC}" | ||
| 17 | export GOROOT_FINAL="${libdir}/go" | ||
| 18 | export GOARCH="${TARGET_ARCH}" | ||
| 19 | |||
| 20 | # supported amd64, 386, arm | ||
| 21 | if [ "${TARGET_ARCH}" = "x86_64" ]; then | ||
| 22 | export GOARCH="amd64" | ||
| 23 | fi | ||
| 24 | |||
| 25 | if [ "${TARGET_ARCH}" = "arm" ] | ||
| 26 | then | ||
| 27 | if [ `echo ${TUNE_PKGARCH} | cut -c 1-7` = "cortexa" ] | ||
| 28 | then | ||
| 29 | echo GOARM 7 | ||
| 30 | export GOARM="7" | ||
| 31 | fi | ||
| 32 | fi | ||
| 33 | export GOOS="linux" | ||
| 34 | export GO_GCFLAGS="" | ||
| 35 | export GO_LDFLAGS="" | ||
| 36 | export GO_CCFLAGS="" | ||
| 37 | export CGO_ENABLED="1" | ||
| 38 | #export CC_FOR_TARGET="${TARGET_SYS}-gcc" | ||
| 39 | #export CXX_FOR_TARGET="${TARGET_SYS}-g++" | ||
| 40 | echo GOARCH ${GOARCH} | ||
| 41 | echo CC_FOR_TARGET ${CC_FOR_TARGET} | ||
| 42 | |||
| 43 | cd src | ||
| 44 | sh -x ./make.bash | ||
| 45 | } | ||
| 46 | |||
| 47 | do_install () { | ||
| 48 | # Install the executables into build system | ||
| 49 | mkdir -p ${D}${bindir} | ||
| 50 | cp -a bin/go ${D}${bindir}/ | ||
| 51 | mkdir -p ${D}${libdir}/go | ||
| 52 | cp -a pkg ${D}${libdir}/go/ | ||
| 53 | cp -a include ${D}${libdir}/go/ | ||
| 54 | cp -a api ${D}${libdir}/go/ | ||
| 55 | cp -a src ${D}${libdir}/go/ | ||
| 56 | } | ||
diff --git a/recipes-devtools/go/golang-cross_1.3.bb b/recipes-devtools/go/golang-cross_1.3.bb new file mode 100644 index 00000000..8813298d --- /dev/null +++ b/recipes-devtools/go/golang-cross_1.3.bb | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | inherit cross | ||
| 2 | require golang-cross.inc | ||
| 3 | require golang-${PV}.inc | ||
