How to build the Funambol OMA-DM client
--------------------------------------------------------------

1. Overview

These instructions are specific for the initial version 0.7.2 of the client. 
This version uses a special release of the Funambol C++ SDK that has been modified to support
the OMA-DM client; Funambol is working to merge the SDK with the regular SDK that is also 
available for download from the Forge. When this is done the structure of this project will 
change.

The current structure is:

dm-client
 |-build    (build scripts and resources for Linux, MacOS, Windows)
 |-config   (configuration scripts - if any)
 |-funambol (containing the object files and the header files of the SDK. Please use the  
 |           headers to compile the client, link with the binaries in your OS of choice)
 |-include  (the client's headers)
 |-src      (the client's source files)


2. Dependencies

The client is build using the Bjam build tool. Also libraries from the list below should be 
installed in the system:
- Funambol Client SDK
- boost 1.39.0
- wbxml2 0.9.2
- openssl 0.9.8e
- cURL 7.20.0

You can get Bjam from: http://www.boost.org/doc/libs/1_39_0/doc/html/jam/building.html
To build please type the following command from the /src/ folder (location of the Jamroot file):
> bjam


3. Manually install the Funambol SDK to a system folder

This initial version of the OMA-DM client uses its own version of the Funambol SDK. The changes
in the SDK to support the client are being merged into the regular Funambol SDK - when this is
done the build process will change. But for the moment:

Linux:

- Manually copy the forge directory structure under /funambol/include/common
                                                    /funambol/include/posix
  to /usr/local/include/funambol/common
     /usr/local/include/funambol/posix

- Manually extract libfunambol.a from the archive under /funambol, copy it to
  /usr/local/lib/libfunambol.a

MacOS:

- Manually copy the forge directory structure under /funambol/include/common
                                                    /funambol/include/mac
                                                    /funambol/include/posix
  to /usr/local/include/funambol/common
     /usr/local/include/funambol/mac
     /usr/local/include/funambol/posix

- Manually extract libfunambol.a from the archive under /funambol, copy it to
  /usr/local/lib/libfunambol.a

Windows:

- The environment variable %FUNAMBOL_INCLUDE% should point to <your local SDK copy>/include/funambol/
- Environment variable %FUNAMBOL_LIB_PATH% should point to the folder where the Funambol library file 
  funambol.lib is located.


4. Windows build / install instructions

More in detail, the following are the instructions on how to manage the client on Windows:

  a. Build 3rd party components:
     - boost_1_39_0
     - wbxml2-0.9.2
     - openssl-0.9.8e
     - curl-7.20.0

  b. Install or build bjam (http://www.boost.org/doc/libs/1_39_0/doc/html/jam/building.html)

  c. Set environment variables
     - BOOST_ROOT = "path to boost_1_39_0"
     - FUNAMBOL_INCLUDE = "path to funambol SDK includes"
     - FUNAMBOL_LIB_PATH = "path to Funambol SDK library win32.lib"
     - OPENSSL_INCLUDE = "path to openssl includes"
     - WBXML_PATH = "path to wbxml includes"
     - WBXML_LIB_PATH = "path to wbxml library"
     - CURL_INCLUDE = "path to cURL includes"
     - CURL_LIB_PATH = "path to cURL library"

  d. Run  "bjam release"
     in folder OMA-DMClient\src\
     All binaries will be located at OMA-DMClient\build\win32\release

  e. Copy file "config\conf.priv" to "%ALLUSERSPROFILE%\Funambol\DMClient\DataStorage\conf\"
     Copy file "config\LogRequired.txt" to "%ALLUSERSPROFILE%\Funambol\DMClient\Logs\"

  f. To install the service run 
		oma_dm_client.exe -i

  g. To remove service from the system run 
		oma_dm_client.exe -u
