xdm(1) is built-in with the X11 Windows System on OpenBSD.
gdm is packaged with Gnome,
kdm is packaged with KDE.
My recommendation is to use packages available for OpenBSD on the sparc64 architecture, rather than trying to build applications yourself. For example,
afterstep and
windowmaker are both available as packages for sparc64.
Porting your own applications to OpenBSD will usually require skills and knowledge you do not appear to have.