This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [CT-NG:patch 02/19] Symlink to cc not always installed correctly


Remy, Bart, All,

On Friday 09 April 2010 21:04:21 Remy Bohmer wrote:
> When building an cross-compiler for a host which depends
> on file extensions the symlink for cc was not installed correctly

Yes, this is needed. But a typo and a few style fixes...

> Signed-off-by: Bart vdr. Meulen <bartvdrmeulen@gmail.com>
> ---
>  scripts/build/cc/gcc.sh |   18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> Index: crosstool-ng/scripts/build/cc/gcc.sh
> ===================================================================
> --- crosstool-ng.orig/scripts/build/cc/gcc.sh
> +++ crosstool-ng/scripts/build/cc/gcc.sh
> @@ -246,7 +246,14 @@ 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 as an extension

as --> has

> +    file=$(ls -1 ${core_prefix_dir}/bin/${CT_TARGET}-gcc.* 2>/dev/null || echo "")

- Properly quote the filename you're listing.
- echo "" --> true

> +    if [ "x${file}" = "x" ]; then

the 'x' stuff is ugly. In this case: [ -z "${file}" ]

> +        CT_DoExecLog ALL ln -sv "${CT_TARGET}"-gcc "${core_prefix_dir}/bin/${CT_TARGET}"-cc
> +    else
> +        ext=${file##*.}
> +        CT_DoExecLog ALL ln -sv "${CT_TARGET}-gcc.${ext}" "${core_prefix_dir}/bin/${CT_TARGET}-cc.${ext}"
> +    fi
>  
>      CT_EndStep
>  }
> @@ -362,7 +369,14 @@ 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 as an extension
> +    file=$(ls -1 ${CT_TARGET}/bin/${CT_TARGET}-gcc.* 2>/dev/null || echo "")
> +    if [ "x${file}" = "x" ]; then
> +        CT_DoExecLog ALL ln -sv "${CT_TARGET}"-gcc "${CT_PREFIX_DIR}/bin/${CT_TARGET}"-cc
> +    else
> +        ext=${file##*.}
> +        CT_DoExecLog ALL ln -sv "${CT_TARGET}-gcc.${ext}" "${CT_PREFIX_DIR}/bin/${CT_TARGET}-cc.${ext}"
> +    fi

3x Ditto.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'



--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]