Trying to emerge xemacs, I saw its configure does not find ncurses.h. This happens as one of the last checks in configure searches it in the ncurses dir. I will provide a patch that allows it to configure wrt the option
Created attachment 75304 [details, diff] patch to fix ncurses detection I assume you apply this just after the gdbm patch. Changes the configure.in as well, so the order in the e-build may be important (before the gdbm one could confuse patch, after autoconf it's useless)
It is not really clear to me what kind of problem this patch is trying to solve. If I emerge xemacs it has the --with-ncurses option on by default and it also finds the correct include files. This can be checked in the src/config.h file and also in the text summary printed at the end of the configure phase. As far as I can tell the patch changes a check for ncurses include files that are specifically in the ncurses directory. At least on x86 and amd64 we don't seem to have those, and the specific problem that is being checked does not apply in this case. Could you elaborate on the platform, xemacs version, and on the problem that this patch solves?
I'm closing this bug with NEEDINFO, without additional info I can't really do much with this report, especially since I cannot reproduce the problem.