compiling FreeBSD date on Linux

Mel Flynn mel.flynn+fbsd.questions at
Wed May 20 20:57:17 UTC 2009

#warning "Pedantic mode on"
#define TOPIC "BSD build system tricks"

On Wednesday 20 May 2009 21:57:02 Polytropon wrote:

> > DPADD=    ${LIBUTIL}
> Needs to compile what ${LIBUTIL} point to, usually the
> libutil directory in the src/ tree.

This is the actual build dependency and the var is defined in

> > LDADD=    -lutil
> Additional info for the linker: link against libutil.
> This indicates that libutil is a build dependency for
> the date program.

It's a linker statement, while it's logical that libutil has to be built 
before it can be linked against, this does in fact not have to be the same 
libutil, so what this line really cares about is that or libutil.a 
is resolvable via the various linker rules.

One can in fact do:

This will link the static libutil from and then try to link 
with /usr/local/lib/, before looking elsewhere.


More information about the freebsd-questions mailing list