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
=====================

FT runs under GNUstep (www.gnustep.org) or Mac OS X (www.apple.com).

It requires:
- BDB version version 0.1 (Berkeley Database Wrapper for Objective-C)
- Encore version 0.3 (set of base functionalities/objects)

In detail:
To run FT, you need the framework "BDB" which is
part of the 42 project and also available at
  http://sourceforge.net/projects/fortytwo/
Please refer to the INSTALL of BDB to read about further requirements.

Encore is to be found at
  http://sourceforge.net/projects/fortytwo/
When downloaded, please refer to INSTALL of Encore for installation of this
framework.
  
To build FT 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.2 or newer


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

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

Building the FT tools (FTControlCmdLine, FTExport, FTImport) follow the next
steps for each tool, starting with FTAbstractTool
- Switch to the subdirectory of the tool (e.g. tools/FTAbstractTool)
- run "make install" 
- Repeat this for each tool

If you wish to make and run the FT tests (recommended):
- Create a subdirectory "testdir" under FT root directory
- Switch to the subdirectory "tests" (NOT testdir)
- Run "make"
- Run "./shared_obj/FTTESTS -configFile ftconfig.xml"
- The latter starts the tests and will create some database files within the
  directory "testdir". You have to clean up this directory before
  you restart the tests; otherwise the tests will fail.
- Switch to the subdirectory "tools"


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. The build steps may be followed in the given order below:

Building the core FT framework:
- Switch to the FT directory
- Open "FT.xcodeproj" with XCode
- Select "FT" as active target.
- Adjust the search paths for headers and libraries in order to be able to 
  include the file "db.h" of your Berkeley DB installation and to use the 
  library from you Berkeley DB installation (refer to INSTALL of the BDB project 
  for additional information).
- Add the frameworks "Encore" and BDB to the list of frameworks for FT,
  FTTests, FTExport, FTImport, FTAbstractTool, FTControlCmdLine
- Now you may build "FT"
- Copy the built framework to your favorite framework installation path

Building the FT tests (optional, recommended):
- Select "FTTests" 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
    + The directory where the framework "FT" 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:
      /Users/oliver/projects/42/frameworks/FT/build
- Edit the active executable "FTTests" and set up/modify the a custom working 
  directory pointing to the directory "tests" which must be placed under the
  FT project root directory.
  Also add a parameter to the program which may look as follows:
    -configFile ftconfig.xml
- Now you may build "FTTests"
- Now you may run "FTTests"
- If the test does not run twice then remove the created databases in "testdir"
  by hand or adjust the target "Clean testdir", which includes a unix script
  intended to remove the databases before each test run.

Building "FTAbstractTool":
- Select "FTAbstractTool" as active target
- Now build the target

Building "FTExport":
- Select "FTExport" as active target
- Now build this target

Building "FTImport":
- Select "FTImport" as active target
- Now build this target

Building "FTControlCmdLine"
- Select "FTControlCmdLine" as active target
- Now build this target

