- Berkeley DB XML Reference Guide:
- Building Berkeley DB XML for UNIX/POSIX systems
|
![Prev](../../images/prev.gif) ![Ref](../../images/ref.gif)
|
Building Berkeley DB XML for UNIX/POSIX
About Building and Building Berkeley DB XML Using the buildall.sh Script
Building Individual Libraries
Configuring Berkeley DB XML
Changing compilation and link options
Installing Berkeley DB XML
Dynamic Shared Libraries
Using Berkeley DB XML on UNIX/POSIX Systems
Architecture Independent Build FAQ
AIX Notes
Solaris Notes
FreeBSD Notes
HP-UX Notes
OS X Notes
Cygwin
About Building Berkeley DB XML and Using the buildall.sh Script
The Berkeley DB XML distribution comprises several libraries: a base C++ library,
three third-party libraries, and optional libraries for additional language
interfaces such as Java, Perl, Python, PHP, and Tcl. Instructions for building
the base libraries as well as Java and Tcl interfaces are included here. Instructions
for the other language bindings appear in their respective directories:
dbxml-2.5.16/dbxml/src/{perl,php,python}.
All bindings require the C++ library and third-party libraries.
Building for Linux, Mac OS X, and Cygwin (Windows) is the same as building
for a conventional UNIX platform.
The Berkeley DB XML 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 XML distribution. For ease of use Berkeley DB XML uses a shell script called
buildall.sh to drive the build process. It wraps the configure and
make steps associated with autoconf
Preparing to build
Berkeley DB XML makes use of several third-party libraries. Berkeley DB XML provides
a shell program that makes it possible to build all of the libraries in
one command. The Berkeley DB XML distribution includes the complete source for compatible
versions of the third-party libraries. No additional downloads
are required. Use of other versions may not
work, and may not be supported.
Each of these packages is freely
available and distributed under an Open Source license, although
Berkeley DB XML depends on specific versions of each. To build Berkeley DB XML,
you will need the following third-party libraries:
Berkeley DB- Berkeley DB is a general purpose database toolkit. This release of Berkeley DB XML
includes Berkeley DB 4.8.x release, and requires the Berkeley DB 4.3.28 release or later.
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.0.1, and requires the Xerces 2.7.0 release or newer.
XQilla- XQilla is an open source implementation of XQuery 1.0 and XPath 2.0.
Berkeley DB XML bundles a specific public release of XQilla which must
be used. Later versions of XQilla may work, but are not implicitly supported.
It is necessary to use GNU make (gmake) to build Berkeley DB XML and
its third-party libraries. If you do not already have GNU make
on your system, you will need to install it.
When using gcc/g++, Berkeley DB XML requires at least a 3.x release of
gcc.
Building Berkeley DB XML and third-party libraries
These instructions assume that you are building in the Berkeley DB XML
distribution.
The simplest possible build command is the following:
cd dbxml-2.5.16
sh buildall.sh
This will configure, build, and install all of the libraries using default
settings, which installs them into the directory dbxml-2.5.16/install. The default build supports the C++ interface
only. The default build also compiles Berkeley DB XML examples, and places
them in the directory
dbxml-2.5.16/dbxml/build_unix.
The buildall.sh script has a number of configuration
options. You can see them with this command:
sh buildall.sh --help
Some common options include:
- --enable-debug to build debug libraries
- --prefix=path to change the default common installation
path (from ./install)
- --enable-java to build the Java API. This also requires
that there is a working javac in your PATH.
The resulting .jar files are created in the install/lib
directory. Java examples are also built, and put in
dbxml-2.5.16/dbxml/build_unix/dbxmlexamples.jar.
- --enable-perl to build the Perl interface
- --disable-compression to disable default compression.
- --clean to clean (make clean) the entire build
- --distclean to clean (make distclean) the entire build. This option
clears the configuration state as well as the compilation state.
There is no option for per-library clean or
rebuild in buildall.sh. See
building individual libraries
for information on how to work with each library build.
Configuring Berkeley DB XML and third-party libraries
The buildall.sh script has a number of configuration
flags to handle platform-specific issues, change
target and destination directories, as well as product configuration
options. The flags that start with "--with-" apply
to each of the libraries, depending on the name used. In
these examples, "libname" is used to represent one of "dbxml,"
"xerces," "xqilla," or "berkeleydb." For example,
a valid flag may be "--with-berkeleydb-prefix=path"
or "--with-xerces-prefix=path."
The following is a partial list of options:
--help- Use this flag to return a help message for buildall.sh.
--enable-debug- To build with -g as a compiler flag and with
DEBUG #defined during compilation, enter --enable-debug as an
argument to buildall.sh. This will create libraries and utilities
with debugging symbols. This argument should not be specified when
configuring to build production binaries.
--enable-java- To build with Java support, use --enable-java. This builds Java support
for both Berkeley DB and Berkeley DB XML. It is necessary to ensure that there is a
working javac in your PATH. The resulting
.jar files are created in the install/lib directory. Java
examples are also built, and put in
dbxml-2.5.16/dbxml/build_unix/dbxmlexamples.jar. By default -source 1.5 and -target 1.5
are passed to javac to build dbxml.jar and
dbxmlexamples.jar. If another target is desired it is possible
to modify the file dbxml/dist/Makefile.defs.in where these flags are set.
--enable-perl- To build with Perl support, use --enable-perl. This builds Perl support
for both Berkeley DB and Berkeley DB XML. This option requires a working perl
program in your PATH.
--with-tcl=path- To build with Tcl support, use --with-tcl=path, where path is the
directory in which the Tcl tclConfig.sh file may be found. See
Loading Berkeley DB with Tcl for information
on sites from which you can download Tcl and which Tcl versions are
compatible with Berkeley DB XML.
--disable-compression- Disables default compression. Compression is turned on by default. Default compression requires the library ZLIB. --with-zlib can by used to specify the path to the ZLIB installation.
--enable-static-zlib- Causes the ZLIB library to be linked statically instead of dynamically
--with-zlib=path- Default compression requires the ZLIB library. If ZLIB is not installed in the directory /usr/local then use this argument to specify the directory in which it is installed. If no ZLIB installation can be found then default compression is disabled automatically.
--enable-test- Enables test suite support. This option requres --with-tcl and
--enable-debug, and if using --enable-java it also requires --with-junit.
--with-junit- Path to a JUnit (4) .jar file. This option is required if
both --enable-test and -enable-java are specified.
-p platform- To specify a platform type to the Xerces runConfigure script, use -p
platform. For most platforms, configure guesses the type correctly.
Use this option only if there are configuration errors without it.
-c C compiler name- To build with C compiler other than gcc, specify the name of the
compiler, for example, -c cc.
-x C++ compiler name- To build with C++ compiler other than g++, specify the name of the
compiler, for example, -x cxx.
-m make_command- To build with make program other than make, specify
the name of the program. For example, -m gmake.
--no-configure- To build without re-running the configure step for each library, enter
--no-configure as an argument to buildall.sh.
--clean- To clean compilation and linking object from all libraries, use
--clean.
--distclean- To clean configuration state from all libraries, use --distclean. After
this is done, configuration must be run again in order to build.
--build-one=library- To build, or clean only one of the libraries, use --build-one=library,
where library is one of berkeleydb, xerces, xqilla or dbxml.
--prefix=path- To change the common installation directory prefix from the default
(./install), specify an alternate path.
--with-libname=path- To use library sources from a location other than the default, specify
a path to the source. For example, if Xerces source were located in
/home/xerces-c-src_3_0_1, specify, --with-xerces="/home/xerces-c-src_3_0_1"
--with-libname-prefix=path- To change the installation directory for only a single library,
specify the path using --with-libname-prefix=path. For example, if
Berkeley DB is to be installed in /usr/local/BerkeleyDB.4.8, specify,
--with-berkeleydb-prefix="/usr/local/BerkeleyDB.4.8"
--with-libname-conf=configure flags- All of the library configurations use the configure program.
Use --with-libname-conf=configure flags to pass library-specific
configuration flags.
Advanced Building and Troubleshooting
If buildall.sh does not provide enough control for your
environment, or if you have trouble with any of these commands, please
see building individual
libraries, which goes into more detail on build options for each
product. At the end of that page, there is information on what to do
if build problems persist.
Copyright (c) 1996-2009 Oracle. All rights reserved.