Date: Thu, 6 Nov 2014 14:05:55 +0100 From: Baptiste Daroussin <bapt@freebsd.org> To: "Simon J. Gerraty" <sjg@juniper.net> Cc: Konstantin Belousov <kostikbel@gmail.com>, arch@freebsd.org Subject: Re: Overlinking in base Message-ID: <20141106130555.GP10388@ivaldir.etoilebsd.net> In-Reply-To: <3912.1415233494@chaos> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <bapt@freebsd.org> 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20141106130555.GP10388>