Subject: Re: How do I add libraries pkgsrc into the default compile paths?
To: Gene ENonymous <yancm@sdf.lonestar.org>
From: Julio M. Merino Vidal <jmmv84@gmail.com>
List: port-i386
Date: 04/06/2005 14:28:56
On Wednesday 06 April 2005 11:25, Gene ENonymous wrote:
> Hi Manuel,
>
> I've attached another related note that made me believe you might know
> the answer to the following...
>
> I've poked around the various mailing lists and documents
> on the site and I have not found a clear answer to the following...
>
> When I add a pkgsrc package that is a library, how do I set up
> the compiler system to add /usr/pkg/lib and /usr/pkg/include in
> the default path for libraries? If this is answered somewhere,
> could you point me?

This is done through standard variables: CFLAGS and LDFLAGS.

> It seems unnecessarily clunky to need to add flags to the complie
> and lines to the ld.so.conf...when I add a pkgsrc library, I would
> like to set it and forget it...

Do not touch ld.so.conf to solve this; that file, although extensively
used in Linux, will be (almost) empty usually.  Just use rpaths, i.e.,
-Wl,-R.

Use the following script (which I call psbuild):

----- snip -----
#!/bin/sh

ACLOCAL_FLAGS="-I /usr/pkg/share/aclocal"; export ACLOCAL_PATH
PKG_CONFIG_PATH=/usr/pkg/lib/pkgconfig; export PKG_CONFIG_PATH
CPPFLAGS='-I/usr/pkg/include -I/usr/X11R6/include'; export CPPFLAGS
LDFLAGS="-L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/X11R6/lib 
-Wl,-R/usr/X11R6/lib"; export LDFLAGS

exec "$@"
----- snip .....

and run it as in "psbuild ./configure".

Cheers

PS: This message is not related to i386, so port-i386@ is inappropriate.

-- 
Julio M. Merino Vidal <jmmv84@gmail.com>
http://www.livejournal.com/users/jmmv/
The NetBSD Project - http://www.NetBSD.org/