From owner-freebsd-arch@FreeBSD.ORG Thu Nov 6 13:06:01 2014 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4162216 for ; Thu, 6 Nov 2014 13:06:01 +0000 (UTC) Received: from mail-wi0-x235.google.com (mail-wi0-x235.google.com [IPv6:2a00:1450:400c:c05::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1D4C0D for ; Thu, 6 Nov 2014 13:06:01 +0000 (UTC) Received: by mail-wi0-f181.google.com with SMTP id n3so1420422wiv.8 for ; Thu, 06 Nov 2014 05:05:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=8sH3oOOfQOt7wfV/PR6CD8kg0G1NOghTxqog4FvTzKc=; b=lOnvwAPmH3CTjzIDao8g2QQ+msvHcnLYu9O+rViEMJx5fcmK8HW+KsNKbRghDROrpl JNnZwu6ZYhm/Dw/Ck+aN2DYDTagLKquC5ymSbKfqkaNagj9QEOmvGaAAky3FV8QrOESS y0nYwWA5Hz+rhBiUz7XG4VC30ZuD0NBlSNwU3HXeFx8zjhGEyNIFNtblc6qvCBdpQP6N SyV2tRdUiJtIxwzARkkHhGYAkQysBU/bN6bH8eiZ/WK8wzHMYqGhKNW3rhu/4dyJbGYx eNb/cu88Ql1ZFtWE7ieiEX9yGU8iPQHz/XBQzIr8XwaIVdqjd9HnDDD5JQDzhsQeFeW1 A/Sw== X-Received: by 10.194.240.68 with SMTP id vy4mr5625425wjc.36.1415279159641; Thu, 06 Nov 2014 05:05:59 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id mc4sm8247663wic.6.2014.11.06.05.05.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Nov 2014 05:05:58 -0800 (PST) Sender: Baptiste Daroussin Date: Thu, 6 Nov 2014 14:05:55 +0100 From: Baptiste Daroussin To: "Simon J. Gerraty" Subject: Re: Overlinking in base Message-ID: <20141106130555.GP10388@ivaldir.etoilebsd.net> References: <20141105113839.GG10388@ivaldir.etoilebsd.net> <20141105125431.GD53947@kib.kiev.ua> <20141105125931.GJ10388@ivaldir.etoilebsd.net> <20141105133029.GH53947@kib.kiev.ua> <20141105134006.GL10388@ivaldir.etoilebsd.net> <3912.1415233494@chaos> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZgGN478A9hzzvyZc" Content-Disposition: inline In-Reply-To: <3912.1415233494@chaos> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Konstantin Belousov , arch@freebsd.org 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: Thu, 06 Nov 2014 13:06:02 -0000 --ZgGN478A9hzzvyZc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 05, 2014 at 04:24:54PM -0800, Simon J. Gerraty wrote: > Baptiste Daroussin wrote: > > In the second case we could do it via make(1) > > LIBADD=3D liba libc libc > > this will open something like a ${PATHTOTHELIB}/link.mk which will defi= ne > > DYNAMIC_ADD > > STATIC_ADD > >=20 > > And this could be recursive. >=20 > We do something like that in the Junos build >=20 > prog makefile might have DPLIBS+=3D ${LIBFOO} > which is exactly equivalent to >=20 > LDADD+=3D -lfoo > DPADD+=3D ${LIBFOO} >=20 > but ensures that they stay in sync (not so important now with meta > mode). >=20 > bsd.libnames.mk can then have >=20 > DPLIBS_libfoo +=3D ${LIBGOO} > DPLIBS_libgoo +=3D ${LIBZOO} >=20 > All of which is processed by dpadd.mk which you can find in > contrib/bmake/mk > Though dpadd.mk ignores DPLIBS_libgoo +=3D ${LIBZOO} if LIBZOO has already > been added. >=20 I'am about to add something based on the following principle: https://people.freebsd.org/~bapt/plop.diff With a bit more changes The version I have now (a bit different from the patch now :)) allows multi= ple things: 1/ simplify the Makefile for users: LIBADD=3D m archive util instead of DPADD=3D ${LIBM} ${LIBARCHIVE} ${LIBUTIL} LDADD=3D -lm -larchive -lutil 2/ ensure dependencies are automatically tracked For example -lucl needs -lm adding LIBADD=3D ucl does the magic by itself 3/ allow to build any single binary statically so far I'm able to build everything is bin sbin usr.bin and usr.sbin statically (which wasn't doable before) 3/ hides the private/internal lib from the final user Do more need to say USEPRIVATELIB because I do use a libunbound it is autom= atic regards, Bapt --ZgGN478A9hzzvyZc Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlRbcjMACgkQ8kTtMUmk6EzVjQCeP5y4K5uJZH0WKPqEFAJweEji dH8AnRCe52hvTFnhSuOCR18qbi8HKx4y =IUji -----END PGP SIGNATURE----- --ZgGN478A9hzzvyZc--