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

This document explains how to download the latest version of the xu4 source code from CVS 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 and install MinGW from:
       http://prdownloads.sourceforge.net/mingw/MinGW-3.1.0-1.exe

    2. Download and install MSYS from:
       http://prdownloads.sourceforge.net/mingw/MSYS-1.0.9.exe

    3. Download and install MSYSDTK from:
       http://prdownloads.sourceforge.net/mingw/msysDTK-1.0.1.exe

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

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

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

    7. Start MSYS

    8. Change to the directory where you want xu4 cvs 
       ie cd C:/

    9. Check out the current xu4 cvs source code
       cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/xu4 login
       Just press enter when it asks for password
       cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/xu4 co u4

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

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

    12. 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

    13. Compile xu4
       make -f makefile.mingw install

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

    15. 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 CVS
       cvs update -d

    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 TortoiseCVS from:
       http://www.tortoisecvs.org/download.shtml

    2. Download the libxml, SDL, SDL_Mixer, and zlib libraries from:
       http://xu4.sourceforge.net/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 "CVS Checkout"

    5. Enter the following for the CVSROOT (including the leading colon):
       :pserver:anonymous@cvs.sourceforge.net:/cvsroot/xu4

    6. At the bottom of the form, enter "u4" for the module and click OK.
       It should download the xu4 source code for you.

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

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

    9. 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.    

    10. Compile and enjoy xu4!

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

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

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

    3. Open Visual Studio 6.0 and open the xu4 project

    4. Click Build->Clean to clean the project

    5. Recompile
