$Id: howtobuild.txt,v 1.8 2004/03/09 18:39:19 epocman Exp $

IBPP, A c++ Client API for Firebird (and Interbase)

HOW TO BUILD THE LIBRARY

---------------------------------------------------------------------------

The contents of this file are subject to the Mozilla Public License
Version 1.0 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/

Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.

The Original Code is "IBPP 0.9" and all its associated documentation.

The Initial Developer of the Original Code is T.I.P. Group S.A.
Portions created by T.I.P. Group S.A. are
Copyright (C) 2000 T.I.P Group S.A.
All Rights Reserved.

Contributor(s): ______________________________________.

---------------------------------------------------------------------------

Dear developers,

This is a short documentation instructing you how to build IBPP Library on the
various supported platforms and compilers.

Starting with version 2.2, IBPP has merged all its builds procedure in a single
integrated set of Makefiles. On some platforms (Win32 using MSVC and BCB today),
these new Makefiles require you to use some additional (free) tools.

It could be done without these tools (and was done in such a way in the past),
BUT it was considered much easier to maintain an integrated set of Makefile(s)
than very different ones for each platform. The old make-bcc and make-msvc files
have been retired. A single Makefile subsists and allows you to build the
library on all its supported platforms.

(*) WHAT YOU WILL NEED in addition to IBPP source code

    FOR ALL SYSTEMS : you need to get and install one of the distributions of
    Firebird 1.x or InterBase 6.x (InterBase 7.x should work too). Though IBPP
    puts a clear bias towards Firebird. More specifically, you need access to
    the ibase.h and iberror.h from the development kit (include directory) of
    the distribution you chose.

    FOR LINUX : you need GCC 3.2 or higher. IBPP relies on decent C++ Standard
    Library support and all versions of GCC prior 3.2 are a bit sketchy about
    this, to say the least. Major Linux distributions are now being updated to
    GCC 3.2 or higher anyway so this is not a concern. What's more, you can
    always at least install a private compiler copy to build IBPP if you can't
    upgrade your system provided one.

    FOR WIN32, using MSVC or BCB/BCC : you need to get MSYS 1.0. For this,
    please visit <http://www.mingw.org/msys.shtml>. MSYS will provide you (on
    your Windows equipment) with a minimal posix-kind (unix/linux kind)
    command-prompt with some tools. You will need to start such a MSYS prompt to
    run the IBPP build procedure from there.

    FOR WIN32, using MinGW : very logically, you will only need MSYS + MINGW. If
    you're interested in building using MinGW, chances are that you already know
    how to get and install MSYS & MINGW.

    FOR WIN32, using CygWin : again, you will only need CygWin. If you're
    interested in building using CygWin, chances are that you already know how
    to get and install CygWin. Special configurations where you use CygWin tools
    but compile with the MinGW compilers are also possible. Regarding IBPP, this
    is considered a MinGW build. Not a CygWin build.

(*) HOW TO BUILD ON LINUX AND ON WIN32 (USING MINGW and CYGWIN)

    (For MinGW/MSYS, we assume you started a MSYS shell.)

    Change directory to the IBPP source code and run :

        make IBPP_GCC=1                 # Release build
        make IBPP_GCC=1 DEBUG=1         # Debug build

(*) HOW TO BUILD ON WIN32 (USING BORLAND TOOLS)

    If you C++ Builder installed, your system environment variables should
    already be defined correctly (regarding PATH to Borland tools and so on). If
    this is not the case, read how we fix this for the Microsoft Visual Studio 6
    below.

    Start a MSYS shell, and change directory to the IBPP source code then run :

        make IBPP_BCC=1                 # Release build
        make IBPP_BCC=1 DEBUG=1         # Debug build

    Hint : to change to an arbitrary directory on your machine from within MSYS,
    use the following syntax : "cd /c/src/ibpp" for instance will be equivalent
    to Windows "cd C:\src\ibpp".

(*) HOW TO BUILD ON WIN32 (USING MICROSOFT TOOLS)

    On some Microsoft Visual Studio configurations, the required environment
    variables are not always pre-defined. Some programmers prefer to start a
    prompt and run the VCVARS32.BAT file (Microsoft provided in the compiler Bin
    directory) to set the required PATH and other variables prior to compiling.

    If your Windows system is setup that way (need to run VCVARS32.BAT before)
    here is how you should do it right with MSYS :

        - start a command-prompt
        - run the VCVARS32.BAT file
        - CD to your MSYS\1.0\bin directory
        - run ..\MSYS.BAT

    Alternatively, you could create a MSVC.BAT file in your MSYS\1.0 directory.
    Put this inside the bat file :

        call "c:\program files\microsoft visual studio\vc98\bin\vcvars32.bat"
        msys.bat

    Now, all you have to do to start your MSYS is to run MSVC.BAT instead of
    MSYS.BAT. Very simple once setup in 1 minute.

    Proceeding that way, you get a MSYS shell where the environment do contains
    those Microsoft required PATH and settings.

    Now, change directory to the IBPP source code then run :

        make IBPP_MSVC=1                 # Release build
        make IBPP_MSVC=1 DEBUG=1         # Debug build

    Hint : to change to an arbitrary directory on your machine from within MSYS,
    use the following syntax : "cd /c/src/ibpp" for instance will be equivalent
    to Windows "cd C:\src\ibpp".

(*) HOW TO BUILD ON WIN32 (USING DIGITAL MARS COMPILER)

    You will need Digital Mars Compiler (DMC) 8.34 or higher. It will install to
    a C:\DM hierarchy by default. You also need to get STLport 4.5.3 from DMC
    website (version adapted to DMC). You will end up with a C:\DM\stlport tree
    in your DMC installation. Finally, you need to update the \dm\bin\sc.ini
    file. The line reading :
    
    INCLUDE="%@P%\..\include";"%@P%\..\mfc\include";"%@P%\..\stl";%INCLUDE%

    needs to be changed to :
    
    INCLUDE="%@P%\..\stlport\stlport";"%@P%\..\include";"%@P%\..\mfc\include";%INCLUDE%

    That is : removed the reference to the SGI stl near the end of the line and
    add the path to the stlport version of stl *before* any other include
    directories.
    
    Start a MSYS shell, and change directory to the IBPP source code then run :

        make IBPP_DMC=1                 # Release build
        make IBPP_DMC=1 DEBUG=1         # Debug build

    Hint : to change to an arbitrary directory on your machine from within MSYS,
    use the following syntax : "cd /c/src/ibpp" for instance will be equivalent
    to Windows "cd C:\src\ibpp".

(*) TIPS AND TRICKS

    (o) CVS CLIENT ON WINDOWS

    If you want a very nice and well-done CVS client for Windows, I recommend
    you TortoiseCVS (http://www.tortoisecvs.org). This is an excellent piece of
    software. This CVS client integrates completely with the Windows Explorer
    UI. All CVS interactions are very easy to do and what's more : the SSH
    functionnality is built-in ! Give it a try.

-- 
Olivier Mascia
om@tipgroup.com

*** EOF ***
