Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 May 2009 22:56:57 +0200
From:      Mel Flynn <mel.flynn+fbsd.questions@mailing.thruhere.net>
To:        freebsd-questions@freebsd.org, Polytropon <freebsd@edvax.de>
Cc:        francis keyes <fkeymo@gmail.com>, Chuck Robey <chuckr@telenix.org>
Subject:   Re: compiling FreeBSD date on Linux
Message-ID:  <200905202256.57922.mel.flynn%2Bfbsd.questions@mailing.thruhere.net>
In-Reply-To: <20090520215702.826770e3.freebsd@edvax.de>
References:  <d64607cc0905191419p621f7e65tf5515d1d3696bfa0@mail.gmail.com> <d64607cc0905201045i36084a34g2a6c0d4e9d5f750d@mail.gmail.com> <20090520215702.826770e3.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help

#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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905202256.57922.mel.flynn%2Bfbsd.questions>