On 01/10/2011 10:29 PM, Alex Schuster wrote:
Nikos Chantziaras writes:

Is there a way to enable debugging symbols only for some packages?  I
need to do that for about 15 packages.  Currently, all I can do is edit
make.conf all the time when emerging one of those and add "-g" to CFLAGS
and "splitdebug" to FEATURES.  But I *always* forget about it the first
time, ending up building twice.

This is possible. I have the problem that older GCCs do not know about
the -march=k8-sse3 CFLAG, so I had to change this to build them. So, I
created the file /etc/portage/env/sys-devel/gcc:3.4, containing this:

   touch /tmp/package.env-gcc:3.4
   CFLAGS="-march=k8"
   CXXFLAGS=$CFLAGS

The files can contain any bash code. I added the touch comand in order
to verify that this code is actually being used. You could put this
inside there:

   CFLAGS="$CFLAGS -g"
   CXXFLAGS=$CFLAGS
   FEATURES="$FEATURES splitdebug"

This seems to work for me.

Seems to work here too. Though it seems to be sourced four times. The packages are being compiled with "-g -g -g -g" :P But in this case it doesn't harm anything.


The portage man page has some info about
this, it also mentions /etc/portage/package.env containing lines like
   <category>/<package>  <conffile>
with<file>  being /etc/portage/env/<conffile>. It suggests to use this
instead of my approach I described above. I did not use this yet, I
assume it should be used when making generic changes for a package, but
as I want the change not for all GCCs, but only for certain slots, I use
the method I described.

Thanks for the pointer. It looks like this is even better since you only need one file to deal with.


I'm using portage-2.2 BTW.

2.1 here.


Reply via email to