Obtaining the Source Code

Obtaining via Cygwin setup

The source code for the packages distributed via Cygwin setup is also available via Cygwin setup. To install the source for the X server, run Cygwin setup and tick the 'Src?' check-box for the 'xorg-server' package.

This may have multiple patches applied on top of the upstream X.Org X Window System source code, and is known to build and function on Cygwin, so this should be the starting point for new developers.

On installing the source code package, setup will unpack it under /usr/src. You should find the source archive, any needed .patch files, and a .cygport file which automates the distribution configuration, build and packaging tasks.

Note: Due to the large number of patches applied to the upstream source, the current source package contains a source archive prepared directly from a git repository containing those patches on top of the upstream source, rather than containing the upstream source archive and many separate patches.

The sources can unpacked and prepared using cygport as follows:


Username@CygwinHost ~
$ cd /usr/src

Username@CygwinHost /usr/src
$ cygport xorg-server-n.n.n-n.cygport prep
[lots of output as archive is unpacked and patches applied]

$ cygport xorg-server-n.n.n-n.cygport compile
[lots of output as source is configured and built]

Username@CygwinHost /usr/src
$ cd xorg-server-n.n.n-n/src/xorg-server-n.n.n/
[navigate to the source directory]

Username@CygwinHost /usr/src/xorg-server-n.n.n-n/src/xorg-server-n.n.n/
$

Note: Alternatively you may manually untar the archive and apply any patches (in the correct order).

Note: It is necessary to run the package's autogen.sh script to regenerate the configure script and Makefiles if the patches modify the autoconf or automake source files

Note: For details of using cygport to generate packages for distribution, see the Section called Packaging a Cygwin/X Distribution

Obtaining from version control

The packaging script for the packages distributed via Cygwin setup is currently held in a git repository. Intermediate versions between released packages can be obtained from there.


Username@CygwinHost ~
$ git clone https://github.com/jon-turney/xorg-server-cygport.git

This will obtain a .cygport file. and any .patch files. You can then add the source archive by downloading it with cygport.


Username@CygwinHost ~
$ cygport xorg-server-n.n.n-n.cygport download

Then proceed as in the Section called Obtaining via Cygwin setup

Obtaining from X.Org

Cygwin/X source code is contained in, and distributed with, the X Window System source code releases.

Anonymous read-only access to the X Window System git source tree hosted on freedesktop.org is available.


$ git clone git://anongit.freedesktop.org/git/xorg/xserver

You will probably want to look at the .cygport file in the source package obtained in the Section called Obtaining via Cygwin setup and check you understand if you need to use the configuration options used there. For example:


$ ./configure --prefix=/usr --with-log-dir=/var/log

Consult the git documentation for details on using git.

The CYGWIN branch exists in git for historical reasons. Current development follows the mainline (called the master branch in git terminology).

If you just want to look at the Cygwin/X source, use the cgit interface to the X.Org tree . Most of the Cygwin/X-specific code is in the xserver/hw/xwin directory.