On 03/31/2014 02:45 AM, Balaji, Pavan wrote:
Hello,

I’m looking for a way to recompile the same source file multiple times with 
different flags and adding them into a single library.

Currently, I’m doing this:

----8<----
lib_foo_la_CPPFLAGS = -DBUILD_FOO
lib_foo_la_SOURCES = a.c b.c

lib_bar_la_CPPFLAGS = -DBUILD_BAR
lib_bar_la_SOURCES = a.c b.c
----8<----


You can merge libfoo and libbar with something like:

lib_LTLIBRARIES = libfubar.la
libyat_la_LIBADD = libfoo.la libbar.la

Very untested and confused by your underscores.

Cheers,
Peter

This builds a.c and b.c with two different flags, but creates two different 
libraries libfoo.la and libbar.la.  Is there a way to embed them into a single 
library?  The build flags already take care of eliminating duplicate symbols.

Note that doing source-specific builds will be inconvenient as the number of 
source files can be very large.

Thanks,

   — Pavan




--
Peter Johansson


Reply via email to