Re: [Re: Shared library with source in sub directories]

2000-07-17 Thread Alexandre Oliva

On Jul 16, 2000, Tom Tromey [EMAIL PROTECTED] wrote:

Murray 1) This doesn't work recursively. For instance, if sub
Murray contains, subsub, which contains subsusbsub, then the library
Murray at sub will contain subsub but not subsubsub. Therefore you
Murray have to LIBADD all the libraries in the top makefile.

 This is suprising.  I thought this was one of the benefits of libtool
 -- portable library dependencies.

It depends on which version of libtool you're using.  IIRC, libtool
1.3.5 (the latest release) still doesn't fully support inter-library
dependencies.  1.4-to-be (CVS trunk) is supposed to fix this problem.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicampoliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist*Please* write to mailing lists, not to me




Re: [Re: Shared library with source in sub directories]

2000-07-16 Thread Murray Cumming


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




Re: [Re: Shared library with source in sub directories]

2000-07-14 Thread Murray Cumming

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.

Thanks. I'll try this. I didn't do it before because the automake manual
explicitly states that noinst_LTLIBRARIES is not allowed. I guess that's
wrong.

Murray Cumming
[EMAIL PROTECTED]
www.murrayc.com
+44 7971 226563


Get free email and a permanent address at http://www.netaddress.com/?N=1




Re: [Re: Shared library with source in sub directories]

2000-07-14 Thread Tom Tromey

Murray Apparently I should do with this with a noinst_LTLIBRARIES, so
Murray you do need to correct the bit in the automake manual that
Murray says that it isn't allowed.

I think that has already been fixed.
When I looked at my copy of the manual this morning it said that
check_LTLIBRARIES is disallowed, but noinst_ is used for convenience
libraries.

Tom