Hopefully this may help..
On Windows Vista and newer, you'll need additional steps to make MSYS fully work if User Account Control is enabled (it is by default). Go to your MSYS folder (C:\MinGW\msys\1.0 here), open msys.bat with a text editor (right-click -> Open With -> Notepad or equivalents) and add the following line after @echo off: cd "C:\MinGW\msys\1.0"
Testing MinGW/MSYS installation
- Open the MinGW shell (MSYS) by running msys.bat.
- Run following commands:
make -v
gcc -v
Compilation and installation of the required packages
Run following commands:
mingw-get install msys-wget
mingw-get install msys-unzip
mingw-get install msys-patch
Installing Subversion
Run command:
wget
http://sourceforge.net/projects/win32svn/files/1.7.6/apache22/svn-win32-1.7.6.zip/download
unzip svn-win32-1.7.6.zip
cd svn-win32-1.7.6
mv bin/* /usr/local/bin/
cd ..
Compiling zlib
Run command:
wget
http://zlib.net/zlib-1.2.7.tar.gz
tar xvfz zlib-1.2.7.tar.gz
cd zlib-1.2.7
make -f win32/Makefile.gcc BINARY_PATH=/usr/local/bin INCLUDE_PATH=/usr/local/include LIBRARY_PATH=/usr/local/lib install
cd ..
Compiling libpng
Run command:
wget
http://sourceforge.net/projects/libpng/files/libpng15/1.5.13/libpng-1.5.13.tar.xz/download
tar xvfJ libpng-1.5.13.tar.xz
cd libpng-1.5.13
mv INSTALL INSTALL.txt
./configure
make install
cd ..
Compiling liblzo2
Run command:
wget
http://www.oberhumer.com/opensource/lzo/download/lzo-2.06.tar.gz
tar xvfz lzo-2.06.tar.gz
cd lzo-2.06
./configure --enable-static
make install
cd ..
Compiling libfreetype
Run command:
wget
http://sourceforge.net/projects/freetype/files/freetype2/2.4.10/freetype-2.4.10.tar.gz/download
tar zxvf freetype-2.4.10.tar.gz
cd freetype-2.4.10
./configure --enable-static
make install
cd ..
Compiling xz
Run command:
wget
http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime_0.18.1.1-2_win32.zip
unzip gettext-runtime_0.18.1.1-2_win32.zip -d /usr/local
wget
http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.26/glib_2.26.0-2_win32.zip
unzip glib_2.26.0-2_win32.zip -d /usr/local
wget
http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.23-3_win32.zip
unzip pkg-config_0.23-3_win32.zip -d /usr/local
wget
http://tukaani.org/xz/xz-5.0.4.tar.gz
tar xvfz xz-5.0.4.tar.gz
cd xz-5.0.4
./configure --enable-static --disable-threads
make install
cd ..
Getting the source code
Run command:
cd && svn checkout svn://svn.openttd.org/trunk
Compiling OpenTTD
Start MSYS.
Run:
cd ~/<path_to_source>
./configure
make
(note that ~ means your MSYS home folder)
- The compiling is complete when the openttd.exe file is made. It will be copied to the ./bin subfolder.
- To test your compilation you can run (from the same folder in which you compiled OpenTTD):
./bin/openttd
- Don't forget to install a base graphics set before this step if you don't have one (the simplest solution is to install OpenGFX)
- If you want to generate a installation bundle you can use this command:
make bundle
After this command is done you will find a complete OpenTTD ready for distribution in the ~/<path_to_source>/bundle folder.
Patching the source code
Place the patch you want to apply into the directory the OpenTTD source code is located in (<MinGW installation folder>\MSYS\1.0\home\<your Windows user name>\trunk in this example). Then, in the MSYS shell:
cd ~/trunk
patch -p1/p0 < <patch name>