Hi! Call me a "control freak", but I would like to be able to specify the CFLAGS on a "per-package" basis. Let me explain my reasons: + There are some packages that can break if you compile them with a aggressive optimizations (ie, -O3, I think octave is one of them), and there are others wich have their own optimizations by default (mplayer, I think), wich varies from file-to-file in the compilation, so for these would be better to "undef" CFLAGS and CXXFLAGS completely. + There are packages that can be compiled with a more aggressive mode, and others don't, so I would like to be able to use -O3 for some packages, and -O2 for others, and even -O0 for some, and for others no CFLAGS at all. I know I can do this by emerging a package, and changing make.conf, and then emerge the next one, and so on.... or I can set the CFLAGS in the command line, but it means that I have to change it every time I emerge the package..... that wouldn't be a problem if I only needed to do it once, but I have to do it every time the package is updated..... At the moment we can control the "dependecies" (aka, USE) in a per-packages basis, but I think that CFLAGS and CXXFLAGS would be nice too. What do you think? Ildefonso Camargo
I think I don't like it, personally. Oft requested feature, rewrite will allow for it to be added; won't be added to stable though (imo). meanwhile echo $' if [ "${CATEGORY}/${PN}" == "dev-util/diffball" ]; then export CFLAGS="the-cflags" export CXXFLAGS=${CFLAGS} fi ' >> /etc/portage/bashrc Will accomplish what you want. Personally, I'd suggest hunting for solar's bashrc; it's hella cleaner then the trick I mentioned above, gives you a fair amount more control (using bashrc as effectively indirection to load up custom bashrc's dependant on the cat/pkg).
http://dev.gentoo.org/~solar/portage_misc/bashrc Example usage of CAT and CAT/PN (atoms are not supported) http://dev.gentoo.org/~solar/portage_misc/package.cflags Comment out the bashrc.autopatch at the end of the bashrc or snag the http://dev.gentoo.org/~solar/portage_misc/bashrc.autopatch
Reopening for duping.
*** This bug has been marked as a duplicate of bug 44796 ***