From c861012e9c6babbefc60bb3b031f96559f99844a Mon Sep 17 00:00:00 2001 From: Amy Fong Date: Tue, 6 Oct 2015 14:41:14 -0400 Subject: docker: fix paths for cross compile Some of the cgo variables were pointing to host paths and not target Fix install rules - binaries can be installed to a subdirectory. Signed-off-by: Amy Fong Signed-off-by: Bruce Ashfield --- recipes-containers/docker/docker_git.bb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'recipes-containers/docker') diff --git a/recipes-containers/docker/docker_git.bb b/recipes-containers/docker/docker_git.bb index 69c45ae3..080e5743 100644 --- a/recipes-containers/docker/docker_git.bb +++ b/recipes-containers/docker/docker_git.bb @@ -84,10 +84,12 @@ do_compile() { export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" cd - + export CGO_ENABLED="1" + # Pass the needed cflags/ldflags so that cgo # can find the needed headers files and libraries - export CGO_CFLAGS="${BUILD_CFLAGS}" - export CGO_LDFLAGS="${BUILD_LDFLAGS}" + export CGO_CFLAGS="${BUILDSDK_CFLAGS}" + export CGO_LDFLAGS="${BUILDSDK_LDFLAGS}" # this is the unsupported built structure # that doesn't rely on an existing docker @@ -125,7 +127,11 @@ do_install() { install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init fi - cp ${S}/vendor/bin/nsinit ${D}/${bindir} + if [ -d ${S}/vendor/bin/linux_* ]; then + cp ${S}/vendor/bin/linux_*/* ${D}/${bindir} + else + cp ${S}/vendor/bin/* ${D}/${bindir} + fi mkdir -p ${D}/usr/share/docker/ cp ${WORKDIR}/hi.Dockerfile ${D}/usr/share/docker/ -- cgit v1.2.3-54-g00ecf