Many developer libraries and developer tools are required to build Cygwin/X. Several packages are required in addition to the default packages installed by the Cygwin installer. Following is a list of additional packages that are required to compile Cygwin/X natively in Cygwin. Note that some of these packages are meta packages that will automatically cause several other packages to be selected for installation; do not unselect any of these automatically selected packages.
autoconf, automake, binutils, bison, bzip2, cygport, diffutils, fileutils, findutils, flex, gawk, gcc4, git, libtool, make, patch, pkg-config, sed, tar
Required protocol headers:
bigreqsproto, compositeproto, damageproto, dmxproto, fixesproto, fontsproto, glproto, inputproto, kbproto, randrproto, recordproto, renderproto, resourceproto, scrnsaverproto, windowswmproto, xcmiscproto, xextproto, xineramaproto, xproto, xf86bigfontproto
Required development libraries:
libdmx-devel, libfontenc-devel, libglapi-devel, libfreetype-devel, libGL-devel, libpixman1-devel, libX11-devel, libXau-devel, libXaw-devel, libxcb-icccm-devel libxcb-image-devel, libXdmcp-devel, libXext-devel, libXfont-devel, libXinerama-devel, libXmu-devel, libXpm-devel, libXRes-devel, libxkbfile-devel, zlib
Other miscellaneous required packages :
dri-drivers, font-util, khronos-opengl-registry, xorg-util-macros, xtrans
Note: The /usr/share/doc/Cygwin/xorg-server-n.n.n.README file installed with the X server binary package lists up-to-date runtime and build requirements.
Tip: Use setup -q -Ppackagename,packagename,etc. to quickly install the required packages.
libXfont must be statically linked for the server to start correctly, otherwise it fails with errors loading all fonts, including the mandatory fixed font.
This is due to limitations of Cygwin's current weak symbol handling, which requires static linking to work correctly. For example, in libXfont the RegisterFPEFunctions function is defined weak and should be overloaded with RegisterFPEFunctions defined in dix/dixfont.c in the xserver. However, such overloading will only currently work for Cygwin when libXfont is statically linked with the X server, and not as a shared libary.
If Cygwin's libXfont-devel package contains a shared library stub, /usr/lib/libXFont.dll.a, when building the X server, you must prepare your compilation environment so that the libXfont shared libary stub is not linked with.
A quick and dirty way of achieving this is to move libXFont.la and libXfont.dll.a aside whilst building the X server.
mv /usr/lib/libXFont.la /usr/lib/libXFont.la.old mv /usr/lib/libXFont.dll.a /usr/lib/libXFont.dll.a.old
A cleaner way is to generate a customized .pc file for libXfont and arrange for that to be in your PKG_CONFIG_PATH when ./configuring the X server. For example:
sed -e 's| -lXfont| /usr/lib/libXfont.a|' /usr/lib/pkgconfig/xfont.pc > ~/xfont.pc export PKG_CONFIG_PATH=~:$PKG_CONFIG_PATH