| 1 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| 2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| 6 |
<title>Chapter 7. Building Berkeley DB for UNIX/POSIX</title> |
| 7 |
<link rel="stylesheet" href="gettingStarted.css" type="text/css" /> |
| 8 |
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> |
| 9 |
<link rel="start" href="index.html" title="Berkeley DB Installation and Build Guide" /> |
| 10 |
<link rel="up" href="index.html" title="Berkeley DB Installation and Build Guide" /> |
| 11 |
<link rel="prev" href="build_wince_faq.html" title="Windows Mobile FAQ" /> |
| 12 |
<link rel="next" href="build_unix_conf.html" title="Configuring Berkeley DB" /> |
| 13 |
</head> |
| 14 |
<body> |
| 15 |
<div xmlns="" class="navheader"> |
| 16 |
<div class="libver"> |
| 17 |
<p>Library Version 11.2.5.3</p> |
| 18 |
</div> |
| 19 |
<table width="100%" summary="Navigation header"> |
| 20 |
<tr> |
| 21 |
<th colspan="3" align="center">Chapter 7. |
| 22 |
Building Berkeley DB for UNIX/POSIX |
| 23 |
</th> |
| 24 |
</tr> |
| 25 |
<tr> |
| 26 |
<td width="20%" align="left"><a accesskey="p" href="build_wince_faq.html">Prev</a> </td> |
| 27 |
<th width="60%" align="center"> </th> |
| 28 |
<td width="20%" align="right"> <a accesskey="n" href="build_unix_conf.html">Next</a></td> |
| 29 |
</tr> |
| 30 |
</table> |
| 31 |
<hr /> |
| 32 |
</div> |
| 33 |
<div class="chapter" lang="en" xml:lang="en"> |
| 34 |
<div class="titlepage"> |
| 35 |
<div> |
| 36 |
<div> |
| 37 |
<h2 class="title"><a id="build_unix"></a>Chapter 7. |
| 38 |
Building Berkeley DB for UNIX/POSIX |
| 39 |
</h2> |
| 40 |
</div> |
| 41 |
</div> |
| 42 |
</div> |
| 43 |
<div class="toc"> |
| 44 |
<p> |
| 45 |
<b>Table of Contents</b> |
| 46 |
</p> |
| 47 |
<dl> |
| 48 |
<dt> |
| 49 |
<span class="sect1"> |
| 50 |
<a href="build_unix.html#build_unix_intro">Building for UNIX/POSIX</a> |
| 51 |
</span> |
| 52 |
</dt> |
| 53 |
<dd> |
| 54 |
<dl> |
| 55 |
<dt> |
| 56 |
<span class="sect2"> |
| 57 |
<a href="build_unix.html#build_unix_sqlinter">Building the Berkeley DB SQL Interface</a> |
| 58 |
</span> |
| 59 |
</dt> |
| 60 |
</dl> |
| 61 |
</dd> |
| 62 |
<dt> |
| 63 |
<span class="sect1"> |
| 64 |
<a href="build_unix_conf.html">Configuring Berkeley DB</a> |
| 65 |
</span> |
| 66 |
</dt> |
| 67 |
<dt> |
| 68 |
<span class="sect1"> |
| 69 |
<a href="build_unix_sql.html">Configuring the SQL Interface</a> |
| 70 |
</span> |
| 71 |
</dt> |
| 72 |
<dd> |
| 73 |
<dl> |
| 74 |
<dt> |
| 75 |
<span class="sect2"> |
| 76 |
<a href="build_unix_sql.html#config_sql">Changing Compile Options</a> |
| 77 |
</span> |
| 78 |
</dt> |
| 79 |
<dt> |
| 80 |
<span class="sect2"> |
| 81 |
<a href="build_unix_sql.html#idp500824">Enabling Extensions</a> |
| 82 |
</span> |
| 83 |
</dt> |
| 84 |
<dt> |
| 85 |
<span class="sect2"> |
| 86 |
<a href="build_unix_sql.html#build_unix_jdbc">Building the JDBC Driver</a> |
| 87 |
</span> |
| 88 |
</dt> |
| 89 |
<dt> |
| 90 |
<span class="sect2"> |
| 91 |
<a href="build_unix_sql.html#idp571856">Using the JDBC Driver</a> |
| 92 |
</span> |
| 93 |
</dt> |
| 94 |
<dt> |
| 95 |
<span class="sect2"> |
| 96 |
<a href="build_unix_sql.html#idp593744">Building the ODBC Driver</a> |
| 97 |
</span> |
| 98 |
</dt> |
| 99 |
<dt> |
| 100 |
<span class="sect2"> |
| 101 |
<a href="build_unix_sql.html#bfile">Building the BFILE extension</a> |
| 102 |
</span> |
| 103 |
</dt> |
| 104 |
</dl> |
| 105 |
</dd> |
| 106 |
<dt> |
| 107 |
<span class="sect1"> |
| 108 |
<a href="build_unix_small.html">Building a small memory footprint library</a> |
| 109 |
</span> |
| 110 |
</dt> |
| 111 |
<dt> |
| 112 |
<span class="sect1"> |
| 113 |
<a href="build_unix_flags.html">Changing compile or load options</a> |
| 114 |
</span> |
| 115 |
</dt> |
| 116 |
<dt> |
| 117 |
<span class="sect1"> |
| 118 |
<a href="cross_compile_unix.html">Cross-Compiling on Unix</a> |
| 119 |
</span> |
| 120 |
</dt> |
| 121 |
<dt> |
| 122 |
<span class="sect1"> |
| 123 |
<a href="build_unix_install.html">Installing Berkeley DB</a> |
| 124 |
</span> |
| 125 |
</dt> |
| 126 |
<dt> |
| 127 |
<span class="sect1"> |
| 128 |
<a href="build_unix_shlib.html">Dynamic shared libraries</a> |
| 129 |
</span> |
| 130 |
</dt> |
| 131 |
<dt> |
| 132 |
<span class="sect1"> |
| 133 |
<a href="build_unix_test.html">Running the test suite under UNIX</a> |
| 134 |
</span> |
| 135 |
</dt> |
| 136 |
<dd> |
| 137 |
<dl> |
| 138 |
<dt> |
| 139 |
<span class="sect2"> |
| 140 |
<a href="build_unix_test.html#build_unix_test_sql">Building SQL Test Suite on Unix</a> |
| 141 |
</span> |
| 142 |
</dt> |
| 143 |
</dl> |
| 144 |
</dd> |
| 145 |
<dt> |
| 146 |
<span class="sect1"> |
| 147 |
<a href="build_unix_notes.html">Architecture independent FAQ</a> |
| 148 |
</span> |
| 149 |
</dt> |
| 150 |
<dt> |
| 151 |
<span class="sect1"> |
| 152 |
<a href="build_unix_aix.html">AIX</a> |
| 153 |
</span> |
| 154 |
</dt> |
| 155 |
<dt> |
| 156 |
<span class="sect1"> |
| 157 |
<a href="build_unix_freebsd.html">FreeBSD</a> |
| 158 |
</span> |
| 159 |
</dt> |
| 160 |
<dt> |
| 161 |
<span class="sect1"> |
| 162 |
<a href="build_unix_iphone.html">Apple iOS (iPhone OS)</a> |
| 163 |
</span> |
| 164 |
</dt> |
| 165 |
<dt> |
| 166 |
<span class="sect1"> |
| 167 |
<a href="build_unix_irix.html">IRIX</a> |
| 168 |
</span> |
| 169 |
</dt> |
| 170 |
<dt> |
| 171 |
<span class="sect1"> |
| 172 |
<a href="build_unix_linux.html">Linux</a> |
| 173 |
</span> |
| 174 |
</dt> |
| 175 |
<dt> |
| 176 |
<span class="sect1"> |
| 177 |
<a href="build_unix_macosx.html">Mac OS X</a> |
| 178 |
</span> |
| 179 |
</dt> |
| 180 |
<dt> |
| 181 |
<span class="sect1"> |
| 182 |
<a href="build_unix_qnx.html">QNX</a> |
| 183 |
</span> |
| 184 |
</dt> |
| 185 |
<dt> |
| 186 |
<span class="sect1"> |
| 187 |
<a href="build_unix_sco.html">SCO</a> |
| 188 |
</span> |
| 189 |
</dt> |
| 190 |
<dt> |
| 191 |
<span class="sect1"> |
| 192 |
<a href="build_unix_solaris.html">Solaris</a> |
| 193 |
</span> |
| 194 |
</dt> |
| 195 |
<dt> |
| 196 |
<span class="sect1"> |
| 197 |
<a href="build_unix_sunos.html">SunOS</a> |
| 198 |
</span> |
| 199 |
</dt> |
| 200 |
</dl> |
| 201 |
</div> |
| 202 |
<div class="sect1" lang="en" xml:lang="en"> |
| 203 |
<div class="titlepage"> |
| 204 |
<div> |
| 205 |
<div> |
| 206 |
<h2 class="title" style="clear: both"><a id="build_unix_intro"></a>Building for UNIX/POSIX</h2> |
| 207 |
</div> |
| 208 |
</div> |
| 209 |
</div> |
| 210 |
<div class="toc"> |
| 211 |
<dl> |
| 212 |
<dt> |
| 213 |
<span class="sect2"> |
| 214 |
<a href="build_unix.html#build_unix_sqlinter">Building the Berkeley DB SQL Interface</a> |
| 215 |
</span> |
| 216 |
</dt> |
| 217 |
</dl> |
| 218 |
</div> |
| 219 |
<p> |
| 220 |
The Berkeley DB distribution builds up to four separate libraries: |
| 221 |
the base C API Berkeley DB library and the optional C++, Java, and |
| 222 |
Tcl API libraries. For portability reasons, each library is |
| 223 |
standalone and contains the full Berkeley DB support necessary to |
| 224 |
build applications; that is, the C++ API Berkeley DB library does |
| 225 |
not require any other Berkeley DB libraries to build and run C++ |
| 226 |
applications. |
| 227 |
</p> |
| 228 |
<p> |
| 229 |
Building for Linux, Apple iOS (known as iPhone OS previously), Mac OS X or the QNX Neutrino release is the same |
| 230 |
as building for a conventional UNIX platform. |
| 231 |
</p> |
| 232 |
<p> |
| 233 |
The Berkeley DB distribution uses the Free Software Foundation's |
| 234 |
<a class="ulink" href="http://www.gnu.org/software/autoconf/autoconf.html" target="_top">autoconf</a> |
| 235 |
and <a class="ulink" href="http://www.gnu.org/software/libtool/libtool.html" target="_top">libtool</a> |
| 236 |
tools to build on UNIX platforms. In general, the standard |
| 237 |
configuration and installation options for these tools apply to the |
| 238 |
Berkeley DB distribution. |
| 239 |
</p> |
| 240 |
<p> |
| 241 |
To perform a standard UNIX build of Berkeley DB, change to the |
| 242 |
<span class="bold"><strong>build_unix</strong></span> |
| 243 |
directory and then enter the following two commands: |
| 244 |
</p> |
| 245 |
<pre class="programlisting">../dist/configure |
| 246 |
make</pre> |
| 247 |
<p> |
| 248 |
This will build the Berkeley DB library. |
| 249 |
</p> |
| 250 |
<p> |
| 251 |
To install the Berkeley DB library, enter the following command: |
| 252 |
</p> |
| 253 |
<pre class="programlisting">make install</pre> |
| 254 |
<p> |
| 255 |
To rebuild Berkeley DB, enter: |
| 256 |
</p> |
| 257 |
<pre class="programlisting">make clean |
| 258 |
make</pre> |
| 259 |
<p> |
| 260 |
If you change your mind about how Berkeley DB is to be configured, you must |
| 261 |
start from scratch by entering the following command: |
| 262 |
</p> |
| 263 |
<pre class="programlisting">make realclean |
| 264 |
../dist/configure |
| 265 |
make</pre> |
| 266 |
<p> |
| 267 |
To uninstall Berkeley DB, enter: |
| 268 |
</p> |
| 269 |
<pre class="programlisting">make uninstall</pre> |
| 270 |
<p> |
| 271 |
To build multiple UNIX versions of Berkeley DB in the same source |
| 272 |
tree, create a new directory at the same level as the build_unix |
| 273 |
directory, and then configure and build in that directory as |
| 274 |
described previously. |
| 275 |
</p> |
| 276 |
<div class="sect2" lang="en" xml:lang="en"> |
| 277 |
<div class="titlepage"> |
| 278 |
<div> |
| 279 |
<div> |
| 280 |
<h3 class="title"><a id="build_unix_sqlinter"></a>Building the Berkeley DB SQL Interface</h3> |
| 281 |
</div> |
| 282 |
</div> |
| 283 |
</div> |
| 284 |
<p> |
| 285 |
To perform a standard UNIX build of the Berkeley DB SQL interface, go |
| 286 |
to the <span class="bold"><strong>build_unix</strong></span> directory and then |
| 287 |
enter the following two commands: |
| 288 |
</p> |
| 289 |
<pre class="programlisting">../dist/configure --enable-sql |
| 290 |
make </pre> |
| 291 |
<p> |
| 292 |
This creates a library, <code class="literal">libdb_sql</code>, and a command |
| 293 |
line tool, <code class="literal">dbsql</code>. You can create and manipulate SQL |
| 294 |
databases using the <code class="literal">dbsql</code> shell. |
| 295 |
</p> |
| 296 |
<p> |
| 297 |
You can optionally provide the <code class="literal">--enable-sql_compat</code> |
| 298 |
argument to the <code class="literal">configure</code> script. In addition to |
| 299 |
creating <code class="literal">libdb_sql</code> and <code class="literal">dbsql</code> this |
| 300 |
causes a thin wrapper library called <code class="literal">libsqlite3</code> and |
| 301 |
a command line tool called <code class="literal">sqlite3</code> to be built. This |
| 302 |
library can be used as a drop-in replacement for SQLite. The |
| 303 |
<code class="literal">sqlite3</code> command line tool is identical to the |
| 304 |
<code class="literal">dbsql</code> executable but is named so that existing |
| 305 |
scripts for SQLite can easily work with Berkeley DB. |
| 306 |
</p> |
| 307 |
<pre class="programlisting"> |
| 308 |
../dist/configure --enable-sql_compat |
| 309 |
make </pre> |
| 310 |
<p> |
| 311 |
There are several arguments you can specify when configuring the |
| 312 |
Berkeley DB SQL Interface. See |
| 313 |
<a class="xref" href="build_unix_sql.html" title="Configuring the SQL Interface">Configuring the SQL Interface</a> |
| 314 |
for more information. |
| 315 |
</p> |
| 316 |
</div> |
| 317 |
</div> |
| 318 |
</div> |
| 319 |
<div class="navfooter"> |
| 320 |
<hr /> |
| 321 |
<table width="100%" summary="Navigation footer"> |
| 322 |
<tr> |
| 323 |
<td width="40%" align="left"><a accesskey="p" href="build_wince_faq.html">Prev</a> </td> |
| 324 |
<td width="20%" align="center"> </td> |
| 325 |
<td width="40%" align="right"> <a accesskey="n" href="build_unix_conf.html">Next</a></td> |
| 326 |
</tr> |
| 327 |
<tr> |
| 328 |
<td width="40%" align="left" valign="top">Windows Mobile FAQ </td> |
| 329 |
<td width="20%" align="center"> |
| 330 |
<a accesskey="h" href="index.html">Home</a> |
| 331 |
</td> |
| 332 |
<td width="40%" align="right" valign="top"> Configuring Berkeley DB</td> |
| 333 |
</tr> |
| 334 |
</table> |
| 335 |
</div> |
| 336 |
</body> |
| 337 |
</html> |