diff options
Diffstat (limited to 'meta/files')
-rw-r--r-- | meta/files/toolchain-shar-relocate.sh | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/meta/files/toolchain-shar-relocate.sh b/meta/files/toolchain-shar-relocate.sh index dfb8e16d7c..4ef2927171 100644 --- a/meta/files/toolchain-shar-relocate.sh +++ b/meta/files/toolchain-shar-relocate.sh | |||
@@ -26,25 +26,21 @@ if [ $relocate = 1 ] ; then | |||
26 | fi | 26 | fi |
27 | fi | 27 | fi |
28 | 28 | ||
29 | # replace @SDKPATH@ with the new prefix in all text files: configs/scripts/etc | 29 | # replace @SDKPATH@ with the new prefix in all text files: configs/scripts/etc. |
30 | # replace the host perl with SDK perl. | ||
30 | for replace in "$target_sdk_dir -maxdepth 1" "$native_sysroot"; do | 31 | for replace in "$target_sdk_dir -maxdepth 1" "$native_sysroot"; do |
31 | $SUDO_EXEC find $replace -type f -exec file '{}' \; | \ | 32 | $SUDO_EXEC find $replace -type f |
32 | grep ":.*\(ASCII\|script\|source\).*text" | \ | 33 | done | xargs -n100 file | grep ":.*\(ASCII\|script\|source\).*text" | \ |
33 | awk -F':' '{printf "\"%s\"\n", $1}' | \ | 34 | awk -F':' '{printf "\"%s\"\n", $1}' | \ |
34 | grep -v "$target_sdk_dir/environment-setup-*" | \ | 35 | grep -v "$target_sdk_dir/environment-setup-*" | \ |
35 | $SUDO_EXEC xargs -n32 sed -i -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:g" | 36 | xargs -n100 $SUDO_EXEC sed -i \ |
36 | done | 37 | -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:g" \ |
38 | -e "s:^#! */usr/bin/perl.*:#! /usr/bin/env perl:g" \ | ||
39 | -e "s: /usr/bin/perl: /usr/bin/env perl:g" | ||
37 | 40 | ||
38 | # change all symlinks pointing to @SDKPATH@ | 41 | # change all symlinks pointing to @SDKPATH@ |
39 | for l in $($SUDO_EXEC find $native_sysroot -type l); do | 42 | for l in $($SUDO_EXEC find $native_sysroot -type l); do |
40 | $SUDO_EXEC ln -sfn $(readlink $l|$SUDO_EXEC sed -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:") $l | 43 | $SUDO_EXEC ln -sfn $(readlink $l|$SUDO_EXEC sed -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:") $l |
41 | done | 44 | done |
42 | 45 | ||
43 | # find out all perl scripts in $native_sysroot and modify them replacing the | ||
44 | # host perl with SDK perl. | ||
45 | for perl_script in $($SUDO_EXEC find $native_sysroot -type f -exec grep -l "^#!.*perl" '{}' \;); do | ||
46 | $SUDO_EXEC sed -i -e "s:^#! */usr/bin/perl.*:#! /usr/bin/env perl:g" -e \ | ||
47 | "s: /usr/bin/perl: /usr/bin/env perl:g" $perl_script | ||
48 | done | ||
49 | |||
50 | echo done | 46 | echo done |