John Levon wrote:
On Sun, Nov 10, 2002 at 01:01:08PM +0100, Ralf Corsepius wrote:You could always just add -lstdc++ to the oprofiled_LDADD variable.This would be a fault, IMO.
Why?
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.
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.The problem is trying to link a c-program against a c++-library. This doesn't work in general, esp. not with g++, unless such a c++ library is specially designed for such purposes.
-8<-
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.This seems IMHO to be a terrible hack. I've found automake to be quite flexible so far; am I hitting one of its limitations ?
Earnie.