compiling FreeBSD date on Linux

Mel Flynn mel.flynn+fbsd.questions at mailing.thruhere.net
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 bsd.libnames.mk.

>
> > 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 libutil.so or libutil.a 
is resolvable via the various linker rules.

One can in fact do:
LDFLAGS=-L/usr/local/lib
LDADD=${LIBUTIL} -lutil

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

-- 
Mel


More information about the freebsd-questions mailing list