On a fresh x86 install, while installing xorg-7.0, mesa-6.5-r4 failed to compile. After searching the forums i found a post that suggested that you should reinstall openmotif. At this point in the process openmotif had already been installed (after fixing a missing symlink I will file a report on that as well). running emerge --oneshot openmotif installed the following. xbitmaps, libXp,libXpm,ed,and libXaw. This packages were slated to be installed after mesa in my original, emerge virtual/x11. While examining the portage log of the initial mesa emerge I found that the header file Xm/PrimiativeP.h wasn't found. I can only assume that in the long and complicated proccess of walking the tree for the virtual/x11 ebuild it put the wrong order for the emerging of the dependencies.After the above file packages were installed, mesa installed with no problems.
*** This bug has been marked as a duplicate of 133671 ***