meta-virtualization/recipes-devtools/go/golang-cross.inc
Amy Fong 0682e9edcb golang-cross: do_compile fails on warnings treated as error
On glibc 2.20+, the _BSD_SOURCE and _SVID_SOURCE feature test macros are
deprecated as of glibc 2.19.90 (2.20 devel), we define _DEFAULT_SOURCE
instead.

(fixed upstream)
https://groups.google.com/forum/#!topic/golang-codereviews/S4TARFCxu2k

Signed-off-by: Amy Fong <amy.fong@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2015-06-19 15:31:34 -04:00

61 lines
1.4 KiB
PHP

DESCRIPTION = "Go Programming Language Cross Compiler."
HOMEPAGE = "golang.org"
# DEPENDS = "virtual/${TARGET_PREFIX}gcc libgcc"
DEPENDS = "libgcc"
PROVIDES = "virtual/${TARGET_PREFIX}golang"
SRC_URI = "\
http://golang.org/dl/go${PV}.src.tar.gz \
file://bsd_svid_source.patch \
"
S="${WORKDIR}/go"
do_compile () {
export CC_FOR_TARGET="${CC}"
export CXX_FOR_TARGET="${CXX}"
# the above should set the right sysroot option, else...:
# export CGO_CFLAGS="--sysroot=${STAGING_DIR_HOST}"
# export CGO_LDFLAGS="--sysroot=${STAGING_DIR_HOST}"
export CC="${BUILD_CC}"
export GOROOT_FINAL="${libdir}/go"
export GOARCH="${TARGET_ARCH}"
# supported amd64, 386, arm
if [ "${TARGET_ARCH}" = "x86_64" ]; then
export GOARCH="amd64"
fi
if [ "${TARGET_ARCH}" = "arm" ]
then
if [ `echo ${TUNE_PKGARCH} | cut -c 1-7` = "cortexa" ]
then
echo GOARM 7
export GOARM="7"
fi
fi
export GOOS="linux"
export GO_GCFLAGS=""
export GO_LDFLAGS=""
export GO_CCFLAGS=""
export CGO_ENABLED="1"
#export CC_FOR_TARGET="${TARGET_SYS}-gcc"
#export CXX_FOR_TARGET="${TARGET_SYS}-g++"
echo GOARCH ${GOARCH}
echo CC_FOR_TARGET ${CC_FOR_TARGET}
cd src
sh -x ./make.bash
}
do_install () {
# Install the executables into build system
mkdir -p ${D}${bindir}
cp -a bin/go ${D}${bindir}/
mkdir -p ${D}${libdir}/go
cp -a pkg ${D}${libdir}/go/
cp -a include ${D}${libdir}/go/
cp -a api ${D}${libdir}/go/
cp -a src ${D}${libdir}/go/
}