bksys / scons (Re: win32 port)

David Faure faure at kde.org
Wed Jan 11 23:28:21 CET 2006


On Wednesday 11 January 2006 23:21, Brad King wrote:
>   Can someone clarify when/why KDE uses rpath please?
When: almost always since it does it by default
Why: so that it works out of the box after installation, without the need
for LD_LIBRARY_PATH or /etc/ld.so.conf. However it has clear disadvantages,
like the fact that it has priority over LD_LIBRARY_PATH (this is so nonsensical imho...),
and that it's hardcoded so it breaks when moving stuff, unlike your wrapper idea.

> When implemented as a C program and not a shell script the overhead is 
> very small.  The resulting program is tiny and then uses exec to replace 
> itself with the full application executable (which could sit in a lib 
> directory or somewhere else not in the PATH).  Compared to the time it 
> takes to load and dynamically link all the shared libraries the overhead 
> will not be noticable.  This approach also has the advantage that the 
> installation prefix need not be known when the application is built 
> since there is no need for rpath.  A tarball of the install tree can be 
> extracted anywhere and the application will run out of the box.  Also no 
> changes to the binaries are needed for them to run in the build tree or 
> the install tree, and no one ever has to set LD_LIBRARY_PATH by hand.

This sounds great to me - clearly an improvement, which removes the need for rpath.

It's a bit like our kdeinit; which also means that most users wouldn't have
this overhead anyway, since kdeinit skips launching the executable and uses
fork+exec of a shared lib anyway.

Thanks a lot for your input, I'm happy to see that you have found a good
solution to this problem.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).



More information about the Kde-buildsystem mailing list