The lyx configure script find xpm.h as xpm.h instead of as X11/xpm.h.
checking for XOpenIM... yes checking for XpmCreateBufferFromImage in -lXpm... yes checking for X11/xpm.h... yes checking xpm header version... 4.11 checking for fl_initialize in -lforms... yes checking for X11/forms.h... no Seems fine this side.
I get ... checking for XOpenIM... yes checking for XpmCreateBufferFromImage in -lXpm... yes checking for X11/xpm.h... no checking for xpm.h... no checking for fl_initialize in -lforms... yes checking for X11/forms.h... no checking for forms.h... no I have xfree-4.2.0-r12
Please emerge the masked lyx-1.2.0.20020705, it should work. Explanation: the 1.2.0 ebuild has one set of compile issues (including but not limited to this xpm issue) and the masked 1.2.0.20020705 ebuild has a different set. 1.2.0 failed for me and other users, so I made the snapshot. The snapshot failed for owen and some other users, so he masked it. We're currently trying to find/construct a version that will work for everyone.
lyx-1.2.0.20020705 works correctly...
Latest xfree and baselayout should add the /usr/include/X11 symlink properly.