Subject: Re: How does ELF work?
To: None <netbsd-users@NetBSD.org>
From: gregory duchesnes <gregory@icilalune.com>
List: netbsd-users
Date: 07/06/2004 23:06:19
i'm compiling directly from sources.
my platform is a bit weird, it's a cobalt Raq2 and not all softwares are
available from pkgsrc.

anyway, for the moment i use the following command line to tell the make
what to do :

make -f Makefile.init makefiles \
    'CCARGS=-DHAS_MYSQL -I/usr/local/include/mysql' \
    'AUXLIBS=-L/usr/local/lib/mysql/ -lmysqlclient -lz -lm'

i don't see how to change it to follow your advice (sorry i'm a newbie)

----- Original Message ----- 
From: "Manuel Bouyer" <bouyer@antioche.eu.org>
To: "gregory duchesnes" <gregory@icilalune.com>
Cc: <netbsd-users@NetBSD.org>
Sent: Tuesday, July 06, 2004 10:56 PM
Subject: Re: How does ELF work?


> 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/director
y/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
> --
>