# @(#)README	8.17 (Sleepycat) 9/5/97

This is a directory for building UNIX versions of DB.

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

	../dist/configure
	make

in this directory.  This will build the DB library.  To install the DB
library, enter:

	make install

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

If you want to rebuild DB, enter:

	make clean
	make

If you change your mind about how DB is configured, you must start from
scratch by entering:

	make distclean
	../dist/configure
	make

To build multiple UNIX versions of DB in the same source tree, create a
new top-level directory, and then configure and build.

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

If you have trouble with any of these commands, please send email to the
addresses found in the ../README file.  In that email, please provide a
complete copy of the commands that you entered and their output.

=-=-=-=-=-=-=
DB'S OPTIONS TO THE CONFIGURE PROGRAM
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
There are many options that you can enter to the configuration program,
only a few of which are DB specific.  To see a complete list of the
options, enter "../dist/configure --help".

The DB specific options are as follows:

--enable-cxx:
	If you want to include C++ interfaces in the library, enter:

	--enable-cxx

	as an argument to configure.

--enable-debug:
	If you want to build DB with -g as a compiler flag and with DEBUG
	#defined during compilation, enter:

	--enable-debug

	as an argument to configure.  This will cause a number of special
	checks to be performed when DB is running.  This flag should NOT
	be defined when building production binaries.

--enable-compat185
	If you want to compile or load DB 1.85 applications against the
	DB 2.0 library, enter:

	--enable-compat185

	as an argument to configure.  This will include DB 1.85 API
	compatibility code in the library.

--enable-dump185:
	If you need to convert DB 1.85 (or earlier) databases to DB 2.0
	databases, enter:

	--enable-dump185

	as an argument to configure.  This will build the dump_185(1)
	utility.  This utility will dump DB 1.85 databases in a format
	readable by the db_load(1) utility.  For more information, see
	db_dump(1) and db_load(1).

	The system libraries with which you are loading the dump_185(1)
	utility MUST already contain the DB 1.85 library routines for this
	to work, as the DB distribution does not include them.  If you
	are using a non-standard library for the DB 1.85 library routines,
	you will have to change the Makefile that configure creates to
	load dump_185 with that library.

--enable-test:
	If you want to build the Tcl test suite, enter:

	--enable-test

	as an argument to configure.  Note, the Tcl test suite will only
	build if the Tcl libraries and include files are found.

=-=-=-=-=-=-=
RUNNING THE DB TEST SUITE
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The DB test suite is built if you specify --enable-test as an argument to
configure and the Tcl libraries are found on your system.  (The libraries
that DB needs to build the test suite are -ltcl and -lm.)  For more
information on running DB's test suite and debugging the DB package, see
the file file ../test/README.

=-=-=-=-=-=-=
ADDING OR CHANGING COMPILERS, OR COMPILE OR LOAD LINE FLAGS
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
If you want to use a specific compiler, specify the CC environment
variable before running configure.  For example:

	env CC=gcc ../dist/configure

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

If you want to specify additional load line flags, specify the ADDLDFLAGS
environment variable before running configure.  For example:

	env ADDLDFLAGS="-Q" ../dist/configure

would specify the -Q flag in the load line when the loader is called.

If you don't want configure to use the default load line flags for the
system, specify the LDFLAGS environment variable before running configure.
For example:

	env LDFLAGS="-32" ../dist/configure

will cause configure to set the load line flags to "-32", and not set
them based on the current system.

If you want to specify additional compile line flags, specify the
ADDCPPFLAGS environment variable before running configure.  For example:

	env ADDCPPFLAGS="-I../foo" ../dist/configure

would cause the compiler to be passed the -I../foo flag when compiling
test programs during configuration as well as when building DB object
files.

If you don't want configure to use the default compile line flags for the
system, specify the CPPFLAGS environment variable before running configure.
For example:

	env CPPFLAGS="-I.." ../dist/configure

will cause configure to use "-I.." as the compile line flags instead of
the default values based on the current system.

=-=-=-=-=-=-=
ADDING LIBRARIES AND INCLUDE FILES
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
If the Tcl or any other include files or libraries are in non-standard
places on your system, you will need to specify the directory path where
they can be found.

If you want to specify additional library paths, set the ADDLIBS environment
variable before running configure.  For example:

	env ADDLIBS="-L/a/b -L/e/f -lposix" ../dist/configure

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

If you want to specify additional include paths, specify the ADDCPPFLAGS
environment variable before running configure.  For example:

	env ADDCPPFLAGS="-I/usr/local/include" LIBS="-lposix" ../dist/configure

would search /usr/local/include for include files, as well as load the posix
library as described above.

Make sure that you prepend -L to any library directory names and that you
prepend -I to any include file directory names!  Also, make sure that you
quote the paths as shown above, i.e. with single or double quotes around
the values you're specifying for ADDCPPFLAGS and ADDLIBS.

The env command is available on most systems, and simply sets one or more
environment variables before running a command.  If the env command is
not available to you, you can set the environment variables in your shell
before running configure.  For example, in sh or ksh, you could do:

	ADDLIBS="-L/a/b -L/e/f -ldb" ../dist/configure

and in csh or tcsh, you could do:

	setenv ADDLIBS "-L/a/b -L/e/f -ldb"
	../dist/configure

See your shell manual page for further information.

=-=-=-=-=-=-=
INSTALLING DB
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
DB installs the following files into the following locations, with the
following default values:

Variables:		Default value:
prefix			/usr/local
exec_prefix		$(prefix)
includedir		$(prefix)/include 
bindir			$(prefix)/bin
libdir			$(prefix)/lib
mandir			$(prefix)/man

File(s):		Default location
----------------------------------------
db.h, db_185.h		$(includedir)
libdb.a			$(libdir)
utilities		$(bindir)
formatted man pages	$(mandir)/cat1/
formatted man pages	$(mandir)/cat3/

Unformatted man pages are not installed by default.

To move the entire installation tree somewhere besides /usr/local, change
the value "prefix".  To move the binaries to a different place, change
the value of "bindir".  Similarly, to move the man pages to a different
location, change the value of "mandir".  These values can be changed as
part of configuration:

	../dist/configure --prefix=/usr/contrib

or when doing the install itself:

	make prefix=/usr/contrib install

Note, the installation process will attempt to create any directories
that are not already in place on the system.
