From owner-freebsd-arch@FreeBSD.ORG Fri Nov 7 15:39:19 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82288E42 for ; Fri, 7 Nov 2014 15:39:19 +0000 (UTC) Received: from hydra.pix.net (hydra.pix.net [IPv6:2001:470:e254::4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D22A650 for ; Fri, 7 Nov 2014 15:39:19 +0000 (UTC) Received: from torb.pix.net (torb.pix.net [IPv6:2001:470:e254:10:12dd:b1ff:febf:eca9]) (authenticated bits=0) by hydra.pix.net (8.14.9/8.14.9) with ESMTP id sA7FdH2O022034; Fri, 7 Nov 2014 10:39:17 -0500 (EST) (envelope-from lidl@pix.net) Message-ID: <545CE7A4.8060804@pix.net> Date: Fri, 07 Nov 2014 10:39:16 -0500 From: Kurt Lidl User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: freebsd-arch@freebsd.org Subject: Re: Overlinking in base References: <3912.1415233494@chaos> In-Reply-To: <3912.1415233494@chaos> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 15:39:19 -0000 Simon J Gerrart wrote: > Baptiste Daroussin 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