automake
[Top][All Lists]
Advanced

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

Re: RFC: Building a Shared Library (take 2)


From: Norman Gray
Subject: Re: RFC: Building a Shared Library (take 2)
Date: Wed, 30 Jul 2003 21:31:08 +0100

Alexandre, greetings,

On Wednesday, July 30, 2003, at 06:40 PM, Alexandre Duret-Lutz wrote:

Here is a second version of this section, so that we have
This looks great -- it's very clear indeed.  As an ignorant user, I'm 
much more confident that I know what's going on.  I have a few comments.
-------

Libtool abstracts shared and static libraries into a unified concept
henceforth called "libtool libraries".  Libtool libraries are files
using the `.la' suffix, and can designate a static library, a shared
[...]
the `.lo' suffix.  Libtool libraries are built from these libtool
objects.
[I would add, here:]

You don't need to know anything about the structure of `.la' or `.lo' files (and they are subject to change), but it is these files that libtool and automake use to coordinate the dependencies in a package, and it is these which you should use to express those dependencies. In other words, the existence of the libtool libraries and objects is part of the automake API; the content is not.
[Incidentally, pace Guido, I agree with Alexandre that giving any 
detail about the .libs directory is probably undesirable, other than 
perhaps saying `no user-servicable parts inside'.  The typical users of 
automake are likely to be the sort of folk who aren't shy of looking at 
the source  to work out what's possible; thus this manual is possibly 
unusual in being heavily concerned with what users should _not_ hack 
at, if they want their makefiles to survive the next automake upgrade.  
Less of a manual, more a style-guide, perhaps?]
[...]

Also, note that if you include the declarations for building a shared library, automake will automatically build the corresponding static library [this is true, isn't it?] Thus you do _not_ need to include and configure (and keep in sync!) both sets of rules.
   The important implementation detail you have to bwe aware of is that
[typo: `be aware']

   For libraries whose destination directory is known when Automake
runs, Automake will automatically supply the appropriate `-rpath'
option to libtool. This is the case for libraries listed explicitly in
some `DIR_LTLIBRARIES' variable.
[I'm not sure exactly what this means (I'm valuably ignorant about 
automake, remember!).  How about:]
...in some `_LTLIBRARIES' variable, such as `lib_LTLIBRARIES'.

[...if that's correct]

Libtool Libraries with Conditional Sources
------------------------------------------

Conditional compilation of sources in a library can be achieved in the
same way as conditional compilation of sources in a program (*note
Conditional Sources::).  The only difference is that `_LIBADD' should
be used instead of `_LDADD' and that it should mention libtool objects
(`.lo' files).
[This was the thing that was terribly unclear to me before]

   Nowadays, the computation of `LTLIBOBJS' for `LIBOBJS' is performed
automatically by Autoconf (*note `AC_LIBOBJ' vs. `LIBOBJS':
(autoconf)AC_LIBOBJ vs LIBOBJS.).
[?add]

Recall that you will typically not assign to either `LIBOBJS' or `LTLIBOBJS', either in `automake' or `configure'; your only contact with it is to declare which library depends on these missing functions. [or am I still confused, sigh?]



-------

I hope these are useful.

All the best,

Norman


--
----------------------------------------------------------------------
Norman Gray                   http://www.astro.gla.ac.uk/users/norman/
Physics and Astronomy, University of Glasgow    address@hidden





reply via email to

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