==========================================
How to Compile xu4 from SVN in Windows
==========================================

This document explains how to download the latest version of the xu4 source code from SVN and how to compile it.
The paths used are just examples; you can change them if you want, as long as you're consistent.

There are two different methods of compiling xu4 in Windows:

    1. MinGW
    2. Microsoft Visual C++ 6.0

MinGW is great for those who are used to the Unix/Linux way of doing things.
For those who have VC6 and prefer a more visual way of doing things, we have also
provided the tools to compile xu4 in Visual Studio 6.0. 

=====================
        MinGW
=====================

    -------------------------------
    Things you only have to do once
    -------------------------------

    1. Download MinGW from:
	http://sourceforge.net/projects/mingw/files/MinGW/BaseSystem/GNU-Binutils/binutils-2.19/binutils-2.19-2-mingw32-bin.tar.gz/download
	http://sourceforge.net/projects/mingw/files/MinGW/BaseSystem/GCC/Version4/Previous%20Testing_%20gcc-4.2.1-sjlj%20-2/gcc-core-4.2.1-sjlj-2.tar.gz/download
	http://sourceforge.net/projects/mingw/files/MinGW/BaseSystem/GCC/Version4/Previous%20Testing_%20gcc-4.2.1-sjlj%20-2/gcc-g%2B%2B-4.2.1-sjlj-2.tar.gz/download
	http://sourceforge.net/projects/mingw/files/MinGW/BaseSystem/RuntimeLibrary/MinGW-RT/mingwrt-3.18/mingwrt-3.18-mingw32-dev.tar.gz/download
	http://sourceforge.net/projects/mingw/files/MinGW/BaseSystem/RuntimeLibrary/Win32-API/w32api-3.14/w32api-3.14-mingw32-dev.tar.gz/download

    2. Create a directory called mingw in the root directory of drive (ie C:\MinGW\ )

    3. Extract the mingw packages to the mingw directory, in the following order:
       gcc-core-4.2.1-sjlj-2.tar.gz
       gcc-core-4.2.1-sjlj-2.tar.gz
       binutils-2.19-2-mingw32-bin.tar.gz (Overwrite any existing files)
       mingwrt-3.18-mingw32-dev.tar.gz
       w32api-3.14-mingw32-dev.tar.gz

    4. Download and install MSYS from:
       http://sourceforge.net/projects/mingw/files/MSYS/BaseSystem/msys-core/msys-1.0.10/MSYS-1.0.10.exe/download

    5. Download and install MSYSDTK from:
       http://sourceforge.net/projects/mingw/files/MSYS/Supplementary%20Tools/msysDTK-1.0.1/msysDTK-1.0.1.exe/download

    6. Download the SDL binaries & headers from:
       http://exult.sourceforge.net/snapshots/exult_sdl_win32.zip

    7. Download the libpng,libxml and zlib binaries & headers from:
       http://xu4.sourceforge.net/download/xu4_dev_win32.zip

    8. Extract libpng,libxml and zlib binaries & headers to mingw directory

    9. Start MSYS

    10. Change to the directory where you want xu4 svn
       ie cd C:/

    11. Check out the current xu4 svn source code
       svn co https://xu4.svn.sourceforge.net/svnroot/xu4/trunk xu4 

    12. Extract SDL binaries & headers to src directory of xu4 source code

    13. Change to src directory of xu4 source code
       ie cd C:/u4/src

    14. Open makefile.mingw in a text editor and change C:/xu4 to the directory you want xu4 to be installed to.
       ie C:/Games/Ultima4

    15. Compile xu4
       make -f makefile.mingw install

    16. Compile xu4 tools (Optional)
       make -f makefile.mingw tools

    17. Exit MSYS and enjoy xu4!

    ------------------------------------------------------------
    Things you have to do every time the xu4 source code changes
    ------------------------------------------------------------

    1. Start MSYS

    2. Change to xu4 source code directory
       ie cd C:/u4

    3. Checkout the latest changes from SVN
       svn up

    4. Change to src directory of xu4 source code
       cd src

    5. Compile and install xu4
       make -f makefile.mingw clean
       make -f makefile.mingw install

    6. Compile and install xu4 tools (Optional)
       make -f makefile.mingw tools

    7. exit MSYS


=====================
    Visual C++ 6.0
=====================

    -------------------------------
    Things you only have to do once
    -------------------------------

    1. Download and install the most recent (stable) version of TortoiseSVN from:
       http://tortoisesvn.net/downloads.html

    2. Download the libxml, SDL, SDL_Mixer, and zlib libraries from:
       http://xu4.sourceforge.net/download/xu4_dev_win32_VC6.zip

    3. Open/Create the folder where you want the xu4 source code to go.
    
    4. Right-click on an empty space in the folder and click "SVN Checkout"

    5. Enter the following for the URL of repository:
       https://xu4.svn.sourceforge.net/svnroot/xu4/trunk

    6. Extract the contents of xu4_dev_win32_VC6.zip into the "u4" directory.

    7. Start VC6 and open the workspace found in the u4\vc6 subdirectory.

    8. Click on Project->Settings and change the following:

           - On the "Debug" tab, change the "Executable for debug session" to C:\xu4\xu4.exe,
             where "C:\xu4\" is the directory where you want xu4 to be installed.

           - On the "Debug" tab, change the "Working Directory" to the directory
             where you want xu4 to be installed.

           - On the "Link" tab, change the "Output file name" to C:\xu4\xu4.exe,
             where "C:\xu4\" is the directory where you want xu4 to be installed.

           - On the "Post-build Step" tab, change the line that reads:
             "set U4PATH=c:\xu4"
             Replace c:\xu4 with the directory where you want xu4 to be installed.    

    9. Compile and enjoy xu4!

    ------------------------------------------------------------
    Things you have to do every time the xu4 source code changes
    ------------------------------------------------------------

    1. Open the folder where you did the "SVN Checkout"

    2. Right click on the "u4" directory itself and click "SVN Update"

    3. Open Visual Studio 6.0 and open the xu4 project

    4. Click Build->Clean to clean the project

    5. Recompile
