Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] "official way" for setting per package CFLAGS and FEATURES?
Date: Sat, 20 Aug 2011 14:43:27
Message-Id: 4E4FC7F3.7030107@gentoo.org
In Reply to: Re: [gentoo-portage-dev] "official way" for setting per package CFLAGS and FEATURES? by Zac Medico
1 On 07/19/2009 01:20 PM, Zac Medico wrote:
2 > Pacho Ramos wrote:
3 >> Hello, I would want to always merge xorg-server, libdrm, and intel
4 >> driver (that likes to crash a lot) to be always compiled with debugging
5 >> symbols and FEATURES="${FEATURES} splitdebug"
6 >>
7 >> Searching in google seems that there are some available hacks done by
8 >> some forums users, but they seem to be a bit old and, before trying
9 >> them, I would want to know if there is an "official" way of doing it.
10 >>
11 >> Thanks a lot :-)
12 >
13 > I use pre_pkg_setup hooks defined in /etc/portage/env. For example:
14 >
15 > cat /etc/portage/env/sys-libs/glibc
16 >
17 > pre_pkg_setup() {
18 > local x
19 > for x in installsources splitdebug ; do
20 > if ! has $x $FEATURES ; then
21 > elog "bashrc is adding $x to FEATURES for $PN"
22 > FEATURES="$FEATURES $x"
23 > fi
24 > done
25 >
26 > if ! hasq -ggdb $CFLAGS ; then
27 > elog "bashrc is adding \"-ggdb\" to CFLAGS for $PN"
28 > CFLAGS="$CFLAGS -ggdb"
29 > fi
30 > }
31
32 Please note that the above approach has been deprecated since
33 portage-2.1.9.24, due to inclusion of package.env support:
34
35 http://bugs.gentoo.org/show_bug.cgi?id=44796
36
37 In order to accomplish the same thing with package.env, you'd put
38 something like "sys-libs/glibc debug.conf" in /etc/portage/package.env,
39 and then you put your FEATURES and CFLAGS variable settings in
40 /etc/portage/env/debug.conf (same format as make.conf). This is
41 documented in the portage man page.
42 --
43 Thanks,
44 Zac

Replies