Overlinking in base

Simon J. Gerraty sjg at juniper.net
Thu Nov 6 00:25:08 UTC 2014


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.



More information about the freebsd-arch mailing list