There is also a Mingw32 Fedora 11 Cross Compile build - see the README file
in the win32-cross directory, which also contains utility scripts for that build.

Content:
- Building with MSVC - CMake
- Building Windows installer.
- Building with MINGW (autotools). (OUT OF DATE)


# 
# Building with MSVC - CMake (+ See README.CMAKE)
#
  All information below assumes C:\build as the base directory, and
  C:\build\tora as tora checkout and C:\build\tora-build as tora build dir


  0. All related steps are done in the "Visual Studio Command Prompt"
     I have MS Visual Studio 2008 Express (aka version 9). It contains
     all basic tools propably so there is no more stuff from Microsoft
     required.

  1. Downaload Qt4 source version for Windows - Trolltech doesn't provide
     MSVC binaries at all. I didn't find a nice download link for this, but
     it was available from the FTP server:

	URL: ftp://ftp.qtsoftware.com/qt/source/qt-all-opensource-src-4.5.2.zip

  2. Install Oracle client - instant or standard one.

  3. Download and install Postgresql development packages. It's a part
     of default installer - just check its component.
     NOTE: Install it to the path *without* space in its name - Qt has
           problems with compilation in the case of space.

        URL: http://www.enterprisedb.com/products/pgdownload.do#windows
	Testing with version 8.4.0
	Seems that this installer doesn't prompt for any paths/etc.
	Be sure and disable postgres service after install if you won't be running the server itself

  4. Download and install Mysql development packages. It's a part
     of default installer - just check its component.
     NOTE: Install it to the path *without* space in its name - Qt has
           problems with compilation in the case of space.

        URL: http://dev.mysql.com/downloads/mysql/5.1.html#win32
	I am testing with the 5.1.37 MSI installer, not the 'Essentials' one

  5. Update system environment paths in variables: INCLUDE and LIB to
     fit Postgresql and Mysql includes and libraries.
     Note: Mysql uses subdirectories in its lib directory.
     Example:

set INCLUDE=%INCLUDE%;c:\build\postgres\include\;c:\build\mysql\include\
set LIB=%LIB%;c:\build\postgres\lib\;c:\build\mysql\lib\opt\
set ORACLE_HOME=c:\build\oracle

  6. Compile Qt4 with MSVC. Run with MS VS 2008 command prompt:

	configure.exe -opensource -plugin-sql-sqlite -plugin-sql-mysql -plugin-sql-psql -plugin-sql-odbc

	Might want to consider building with '-release' to only build the release code

  7. Download and install cmake from www.cmake.org.

  8. Compile Tora - read README.CMAKE and dont forget to check environment is in 5.
     Example:
c:
cd \build\tora-build
set PATH=%PATH%;c:\build\qt\bin

# If you need to refresh from cmake, otherwise skip this step
cmake -G "NMake Makefiles" -DWANT_INTERNAL_QSCINTILLA=1 -DCMAKE_INSTALL_PREFIX=c:\build\tora-build\RELEASE -DORACLE_OCI_VERSION=10G_R2 ..\tora

     Misc notes: seting ORACLE_HOME is a good thing (TM)
                 building with internal qscintilla is easier for beginners ;)
                 prepare for longer headache (if you're a windows devel newbie) 

                 If you build qscintilla externally, follow the directions to make a staticlib.
                 Otherwise you get mysterious linker unresolved external symbols
                 even though depends.exe can see them. Meh, Windows.
                 
nmake
     Issuing nmake will actually run the build process itself.

#
# Testing
#
Above build will generate into the tora-build\RELEASE dir. Copy the various dll files from Qt, Postgres, MySQL 
installs into that dir as well: 
	comerr32.dll gssapi32.dll k5sprt32.dll krb5_32.dll libeay32.dll libiconv-2.dll libintl-8.dll libpq.dll ssleay32.dll
	libmysql.dll qsqlmysqld4.dll
	oci.dll 
	QtCore4.dll QtGui4.dll QtNetwork4.dll QtSql4.dll QtXml4.dll 
Then you should be able to run tora.exe from that dir. This can be used to test prior to packaging.

(NOTE- Above is ghastly, surely there is a better way of doing this?!?!)

#
# Building Windows installer.
#

    1. Obtain and install NSIS installer software from 
        http://nsis.sourceforge.net

    2. Copy all the distribution files with desired directory structure
       to the src/windows/installer/files directory within your TOra directory 
       structure (or use it as INSTALLDIR when building TOra and use step 9 
       of above build instrucstions).

    3. Run NSIS compiler GUI and then drag and drop the tora.nsi file from
        src/windows/installer directory in TOra to the compiler GUI window and 
        wait till installer will finish the build.

Please report any bugs should you find them as this port is still in the
experimental stage.



#
# BELOW DOCS ARE OUT OF DATE, STANDARD BUILD METHOD IS ABOVE
#

Building with MINGW (autotools).

    At the moment this only works with QT3/Windows Free Edition port 
    (http://qtwin.sourceforge.net/).

    The makefiles were only tested in Mingw MSYS environment so it is 
    advised that you obtain and install full MINGW and MSYS packages
    from http://www.mingw.org. 

    This requires mingw compiled binaries of QT which could be obtained
    at http://qtwin.sourceforge.net/

    Please note that for TOra to work properly QT has to be compiled 
    with RTTI support in mingw. If the available QT binary does not 
    work then please compile  your own version of it following HOWTO 
    instructions on http://qtwin.sourceforge.net/ website and using 
    -rtti configuration parameter.

    1. Get and install (or build) QT3/Windows Free Edition from 
         http://qtwin.sourceforge.net/

    2. Get the QScintilla sources here
        http://www.riverbankcomputing.co.uk/qscintilla/index.php

    3. Obtain TOra sources

    4. Modify the qscintilla\build.cmd file in TOra directory with
       your environment settings (MINGW, QT and QScintilla paths)

    5. Build and install QScintilla by running qscintilla\build.cmd

    6. Copy Makefile.migw to src/Makefile in your TOra directory

    7. Edit src/Makefile and change path for QTDIR, OCI_DLL and OCI_HOME
       (and optionally for INSTALLDIR). Optionally edit the TARGET to 
       set the desirable executable. Also check the CFLAGS_GLOB and 
       LFLAGS_GLOB for the debug option (-g) depending on whether you 
       want debug executable or not. You may also need to create default
       version of config.h

    8. Run 'make' in MSYS environment from TOra src directory.

    9. Optionally run 'make install' - this will strip down the executable
       and copy the necessary files (not yet all of them) to the install 
       directory (INSTALLDIR)

