Initial Build Instructions
==========================

For more detailed instructions, you may wish to consult our website at
www.bongo-project.org.

The first thing to do is create a new directory to do the build in: this 
stops all the build files from littering the source tree. Assuming you're
in the Bongo source tree:

$ mkdir build
$ cd build/

Now we need to configure the build. There are two ways of doing this, and 
you can use both! One way is good to start off, the other way is good for 
tweaking. You’ll see what I mean, but let’s start with the initial 
configuration. A good invocation might be something like:

$ cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/local/bongo -DBONGO_USER=bongo \
  -DCMAKE_BUILD_TYPE=Debug -DDEBUG=On

The first argument points to the Bongo source directory. Because we made a 
‘build’ directory in the source tree and went into it, we’re just pointing at 
our parent directory. Then come some other options. Every option is prefixed 
with “-D”, and some of them are CMake options and others are Bongo options. 

In full:

    * CMAKE_INSTALL_PREFIX: where we want to install to. I use /tmp/build for 
      testing, and /usr/local/bongo when I want to run it in production.
    * BONGO_USER: which user you want Bongo to run as. I use my user account 
      for testing, “bongo” for production. You can also run as “root” if 
      brave (not recommended!)
    * CMAKE_BUILD_TYPE: set this to Debug to generate information for gdb, 
      otherwise leave this option out.
    * DEBUG: enable code paths which generate debugging messages. Both this 
      option and the previous are for either advanced users or developers, 
      really.

There are other options to the Bongo build, but these are the main ones. 
However, once you’ve configured Bongo, you may want to tweak something: 
perhaps turn on debugging, or change one of the file paths, or something 
different. The easiest way to do that is simply:

$ ccmake ./

Note that it’s “ccmake”, not “cmake”. This starts an interactive application 
where you can change each configuration item. You point it at the build 
directory, not the source, and it gives you all the various tweakable options. 
You’ll see that they are the same options that we pass to cmake - and indeed, 
you can pass them to cmake! 

There’s even an advanced mode with even more knobs (press ‘t’). When you’re 
done, press ‘c’ to configure the build and then ‘q’ to quit.

Once you have configured the build, you have access to the usual make commands:

$ make
$ make install
$ make clean

The first builds Bongo, the second installs it to your prefix, the last 
removes the intermediate compilation files.
