# Building CORBA Compiler Framework (CCF) Libraries

## Table of Contents

1. Prerequisite Libraries
2. Configuring the Build Environment
3. Building CORBA Compiler Framework (CCF)

# Prerequisite Libraries

## Debian GNU/Linux [i386.deb]

You will need to install the following packages from the Debian package repository:

1. `libboost-dev-1.30.2-2` or better
2. `libboost-regex-dev-1.30.2-2` or better

Additionally, you will need to download and and install

1. `libutility_1.2.2-1_i386.deb`
2. `libutility-dev_1.2.2-1_i386.deb`

For example, if you downloaded them into `/tmp` then to install you can issue these commands:

    $ cd /tmp
    $ dpkg -i libutility*.deb

## RedHat OS family [i386.rpm]

You will need to install the following RedHat packages:

1. `boost-devel-1.30.2-2.i386.rpm`
2. `Utility-1.2.2-3.i386.rpm`

For example, if you downloaded them into `/usr/src/redhat/RPMS/i386` then to install you can issue these commands:

    $ cd /usr/src/redhat/RPMS/i386
    $ rpm -Uhv boost-devel-1.30.2-2.i386.rpm
    $ rpm -Uhv Utility-1.2.2-3.i386.rpm

## Other GNU/Linux or UNIX Distributions & Windows

### C++

On the Lunix/UNIX platforms, you can use any standard-conformant C++ compiler. We recommend you use the lastest stable release of the GNU C++ compiler.

On the Windows platform, VC++ 7.1 or better is required to build CCF. We do not support VC++ 6 or VC++ 7.0.

### Boost Libraries

In order to build CCF you will need the following libraries from the Boost distribution:

1. regex
2. filesystem
3. spirit parser framework

There are two commonly used ways to obtain those libraries: you can get precompiled binaries from your system distributor or download source code and compile it yourself. The first approach is recommended where available and if you got precompiled binaries then you can skip the rest of this section.

If you choose to compile Boost Libraries yourself please refer to the Boost Building Instructions. Please remember the install locations of the boost libraries because they will be needed to properly configure your environment for building CCF. bjam --build-dir="c:\temp\boost2" --toolset=msvc-8.0 link=static/variant=debug/runtime-link=static --with-regex

### Utility Library

Another prerequisite for CCF is the Utility Library. You don't need to build anything in this library. The Utility library is available in the following two different forms for convinience:

1. A bz2 package for unix based platforms including Unix.
2. A zip package for Win32 based platforms.

Just unpack it to some convenient place and remember its location because it will be need to properly configure the build environment for CCF.

# Configuring the Build Environment

Before you can start building CCF you need to specify the location of Boost Libraries and Utility Library. There are two ways you can do this. The first way is to specify the environment variables `BOOST_ROOT, BOOST_INCLUDE, BOOST_LIB, BOOST_VERSION, BOOST_CFG` and `UTILITY_ROOT`.

To configure `BOOST_ROOT` and `UTILITY_ROOT`, set both enviroment variables to the root directory for the respective libraries as follows:

- On Linux/UNIX

      %> export BOOST_ROOT=<path_to_boost>
      %> export UTILITY_ROOT=<path_to_utility>

- On Windows

      %> set BOOST_ROOT=<path_to_boost>
      %> set UTILITY_ROOT=<path_to_utility>

If `BOOST_INCLUDE` and `BOOST_LIB` are not initialized, then their values are derived from `BOOST_ROOT` as follows:

    BOOST_LIB     := $(BOOST_ROOT)/lib
    BOOST_INCLUDE := $(BOOST_ROOT)

`BOOST_VERSION` and `BOOST_CFG` are two environment variables that depend on the version and configuration of Boost that you are using. `BOOST_VERSION` is initialized as follows:

1. Look in `$BOOST_ROOT/include/boost` directory
2. If there is another boost directory, e.g. `boost-1_32` for building boost-1.32, then this is your version
   - On Linux/UNIX:

         %> export BOOST_VERSION=boost-1_32

   - On Windows:

         %> set BOOST_VERSION=boost-1_32

`BOOST_CFG` depends on which configuration of the boost libraries you want use for CCF. If you look in `$BOOST_ROOT/lib`, you will notice all the Boost libraries. Each library has the compiler and threading support, e.g. `-vc71-mt` for VC++ 7.1 and multi-threaded, as part of the filename. If this is not the case for your libraries, then you can skip this section and continue at Building CORBA Compiler Framework (CCF). This part of the filename is known as the `BOOST_CFG` and needs to be specified. For example, if you are using VC++ 7.1 and want to use the multi-threaded version of the libraries for CCF, your would do the following:

> `%> set BOOST_CFG=-vc71-mt`

This can be done similarly on the Linux/UNIX platforms depending on your compiler version and the Boost configuration you want to use.

Alternatively, you can specify all values for `BOOST_*` and `UTILITY_*` in `$CIAO_ROOT/CCF/Config.rules`

# Building CORBA Compiler Framework (CCF)

Now that you have built and installed the required libraries, you are now ready to build the CCF libraries. If there are any makefiles or project solutions in the CCF directory we recommend that you disgard those and regenerate all the projects files using MPC. To build all project files and CCF, please use the following steps:

1. `%> cd $CIAO_ROOT/CCF/CCF`
2. `%> $ACE_ROOT/bin/mwc.pl -type <project-type> -static -features cidl=1, exceptions=1, boost=1`

On Linux/UNIX, if you are building with a make utility, e.g., gmake, use the following command to build CCF:

    %> gmake cidl=1 exceptions=1 boost=1

If you are building on Windows, just open the generated solution file.

Note: If you are building CCF on a Windows platform, use `%ACE_ROOT%\bin\mwc.pl` instead `of $ACE_ROOT/bin/mwc.pl`. Also, for a list of project types and other command-line options supported by MPC, type `$ACE_ROOT/bin/mwc.pl --help`.