automake
[Top][All Lists]
Advanced

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

Re: Linking in C++ mode


From: John Levon
Subject: Re: Linking in C++ mode
Date: Mon, 11 Nov 2002 00:35:56 +0000
User-agent: Mutt/1.3.25i

On Sun, Nov 10, 2002 at 06:50:47PM -0500, Earnie Boyd wrote:

> >I do not think getting gcc to link -lstdc++ is a good idea either, but
> >it doesn't have much more hack value than the solution you propose below
> >IMHO.
> 
> It's the hack that using g++ performs.

I do not believe there is any guarantee that using gcc to link will get
the C++ linking case correct. Now, I know this works, but the previous
sentence gives the reason I call it a hack.

> Well, g++ does the same extension filtering that gcc does.  It will 
> compile .c as C and .C, .cc, .cxx, .cpp as C++.  If either finds source 
> in the form of the other then the compilation type is changed.

However, gcc/g++ gets this right, and allows you to override its
guessing, via the -x flag. It seems automake does not.

> Another solution would be to use a BUILD_CC variable.  Set BUILD_CC to 
> the value of $(CC) for C and the value of $(CXX) for C++ and use 
> $(BUILD_CC) in the rules.

How would this look in a Makefile.am ? Would I have to throw away
auto-deps for this to work ?

regards
john
-- 
"History is the slaughter-bench at which the happiness of peoples, the
 wisdom of states and the virtue of individuals have been sacrificed."
        - Hegel




reply via email to

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