nas-1.7-r1 (and possibly others) have some compile-time dependencies, which are not checked. Namely, before "emerge nas" you need to do: emerge x11-misc/imake x11-misc/gccmakedep app-text/rman otherwise compilation will fail.
Funny, just found this in the ebuild: DEPEND="${RDEPEND} || ( ( x11-misc/gccmakedep x11-misc/imake app-text/rman x11-proto/xproto ) virtual/x11 )" I can confirm that this does not work with xorg 7.0 r1; it doesn't seem to pull in these packages therefore the dependancy on virtual/x11 is probably insufficient.
*** This bug has been marked as a duplicate of 127617 ***