Subject: Re: How does ELF work?
To: gregory duchesnes <gregory@icilalune.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: netbsd-users
Date: 07/06/2004 22:56:02
On Tue, Jul 06, 2004 at 10:23:24PM +0200, gregory duchesnes wrote:
> Hi,
> 
> I have a problem compiling postfix with mysql support, make complains about
> a missing libmysqlclient.so.12
> 
> i know it is a dynamic linked libraries problem and i managed to solve it by
> creating a /etc/ld.so.conf file containing the path to the mysql libs.
> 
> BUT, i read on the ELF Faq that it was a bad thing to do (too bad since it's
> so easy) and i'd like to do it properly thanks to ELF
> 
> 
> The problem is that i've read the FAQs and ELF man pages but i don't
> understand anything about how it works.

Are you compiling from pkgsrc, or directly from sources ?
I would suggest using pkgsrc, as it will do all of this for you.

Otherwise, before the -lmysqlclient on the link command line, you need to
put:
-L/path/to/directory/where/libmysqlclient.so.12/is -Wl,-R/path/to/directory/where/libmysqlclient.so.12/is

-L tells the compiler (linker, really) where to find libmysqlclient.so,
to get symbols, etc ...
-Wl,-R records in the executable where to look for libmysqlclient.so at
run time.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--