Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 07 Nov 2014 10:39:16 -0500
From:      Kurt Lidl <lidl@pix.net>
To:        freebsd-arch@freebsd.org
Subject:   Re: Overlinking in base
Message-ID:  <545CE7A4.8060804@pix.net>
In-Reply-To: <3912.1415233494@chaos>
References:  <3912.1415233494@chaos>

next in thread | previous in thread | raw e-mail | index | archive | help
Simon J Gerrart wrote:
> Baptiste Daroussin <bapt at freebsd.org> wrote:
>> In the second case we could do it via make(1)
>> LIBADD=	liba libc libc
>> this will open something like a ${PATHTOTHELIB}/link.mk which will define
>> DYNAMIC_ADD
>> STATIC_ADD
>>
>> And this could be recursive.
>
> We do something like that in the Junos build
>
> prog makefile might have DPLIBS+= ${LIBFOO}
> which is exactly equivalent to
>
> LDADD+= -lfoo
> DPADD+= ${LIBFOO}
>
> but ensures that they stay in sync (not so important now with meta
> mode).
>
> bsd.libnames.mk can then have
>
> DPLIBS_libfoo += ${LIBGOO}
> DPLIBS_libgoo += ${LIBZOO}
>
> All of which is processed by dpadd.mk which you can find in
> contrib/bmake/mk
> Though dpadd.mk ignores DPLIBS_libgoo += ${LIBZOO} if LIBZOO has already
> been added.

Wow, I wish I had know that this existed.  I ended up writing an simpler
version of this for some work last year.  This was mostly so we didn't
have to track the same library twice, for both LDADD and DPADD.

I'm totally in favor of something that exposes this to wider usage,
like having it in /usr/share/mk rather than hidden away in the source
tree only.

-Kurt




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?545CE7A4.8060804>