Guide to compiling Tome 4 on Windows 10

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
Nevuk
Thalore
Posts: 189
Joined: Thu Jul 27, 2006 2:50 am

Guide to compiling Tome 4 on Windows 10

#1 Post by Nevuk »

This was in my other thread, but I realized it probably wasn't very clear what the thread was about based on the title.

It's a lot simpler than I thought it would be, but complex to figure out the right steps.

Required :
msys2 http://www.msys2.org/
premake4 https://premake.github.io/ (must be 4, 5 does not work)
openalsoft http://kcat.strangesoft.net/openal.html

(if you choose to use the provided openalsoft binaries instead of compiling yourself, you need to get the openal32.dll from the normal openal site's installer, copying it from the windows directory into the mingw32/bin)

All the other libraries will be downloaded via msys2

(You can use tortoisegit for mercurial git if you want instead of msys2's git command, but it seems silly because you need msys2 anyways).

Steps after downloading


1. Install msys2 (i'll be using the default install directories, but as long as you remember them it's fine).

2. In the msys2 shell, type in
pacman -Syuu

This is the update command. Eventually it will ask you to close the window, do this, then reopen msys2 and run
pacman -Syuu
until there are no more updates.
Note: There are three binaries for msys2 - msys2, mingw32, and mingw64. You can install the libraries with any of them, but you will need to compile tome with mingw32.
4. Run this command (you can use ctrl + shift +insert to paste into the shell). It gets git, cmake, and the compilers we'll use (gcc). When it asks you how many you're trying to download, just go with the default (blank = all). This is all one command despite the separate lines
pacman -S --needed base-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain \
git subversion mercurial \
mingw-w64-i686-cmake mingw-w64-x86_64-cmake

5. Now we need to get our libraries. It's possible to make this command more concise, but I'm no expert. This command will both download and compile the libraries(zlib comes with msys2). Use these commands :
pacman -S mingw-w64-i686-freetype
pacman -S mingw-w64-i686-SDL2_image
pacman -S mingw-w64-i686-openal
pacman -S mingw-w64-i686-libogg
pacman -S mingw-w64-i686-libvorbis
pacman -S mingw-w64-i686-SDL2_ttf
pacman -S mingw-w64-i686-libpng
pacman -S mingw-w64-i686-SDL_ttf


6 OpenAL32 binary - download it from the OpenAL soft website. Extract libs\win32 to mingw32\lib , include\ to mingw32\include (should be an AL folder in include at end of step), bin\win32 to mingw32\bin
You will need to rename soft_oal.dll to OpenAL32.dll


7. Get tome 4 source via git : type this into one of your shells, while in the directory you want the source in.

git clone http://git.net-core.org/tome/t-engine4.git
(this can take a bit)

8 Place premake4.exe into the t-engine4 folder.

9. Time to edit premake4.lua. I recommend notepad++, but wordpad works. Look for section that says "configuration windows" . You want it to look something like this :

libdirs {
"/c/msys64/mingw32/lib",
"/c/msys64/mingw32/i686-w64-mingw32/lib",
}
includedirs {
"/c/msys64/mingw32/include/SDL2",
"/c/msys64/mingw32/include/SDL2",
"/c/msys64/mingw32/i686-w64-mingw32/include/GL",
"/c/msys64/mingw32/i686-w64-mingw32/include/",
}

Bonus :
If you find the game to be loading overly slowly, try editing buildoptions { "-O2" } to buildoptions { "-O3" }, which will significantly speed it up.
10. In normal windows cmd, navigate to the t-engine4 folder and run the command (no other command is being done in windows' command prompt)
premake4 gmake

11. Finally, to compile tome run this command in msys2 shell(it will also take a while).
make -e CC=gcc

Closing thoughts :
I have no idea if that's the required command or not (the resulting tome feels a bit slower to load to me than normal tome). I also have no idea how to deal with compiling expansions or anything, but I have a working dev copy of 1.6.0 on windows now. I have no idea if the resulting binary would be useful to other people for the nightly thread.


A lot of the steps here are taken from various sources that may help others :

https://github.com/orlp/dev-on-windows/ ... C--&-MSYS2
https://dorinlazar.ro/making-sdl2-and-g ... n-windows/

Post Reply