Compile libraries from svn sources

This page describes all steps that needs to be taken to compile libraries from sources checked out from svn repository.

Prequesties

To build native project files you need bakefile 0.2.2 or higher. Get it from bakefile site and install in default location.

To build wxdba library you need wxWidgets library installed.

To compile debea library with regression tests you need CppUnit library. Note that build scripts that reside in trunk run regression tests by default.

You probably want to compile at least one driver for SQLArchive. In this case you need to set-up one of the following database devel packages:

odbc

Under unix you should have iODBC devel package installed. MS Windows does not need any additional setup.

sqlite3

Windows:
Get source package and compile dll from it. Setup %SQLITE3_PATH environment variable to point to directory where you put header files and libraries. Put header files in %SQLITE3_PATH\include subdirectory. Put libraries %SQLITE3_PATH%\lib subdirectory.

Unix:
Depending on distribution there could be package with header files and libraries available on your system or you need to compile sqlite3 from sources and install it.

PostgreSQL

Windows:
Get latest installer from here and install it. Add %POSTGRESQL% environment variable and point it to directory that contains lib and include subdirectories.

Unix:
Install latest devel package and make sure that pg_config is in your path.

Get sources

You can get latest debea sources issuing following command:

svn co http://debea.net/svn/debea/trunk debea

Setup your enviroment

You should have build scripts in root directory of checked sources. For windows there is debea_dev_build.bat, and for unix there is debea_dev_build.sh

Those scripts build sqlite3 driver, run regression tests and build wxdba library by default.

If you don't want to run regression tests edit build script and remove TESTS=1 (for Windows) and --enable-tests (for Unix) from it.

If you don't want to build wxdba library then you need to remove section that tries to build it from build script manually.

Review all variables that setup build dir, install dir and plugins that should be build. Detailed explanations of used variables are in script files.

Build libraries

Now you are ready to run build script. It should compile, test and install three libraries and their headers files:

  • common library
  • dba library
  • wxdba library

Building consists of following steps for each library:

  1. project files are created from .bkl files using bakefile command. For windows bakefile creates dsw/dsp files, for unix configure script is created.
  2. library is build in %BUILD_DIR%
  3. regression tests are run.
  4. libraries and header files are copied to %DEVEL%\include\<libname> and %DEVEL%\lib\
  5. plugins are copied to %DEVEL%\lib\plugins(d)

If library was build with DEBUG=1 (--enable-debug for Unix) then all built libraries have 'd' suffix appended to its name and plugins are installed in 'pluginsd' directory. Otherwise 'd' suffix is ommited.

Additionally under Unix config scripts are copied to %DEVEL%\bin

Library usage

For windows:
To use compiled libraries you need to add %DEVEL%\include to your INCLUDE search path for your project and %DEVEL%\lib for linker to find libraries. Remember that plugins directory needs to be in your PATH if you are using them in you project.

For unix:
There is config script to use in $DEVEL/bin that you can use to add compiler and linker flags to your project.