Compiling Cygwin/X doesn't have to be hard, although the X Window System source code tree is reasonably large. There are a few simple techniques that make building the source code, keeping the source code up to date, and keeping the source code organized much easier.
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
bzip2
diffutils
fileutils
findutils
flex
gawk
gcc
git
make
patch
sed
tar
zlib
Follow these steps to create a standard, non-debug, build:
Change the current directory to your X Window System development directory:
Username@CygwinHost ~ $ cd x-devel Username@CygwinHost ~/xserver $ ./configure --prefix=/usr [lots of output] $ make [lots more output] |
Standard build is now complete.
Note: XXX: Add figures for normal diskspace occupied by source, additional diskspace occupied by build, and a benchmark time for the build to complete
XXX: Describe configure option for specifying a builddir
Follow these steps to create a build with debugging information:
Change the current directory to your X Window System development directory:
Username@CygwinHost ~ $ cd x-devel Username@CygwinHost ~/xserver $ ./configure --prefix=/usr --enable-debug CFLAGS="-g -O0" [lots of output] $ make [lots more |
Debug build is now complete.
Follow these steps to run the built X server:
Change the current directory to your X Window System development directory:
Username@CygwinHost ~ $ cd xserver Username@CygwinHost ~/xserver $ |
Invoke the hw/xwin/Xwin executable:
Username@CygwinHost ~/xserver $ hw/xwin/XWin |
The X server you have built will now attempt to run.
Installing a local build enables you to verify that a build of the entire source tree is operational. It is wise to verify the operation of full builds of the source tree from time to time, as full builds will occasionally be broken by changes that other developers are making to the X Window System source code tree.
Installing a local build on top of an existing build is not a good idea, as this can mask problems that occurred during the build process, or it can cause problems that are unrelated to the build process; either situation is undesirable. It is generally a good idea to move your old installation out of the way before installing a local build, and these instructions will assume that you desire to do so. Follow the instructions below to install a local build:
Change the current directory to your desired X Window System build directory:
Username@CygwinHost ~ $ cd ~/xserver/build/build-prefix Username@CygwinHost ~/xserver/build/build-prefix $ |
Make the install target, which installs everything:
Username@CygwinHost ~/xserver/build/build-prefix $ make install Username@CygwinHost ~/xserver/build/build-prefix $ |
git makes keeping your source code tree up to date easy. Consult the git documentation for details.