37Berkeley DB: Building for UNIX platforms
1

Berkeley DB: Building for UNIX platforms

LBuilding Berkeley Berkeley DB on a UNIX platform
@Berkeley DB's configuration options
VChanging compilers, libraries or compiler and loader options
1Installing Berkeley DB

>

Building Berkeley Berkeley DB on a UNIX platform:



GTo build the default configuration of Berkeley DB, simply enter the two commands:

	../dist/configure	make
#in the build.unix directory.(This will build the Berkeley DB library.*To install the Berkeley DB library, enter:

	make install


JSee below for specific information on what files are installed and in whatEdirectories, and how to configure installation on a per-system basis.

!If you want to rebuild DB, enter:

	make clean	make


KIf you change your mind about how Berkeley DB is configured, you must startfrom scratch by entering:

	make distclean	../dist/configure	make


PTo build multiple UNIX versions of Berkeley DB in the same source tree, create aLnew directory at the same level as build.unix, and then configure and build.

	mkdir build.bsdos3.0	cd build.bsdos3.0	../dist/configure	make


KJava support cannot be built using the configuration options. To configureIand build the Java API, see the file db/java/README for more information.

HIf you have trouble with any of these commands, please send email to theGaddresses found in the Sleepycat Software contact information. In thatJemail, please provide a complete copy of the commands that you entered and their output.


1

Berkeley DB's configuration options:



GThere are many options that you can enter to the configuration program,Lonly a few of which are Berkeley DB specific. To see a complete list of the/options, enter ../dist/configure --help.

0The Berkeley DB specific options are as follows:

--enable-cxx:



--enable-debug:



--enable-diagnostic:



--enable-compat185:



--enable-dump185:



--enable-test:



--disable-bigfile:


J

Changing compilers, libraries or compiler and loader options:



FYou can specify a compiler and/or compile and load time flags by usingEenvironment variables during configuration. For example, if you wantFto use a specific compiler, specify the CC environment variable beforerunning configure:





CUsing anything other than the native compiler will almost certainlyDmean that you'll want to check the compile and load line flags, too.

ATo specify debugging and optimization options for the C compiler,$use the CFLAGS environment variable:





ITo specify header file search directories and other miscellaneous optionsKfor the C preprocessor and compiler, use the CPPFLAGS environment variable:





CTo specify debugging and optimization options for the C++ compiler,&use the CXXFLAGS environment variable:





@To specify miscellaneous options for the linker, use the LDFLAGSenvironment variable:





FIf the Tcl or any other include files or libraries are in non-standardHplaces on your system, you will need to specify the directory path wherethey can be found.

HIf you want to specify additional libraries and library directories, setEthe LIBS environment variable before running configure. For example:





Fwould specify two additional directories to search for libraries, /a/b6and /e/f, and one additional library to load, "posix".

IMake sure that you prepend -L to any library directory names and that youIprepend -I to any include file directory names! Also, make sure that youEquote the arguments as shown above, i.e. with single or double quotesFaround the values you're specifying for LIBS, if they contain blank ortab characters.

IThe env command is available on most systems, and simply sets one or moreFenvironment variables before running a command. If the env command isInot available to you, you can set the environment variables in your shellCbefore running configure. For example, in sh or ksh, you could do:e

)

f

I!and in csh or tcsh, you could do:d

o

s

5See your shell's manual page for further information.k


o$

Installing Berkeley DB:



oFBerkeley DB installs the following files into the following locations,"with the following default values:

l e b   m  f ,  > c  >   t  > t  "  n - n r l  c y
VariablesDefault value
prefix/usr/local/BerkeleyDB
exec_prefix$(prefix)
bindir$(prefix)/bin
includedir$(prefix)/include
libdir$(prefix)/lib
mandir$(prefix)
File(s)Default location
db.h, db_cxx.h, db_185.h$(includedir)
libdb.a$(libdir)
utilities$(bindir)
documentation$(mandir)/docs


,ITo move the entire installation tree somewhere besides /usr/local,.Dchange the value prefix. To move the binaries to a differentIplace, change the value of bindir. These values can be changed asspart of configuration:

t

.

c!or when doing the install itself:e

k

t

tENote, the installation process will attempt to create any directoriesh(that do not already exist on the system.v˙˙trouble with any of these commands, please send email to theGaddresses found in the Sleepycat Software contact information. In thatJemail, please provide a complete copy of the commands that you entered and their output.