[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CC can be a program name *with arguments*
From: |
Ralf Wildenhues |
Subject: |
Re: CC can be a program name *with arguments* |
Date: |
Tue, 1 Mar 2005 14:57:22 +0100 |
User-agent: |
Mutt/1.4.1i |
Hi Gary,
* Gary V. Vaughan wrote on Tue, Mar 01, 2005 at 02:04:51PM CET:
>
> Welcome back :-)
Thanks! (freezing)
> > * Gary V. Vaughan wrote on Fri, Feb 25, 2005 at 01:21:14PM CET:
> >>Bob Friesenhahn wrote:
> >>
> >>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.
Sure. But we are talking about m4/libtool.m4, right?
This happens at configure time.
I want, in a libtoolized project,
../configure CC='pgcc-78.9 -foo-option'
to succeed in choosing Portland compiler options. No multiple compilers
involved here.
> > 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.
Well, yes. Maybe it could be worth doing s#-.*## to kill version
appendices. But that would be more limiting than necessary IMVHO
(nobody specified version appendices had to look like this).
> > 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%'`
Why? People writing
CC=' gcc'
by accident are people that get run over by accident. :->
> > 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?
Yep.
Regards,
Ralf