This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
ld and linktime/runtime lib dirs
- From: vda <vda at port dot imtp dot ilyichevsk dot odessa dot ua>
- To: binutils at sources dot redhat dot com, binutils at sourceware dot cygnus dot com
- Date: Mon, 17 Dec 2001 11:10:34 -0200
- Subject: ld and linktime/runtime lib dirs
This is a little conversation originated on gcc list.
Question I'm interested in is at the end, please read on.
From: vda <vda@port.imtp.ilyichevsk.odessa.ua>
To: Andreas Jaeger <aj@suse.de>
> There shouldn't be any shared libs in /lib that you link against. But
> anything outside /usr/lib has to be specified.
Does that mean that I have to dig into and modify KDE makefiles if some
of required libs are NOT in [/usr]/lib?
I looked there and become worried: it looks like KDE will record paths to my
QT libs in KDE libs (via -rpath) which I _don't want_ to happen! "Hardcoded
paths to libs??!! AAAAAARRRRRRGGGGGGHHHHHH!!" :-)
I thought it's admin job to put all lib dirs into /etc/ld.so.conf, it adds
flexibility: I can move them around and KDE won't break.
And it's only a part of a problem: while KDE configure have dirty hooks for
QT libs in it's own dirs, it doesn't do that for other less famous libs
(pcre lib).
I tried to set LD_LIBRARY_PATH to `cat /etc/ld.so.conf` for KDE make but it
still moaning about -lpcre...
Is there a way to tell make what lib dirs to use without encoding them in
rpath? Makefile is autogenerated, I hope to avoid makefile hacking. Any
environment vars?
> KDE should find those itself. configure has a switch for e.g. the qt
> Dir and might also have it for others:
>
> ./configure \
> --prefix=/opt/kde2 \
> --with-qt-dir=/usr/lib/qt2/
Yes, that's the (ugly) way KDE makefile adds -L and -rpath to gcc/ld.
It does not do that for pcre lib etc.
I want to say: "Hey make, these are my lib dirs, use them for ld, but
don't encode them into .so libs you make! I'm deadly sure I'll give them good
/etc/ld.so.conf at runtime!"
Looks like this isn't trivially possible.
If anyone knows how to do it, please enlighten me.
It is ok to tell me that I'm doing something silly/wrong,
but _don't forget_ to CC me :-) Thanks.
--
vda