I documented a step-by-step guide to get a working build environment to compile SVN OpenTTD on Windows. If you ever wanted to do it, but didn't know how, here is your chance
So, here we go:
Download needed files:
- Download MSYS 1.0.10
Download MinGW 5.0.2
Download SVN 1.3.1
Download EnvSetup 1.0 (by LKRaider ; )
Download the mingw.ini file attached to this post. (remember to rename it - remove the txt extension)
Install the packages:
Install MSYS:
Folder: X:\msys (remove the 1.0 thing, it's useless)
Questions: Answer "no" when it asks about MinGW, we'll install it next.
Install MinGW:
Preparation: First copy the mingw.ini file to the folder where the MinGW setup program is, then execute the setup.
Folder: X:\msys\mingw (replace X: with a real drive letter)
Questions: Select Candidate, then select the Minimal install plus the g++ compiler.
Install SVN:
Details: Just unzip it to the folder below.
Folder: X:\msys\home\YourUser (replace with the name of your user there)
Install EnvSetup:
Folder: X:\msys\home\YourUser (same as before)
Okay, installations are complete, now let's setup the compilation environment.
Setup Compilation:
> Start MSYS : msys.bat
Run these commands, one by one:
Code: Select all
./build\ requirements.sh
- This will build the required libraries (zlib, libpng, and copy dx9 files)
Code: Select all
./get\ latest\ openttd.sh
- This will download the latest OpenTTD code from SVN. You can run it anytime later on, to always have the most up-to-date code from the net
Code: Select all
cd ../OpenTTD/trunk
- Change to OpenTTD build directory
Code: Select all
./configure --with-png --with-directmusic
- Configure compilation
Code: Select all
notepad Makefile.config
- This will open the file that configures the compilation for manual edit, we will change a few lines.
Edit the corresponding lines to look like this:
Code: Select all
INSTALL:=1
PREFIX:=home/OpenTTD
BINARY_DIR:=build
DATA_DIR:=build
ICON_DIR:=build
USE_HOMEDIR:=
PERSONAL_DIR:=/home/OpenTTD/build
SECOND_DATA_PATH:=data
CUSTOM_LANG_PATH:=lang
- Save and close Notepad. We are ready to compile.
Compile:
Back on MSYS, execute:
Code: Select all
make && make install && make clean
- and wait! When done, you'll have the new compiled files at OpenTTD\build, looking just like a nightly release !
Also, for applying patches, you may like to try TortoiseSVN. It also will let you administer the OpenTTD SVN folder through Windows Explorer.
NOTE: I did my best to test the correctness of these instructions, but it is quite possible something has evaded my sight, so if you face problems while following them, please post them here and I will try to correct the guide.