summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2019-08-07 09:14:43 +0800
committerBruce Ashfield <bruce.ashfield@gmail.com>2019-08-12 11:03:01 -0400
commit7de381880415b20aba3a0840207e9983af489421 (patch)
tree25a8567ff1f16a69ff2184dc063ec58e3c3e47df
parentb19add379e21f7d7ae0b01d1e5e329f916fd4eb2 (diff)
downloadmeta-virtualization-7de381880415b20aba3a0840207e9983af489421.tar.gz
kubernetes: clean up environment settings in do_compile
There are unnessary and incorrect settings like GOOS and GOROOT. There are also redundant settings like GOPATH, CGO_CFLAGS, etc, whose latter setting will cover the previous one. So clean all these up. Also, remove the comment which suggests settings GOVERSION to "1.10%", as it's no longer valid for current OE. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-containers/kubernetes/kubernetes_git.bb36
1 files changed, 12 insertions, 24 deletions
diff --git a/recipes-containers/kubernetes/kubernetes_git.bb b/recipes-containers/kubernetes/kubernetes_git.bb
index 5b4c3a91..0aa7c009 100644
--- a/recipes-containers/kubernetes/kubernetes_git.bb
+++ b/recipes-containers/kubernetes/kubernetes_git.bb
@@ -5,8 +5,6 @@ applications across multiple hosts, providing basic mechanisms for deployment, \
5maintenance, and scaling of applications. \ 5maintenance, and scaling of applications. \
6" 6"
7 7
8# Note: 1.11+ requires go 1.10.2+, so the following must be set
9# in your configuration: GOVERSION = "1.10%"
10PV = "v1.16.0-alpha+git${SRCREV_kubernetes}" 8PV = "v1.16.0-alpha+git${SRCREV_kubernetes}"
11SRCREV_kubernetes = "7054e3ead7e1a00ca6ac3ec47ea355b76061a35a" 9SRCREV_kubernetes = "7054e3ead7e1a00ca6ac3ec47ea355b76061a35a"
12 10
@@ -31,39 +29,29 @@ inherit goarch
31COMPATIBLE_HOST = '(x86_64.*|arm.*|aarch64.*)-linux' 29COMPATIBLE_HOST = '(x86_64.*|arm.*|aarch64.*)-linux'
32 30
33do_compile() { 31do_compile() {
34 export GOARCH="${TARGET_GOARCH}"
35 export GOOS="${TARGET_GOOS}"
36 export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
37 export GOPATH="${S}/src/import:${S}/src/import/vendor"
38
39 # Pass the needed cflags/ldflags so that cgo
40 # can find the needed headers files and libraries
41 export CGO_ENABLED="1"
42 export CFLAGS=""
43 export LDFLAGS=""
44 export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
45 export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
46
47 # link fixups for compilation 32 # link fixups for compilation
48 rm -f ${S}/src/import/vendor/src 33 rm -f ${S}/src/import/vendor/src
49 ln -sf ./ ${S}/src/import/vendor/src 34 ln -sf ./ ${S}/src/import/vendor/src
50 35
51 export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" 36 export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
52 export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go"
53
54 # Pass the needed cflags/ldflags so that cgo
55 # can find the needed headers files and libraries
56 export CGO_ENABLED="1"
57 export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
58 export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
59
60 cd ${S}/src/import 37 cd ${S}/src/import
38
61 # Build the host tools first, using the host compiler 39 # Build the host tools first, using the host compiler
62 export GOARCH="${BUILD_GOARCH}" 40 export GOARCH="${BUILD_GOARCH}"
41 # Pass the needed cflags/ldflags so that cgo can find the needed headers files and libraries
42 export CGO_ENABLED="1"
43 export CFLAGS=""
44 export LDFLAGS=""
45 export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
46 export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
63 make generated_files KUBE_BUILD_PLATFORMS="${HOST_GOOS}/${BUILD_GOARCH}" 47 make generated_files KUBE_BUILD_PLATFORMS="${HOST_GOOS}/${BUILD_GOARCH}"
64 48
65 # Reset GOARCH to the target one 49 # Build the target binaries
66 export GOARCH="${TARGET_GOARCH}" 50 export GOARCH="${TARGET_GOARCH}"
51 # Pass the needed cflags/ldflags so that cgo can find the needed headers files and libraries
52 export CGO_ENABLED="1"
53 export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
54 export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
67 # to limit what is built, use 'WHAT', i.e. make WHAT=cmd/kubelet 55 # to limit what is built, use 'WHAT', i.e. make WHAT=cmd/kubelet
68 make cross KUBE_BUILD_PLATFORMS=${GOOS}/${GOARCH} 56 make cross KUBE_BUILD_PLATFORMS=${GOOS}/${GOARCH}
69} 57}