Berkeley DB XML Reference Guide:
Building Berkeley DB XML for UNIX/POSIX systems

PrevRefNext

Building Berkeley DB XML Libraries for UNIX/POSIX

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 on this page is not necessary.

Building Individual Libraries

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

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

When you build Berkeley DB, you must specify the --enable-cxx configuration option, so the minimal build commands for Berkeley DB are:

cd dbxml-2.3.10/db-4.5.20/build_unix
../dist/configure --enable-cxx
make
make install

This will install Berkeley DB in /usr/local/BerkeleyDB.4.5. 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 requires the Xerces 2.7.0 release or newer. Building Xerces requires GNU make.

Example Bourne shell build commands for Xerces are:

cd dbxml-2.3.10/xerces-c-src2_7_0
export XERCESCROOT=`pwd`
cd src/xercesc
./runConfigure -plinux -d -cgcc -xg++ -minmem -nsocket -tnative -rnone
make
make install

You may have to adjust your system type and compiler information, of course.

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 an implementation of XQuery 1.0 and XPath 2.0 using Xerces DOM. Berkeley DB XML requires a version of XQilla that is not publicly available and is distributed with Berkeley DB XML.

An example Bourne shell build command for XQilla is:

cd dbxml-2.3.10/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 compiled Xerces source tree (vs. an install 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-2.3.10/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.2.3. 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.


PrevRefNext

Copyright (c) 1996,2007 Oracle. All rights reserved.