Subject: How do I add libraries pkgsrc into the default compile paths?
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Gene ENonymous <yancm@sdf.lonestar.org>
List: port-i386
Date: 04/06/2005 06:25:52
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?

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...

Thanks,
gene


On Wed, March 23, 2005 2:48 pm, Manuel Bouyer said:
> [ this is quite off-topic for tech-net ]
>
> On Wed, Mar 23, 2005 at 07:40:02PM +0000, Phil Pereira wrote:
>> Hey all,
>>
>> I'm a little confused by an issue I'm having.
>>
>> The pkgsrc collection builds fine and I've *never* needed to change
>> anything to have an app complie and work.
>>
>> Yesterday I downloaded the app wmswallow and tried to build it. All
>> seemed to go well, and the app itself compiled. However - upon trying to
>> run the program I was told that a certain .so file could not be found :(
>>
>> I used "ldd" to determine that, in fact, a couple of dependencies could
>> not be found.
>>
>> I added "/usr/X11R6/lib" to ld.so.conf and all worked fine - including
>> the app. "ldd" showed links to the correct dependencies.
>>
>> My question : If I *never* need to add anything to ld.so.conf to compile
>> an app in pkgsrc, why did I need to add it for a program I compiled
>> myself?  What am I missing? Or what did I get wrong?
>
> The gcc flags passed at link time:
> -L tells the linker where to find the library at link time
> -Wl,-R tells the dynamic loader where to find the libraries at run time.
>
> I guess the application was linked with -L (otherwise it wouldn't have
> worked)
> but without -Wl,-R
>
> --
> Manuel Bouyer <bouyer@antioche.eu.org>
>      NetBSD: 26 ans d'experience feront toujours la difference
> --
>