diff options
author | 2010-04-20 09:39:13 (GMT) | |
---|---|---|
committer | 2010-04-20 09:39:13 (GMT) | |
commit | 24f9a61f00cb74dd0c9ac9424b3ec33a3369ade4 (patch) | |
tree | fdca4ee8bb95b1d8bfb81980aa7f16560b94931f | |
parent | 0cbe74a2ab2000e14b05e32fea26d39c2d554077 (diff) |
cc/gcc: fix cc symlink when executables have an extension
When building a cross-compiler for a host which depends
on file extensions the symlink for cc was not installed correctly
Signed-off-by: Bart vdr. Meulen <bartvdrmeulen@gmail.com>
[Yann E. MORIN: style fixes, enhancements, code prettying]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
(transplanted from 214c64ba8b21db15f610eca886fb194a6675e40c)
-rw-r--r-- | scripts/build/cc/gcc.sh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh index 1737b44..efaa241 100644 --- a/scripts/build/cc/gcc.sh +++ b/scripts/build/cc/gcc.sh @@ -246,7 +246,10 @@ do_cc_core() { # Create a symlink ${CT_TARGET}-cc to ${CT_TARGET}-gcc to always be able # to call the C compiler with the same, somewhat canonical name. - CT_DoExecLog ALL ln -sv "${CT_TARGET}"-gcc "${core_prefix_dir}/bin/${CT_TARGET}"-cc + # check whether compiler has an extension + file="$( ls -1 "${core_prefix_dir}/bin/${CT_TARGET}-gcc."* 2>/dev/null || true )" + [ -z "${file}" ] || ext=".${file##*.}" + CT_DoExecLog ALL ln -sv "${CT_TARGET}-gcc${ext}" "${core_prefix_dir}/bin/${CT_TARGET}-cc${ext}" CT_EndStep } @@ -354,7 +357,10 @@ do_cc() { # Create a symlink ${CT_TARGET}-cc to ${CT_TARGET}-gcc to always be able # to call the C compiler with the same, somewhat canonical name. - CT_DoExecLog ALL ln -sv "${CT_TARGET}"-gcc "${CT_PREFIX_DIR}/bin/${CT_TARGET}"-cc + # check whether compiler has an extension + file="$( ls -1 "${CT_TARGET}/bin/${CT_TARGET}-gcc."* 2>/dev/null || true )" + [ -z "${file}" ] || ext=".${file##*.}" + CT_DoExecLog ALL ln -sv "${CT_TARGET}-gcc${ext}" "${CT_PREFIX_DIR}/bin/${CT_TARGET}-cc${ext}" CT_EndStep } |