1<!--$Id: multiple.so,v 10.4 2004/06/10 16:39:28 bostic Exp $-->
2<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
3<!--See the file LICENSE for redistribution information.-->
4<html>
5<head>
6<title>Berkeley DB Reference Guide: Building with multiple versions of Berkeley DB</title>
7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
9</head>
10<body bgcolor=white>
11<table width="100%"><tr valign=top>
12<td><b><dl><dt>Berkeley DB Reference Guide:<dd>System Installation Notes</dl></b></td>
13<td align=right><a href="/install/file.html"><img src="/images/prev.gif" alt="Prev"></a><a href="/toc.html"><img src="/images/ref.gif" alt="Ref"></a><a href="/debug/intro.html"><img src="/images/next.gif" alt="Next"></a>
14</td></tr></table>
15<p align=center><b>Building with multiple versions of Berkeley DB</b></p>
16<p>In some cases it may be necessary to build applications which include
17multiple versions of Berkeley DB.  Examples include applications which include
18software from other vendors, or applications running on a system where
19the system C library itself uses Berkeley DB.  In such cases, the two versions
20of Berkeley DB may be incompatible, that is, they may have different external
21and internal interfaces, and may even have different underlying database
22formats.</p>
23<p>To create a Berkeley DB library whose symbols won't collide with other Berkeley DB
24libraries (or other application or library modules, for that matter),
25configure Berkeley DB using the <a href="/ref/build_unix/conf.html#--with-uniquename=NAME">--with-uniquename=NAME</a> configuration option,
26and then build Berkeley DB as usual.  (Note that
27<a href="/ref/build_unix/conf.html#--with-uniquename=NAME">--with-uniquename</a> only affects the Berkeley DB C language library build;
28loading multiple versions of the C++ or Java APIs will require
29additional work.)  The modified symbol names are hidden from the
30application in the Berkeley DB header files, that is, there is no need for
31the application to be aware that it is using a special library build as
32long as it includes the appropriate Berkeley DB header file.</p>
33<p>If "NAME" is not specified when configuring with
34<a href="/ref/build_unix/conf.html#--with-uniquename=NAME">--with-uniquename</a>, a default value built from the major and minor
35numbers of the Berkeley DB release will be used.  It is rarely necessary to
36specify NAME; using the major and minor release numbers will ensure that
37only one copy of the library will be loaded into the application unless
38two distinct versions really are necessary.</p>
39<p>When distributing any library software that uses Berkeley DB, or any software
40which will be recompiled by users for their systems, we recommend two
41things: First, include the Berkeley DB release as part of your release.  This
42will insulate your software from potential Berkeley DB API changes as well as
43simplifying your coding because you will only have to code to a single
44version of the Berkeley DB API instead of adapting at compile time to whatever
45version of Berkeley DB happens to be installed on the target system.  Second,
46use <a href="/ref/build_unix/conf.html#--with-uniquename=NAME">--with-uniquename</a> when configuring Berkeley DB, because that will insure that
47you do not unexpectedly collide with other application code or a library
48already installed on the target system.</p>
49<table width="100%"><tr><td><br></td><td align=right><a href="/install/file.html"><img src="/images/prev.gif" alt="Prev"></a><a href="/toc.html"><img src="/images/ref.gif" alt="Ref"></a><a href="/debug/intro.html"><img src="/images/next.gif" alt="Next"></a>
50</td></tr></table>
51<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
52</body>
53</html>
54