[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-arch
Subject:    Re: Overlinking in base
From:       Kurt Lidl <lidl () pix ! net>
Date:       2014-11-07 15:39:16
Message-ID: 545CE7A4.8060804 () pix ! net
[Download RAW message or body]

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

_______________________________________________
freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic