## 6.3 Building Mozart

Now we can get to the real thing. Retrieve the sources from the CVS:

> `cvs -d cvs.mozart-oz.org:/services/mozart/CVS get mozart
> cvs -d cvs.mozart-oz.org:/services/mozart/CVS get mozart-stdlib`

(specify `-r mozart-1-3-0-fixes` to get the fixes branch). See http://www.mozart-oz.org/download/view.cgi?action=cvs for details about anonymous CVS. Let mozart be the directory created by the first `cvs get` command and stdlib the one created by the second.

Environment Variables

We need to start with a clean `PATH`, which in particular must not contain any Mozart installation. The following works on my system:

> `export PATH=/usr/bin:/bin:`emacs`/bin:/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT`

Furthermore, we want to tell the configuration scripts where we placed our Windows DLLs:

> `export windlldir=`packages`/dlls`

The Fun Part

Say we want to install Mozart into directory install. Then we can configure, build, and install Mozart as follows:

> `cd` build`
> mkdir mozart-build
> cd mozart-build
> CXX=g++` mozart`/configure \
> --prefix=`install`\
> --with-inc-dir=`packages`/include \
> --with-lib-dir=`packages`/lib \
> --with-tcl=`packages`\
> --with-tk=`packages`\
> --disable-contrib-compat \
> make bootstrap
> make install`

`oztool` (which is required for building some of the contributions) does not work if given a cygwin symbolic link to the executable it should run. Currently cygwin has `c++` as a symbolic link to `g++`. We get around this by setting `CXX=g++` during the configure process, which will then choose `g++` as our default C++ compiler.

We will build the standard library in a different directory, but it will be installed in the same one where Mozart is. This is specified in during the configuration. Then we can configure, build, and install Mozart as follows:

> `cd` build`
> mkdir stdlib-build
> cd stdlib-build
> ../`stdlib`/configure --prefix=`install`
> make
> make install`

A note on the configuration options: Most of these should be clear, they simply convey to the configuration scripts the knowledge of where we placed our packages. More information on configuration options can be found in Chapter 7. We have to disable the `compat` contrib because it does not build in bootstrap mode (yet). This is why we have to build it separately once we have our installed system:

> `cd` build`
> mkdir compat-build
> cd compat-build
> export PATH=`install`/bin:$PATH
> CXX=g++` mozart`/contrib/compat/configure --with-global-oz --prefix=`install`
> mkdir share
> cp` build`/mozart-build/share/Makefile.boot share
> make
> make install`

And yeah, verily, thus and so - we're done.

Using Mozart

To use Mozart, you simply have to extend your `PATH`:

> `export PATH=`install`/bin:$PATH`

Then you can start `oz`, `ozc` and so on, as you would expect.