Murray Cumming wrote:
>> I'm trying to use automake/autoconf to build a shared library whose source
>> code is neatly organised sub directories (about 5 levels wide and 5 levels
>> deep).
>>
>> If this was an application then I would build static libraries in each of
the
>> subfolders and link them all together at the top. But when I do something
like
>> this:
>>
>> libfoo_la_LDADD = exceptions/libexceptions.la factories/libfactories.la
>
> libtool complains that the .la libraries are not libtool objects. I could
>> build libtool libraries in the sub directories instead of static
libraries,
?> but then I'd have to install each of those temporary libraries. That would
be
>> stupid.
>>
>> So, how should I use automake to build a shared library if the source is
in
>> sub directories?
Paul Berrevoets <[EMAIL PROTECTED]> wrote:
> You create what are called 'convenience' libraries in libtool.
> In exceptions/Makefile.am:
> noinst_LTLIBRARIES = libexceptions.la
> ...
> Convenience libraries are not installed, and the object they contain will
be
> included in the higher level ltlibrary that LDADD's them.
I've got that working now. But here's a couple of important details for the
record:
1) This doesn't work recursively. For instance, if sub contains, subsub, which
contains subsusbsub, then the library at sub will contain subsub but not
subsubsub. Therefore you have to LIBADD all the libraries in the top
makefile.
2) noinst libraries with the same names in different directories will
conflict, leading to multiple definitions of one of them. So you should
probably name each noinst library according to its complete path. e.g.
libsub_subsub_subsubsub.la.
Is there any news on a timeline for the prophesied version of automake that
properly handles sources in sub directories?
Murray Cumming
[EMAIL PROTECTED]
www.murrayc.com
+44 7971 226563
Get free email and a permanent address at http://www.netaddress.com/?N=1