Ok, I've been meaning to upload this for a while, but just didn't get around to it until now. Every since I started with Gentoo until about a month ago I kept changing my CFLAGS all the time, and of course compiling things as i went with all different flags.

Well, the question has been asked, and I myself wondered... how do I only compile packages that haven't ALREADY been compiled with my existing CFLAGS? Or, how can I automatically re-compile all the packages I've compiled with -O3 to -O2 (my current pref). Going from -O3 to -O2 was my biggest push...

I wrote my own answer... try running it with no parameters to get the built in help... please provide feedback, thoughts, constructive critism, bug reports, etc... and let me know if you find this useful.

${YL}Notes${NO}:
Some packages modify your custom CFLAGS for improved stability. It may
not be possible to get ${BR}_every_${NO} package on your system compiled
with your exact CFLAGS.

${YL}Examples${NO}:
${PROG} -l list packages not compiled with current CFLAGS
${PROG} -v same as above, but show the CFLAGS used to compile
${PROG} -vv \"\", but show pkgs compiled with current CFLAGS as well
${PROG} -g sys-apps show only packages in the sys-apps group
${PROG} bash show only packages that match \"bash\"

${PROG} --flags O3 show only pacakges compiled with O3 in the CFLAGS
"
exit
fi

# remove the includes and other stuff that are added by some builds
p_cflags=${p_cflags%% -I*}
p_cflags=${p_cflags/ -Wno-deprecated/}
# remove -g from end od gnome-common build
[ "${n#gnome-base/gnome-common}" ] && p_cflags=${p_cflags/ -g/}

Fine by me. I'd be happy to officially maintain it as long as I can. I have a few ideas for improvements, but it currently does all I need. Though I'd be happy to add features based on suggestions of others.

I've always wanted a little proggy to maintain even if it isn't much...

This is a tip rather than a support question, so I'm moving it to Documentation, Tips & Tricks from Portage and Programming._________________"An empty head is not really empty; it is stuffed with rubbish. Hence the difficulty of forcing anything into an empty head."
-- Eric Hoffer

There is no fancy logic to detect your CFLAGS, it simple sources (includes) your make.conf file at the top of the script and then it prints the value of CFLAGS... check to make sure your make.conf isn't defining CFLAGS twice and it's the latter one that qcflags is printing (and all your programs are using to compile).