libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CC can be a program name *with arguments*


From: Gary V. Vaughan
Subject: Re: CC can be a program name *with arguments*
Date: Tue, 01 Mar 2005 13:04:51 +0000
User-agent: Mozilla Thunderbird 0.9 (X11/20041103)

Ralf Wildenhues wrote:
> Hi guys,

Hallo Ralf!

Welcome back :-)

> * Gary V. Vaughan wrote on Fri, Feb 25, 2005 at 01:21:14PM CET:
> 
>>Bob Friesenhahn wrote:
>>
>>>On Thu, 24 Feb 2005, Peter O'Gorman wrote:
>>>
>>>
>>>>Okay to apply to branch-1-5 and then forward port?
>>>
>>>Doesn't it make most sense to fix cc_basename so that it doesn't include
>>>any trailing cruft?  Then the switch would not need to be changed.  The
>>>wildcard might match a command name which differs by later characters.
>>
>>My thoughts exactly.  cc_basename is only ever used in case statements,
>>so lets set it with:
>>
>>  cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%;s%[    ].*$%%'`
> 
> 
> You guys ever encountered a system with compilers named
>   gcc-3.4.1
>   gcc-3.4.2
>   icc-8.1
>   ...

Yep, but you would need to build a different libtool for each compiler.
Relying on the compiler checks performed on one working for another is
likely to cause trouble.

> I think the original patch was useful, and have yet to see an instance
> where it causes trouble (e.g., two compilers starting with the same
> prefix;  that could be disambiguated by leaving out the * at the end of
> the case pattern on a case-by-case basis).

>From a maintenance point of view, keeping the fix isolated in 1 line of
code will save us from forgetting the * in case statements in future
patches.

> Independently still, cc_basename should be calculated like above
> (not like is done currently, and also not like Gary suggested,
> 
> |  cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%;s%[   ]*.*$%%'`
> 
> which looks quite bogus to me, as it deletes everything.)

D'oh!  Good catch.  :")

  cc_basename=`$echo X"$compiler" | $Xsed -e 's%^[      ]*\([^  ]*\).*$%\1%'`

> Maybe we need to adjust for things like ccache and distcc here, so the
> thingy takes the second argument (I still have not looked at how they
> are typically used together with libtool, so this is just speculation)
> for better matching.  Dunno if anybody has ever used those together with
> non-GCC compilers and with libtool.

Maybe worth a scribble in TODO?

Cheers,
        Gary.
-- 
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]