[PATCH] Libtool & indirect dependencies

Szombathelyi Gy�rgy gyurco at freemail.hu
Sun May 30 16:07:07 BST 2004

Miert fizetsz az internetert? Korlatlan, ingyenes internet hozzaferes a FreeStarttol.
Probald ki most! http://www.freestart.hu


I started a thread about how to _not_ link a lib/program to its indirect 
dependencies. It turned out that libtool links to all dependency_libs in 
the .la file. In a discussion at the libtool mailing list turned out that 
this problem may not easily solved by libtool, mainly because removing 
dependency_libs will break static library linking. 
So I started to look into 'ld', and found out that newer GNU ld's have the 
--as-needed flag, which is exactly what I was looking for. The only problem 
with this that if I specify a LDFLAGS=-Wl,--as-needed, libtool will insert 
this option _after_ the libraries to be linked, effectively disabling the 
expected behavior. My patch simply bring $compiler_options before any 
dependencies in libtool, so the --as-needed flag actually will have the 
desired effect. 
I already compiled kdelibs, kdebase and a couple of other modules with 
success, and greatly reduced dependencies! 
Is my patch acceptable? If it is, then I'll try to push this to libtool 
upstream, too.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: kde-libtool.diff.gz
Type: application/x-gzip
Size: 5818 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040530/7acc87e6/attachment.bin>

More information about the kde-core-devel mailing list