automake
[Top][All Lists]
Advanced

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

adding conditionally a c++ file implies static linking with g++


From: Vincent Torri
Subject: adding conditionally a c++ file implies static linking with g++
Date: Fri, 5 Nov 2010 16:56:55 +0100 (CET)


Hey,

In a Makefile.am, I have something like that:

foo_SOURCES = bar1.c

if MY_COND
foo_SOURCES += bar2.cpp
else
foo_SOURCES += bar2.c
endif

One told me on that ML that it is normal that automake uses g++ for linking, even if MY_COND is not verified. One possible way to work around that is redefining rules of linking, according to the value of MY_COND. Something like (maybe not 100% correct) :

if MY_COND
foo_la-bar2.lo: bar2.cpp
        $(LTCXXCOMPILE) blah blah blah
else
foo_la-bar2.lo: bar2.c
        $(LTCOMPILE) blah blah blah
endif

Is there something more elegant than doing that ?

thank you

Vincent Torri



reply via email to

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