From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2916 invoked from network); 22 Nov 2004 18:32:38 +0000 Received: from smtp.gentoo.org (156.56.111.197) by lists.gentoo.org with AES256-SHA encrypted SMTP; 22 Nov 2004 18:32:38 +0000 Received: from lists.gentoo.org ([156.56.111.196] helo=parrot.gentoo.org) by smtp.gentoo.org with esmtp (Exim 4.41) id 1CWIzN-00047T-Tw for arch-gentoo-dev@lists.gentoo.org; Mon, 22 Nov 2004 18:32:37 +0000 Received: (qmail 1757 invoked by uid 89); 22 Nov 2004 18:32:37 +0000 Mailing-List: contact gentoo-dev-help@gentoo.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Received: (qmail 19196 invoked from network); 22 Nov 2004 18:32:37 +0000 Date: Mon, 22 Nov 2004 13:27:00 -0500 X-OfflineIMAP-x2119662922-70696d656e7473656e64-494e424f582e4f7574626f78: 1101148355-0962866606716-v4.0.8 From: Aron Griffis To: gentoo-dev@lists.gentoo.org Message-ID: <20041122182700.GD16482@kaf.zk3.dec.com> Mail-Followup-To: gentoo-dev@lists.gentoo.org References: <419EE0D6.2090900@gentoo.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0ntfKIWw70PvrIHh" Content-Disposition: inline In-Reply-To: <419EE0D6.2090900@gentoo.org> User-Agent: Mutt/1.5.6i Subject: Re: [gentoo-dev] CUSTOM cflags replacement snippet X-Archives-Salt: 562c56a4-0a0f-46c7-81eb-3822fc839b23 X-Archives-Hash: bc1fccae6bdd20a111fbb7e210949bb2 --0ntfKIWw70PvrIHh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Chris, Chris White wrote: [Sat Nov 20 2004, 01:14:46AM EST] > Go ahead and flame, just thought I'd toss it here to make people's lives= =20 > 2% easier :). As was mentioned later in the thread, this is not the right approach. Sedding the Makefiles is error-prone because you use a variable in the RHS of the sed expression. Whether it works for you in your limited tests is irrelevant. You shouldn't be willingly inserting error-prone code into ebuilds. There are two different ways you can deal with the CFLAGS issue instead. Both are better than the sed method. 1. If the Makefiles are well-constructed and flags are appropriate passed to sub-makes, then you can do: emake CFLAGS=3D"${CFLAGS}" CXXFLAGS=3D"${CXXFLAGS}" 2. If the Makefiles do lazy assignment of variables instead of immediate assignment, then you can simply append a new assignment to the bottom of the ebuild. Here is the comparison of lazy vs. immediately assignment: # lazy assignment CFLAGS =3D -g # immediate assignment CFLAGS :=3D -g Almost all Makefiles use lazy assignment. In that case you can use a snippet like the following which will override all previous assignments in the ebuild: find "${S}" -name Makefile | while read mf; do printf "\n\nCFLAGS =3D %s\nCXXFLAGS =3D %s\n" \ "${CFLAGS}" "${CXXFLAGS}" >> "$mf" done Regards, Aron -- Aron Griffis Gentoo Linux Developer --0ntfKIWw70PvrIHh Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFBoi90JrHF4yAQTrARAlBKAJ9mgpI7jbcd2bdOisc3SCDoBQrjUgCfalUA 81efbHoPurQQzQUK0CKhFmo= =vacD -----END PGP SIGNATURE----- --0ntfKIWw70PvrIHh--