libtool
[Top][All Lists]
Advanced

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

Re: unable to infer tagged configuration


From: Ralf Wildenhues
Subject: Re: unable to infer tagged configuration
Date: Thu, 17 Nov 2005 08:59:00 +0100
User-agent: Mutt/1.5.11

Hi Ross, Mike,

* Mike Frysinger wrote on Wed, Nov 16, 2005 at 09:25:00PM CET:
> On Wed, Nov 16, 2005 at 11:53:24AM -0800, Ross Boylan wrote:
> >
> > It's odd that CC is used for the C++ compiler.
> 
> dont confuse internal 'CC' with having any particular meaning ... cause
> it doesnt have any meaning other than 'this is the compiler for this tag 
> configuration'
> 
> the C tag config usually has 'CC=gcc' while the CXX tag config usually
> has 'CC=g++'

Correct.  Inside the libtool script, $CC is merely the name for the
configured compiler.  $LTCC is always a C compiler, OTOH.

> > I see why g++-3.3 would be a problem, but I don't see why g++ works.
> 
> g++-3.3 pissed libtool off because when it was scanning the tag configs,
> it does a text match, sort of like '$tagCC == $userCC' ... in this case,
> libtool ran
> C tag config:   CC=gcc userCC=g++-3.3 ... "$CC" == "$userCC" -> nope
> CXX tag config: CC=g++ userCC=g++-3.3 ... "$CC" == "$userCC" -> nope
> no more tags in libtool -> unable to infer tagged configuration

Correct as well.  libtool has no way of finding out the matching tag to
use (i.e., compilation language settings) unless either --tag=... is given
or the compiler matches the configured compiler exactly.

Note unfortunately we can't make this any better easily: matching only
the leading portion will fail for
  KCC       (C++)
  KCC --c   (C)
and for users using their C++ compiler to compile C code.

> if you're running ./libtool yourself in your Makefile, just make sure
> to use '--tag CXX' when dealing with C++ sources and '--tag CC' when
> dealing with C sources ... that should handle all the funky compilers a
> user at your package

Correct as well.  The only thing I should add, to avoid your next
confusion: libtool will use the *configured* compiler when linking,
not the one you give on the command line.  Again, if you need that any
differently, please reconfigure.

You may think: why can't it regocnize that I gave a different compiler
on the command line?  Well, that is nontrivial to recognize.  Think of
  CC='compile cc'       (automake wrapper script)
  CC='distcc cc'
etc.  Also, in several cases libtool chooses different rules for linking
based upon the compiler with which it was configured.  This is necessary
in some cases; so it would not be dangerous to change the compiler
there.

Hope this helps a bit.  :)

Cheers,
Ralf




reply via email to

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