Subject: Re: Pkgsrc zlib vs. base zlib, NetBSD
To: Gary Thorpe <>
From: Roland Illig <>
List: pkgsrc-users
Date: 06/06/2007 10:01:06
Gary Thorpe wrote:
> Hi,
> I am trying to get some software (not in pkgsrc) to build using the
> pkgsrc version of zlib and not the version found bundled with NetBSD
> (which is too old for the included ./configure to work).
> The configure script accepts a zlib prefix (/usr/pkg/lib) and makes the
> test but it fails to run:
> configure:3865: gcc -o conftest  -pipe -I. -D__UNIXSDL__ -D__BSDSDL__
> -I/usr/pkg
> /lib   conftest.c  -L/usr/pkg/lib -lz >&5
> configure:3868: $? = 0
> configure:3874: ./conftest
> Shared object "" not found
> configure:3877: $? = 1
> configure: program exited with status 1
> I have tried changing the flags to include '-Wl,-rpath,/usr/pkg/lib'
> but this just results in the library in /usr/lib being used (which gets
> the older version). It seems the -rpath adds the directory to the list
> but /usr/lib is still in front of it.

Have you tried this:?

env \
     CPPFLAGS="-I/usr/pkg/include" \
     LDFLAGS="-L/usr/pkg/lib -Wl,-R/usr/pkg/lib" \
     ./configure ...

You need both of the flags, one for compile time and one for run time.