Cygwin/X Contributor's Guide
Prev | Chapter 2. Programming | Next

# Native Compiling

## Compiling the Source Code

### Standard Build

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

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
    [lots of output]

    Username@CygwinHost ~/xserver
    $ make
    [lots more output]

Standard build is now complete.

> Note: You may 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: If you wish to keep build products separate from the source, you may run configure from a separate build directory.

### Debug Build

Follow these steps to create a build with debugging information:

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 --enable-debug CFLAGS="-g -O0"
    [lots of output]

    Username@CygwinHost ~/xserver
    $ 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 build 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

Prev | Home | Next
Obtaining the Source Code | Up | Cross Compiling