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?
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.
--
Paul