libtool
[Top][All Lists]
Advanced

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

Shared libraries management in Linux


From: Denis Vlasenko
Subject: Shared libraries management in Linux
Date: Wed, 30 Jan 2002 15:42:45 -0200

Hi,

I wanted to play a little with KDE 2.2.2 source and had problems with shared 
libraries. I had similar problems before and worked around them.

Now I decided to sort it out once and for all.

Problem description:

Long ago I compiled GCC 3.0.1 from sources and put it all in /usr/lib/gcc301.

After some time I decided that using /usr/lib for installed packages is not 
ok: it is for libraries only. I want to get rid of dual-purpose dirs.
So I started to put newly compiled packages under /usr/app. I specify all 
target directories during configure to point to /usr/app/coolpackage-1.2.3

In order to make binaries, man pages etc easily accessible I decided to 
symlink all relevant files (via shell script):
/usr/bin/xyzzy ->            /usr/app/coolpackage-1.2.3/bin/xyzzy
/usr/man/man8/xyzzy.8.man -> /usr/app/coolpackage-1.2.3/man/man8/xyzzy8.man
/usr/lib/xyzzy.so ->         /usr/app/coolpackage-1.2.3/lib/xyzzy.so

However, authors of those packages don't know of my cool scheme and devise 
their own means to preserve knowledge of where package was installed.
I thought it won't mess up but it did. Please read on.

I compiled KDE 2.2.2 from sources, targeting it to /usr/app/kde-2.2.2
It went mostly fine (minor compilations problems).

Then I compiled new GCC 3.0.3 to get rid of kernel miscompilation problem 
(GCC bug). Targeted to /usr/app/gcc-3.0.3. This went fine too.

Now I modified some KDE sources and typed 'make'. *Gotcha*! KDE remembers 
that it was compiled with GCC 3.0.1 and wants some libraries from 
/usr/lib/gcc301/lib/*. These libraries *is* available from newer GCC 3.0.3 
and even present in /usr/lib (in the form of symlinks to 
/usr/app/gcc-3.0.3/lib/*) but this is not enough.

I can work around this. But I _don't want_ to. I want to do it _right_.
I don't want to needlessly recompile packages like KDE when I upgrade 
compiler to next minor release. Or when I upgrade audiofile.
'Faking' /usr/lib/gcc301/lib/xxx/yyy/zzz is out of the question too.

It seems to be that library management in Linux either isn't standardized of 
too weird for me to understand it. I am very willing to RTFM if it exist.

I'd be immensely grateful if someone would tell me how to manage libraries 
right. For example, tell me how you do it if your method does not involve 
ugly workarounds.

PS. What's in those .la files in kde/lib/* dir? Why does kde insist on 
remembering where dependent libraries are? Is that a part of a problem?
--
vda



reply via email to

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