Subject: Re: help with libraries on current...
To: Matt Bell <mtbell@mb1.dial.servtech.com>
From: Frederick Bruckman <fb@enteract.com>
List: netbsd-help
Date: 05/09/2000 20:29:16
On Tue, 9 May 2000, Matt Bell wrote:

> I am trying to build a program that requires pthreads. So I go to the
> pkgsrc and make build the pth package and it installes the libraries in
> the /usr/local/lib dir. I go back to try to build the program again and
> still doesn't find the newly installed libraries. If my system was still
> a.out I would just simple add the path to the libraries to /etc/ld.so.conf
> and do a ldconfig. My question is, is how do you do this in elf format?

To _build_, you have to add the path of the libraries to the gcc
command line, "-L/usr/local/lib. To _run_ on ELF, you need also
"-Wl,-R/usr/local/lib" at build time. You would normally add these to
something like LIBS or LDFLAGS or PTHREAD_LIB variable in the
distribution's makefile (or Makefile).

If the package uses Gnu "configure", it's supposed to look for
"pthread-config" in the path, and use that to set the flags. If not,
you can help it, like so:

	CFLAGS="`pthread-config --cflags`" \
	LDFLAGS="`pthread-config --ldflags`" \
	LIBS="`pthread-config --libs`" \
	./configure