libtool convinience libs with unsermake/scons/cmake/... ?

Thiago Macieira thiago at kde.org
Fri Jan 13 04:32:19 CET 2006


Alexander Neundorf wrote:
>libtool is able to create convinience libraries, i.e. static libraries
> which are included completely in a shared library when linking
> together. This is implemented in libtool with different flags for the
> linker depending on the platform. Do we want to do this the same way
> for KDE 4 ? Is this supported by MSVC ?
>
>I see the following options:
>1) implement libtool behaviour
>2) link all object files to one object file together and include this in
> one the shared library: ld -o -r conv.o *.o (is this portable ?)
>3) compile all source files of the former conv. lib again everytime the
> conv. lib is (was) used
>4) create a (-enable-)final file from the source files of the former
> conv. lib and compile this everytime the conv. lib is (was) used.
>
>How is this handled by unsermake and scons ?
>How should it ideally be handled ?

libtool is able to create convenience libraries _in_ _some_ _platforms_, 
but not all. In those that it can't, it foregoes creating the .a and 
simply passes all the .o to the linker when creating the final binary or 
shared library.

So, given that it already is the behaviour in some platforms (albeit not 
those that KDE is usually used on, since the GNU ld supports it), I 
suggest ignoring the .a file and creating a virtual target in memory. 
When it's used, replace it with the objects that compose the library.

Also note that, if a convenience library is used in two targets, each .o 
should be compiled twice. There may be differences in pre-processor 
flags, especially on Windows.
-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

3. Ac seo woruld wearð geborod, swá se Scieppend cwæð "Gewurde Unix" and 
wundor fremede and him "Unix" genemned, þæt is se rihtendgesamnung.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-buildsystem/attachments/20060113/6fe9c523/attachment.pgp 


More information about the Kde-buildsystem mailing list