Native Compiling

Compiling the Source Code

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.

Standard Build

Follow these steps to create a standard, non-debug, build:

  1. Change the current directory to your X Window System development directory:

    
Username@CygwinHost ~
    $ cd ~/xserver
    
    Username@CygwinHost ~/xserver
    $ ./configure --prefix=/usr --with-log-dir=/var/log --disable-xv
    [lots of output]
    $ make
    [lots more output]
    
    

    Standard build is now complete.

    Note: You wish to consult the .cygport file for the current ./configure flags used in distributed packages

    Note: The unpacked source occupies approximately 80MB of disk space. Building the source requires approximately an additional 160MB. On my ageing 2.2MHz Athlon64 3500+, a full build takes about 20 minutes.

    Note: XXX: Describe how to configure using a builddir

Debug Build

Follow these steps to create a build with debugging information:

  1. Change the current directory to your X Window System development directory:

    
Username@CygwinHost ~
    $ cd ~/xserver
    
    Username@CygwinHost ~/xserver
    $ ./configure --prefix=/usr --with-log-dir=/var/log --disable-xv --enable-debug CFLAGS="-g -O0"
    [lots of output]
    $ make
    [lots more output]
    

    Debug build is now complete.

Running a local build

Follow these steps to run the built X server:

  1. Change the current directory to your X Window System development directory:

    
Username@CygwinHost ~
    $ cd xserver
    Username@CygwinHost ~/xserver
    $
    
  2. 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

Installing a local build installs the built X server(s) and associated man pages.

  1. 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
    $ 
    
  2. Make the install target, which installs everything:

    
Username@CygwinHost ~/xserver/build/build-prefix
    $ make install
    
    Username@CygwinHost ~/xserver/build/build-prefix
    $ 
    

Keeping your source code tree updated

git makes keeping your source code tree up to date easy. Consult the git documentation for details.