BNBT Documentation

## 1.2 Compiling BNBT on Other Systems

BNBT should compile on Linux, Unix, OS X, BSD, Sun Solaris, and possibly other systems. You will need a compiler such as GCC (most systems should already have this) and a GNU compatible make such as GNU Make (most systems should already have this). You will also need zlib 1.2.1 or newer and if you wish to compile a binary with MySQL support you will also need MySQL 4.0 or newer. If you are compiling BNBT with an old version of GCC (older than version 3) you will also need STLport.

Step 1 (install zlib): If you already have zlib 1.2.1 or newer, skip this step. To install zlib, simply download zlib 1.2.1 or newer, source distribution and extract it to any folder (for example, ~/zlib - I will call this zlibdir).

- If you have root access you should install zlib as a shared library for the system. Change to zlibdir and type ./configure --shared --prefix=/usr then type make install (on BSD systems, type gmake install).
- If you don't have root access you should install zlib as a static library for BNBT only. Change to zlibdir and type make (on BSD systems, type gmake) then copy libz.a to bnbtdir/src (where bnbtdir is the directory you extracted BNBT to).

Step 2 (install MySQL): If you already have MySQL 4.0 or newer, skip this step. You only need to install MySQL if you wish to compile a binary with MySQL support. To install MySQL, go to http://www.mysql.org/ and follow the instructions. You don't need to install the source distribution (the binary distribution or the RPM distribution should work fine).

Step 3 (Sun Solaris users only): If you are running Sun Solaris and your system is little endian (e.g. Intel) you should remove the indicated lines near the top of bnbt.h and sha1.h.

Step 4 (install STLport): If you are compiling BNBT with GCC version 3 or newer (check with g++ --version), skip this step. To install STLport, go to http://www.stlport.org/ and follow the instructions. TODO - MAKEFILE INSTRUCTIONS.

Step 5 (compile): If you wish to compile a release binary, simply change to the bnbtdir/src directory and type make bnbt (on BSD systems, type gmake bnbt). If you wish to compile a release binary with MySQL support, simply change to the bnbtdir/src directory and type make bnbtmysql (on BSD systems, type gmake bnbtmysql). A bnbt or bnbtmysql binary will be compiled in the bnbtdir/src directory. If you wish to remove all files created during compilation, type make clean (on BSD systems, type gmake clean).