Building Individual Berkeley DB XML Libraries for UNIX

Building Individual Libraries
Configuring and building Berkeley DB XML
Building the Java API

The buildall.sh script is a wrapper around separate build procedures for each third-party library. If there are problems using the script, or if it is necessary to build libraries individually, it is possible to build manually. Building manually gives you finer control over configuration, build and installation. If you are able to build successfully using buildall.sh, the information in this section is not necessary.

Building Individual Libraries

These instructions assume that the third-party libraries are in the directory, dbxml-6.0.xx. They apply regardless of actual location.

Berkeley DB

Berkeley DB XML requires Berkeley DB 4.3.28 or newer. This release includes Berkeley DB 6.1.x. Adjust the path below to match the version bundled with the distribution.

This will install Berkeley DB in /usr/local/BerkeleyDB.6.1. If you want to install in a different directory, add --prefix=/path/to/install to the configure line.

If you want to use the Berkeley DB XML Java API, you must also build Berkeley DB with Java support by adding --enable-java to the configure line.

Xerces

Xerces is the Apache implementation of XML parsing technology and DOM. The build requires a source release of Xerces, not just a binary release. This release of Berkeley DB XML bundles Xerces-C 3.1.2, and requires the Xerces 3.0.1 release or newer.

Example Bourne shell build commands for Xerces are:

cd dbxml-6.0.xx/xerces-c-src 
export XERCESCROOT=`pwd` 
cd src/xercesc 
./configure --disable-pretty-make 
make 
make install

The option --disable-pretty-make is added because that eliminates the requirement for GNU make. It results in more verbose output. If it is not used GNU make will be required.

This will install Xerces under /usr/local. If you want to install in a different directory, add -P/path/to/install to the configure line.

XQilla

XQilla is a partial implementation of XQuery 3.0 and XPath 2.0. This release of Berkeley DB XML bundles the XQilla version that is required. Other versions may work, but are not implicitly supported. Generally releases with the same major and minor number will be compatible.

An example Bourne shell build command for XQilla is:

 cd dbxml-6.0.xx/xqilla
mkdir build
cd build
../configure --with-xerces=../../xerces-c-src
make
make install 

This will install XQilla under /usr/local. If you want to install in a different directory, add --prefix=/path/to/install to the configure line. The --with-xerces directive is required, and must point to a valid installed Xerces tree.

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

Configuring and building Berkeley DB XML

The --with-berkeleydb, --with-xerces, and --with-xqilla configuration options can be used to specify the location of the install trees. Alternatively, the CFLAGS, LDFLAGS and other standard environment variables can be used to specify the location of the already installed include and library files.

To do a standard UNIX build of Berkeley DB XML using default paths and installations of the third-party libraries, change to the build_unix directory and then enter the following two commands, adjusting the paths as necessary:

cd dbxml-6.0.xx/dbxml/build_unix
../dist/configure
make 

If you have changed the locations where Berkeley DB, Xerces, or XQilla are installed from the defaults, add the arguments --with-berkeleydb=/path/to/db, --with-xqilla=/path/to/xqilla and/or --with-xerces=/path/to/xerces to configure.

By default, Berkeley DB XML is installed in /usr/local/BerkeleyDBXML.6.0. To change that, add --prefix=/path/to/install to configure. To install the Berkeley DB XML library, enter the following command:

make install

To rebuild Berkeley DB XML, enter:

make clean
make

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

make distclean
../dist/configure
make 

To build multiple UNIX versions of Berkeley DB XML 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.

Building the Java API

To build the DB XML Java API, make sure there is a working javac in your PATH, and specify --enable-java when running both the Berkeley DB and Berkeley DB XML configure scripts. When you run make, the Java support library for Berkeley DB XML will be built, creating the file dbxml.jar in your build directory.

To make use of the DB XML Java API set your environment variable CLASSPATH to include the full pathname of the dbxml.jar file, as well as the db.jar file from Berkeley DB, and your environment variable LD_LIBRARY_PATH (or equivalent) to include the .libs subdirectory of your build directory.