It is often the case, that when you emerge some package portage calculates something like this: To merge dev-foo/bar you have to enable the useflag foo in package app-bar/asdf. Add the line: >=app-bar/asdf-0.1.0 foo to the specific config files. My suggestion would be, to enable automatic useflag dependencies. This could be done by settings this as portage feature in /etc/portage/make.conf. The behaviour could be as followed: If an ebuild the user wants to merge needs several packages recompiled with other useflags, a warning is given "The following ebuilds are causing rebuilds with useflag ..." (or something similar) and all ebuilds are remerged automatically with the required useflags. If at some time the user unmerge the previous package and after that do an "emerge -N world", than all packages with "automatic useflags" enabled should be remerged without these useflags. My motivation behind this is to help to hold the config files clean, so only useflags the user has set by itself are listed. (BTW: More less the same feature is possible with keywords, so only keywords for world packages are necessary.)
*** This bug has been marked as a duplicate of bug 258371 ***