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>Configuring Berkeley DB</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 Programmer's Reference Guide" /> 10 <link rel="up" href="build_unix.html" title="Chapter 27. Building Berkeley DB for UNIX/POSIX" /> 11 <link rel="prev" href="build_unix.html" title="Chapter 27. Building Berkeley DB for UNIX/POSIX" /> 12 <link rel="next" href="build_unix_small.html" title="Building a small memory footprint library" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">Configuring Berkeley DB</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="build_unix.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 27. 23 Building Berkeley DB for UNIX/POSIX 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="build_unix_small.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="build_unix_conf"></a>Configuring Berkeley DB</h2> 35 </div> 36 </div> 37 </div> 38 <p>There are several arguments you can specify when configuring Berkeley DB. 39Although only the Berkeley DB-specific ones are described here, most of the 40standard GNU autoconf arguments are available and supported. To see a 41complete list of possible arguments, specify the --help flag to the 42configure program.</p> 43 <p>The Berkeley DB specific arguments are as follows:</p> 44 <div class="itemizedlist"> 45 <ul type="disc"> 46 <li> 47 <p><a id="build_unix_conf.--disable-largefile"></a> 48 <span class="bold"><strong>--disable-largefile</strong></span> 49 </p> 50 <p> 51 Some systems, notably versions of HP/UX and Solaris, require 52 special compile-time options in order to create files larger 53 than 2^32 bytes. These options are automatically enabled when 54 Berkeley DB is compiled. For this reason, binaries built on 55 current versions of these systems may not run on earlier 56 versions of the system because the library and system calls 57 necessary for large files are not available. To disable 58 building with these compile-time options, enter 59 --disable-largefile as an argument to configure. 60 </p> 61 </li> 62 <li> 63 <p> 64 <span class="bold"><strong>--disable-shared, --disable-static</strong></span> 65 </p> 66 <p> 67 On systems supporting shared libraries, Berkeley DB builds both 68 static and shared libraries by default. (Shared libraries are 69 built using 70 <a class="ulink" href="http://www.gnu.org/software/libtool/libtool.html" target="_top"> 71 the GNU Project's Libtool</a> distribution, which supports 72 shared library builds on many (although not all) systems.) To 73 not build shared libraries, configure using the 74 --disable-shared argument. To not build static libraries, 75 configure using the --disable-static argument. 76 </p> 77 </li> 78 <li> 79 <p> 80 <span class="bold"><strong>--enable-compat185</strong></span> 81 </p> 82 <p> 83 To compile or load Berkeley DB 1.85 applications against this 84 release of the Berkeley DB library, enter --enable-compat185 as 85 an argument to configure. This will include Berkeley DB 1.85 86 API compatibility code in the library. 87 </p> 88 </li> 89 <li> 90 <p> 91 <span class="bold"><strong>--enable-cxx</strong></span> 92 </p> 93 <p> 94 To build the Berkeley DB C++ API, enter --enable-cxx as an 95 argument to configure. 96 </p> 97 </li> 98 <li> 99 <p><a id="build_unix_conf.--enable-debug"></a> 100 <span class="bold"><strong>--enable-debug</strong></span> 101 </p> 102 <p> 103 To build Berkeley DB with <span class="bold"><strong>-g</strong></span> 104 as a compiler flag and with <span class="bold"><strong>DEBUG</strong></span> #defined during compilation, 105 enter --enable-debug as an argument to configure. This will 106 create a Berkeley DB library and utilities with debugging 107 symbols, as well as load various routines that can be called 108 from a debugger to display pages, cursor queues, and so forth. 109 If installed, the utilities will not be stripped. This 110 argument should not be specified when configuring to build 111 production binaries. 112 </p> 113 </li> 114 <li> 115 <p><a id="build_unix_conf.--enable-debug_rop"></a> 116 <span class="bold"><strong>--enable-debug_rop</strong></span> 117 </p> 118 <p> 119 To build Berkeley DB to output log records for read operations, 120 enter --enable-debug_rop as an argument to configure. This 121 argument should not be specified when configuring to build 122 production binaries. 123 </p> 124 </li> 125 <li> 126 <p><a id="build_unix_conf.--enable-debug_wop"></a> 127 <span class="bold"><strong>--enable-debug_wop</strong></span> 128 </p> 129 <p> 130 To build Berkeley DB to output log records for write 131 operations, enter --enable-debug_wop as an argument to 132 configure. This argument should not be specified when 133 configuring to build production binaries. 134 </p> 135 </li> 136 <li> 137 <p><a id="build_unix_conf.--enable-diagnostic"></a> 138 <span class="bold"><strong>--enable-diagnostic</strong></span> 139 </p> 140 <p> 141 142 To build Berkeley DB with run-time debugging checks, enter 143 --enable-diagnostic as an argument to configure. This causes a 144 number of additional checks to be performed when Berkeley DB is 145 running, and also causes some failures to trigger process abort 146 rather than returning errors to the application. Applications 147 built using this argument should not share database 148 environments with applications built without this argument. 149 This argument should not be specified when configuring to build 150 production binaries. 151 </p> 152 </li> 153 <li> 154 <p> 155 <span class="bold"><strong>--enable-dump185</strong></span> 156 </p> 157 <p> 158 To convert Berkeley DB 1.85 (or earlier) databases to this 159 release of Berkeley DB, enter --enable-dump185 as an argument 160 to configure. This will build the <a href="../api_reference/C/db_dump.html" class="olink">db_dump185 utility</a>, which can dump 161 Berkeley DB 1.85 and 1.86 databases in a format readable by the 162 Berkeley DB <a href="../api_reference/C/db_load.html" class="olink">db_load utility</a>. 163 </p> 164 <p> 165 The system libraries with which you are loading the 166 <a href="../api_reference/C/db_dump.html" class="olink">db_dump185 utility</a> must already contain the Berkeley DB 1.85 library 167 routines for this to work because the Berkeley DB distribution 168 does not include them. If you are using a non-standard library 169 for the Berkeley DB 1.85 library routines, you will have to 170 change the Makefile that the configuration step creates to load 171 the <a href="../api_reference/C/db_dump.html" class="olink">db_dump185 utility</a> with that library. 172 </p> 173 </li> 174 <li> 175 <p><a id="build_unix_conf.--enable-java"></a> 176 <span class="bold"><strong>--enable-java</strong></span> 177 </p> 178 <p> 179 To build the Berkeley DB Java API, enter --enable-java as an 180 argument to configure. To build Java, you must also build with 181 shared libraries. Before configuring, you must set your PATH 182 environment variable to include javac. Note that it is not 183 sufficient to include a symbolic link to javac in your PATH 184 because the configuration process uses the location of javac to 185 determine the location of the Java include files (for example, 186 jni.h). On some systems, additional include directories may be 187 needed to process jni.h; see <a class="xref" href="build_unix_flags.html" title="Changing compile or load options">Changing compile or load options</a> for more information. 188 </p> 189 </li> 190 <li> 191 <p><a id="build_unix_conf.--enable-posixmutexes"></a> 192 <span class="bold"><strong>--enable-posixmutexes</strong></span> 193 </p> 194 <p> 195 To force Berkeley DB to use the POSIX pthread mutex interfaces 196 for underlying mutex support, enter --enable-posixmutexes as an 197 argument to configure. This is rarely necessary: POSIX mutexes 198 will be selected automatically on systems where they are the 199 preferred implementation. 200 </p> 201 <p> 202 The --enable-posixmutexes configuration argument is normally 203 used in two ways: First, when there are multiple mutex 204 implementations available and the POSIX mutex implementation is 205 not the preferred one (for example, on Solaris where the LWP 206 mutexes are used by default). Second, by default the Berkeley 207 DB library will only select the POSIX mutex implementation if 208 it supports mutexes shared between multiple processes, as 209 described for the pthread_condattr_setpshared and 210 pthread_mutexattr_setpshared interfaces. The 211 --enable-posixmutexes configuration argument can be used to 212 force the selection of POSIX mutexes in this case, which can 213 improve application performance significantly when the 214 alternative mutex implementation is a non-blocking one (for 215 example test-and-set assembly instructions). However, 216 configuring to use POSIX mutexes when the implementation does 217 not have inter-process support will only allow the creation of 218 private database environments, that is, environments where the 219 <a href="../api_reference/C/envopen.html#open_DB_PRIVATE" class="olink">DB_PRIVATE</a> flag is specified to the <a href="../api_reference/C/envopen.html" class="olink">DB_ENV->open()</a> method. 220 </p> 221 <p> 222 Specifying the --enable-posixmutexes configuration argument may require 223 that applications and Berkeley DB be linked with the -lpthread library. 224 </p> 225 </li> 226 <li> 227 <p><a id="build_unix_conf.--enable-pthread_api"></a> 228 <span class="bold"><strong>--enable-pthread_api</strong></span> 229 </p> 230 <p> 231 To configure Berkeley DB for a POSIX pthreads application (with 232 the exception that POSIX pthread mutexes may not be selected as 233 the underlying mutex implementation for the build), enter 234 --enable-pthread_api as an argument to configure. The build 235 will include the Berkeley DB replication manager interfaces and 236 will use the POSIX standard pthread_self and pthread_yield 237 functions to identify threads of control and yield the 238 processor. The --enable-pthread_api argument requires POSIX 239 pthread support already be installed on your system. 240 </p> 241 <p> 242 Specifying the --enable-pthread_api configuration argument may 243 require that applications and Berkeley DB be linked with the 244 -lpthread library. 245 </p> 246 </li> 247 <li> 248 <p> 249 <span class="bold"><strong>--enable-smallbuild</strong></span> 250 </p> 251 <p> 252 To build a small memory footprint version of the Berkeley DB 253 library, enter --enable-smallbuild as an argument to configure. 254 The --enable-smallbuild argument is equivalent to individually 255 specifying --disable-cryptography, --disable-hash, 256 --disable-queue, --disable-replication, --disable-statistics 257 and --disable-verify, turning off cryptography support, the 258 Hash and Queue access methods, database environment replication 259 support and database verification support. See 260 <a class="xref" href="build_unix_small.html" title="Building a small memory footprint library">Building a small memory footprint library</a> 261 for more information. 262 </p> 263 </li> 264 <li> 265 <p> 266 <span class="bold"><strong>--enable-stl</strong></span> 267 </p> 268 <p> 269 To build the Berkeley DB C++ STL API, enter --enable-stl as an 270 argument to configure. Setting this argument implies that --enable-cxx is set, 271 and the Berkeley DB C++ API will be built too. 272 273 </p> 274 <p> 275 There will be a libdb_stl-X.X.a and libdb_stl-X.X.so 276 built, which are the static and shared library you should link your application with in order to 277 make use of Berkeley DB via its STL API. 278 279 </p> 280 <p> 281 If your compiler is not ISO C++ compliant, the configure may fail with this argument 282 specified because the STL API requires standard C++ template features. In this case, 283 you will need a standard C++ compiler. So far gcc is the best choice, we have tested and found 284 that gcc-3.4.4 and all its newer versions can build the Berkeley DB C++ STL API successfully. 285 </p> 286 <p> 287And you need to include the STL API header files in your application code. 288If you are using the Berkeley DB source tree, the header files are in <Berkeley DB Source Root >/stl directory; 289If you 290are using the installed version, these header files are in < Berkeley DB Installed Directory>/include, as well as the 291db.h and db_cxx.h header files. 292</p> 293 </li> 294 <li> 295 <p> 296 <span class="bold"><strong>--enable-tcl</strong></span> 297 </p> 298 <p> 299 To build the Berkeley DB Tcl API, enter --enable-tcl as an 300 argument to configure. This configuration argument expects to 301 find Tcl's tclConfig.sh file in the 302 <code class="filename">/usr/local/lib</code> directory. See the 303 --with-tcl argument for instructions on specifying a 304 non-standard location for the Tcl installation. See <a class="xref" href="tcl.html#tcl_intro" title="Loading Berkeley DB with Tcl">Loading Berkeley DB with Tcl</a> for 305 information on sites from which you can download Tcl and which 306 Tcl versions are compatible with Berkeley DB. To build Tcl, 307 you must also build with shared libraries. 308 </p> 309 </li> 310 <li> 311 <p><a id="build_unix_conf.--enable-test"></a> 312 <span class="bold"><strong>--enable-test</strong></span> 313 </p> 314 <p> 315 To build the Berkeley DB test suite, enter --enable-test as an 316 argument to configure. To run the Berkeley DB test suite, you 317 must also build the Tcl API. This argument should not be 318 specified when configuring to build production binaries. 319 </p> 320 </li> 321 <li> 322 <p><a id="build_unix_conf.--enable-uimutexes"></a> 323 <span class="bold"><strong>--enable-uimutexes</strong></span> 324 </p> 325 <p> 326 To force Berkeley DB to use the UNIX International (UI) mutex 327 interfaces for underlying mutex support, enter 328 --enable-uimutexes as an argument to configure. This is rarely 329 necessary: UI mutexes will be selected automatically on systems 330 where they are the preferred implementation. 331 </p> 332 <p> 333 The --enable-uimutexes configuration argument is normally used 334 when there are multiple mutex implementations available and the 335 UI mutex implementation is not the preferred one (for example, 336 on Solaris where the LWP mutexes are used by default). 337 </p> 338 <p> 339 Specifying the --enable-uimutexes configuration argument may 340 require that applications and Berkeley DB be linked with the 341 -lthread library. 342 </p> 343 </li> 344 <li> 345 <p><a id="build_unix_conf.--enable-umrw"></a> 346 <span class="bold"><strong>--enable-umrw</strong></span> 347 </p> 348 <p> 349 Rational Software's Purify product and other run-time tools 350 complain about uninitialized reads/writes of structure fields 351 whose only purpose is padding, as well as when heap memory that 352 was never initialized is written to disk. Specify the 353 --enable-umrw argument during configuration to mask these 354 errors. This argument should not be specified when configuring 355 to build production binaries. 356 </p> 357 </li> 358 <li> 359 <p><a id="build_unix_conf.--with-mutex"></a> 360 <span class="bold"><strong>--with-mutex=MUTEX</strong></span> 361 </p> 362 <p> 363 To force Berkeley DB to use a specific mutex implementation, 364 configure with --with-mutex=MUTEX, where MUTEX is the mutex 365 implementation you want. For example, 366 --with-mutex=x86/gcc-assembly will configure Berkeley DB to use 367 the x86 GNU gcc compiler based test-and-set assembly mutexes. 368 This is rarely necessary and should be done only when the 369 default configuration selects the wrong mutex implementation. 370 A list of available mutex implementations can be found in the 371 distribution file <code class="filename">dist/aclocal/mutex.m4</code>. 372 </p> 373 </li> 374 <li> 375 <p> 376 <span class="bold"><strong>--with-tcl=DIR</strong></span> 377 </p> 378 <p> 379 To build the Berkeley DB Tcl API, enter --with-tcl=DIR, 380 replacing DIR with the directory in which the Tcl tclConfig.sh 381 file may be found. See <a class="xref" href="tcl.html#tcl_intro" title="Loading Berkeley DB with Tcl">Loading Berkeley DB with Tcl</a> for information on sites from 382 which you can download Tcl and which Tcl versions are 383 compatible with Berkeley DB. To build Tcl, you must also build 384 with shared libraries. 385 </p> 386 </li> 387 <li> 388 <p><a id="build_unix_conf.--with-uniquename=NAME"></a> 389 <span class="bold"><strong>--with-uniquename=NAME</strong></span> 390 </p> 391 <p> 392 To build Berkeley DB with unique symbol names (in order to 393 avoid conflicts with other application modules or libraries), 394 enter --with-uniquename=NAME, replacing NAME with a string that 395 to be appended to every Berkeley DB symbol. If "=NAME" is not 396 specified, a default value of "_MAJORMINOR" is used, where 397 MAJORMINOR is the major and minor release numbers of the 398 Berkeley DB release. See <a class="xref" href="install_multiple.html" title="Building with multiple versions of Berkeley DB">Building with multiple versions of Berkeley DB</a> for more information. 399 </p> 400 </li> 401 </ul> 402 </div> 403 </div> 404 <div class="navfooter"> 405 <hr /> 406 <table width="100%" summary="Navigation footer"> 407 <tr> 408 <td width="40%" align="left"><a accesskey="p" href="build_unix.html">Prev</a> </td> 409 <td width="20%" align="center"> 410 <a accesskey="u" href="build_unix.html">Up</a> 411 </td> 412 <td width="40%" align="right"> <a accesskey="n" href="build_unix_small.html">Next</a></td> 413 </tr> 414 <tr> 415 <td width="40%" align="left" valign="top">Chapter 27. 416 Building Berkeley DB for UNIX/POSIX 417 </td> 418 <td width="20%" align="center"> 419 <a accesskey="h" href="index.html">Home</a> 420 </td> 421 <td width="40%" align="right" valign="top"> Building a small memory footprint library</td> 422 </tr> 423 </table> 424 </div> 425 </body> 426</html> 427