Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo Portage Developer (http://www.linux-archive.org/gentoo-portage-developer/)
-   -   "official way" for setting per package CFLAGS and FEATURES? (http://www.linux-archive.org/gentoo-portage-developer/566334-official-way-setting-per-package-cflags-features.html)

Zac Medico 08-20-2011 02:42 PM

"official way" for setting per package CFLAGS and FEATURES?
 
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

Pacho Ramos 08-27-2011 06:39 PM

"official way" for setting per package CFLAGS and FEATURES?
 
El sáb, 20-08-2011 a las 07:42 -0700, Zac Medico escribió:
> 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 a lot for the updated information, will migrate to new approach
as soon as possible :-)


All times are GMT. The time now is 08:46 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.