Subject: Re: pfstat
To: Staffan =?iso-8859-1?Q?Thom=E9n?= <duck@multi.fi>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: netbsd-users
Date: 01/12/2006 12:35:21
In message <20060112164632.GA14931@knightrider.shangtai.net>, Staffan =?iso-885
9-1?Q?Thom=E9n?= writes:
>
>--x+6KMIRAuhnl3hBn
>Content-Type: text/plain; charset=us-ascii
>Content-Disposition: inline
>Content-Transfer-Encoding: quoted-printable
>
>> Original text by Jan Danielsson
>> Hello all,
>>=20
>> Being pretty new to Unix:ish systems and all...
>>=20
>>    I went from ipf to pf, and I feel it was a good move. The only thing
>> I miss is something like "ipfstat -t". I found something called pfstat,
>> so I downloaded the source, adjusted the Makefile, fixed a build error,
>> and got a "pfstat" executable.
>>=20
>>    However, when I run pfstat, it complains that it can not find
>> "libgd.so.2". libgd.so.2 is in /usr/pkg/lib. In OS/2, I would simply
>> have adjusted LIBPATH, but how do I do in NetBSD?
>
>The unix equivalent is LD_LIBRARY_PATH, though properly your linker should
>include the path in the binary (-L ougt to do this, most linkers I've seen
>also have an -rpath flag, and gnu tools have -R aswell.)
>
>Someone else mentioned /etc/ld.so.conf where you can add paths to the global
>search.

The best way is to use the

	-Wl,-R/usr/pkg/lib

option to cc at link-time

		--Steven M. Bellovin, http://www.cs.columbia.edu/~smb