Using a shadow directory of symbolic links for the build

Building XFree86 from a Source Distribution : Using a shadow directory of symbolic links for the build
Previous: Configuring the source before building
Next: Building and installing the distribution

## 3. Using a shadow directory of symbolic links for the build

A recommended practice is to use a shadow directory of symbolic links to do the build of XFree86. This permits to keep the source directory unmodified during the build, which has the following benefits:

- In the case where CVS is used to maintain the source tree up to date, the update process is not disturbed by foreign files not under the control of CVS.
- It is possible to build XFree86 for several different Operating System or architectures from the same sources, shared by NFS.
- It is possible to build XFree86 with different configuration options, just by putting a real copy`host.def` in each build tree and by customizing it separately in each build tree.

To make a shadow directory of symbolic links, use the following steps:

- create the directory at the top of the build tree. It is often created at the same level that the `xc` directory, but this is not mandatory.

  > `cd the directory containing the xcdirectory
  > mkdir build`

- use the `lndir`command to make the shadow tree:

  > `lndir ../xc`

  Note that you can refer to the `xc` directory with an absolute path if needed.

  See the lndir(1) manual page for details.

If `lndir` is not already installed on your system, you can build it manually from the XFree86 sources by running the following commands:

> `cd xc/config/util
> make -f Makefile.ini lndir
> cp lndir some directory in your PATH`

Building XFree86 from a Source Distribution : Using a shadow directory of symbolic links for the build
Previous: Configuring the source before building
Next: Building and installing the distribution