Preleminaries
=============

Please regard the software requirements at first.
Depending on the kind of file you have downloaded the installation procedure
varies:
- if you have downloaded a source tarball you may choose
  "Compiling under GNUstep" or
  "Compiling under Mac OS X using the given XCode project file"
- if you have downloaded a binary version you may choose
  "Installing the binary version (DMG file) on Mac OS X"

Note: The binary distribution does not contain the testcases.


Software Requirements
=====================

Short:
  - Encore Version 0.3
  - Berkeley DB 4.3.x or greater
  - GNUstep 1.11 (or greater) or Cocoa / OS X 
  

In detail:
To run BDB, you need the framework "Encore" which is
part of the 42 project and also available at
  http://sourceforge.net/projects/fortytwo/

You need Berkeley DB installed. The BDB framework has been developed and
tested with version 4.3.21.
You can obtain Berkeley DB from
  www.sleepycat.com
The Berkeley DB software and its installation is well documented and this 
documentation is given in each distribution. So normally it is quite easy
to install the software.

After the installation of Berkeley DB you may have to adjust your 
environment variable telling your os where to find the dynamic libraries. For
linux, set LD_LIBRARY_PATH to the subdirectory lib of your Berkeley DB
installation.

To compile and install Berkeley DB on your machine just the follow the well 
documented 
To build BDB you need:
  - Under GNUstep:
    * An Objective-C environment (gcc + rudimentary libraries)
      suitable to be used with GNUstep.
    * GNUstep make (version 1.11) and 
    * GNUstep base (version 1.11)

  - Under Mac OS X:
    * XCode 2.1 or newer


Compiling under GNUstep
========================

- Switch to the directory "BDB"
- copy config.properties.templates to config.properties
- Adjust the setting DBROOT pointing to the root of your Berkeley DB 
  installation
- Run "make install"

If you wish to create and run the tests:
- Switch to the subdirectory "tests"
- Run "make"
- Create a subdirectory "testdir" and switch into this directory
- Run "../shared_obj/BDBTESTS"
- The latter starts the tests and will create some database files within the
  current directory ("testdir"). You have to clean up this directory before
  you start the tests once again; otherwise the tests will fail.


Compiling under Mac OS X using the given XCode project file
===========================================================

The preferred way is to create an own project based on the following hints. But
you may also use and appropriately modify the XCode project file which is given
in the distribution. 

To build BDB you may set up the following things:
- Switch to the BDB directory
- Open "BDB.xcodeproj" with XCode
- Select "BDB" as active target.
- Adjust the search paths for headers and libraries in order to be able to 
  include the file "db.h" and to use the library from you Berkeley DB
  installation.
- Add the framework "Encore" to the list of frameworks for BDB
- Now you may build "BDB"
- Copy the built framework to your favorite framework installation path.

If you wish to build and run the tests:
- Select "BDBTests" as active target
- Edit the active executable and choose "Arguments"
- Add or adjust the environment variable "DYLD_FRAMEWORK_PATH" containing
  the following entries:
    + The directory "lib" of your Berkeley DB installation
    + The directory where the framework "Encore" is installed
    + The directory where the framework "BDB" is installed
    + This may look e.g. as follows (in a single line):
      DYLD_FRAMEWORK_PATH=/Users/oliver/projects/fortytwo/installed/lib:
      /Users/oliver/projects/42/frameworks/Encore/build:
      /Users/oliver/projects/42/frameworks/BDB/build
- Now you may build "BDBTests"
- Edit the executable "BDBTests" and set up/modify the a custom working 
  directory pointing to the directory "testdir" which must be placed under the
  BDB project root directory
  (you do not have to create this directory since it will be created by a
  script)
