From owner-freebsd-hackers@freebsd.org Thu Aug 2 15:33:59 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EDD6106A5E6 for ; Thu, 2 Aug 2018 15:33:59 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (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 DD60A8D725 for ; Thu, 2 Aug 2018 15:33:58 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 462715A9F17; Thu, 2 Aug 2018 15:33:57 +0000 (UTC) Date: Thu, 2 Aug 2018 15:33:57 +0000 From: Brooks Davis To: Eric McCorkle Cc: freebsd-hackers@freebsd.org Subject: Re: A few build system questions Message-ID: <20180802153357.GA25687@spindle.one-eyed-alien.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FCuugMFkClbJLl1L" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Aug 2018 15:33:59 -0000 --FCuugMFkClbJLl1L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 02, 2018 at 11:17:06AM -0400, Eric McCorkle wrote: > Hi, >=20 > I have a few questions about how to accomplish some things with the > build system. >=20 > First, I want to create some libraries that exist only as static > archives, meaning no shared object (ex. libsomething.a, but no > libsomething.so) If it's something for use by only the base system PRIVATELIB=3D will do it (and change the name to libprivatesomethi.a). If you want to be broadly available outside the base system, NO_SHARED=3D should do it IIRC. > Second, how do I arrange to have sources be generated prior to the > build? I can probably get away with having a shell script that does it, > but I may require a tool to be built. If it's a shell script add a target for the sources. If there's a compiled tool then you need a build-tools target to build the tool in the right stage of the bootstrap process. > Third, how would I go about creating a kind of derived library- that is, > one created by invoking a whole bunch of linker/objcopy/etc commands on > some other library? That is to say, "I want to get libsomething.a by > running this script that processes libsomethingelse.a". You'll probably want to add a libsomething.a target that depends on libsomethingelse.a and the script and add libsomething.a to _LIBS in the libsomethingelse Makefile. You will also need to make certain the script has the right failure modes (e.g. doesn't create libsomething.a unless it succeeds even if it or it's children are killed with kill -9) or life will get very confusing. You'll want to get review from at least bdrewery@ and brd@ for anything non-standard. -- Brooks --FCuugMFkClbJLl1L Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJbYyRkAAoJEKzQXbSebgfA8e0IAJ+AGiiSqnYI0Lztgy1C+QBY 30BNdUmkVnPUZn0x+HOO3GKDxFmTPhn2Zmg4C7Ugho3jpQI3ASssw0x2Fuen3VN0 C/rUxfNKu8OwkOZL73rai4slw93u47IlF+QRdfAcTvg0n+s/mrukPVLRXZRilKmh JYKQ+qb44vIOzZ1qY2HihJoPRenvdASKDBU/DrY9vhvc0pig4/AvzwSBBdKWDyfU tkZeekePYvSVZ8eyjdjXJ2HlKVKAzQR5puaSEteAkGEqfHLmZb8asmV7O1+NLQkd Mt7c8k6Ise0hSm1C4fhAWv1LltPg7l43h/b6VHdNR6GdfobK/Nxv+ba5ptNW+kA= =5QSc -----END PGP SIGNATURE----- --FCuugMFkClbJLl1L--