File:		build_win.txt
Summary:	contains instructions for building Mahogany under MS Windows
Audience:	Mahogany developers
Author:		Vadim Zeitlin <vadim@wxwindows.org>
Modified by:	Nerijus Baliunas <nerijus@users.sf.net> (cygwin part)
Last modified:	23.07.03
Version:	the information in this file applies to the cvs sources

0. Requirements
---------------

a) a compiler: currently, the supported compilers for building Mahogany are
   MS Visual C++ 6.0 and cygwin. Version 5.0 of Visual C++ can be used as well.
   If you are interested in building using another compiler (mingw32, BC++)
   please contact us and we will try to help you.

b) cvs client: you need to have daily access to Mahogany (and sometimes
   wxWindows) source tree, and the cvs is the only way to keep up to date. The
   precompiled cvs binaries for Win32 can be found at http://www.cyclic.com/

c) GNU m4 from cygwin tools: this is not an absolute requirement, however you
   will not be able to compile *.mid (Mahogany Interface Description) files if
   you don't have it and so you will have to use the versions already in the
   cvs. If you do have m4, set the environment variable M4 to contain its full
   path (or just m4 if it is in your PATH), otherwise it won't be used.


1. Visual C++
-------------

a) wxWindows
------------

   Mahogany depends on wxWindows and prior to compiling Mahogany you need to
build the wxMSW library.

   You may use either wxMSW 2.4.1 release (latest 2.4 release as of the time
of this writing, if a newer one is available, do use it) or the latest
wxWindows sources from cvs HEAD which usually provide more functionality. Note
that you may use M_STABLE tag to check out the wxWindows version which is known
to work well with Mahogany.

   Before building Mahogany you will need to build wxWindows. To do it, you
should open src/wxWindows.dsw in wxWindows directory and build wxWindows
project in it. Note that in wxWindows cvs HEAD there are new project files in
build directory but you should _not_ use them. You may use extra\scripts\
wxmsw_setup.h file instead of the standard setup.h when building if you want to
disable all the features not needed by Mahogany but doing this is optional and
you should revert to the standard wx/setup.h if using wxmsw_setup.h results in
errors (it is not always up to date...).


b) Build process
----------------

   After this you can open the project workspace M.dsw in Visual C++ IDE. You
will have to load (right click the project in the project tree, choose "Load")
the following projects contained in this workspace if they are not loaded yet:

* cclient - the mail routines support library
* compface - the library for X-Face handling
* M - the main Mahogany project
* versit - vCard handling routines
* wxWindows - the wxMSW library: when opening this project, specify the correct
              file location (in Mahogany directory) when asked

   Note that after building everything (successfully) once, you may unload all
the projects except "M" -- this will speed up workspace opening/closing. But if
you do it, be careful to load them all before rebuilding everything --
otherwise, dependencies will not be handled correctly.

   Finally, just build everything. Before running M.exe, copy the file
versit.dll produced when building versit project into the root Mahogany
directory (or elsewhere in your PATH).


c) Common problems
------------------

Visual C++ 5.0 doesn't understand environment variables in the project
settings, so you will need to replace the occurences of $(wx) with the value
of the variable.

If you don't have yacc or bison on your system, you will need to manually copy
src/wx/vcard/vcc.c-yacc to vcc.c.

If you get problem with PROIO_yywrap being multiply defined in wxWindows,
comment out the 2nd definition of this function in src/common/y_tab.c.


2. Cygwin
---------

a) Build process
----------------

g++ 3.x can not compile Mahogany currently, so I used g++ 2.95.3. As compiler
version should be the same when compiling both wxWindows and Mahogany, we should
use g++ 2.95.3 for compiling wxWindows as well. Just use

cd <path to wxWindows sources>
mkdir build.cygwin.gcc295
cd build.cygwin.gcc295
CC=gcc-2 CXX=g++-2 ../configure
make
make install

cd <path to Mahogany sources>
mkdir build.cygwin.gcc295
cd build.cygwin.gcc295
CC=gcc-2 CXX=g++-2 ../configure --with-modules=static
make
make install

in cygwin bash shell.

You can also compile with -mno-cygwin switch, i.e. mingw version. Use
CC='gcc-2 -mno-cygwin' CXX='g++-2 -mno-cygwin' OSTYPE=mingw ../configure --with-modules=static

b) Common problems
------------------

Linking Mahogany compiled with debug info requires a lot of memory, so please
disable debugging if you experience out of memory problems.

SSL does not work with cygwin.

IMAP does not work with mingw.

vi: ts=8 nolist nocin ai:
