library dependency implementation

Ralf Habacker ralf.habacker at freenet.de
Tue Oct 25 18:01:21 CEST 2005


Hi all, 

I like to know some suggestions for the bksys implementation relating to the 
subject. The background: 

genobj classes provides the lib and libpaths attribute for selecting required 
external and internal libraries.  There are platform depending forms like 

obj.libs = '../kdecore/libkdecore.a' 

and platform independent forms like 

obj.libs = '../kdecore/libkdecore.la' 

(because la files are now also available for static libs)

another form is using libs and libpaths


obj.libpaths = 'path another_path'
obj.libs = 'lib1 lib2'

All this attributes are used for the link line and the linker checks all 
obj.libpaths for libraries specified in obj.libs. 

For several reasons it is required for bksys to know the exact path of a given 
library and the above mentioned form requires to scan all given pathes for 
shared and static libraries or la files to detect what to do which this 
library. 

This relates to the whole-archive linker option, which is required to include 
static libraries into a shared library using gcc/ld. To use this option the 
absolute path of the static library is required and could be retrieved from 
the relating la file. 

For the implementation of the above mentioned form using libpaths and libs 
independent, I' m worried about the estimated run time of the search if  many  
libraries are used. Each combination of libpath and lib requires one stat 
call to see if the file is presented, which result in <= n*n tries. 
(libtool has the same problem) 

There may be a cache, which stores all results and allow lookup quickly, but 
I'm thinking about an easier way to deal with. 

One way seems to me to go back to the ../dir/libxyz.la form for internal 
libraries or does anyone have a better idea ? 

Regards
 Ralf 










More information about the Kde-buildsystem mailing list