@c -*-texinfo-*-
@node Unix, Debian, Platform Instructions, Platform Instructions
@subsection Unix
@cindex Unix

This section covers all of the Unix-style platforms supported by Crystal Space,
including @sc{gnu}/Linux, FreeBSD, NetBSD, Solaris, etc.

It is also possible to install Crystal Space using packaging systems,
@xref{HOWTO Create RPM}.

Crystal Space's X11 canvas optionally supports the @sc{mit} Shared Memory
Extension (@sc{mit-shm}).  This makes Crystal Space run much faster if your
server supports it.  The Crystal Space configuration script will detect this
extension automatically and use it if present.

A note of caution: Take care when obtaining the Crystal Space source code to
ensure that the line-terminators are in Unix format (a single linefeed should
terminate each line).  This is an especially important consideration when
transporting the code from Windows to Unix.  Although many Unix tools deal
gracefully with Windows line-terminators (a carriage-return followed by a
linefeed), not all tools do so, and may emit apparently inexplicable error
messages when encountering files with Windows line-terminators.  The official
distributions of Crystal Space, including the stable releases and the @sc{svn}
snapshots, are packaged with Unix line-terminators, which are acceptable on all
supported platforms.  These virgin packages themselves can be transported
between Windows and Unix safely

@subsubheading Compiling on Unix

Crystal Space can be built with either @file{make} or Jam (@pxref{GettingJam}).
Both tools work equally well.  In the examples below, wherever @samp{jam}
is used, you can instead substitute @file{make -k} (with the @samp{-k}) if you
so desire.

You first need to configure the project for your platform.  You do this
by running the configuration script.  For example, from within the @file{CS}
directory:

@example
./configure
@end example

If you wish to build with debugging information enabled, use this command,
instead:

@example
./configure --enable-debug
@end example

For a list of useful configuration options, invoke:

@example
./configure --help=short
@end example

If the Crystal Space source directory is read-only, if it is shared between
several developers, or if you simply dislike building a project within its
source tree, you can instead configure and build from a different directory.
For instance:

@example
mkdir $HOME/builddir
cd $HOME/builddir
/path/to/CS/configure --enable-debug
@end example

Now, you can actually build the entire project:

@example
jam
@end example

If your machine includes a dual core processor, you can easily reduce build
times by as much as half and utilize the cores better by enabling more shell
processes e.g.

@example
jam -j 2
@end example

The build process will create an executable for each demonstration program or
tool, and a dynamic-load-library for each plugin module (with extension
@file{.so} on @sc{gnu}/Linux and most Unix platforms).  Plugin modules include
3D renderers, 2D canvases, 3D engine, etc.

Finally, if you want to utilize Crystal Space as a software development kit
(@sc{sdk}), you can install it and then clean up the detritus of the build
process:

@example
jam install
jam distclean
@end example

You can now try running the @file{walktest} demonstration. @xref{Quick Start}.

