File:		build_win.txt
Summary:	contains instructions for building Mahogany under Unix
Audience:	Mahogany developers and end users
Author:		Vadim Zeitlin <vadim@wxwindows.org>
Last modified:	04.08.03
Version:	accurate for 0.65 release


Windows users: you shouldn't be reading this file, please refer
               to README or doc/build_win.txt instead


The rest of this file is oriented towards Unix users and explains
how to build the program from sources. Please note that we provide
some binaries for the Unix platforms as well and it is much simpler
to use them if you have one of the supported systems. However you do
need to rebuild the program yourself otherwise, in particular the
RPMs built for RedHat Linux most probably will *not* work correctly
on the other Linux distributions even if you manage to install them.

--------------------------------------------------------------------
Unix compilation instructions
--------------------------------------------------------------------

0. Prerequisites
----------------

Required software:

   - wxGTK (GTK+ port of wxWindows) 2.4.2 or above (note that 2.4.2
     is not yet released as of time of this writing so you may need to use
     wxWindows sources from cvs, see below)

   - GTK+ 1.2.3 or above, 1.2.10 recommended

   - GNU make: both wxWindows and Mahogany may be compiled with many
     different C++ compilers (i.e. not only g++) but they both
     require GNU make, please install it if you don't have it yet
     (it might be available as gmake on some systems)

In addition:

   - If you want to compile Mahogany with SSL support, you must also
     have OpenSSL libraries and headers, see http://www.openssl.org/.
     If you already have them installed but in a non-standard
     location where Mahogany doesn't find them, use --with-ssl=dir
     configure option.

   - If you want to compile Mahogany with Python support, you need
     Python libraries and headers installed. Python 1.5x, 2.0 and
     2.1 are currently supported. You should run configure with
     --with-python option as well. Note that this is currently not
     very useful and may even be brokwn due to lack of interest in
     this functionality.

   - To build with Palm support you need pisock library and headers.

   - To rebuild the documentation from sources you need Perl, LaTeX,
     makeindex, dvips, ps2pdf and latex2html - however you may just
     use the prebuilt documentation instead of installing all these
     tools if you don't have them, please see below

   - If you want AvantGo/MAL synchronisation for the PalmOS module,
     you will need to get the libmal.tar.gz library source from the
     Mahogany ftp server and unpack it in the extra/src directory.

1. Compilation of wxWindows
---------------------------

Before you can compile Mahogany, you will need to have installed
wxWindows compiled for the GTK library (wxGTK).

NOTE: there are unfortunately a few bugs in wxGTK 2.4.1 directly
      affecting Mahogany which were fixed immediately after 2.4.1
      release. If, by the time you are reading it, 2.4.2 is not
      released yet please get a wxWindows daily snapshot or the cvs
      sources (use "-r WX_2_4_BRANCH" to get the latest 2.4.x which
      is the safest; but you may also get the sources from cvs HEAD
      which would enable a few more features, in this case you may
      want to use M_STABLE tag to get a wxWindows version known to
      work well with Mahogany).

The recommended switches for wxWindows compilation are:

      ./configure --disable-threads --disable-joystick \
                  --no-recursion --with-gtk

(you may also use the usual --prefix switch, of course)

After running configure, do "make" (or "gmake" if your make is not
the GNU make) and "make install".

If you get a message "cannot find wx-config" while compiling Mahogany
you have to add /usr/local/bin to your PATH.

If you cannot run Mahogany and get an error

    mahogany: error while loading shared libraries:
    libwx_gtk-2.4.so: cannot open shared object file:
    No such file or directory

you have to add /usr/local/lib to /etc/ld.so.conf and run
/sbin/ldconfig.

2. Compilation of Mahogany
--------------------------

Mahogany uses the standard configure script as well, so the simplest
way to compile it is to just type "./configure && make && make
install".

The recommended way to build it is to do the following from the
Mahogany directory:

      mkdir build_dir   # name is arbitrary
      cd build_dir
      ../configure
      make    # or "make all" to try to build message catalogs as well
      make doc
      make install

Depending on whether you have installed all required programs in the
right versions, "make doc" and "make install" might fail. Please
download the file Mdocs-0.64.tar.gz from the SourceForge download
server and put it in the build_dir/doc directory, then retry.

If you don't want to install the documentation at all, you may do the
following:

    make install_bin     # this will install the program and other
                         # required files
    make install_locale  # this tries to build and install the message
                         # catalogs
    make install_doc     # this should install the documentation and
                         # online help


vi: ts=8 nolist nocin ai tw=68:
