Chapter 5.  Building Berkeley DB for UNIX/POSIX

Table of Contents

Building for UNIX/POSIX
Configuring Berkeley DB
Building a small memory footprint library
Changing compile or load options
Cross-Compiling on Unix
Installing Berkeley DB
Dynamic shared libraries
Running the test suite under UNIX
Architecture independent FAQ
AIX
FreeBSD
HP-UX
Apple iOS (iPhone OS)
IRIX
Linux
Mac OS X
SCO
Solaris
SunOS

Building for UNIX/POSIX

The Berkeley DB distribution builds up to six separate libraries: the base C API Berkeley DB library and the optional C++, Java, and Tcl. For portability reasons, each library is standalone and contains the full Berkeley DB support necessary to build applications; that is, the C++ API Berkeley DB library does not require any other Berkeley DB libraries to build and run C++ applications.

Building for Linux, Apple iOS (known as iPhone OS previously), or Mac OS X is the same as building for a conventional UNIX platform.

The Berkeley DB distribution uses the Free Software Foundation's autoconf and libtool tools to build on UNIX platforms. In general, the standard configuration and installation options for these tools apply to the Berkeley DB distribution.

To perform a standard UNIX build of Berkeley DB, change to the build_unix directory and then enter the following two commands:

../dist/configure
make

This will build the Berkeley DB library.

To install the Berkeley DB library, enter the following command:

make install

To rebuild Berkeley DB, enter:

make clean
make

If you change your mind about how Berkeley DB is to be configured, you must start from scratch by entering the following command:

make realclean
../dist/configure
make

To uninstall Berkeley DB, enter:

make uninstall

To build multiple UNIX versions of Berkeley DB in the same source tree, create a new directory at the same level as the build_unix directory, and then configure and build in that directory as described previously.