SDKs for multilib configurations have multiple environment scripts, so
re-arrange the post-relocate hook invocation so that it runs the post-relocate
hooks after sourcing each environment script.

Signed-off-by: Ross Burton <[email protected]>
---
 meta/classes/toolchain-scripts.bbclass | 46 +++++++++++++++++-----------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/meta/classes/toolchain-scripts.bbclass 
b/meta/classes/toolchain-scripts.bbclass
index 6d1ba69473a..1a2ec4f3b29 100644
--- a/meta/classes/toolchain-scripts.bbclass
+++ b/meta/classes/toolchain-scripts.bbclass
@@ -128,30 +128,30 @@ toolchain_create_post_relocate_script() {
        touch $relocate_script
 
        cat >> $relocate_script <<EOF
-# Source top-level SDK env scripts in case they are needed for the relocate
-# scripts.
-for env_setup_script in ${env_dir}/environment-setup-*; do
-    . \$env_setup_script
-    status=\$?
-    if [ \$status != 0 ]; then
-        echo "\$0: Failed to source \$env_setup_script with status \$status"
-        exit \$status
-    fi
-done
-
 if [ -d "${SDKPATHNATIVE}/post-relocate-setup.d/" ]; then
-    for s in ${SDKPATHNATIVE}/post-relocate-setup.d/*; do
-        if [ ! -x \$s ]; then
-            continue
-        fi
-        \$s "\$1"
-        status=\$?
-        if [ \$status != 0 ]; then
-            echo "post-relocate command \"\$s \$1\" failed with status 
\$status" >&2
-            exit \$status
-        fi
-    done
-    rm -rf "${SDKPATHNATIVE}/post-relocate-setup.d"
+       # Source top-level SDK env scripts in case they are needed for the 
relocate
+       # scripts.
+       for env_setup_script in ${env_dir}/environment-setup-*; do
+               . \$env_setup_script
+               status=\$?
+               if [ \$status != 0 ]; then
+                       echo "\$0: Failed to source \$env_setup_script with 
status \$status"
+                       exit \$status
+               fi
+
+               for s in ${SDKPATHNATIVE}/post-relocate-setup.d/*; do
+                       if [ ! -x \$s ]; then
+                               continue
+                       fi
+                       \$s "\$1"
+                       status=\$?
+                       if [ \$status != 0 ]; then
+                               echo "post-relocate command \"\$s \$1\" failed 
with status \$status" >&2
+                               exit \$status
+                       fi
+               done
+       done
+       rm -rf "${SDKPATHNATIVE}/post-relocate-setup.d"
 fi
 EOF
 }
-- 
2.11.0

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to