How to use functions from libs in /usr/local/lib in pam?

Ruslan Ermilov ru at freebsd.org
Mon Jul 21 05:55:45 PDT 2003


On Mon, Jul 21, 2003 at 04:42:12AM -0400, Ilmar S. Habibulin wrote:
> 
> I'm trying to write pam module, which uses libs from /usr/local/lib (lber
> and lsap). What should i put in Makefile in order to link module with this
> libs?
> 
> LIBLDAP= /usr/local/lib/ldap.a
> 
> LDADD+= -L/usr/local/lib -lldap
> LDFLAGS += -L/usr/local/lib -lldap
> DPADD= ${LIBCRYPT} ${LIBLDAP}
> 
> doesn't help.
> 
The library should be named /usr/local/lib/libldap.a at the minimum,
to make -lldap work.  Also, -L should be taken out of LDADD, and be
put only in LDFLAGS, so it should look like this:

LIBLDAP=	/usr/local/lib/libldap.a
DPADD=		${LIBCRYPT} ${LIBLDAP}
LDADD=		-lcrypt -lldap
LDFLAGS=	-L/usr/local/lib


Cheers,
-- 
Ruslan Ermilov		Sysadmin and DBA,
ru at sunbay.com		Sunbay Software Ltd,
ru at FreeBSD.org		FreeBSD committer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20030721/c6be74cd/attachment.bin


More information about the freebsd-hackers mailing list