recommended setup for building ports in development env?

Tijl Coosemans tijl at
Wed Apr 25 08:56:00 UTC 2018

On Tue, 24 Apr 2018 19:18:50 -0600 Gary Aitken <freebsd at> wrote:
> Asked this on questions a while ago and got no response;
> any thoughts would be much appreciated.
> I'm trying to set up a development environment for a few ports.
> I established a parallel ports tree and set the environment variables
>    PREFIX=${MYFREEBSD}/usr/local
>    WORKDIR=${MYFREEBSD}/var/db/portsnap
>    PORTSDIR=${MYFREEBSD}/usr/ports
> With those set, I can build and install some things.
> For example, I can build and install graphics/ufraw, and with my PATH
> properly extended to include ${MYFREEBSD}/usr/local/bin I can execute it.
> I can also build and install x11/babl into ${MYFREEBSD}.
> Running a normally built gimp finds the new libbabl located in a
> different, non-standard place:
>    $ ldd `which gimp` | grep babl
> => /usr/home/.../usr/local/lib/
> I didn't expect that to work; nice.
> However, when I go to build graphics/gegl it fails because it can't find
> the installed babl:
>    ===>   gegl-0.3.34 depends on shared library: - not found  
> If I set
>    LOCALBASE=${MYFREEBSD}/usr/local
> it wants to rebuild all dependencies, since it doesn't find any of the
> normally installed stuff.
> Adding
>     -L${MYFREEBSD}/usr/local/lib      to LDFLAGS
>    -I${MYFREEBSD}/usr/local/include  to CPPFLAGS
> in the Makefile doesn't solve the problem.
> Is there a good solution to this, or do I have to set LOCALBASE with the
> resulting build of everything else, not just the things that I need to
> upgrade for this work?  Hopefully there's a way to extend the normal
> search path for port builds?
> Thanks for any hints,

Try setting LIB_DIRS.  Its default value is "/lib /usr/lib ${LOCALBASE}/lib".

More information about the freebsd-questions mailing list