Unpack the XFree86 source. (tar -xzf XFree86-3.3.tar.gz '*/programs/xdm/*')

Change into the xdm source directory.

Apply the patch with patch -p1 <xdm-load.patch

Run Imake (xmkmf -a)

Make the program (make)
