summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorMartin Kelly <mkelly@xevo.com>2018-06-04 16:06:00 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-06-07 08:52:55 +0100
commitaa497e057b27e580a1d280a4d99311f6309c3d55 (patch)
tree3eb54457088f9a1cf1425f835d5334370f76ea74 /meta
parent27f593ebd271f8d4146a1b56c1b8b8879c946dfd (diff)
downloadpoky-aa497e057b27e580a1d280a4d99311f6309c3d55.tar.gz
toolchain-scripts: pass env to post-relocate
It's useful for the post-relocate scripts to be able to see the SDK environment, for example to see the values of CC, CXX etc. in order to dynamically generate toolchain files. To enable this, source the SDK environment script prior to calling the relocate scripts. (From OE-Core rev: adcf69ee3310171580c28e141fec6997b1f06da4) Signed-off-by: Martin Kelly <mkelly@xevo.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/toolchain-scripts.bbclass20
-rw-r--r--meta/recipes-core/meta/meta-environment.bb2
2 files changed, 17 insertions, 5 deletions
diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
index 779cc3f5e4..0ff5301530 100644
--- a/meta/classes/toolchain-scripts.bbclass
+++ b/meta/classes/toolchain-scripts.bbclass
@@ -118,11 +118,23 @@ EOF
118} 118}
119 119
120toolchain_create_post_relocate_script() { 120toolchain_create_post_relocate_script() {
121 script=$1 121 relocate_script=$1
122 rm -f $script 122 env_dir=$2
123 touch $script 123 rm -f $relocate_script
124 touch $relocate_script
125
126 cat >> $relocate_script <<EOF
127# Source top-level SDK env scripts in case they are needed for the relocate
128# scripts.
129for env_setup_script in ${env_dir}/environment-setup-*; do
130 . \$env_setup_script
131 status=\$?
132 if [ \$status != 0 ]; then
133 echo "\$0: Failed to source \$env_setup_script with status \$status"
134 exit \$status
135 fi
136done
124 137
125 cat >> $script <<EOF
126if [ -d "${SDKPATHNATIVE}/post-relocate-setup.d/" ]; then 138if [ -d "${SDKPATHNATIVE}/post-relocate-setup.d/" ]; then
127 for s in ${SDKPATHNATIVE}/post-relocate-setup.d/*; do 139 for s in ${SDKPATHNATIVE}/post-relocate-setup.d/*; do
128 if [ ! -x \$s ]; then 140 if [ ! -x \$s ]; then
diff --git a/meta/recipes-core/meta/meta-environment.bb b/meta/recipes-core/meta/meta-environment.bb
index 09f757a087..da1230bead 100644
--- a/meta/recipes-core/meta/meta-environment.bb
+++ b/meta/recipes-core/meta/meta-environment.bb
@@ -56,7 +56,7 @@ create_sdk_files() {
56 # Add version information 56 # Add version information
57 toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${REAL_MULTIMACH_TARGET_SYS} 57 toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${REAL_MULTIMACH_TARGET_SYS}
58 58
59 toolchain_create_post_relocate_script ${SDK_OUTPUT}/${SDKPATH}/post-relocate-setup.sh 59 toolchain_create_post_relocate_script ${SDK_OUTPUT}/${SDKPATH}/post-relocate-setup.sh ${SDKPATH}
60} 60}
61 61
62do_install() { 62do_install() {