From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Qumli-0005gC-SR for garchives@archives.gentoo.org; Sat, 20 Aug 2011 14:43:27 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C5BC921C266; Sat, 20 Aug 2011 14:43:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id F002321C263 for ; Sat, 20 Aug 2011 14:43:01 +0000 (UTC) Received: from [192.168.26.4] (ip98-164-193-252.oc.oc.cox.net [98.164.193.252]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: zmedico) by smtp.gentoo.org (Postfix) with ESMTPSA id 606551B401A for ; Sat, 20 Aug 2011 14:43:01 +0000 (UTC) Message-ID: <4E4FC7F3.7030107@gentoo.org> Date: Sat, 20 Aug 2011 07:42:59 -0700 From: Zac Medico User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:5.0) Gecko/20110705 Thunderbird/5.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-portage-dev@lists.gentoo.org Subject: Re: [gentoo-portage-dev] "official way" for setting per package CFLAGS and FEATURES? References: <1247940945.2134.2.camel@localhost> <4A638016.3040602@gentoo.org> In-Reply-To: <4A638016.3040602@gentoo.org> X-Enigmail-Version: 1.2pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Archives-Salt: X-Archives-Hash: b3274fa5e760792fd27b86e36303b986 On 07/19/2009 01:20 PM, Zac Medico wrote: > Pacho Ramos wrote: >> Hello, I would want to always merge xorg-server, libdrm, and intel >> driver (that likes to crash a lot) to be always compiled with debugging >> symbols and FEATURES="${FEATURES} splitdebug" >> >> Searching in google seems that there are some available hacks done by >> some forums users, but they seem to be a bit old and, before trying >> them, I would want to know if there is an "official" way of doing it. >> >> Thanks a lot :-) > > I use pre_pkg_setup hooks defined in /etc/portage/env. For example: > > cat /etc/portage/env/sys-libs/glibc > > pre_pkg_setup() { > local x > for x in installsources splitdebug ; do > if ! has $x $FEATURES ; then > elog "bashrc is adding $x to FEATURES for $PN" > FEATURES="$FEATURES $x" > fi > done > > if ! hasq -ggdb $CFLAGS ; then > elog "bashrc is adding \"-ggdb\" to CFLAGS for $PN" > CFLAGS="$CFLAGS -ggdb" > fi > } Please note that the above approach has been deprecated since portage-2.1.9.24, due to inclusion of package.env support: http://bugs.gentoo.org/show_bug.cgi?id=44796 In order to accomplish the same thing with package.env, you'd put something like "sys-libs/glibc debug.conf" in /etc/portage/package.env, and then you put your FEATURES and CFLAGS variable settings in /etc/portage/env/debug.conf (same format as make.conf). This is documented in the portage man page. -- Thanks, Zac