How to compile T-Engine from sources
Please note that building ToME4 beta 32 or higher requires SDL version 1.3, which is not yet released. Most operating systems only supply the stable release, SDL 1.2.
Most of the instructions on this page have not yet been updated for beta 32's new requirements.
Windows
Note: This is still a work in progress. I have compiled successfully, but there are some issues that can easily occur.
Precursor
After some struggling, with DarkGod's help, we've got this down to a fairly easy process. Follow step by step and you *should* be OK.
Be prepared to use the command prompt and shells!
Requirements:
Step by step
For the purpose of this article, we'll assume you've installed/extracted it to C:\mingw2\, and the source is in C:\games\tome\
- Add the path to the gcc binary to your path
- Right click on My Computer -> Properties -> Advanced -> Set Environment Variables -> System Path -> Edit -> add c:\mingw2\bin to the path. Take care not to delete the existing parts

- Edit premake4.lua so that it points to the correct paths
- In C:\games\tome\premake4.lua edit the includedirs and the libdirs so that they point to the correct paths: (The libdirs part only needs the mingw2/include part, and the vorbis part) The paths are case sensitive, so check if you need /C/ or /c/ etc.
libdirs {
"/e/libs/SDL-1.2.14/lib",
"/e/libs/SDL_ttf-2.0.9/lib",
"/e/libs/SDL_image-1.2.10/lib",
"/e/libs/SDL_mixer-1.2.11/lib",
"/e/libs/libvorbis-1.3.2/lib/.libs",
"/e/libs/libogg-1.2.2/src/.libs",
"/c/mingw2/include/vorbis",
"/c/mingw2/include",
}
includedirs {
"/c/mingw2/include/SDL",
"/c/mingw2/include/SDL_ttf-2.0.9/include/",
"/c/mingw2/include/SDL_image-1.2.10/include/",
"/c/mingw2/include/SDL_mixer-1.2.11/include/",
"/c/mingw2/include/libvorbis-1.3.2/include",
"/c/mingw2/include/libogg-1.2.2/include",
"/c/mingw2/include/GL",
"/c/mingw2/include",
}
- Run Mingw (C:\mingw2\msys\1.0\msys.bat)
- Run these commands
- cd /c/games/tome
- premake4.exe --cc=gcc gmake
- make -e CC=gcc
- Copy all the DLL files from a previous download to c:\games\tome
- Try to run the game.
- Troubleshooting: If you have previously compiled the game and are compiling a more recent version you may need to run the following commands (from within Mingw, after changing directory but before running premake4 and make) in order for the game to compile correctly.
- premake4.exe clean
- make clean
Please join us on IRC (#tome on irc.rizon.net), or leave a comment, or edit this page if you are having trouble and found a solution.
Windows - older instructions
Example of lib/include section:
configuration "windows"
libdirs {
"libs/SDL-1.2.14/lib",
"libs/SDL_ttf-2.0.10/lib",
"libs/SDL_image-1.2.10/lib",
"libs/SDL_mixer-1.2.11/lib",
"/c/MinGW/lib",
}
includedirs {
"libs/SDL-1.2.14/include/SDL/",
"libs/SDL_ttf-2.0.10/include/",
"libs/SDL_image-1.2.10/include/",
"libs/SDL_mixer-1.2.11/include/",
"/c/MinGW/include/GL",
}
Linux Debian
Updated for beta 33. This guide suggests building ToME sources from SVN, rather than using release tarballs. Given the frequent release schedule ToME is currently enjoying, this will greatly reduce wasted downloads as new versions come out.
- Install operating system prerequisite software packages:
sudo apt-get install build-essential subversion mercurial libopenal-dev libogg-dev libpng12-dev libsdl-image1.2-dev libsdl-ttf2.0-dev libvorbis-dev autoconf automake libtool
cd /usr/local/src
hg clone http://hg.libsdl.org/SDL
cd SDL
hg update 5580
./autogen.sh && ./configure && make && sudo make install
- If it fails, see http://forums.te4.org/viewtopic.php?p=114539#p114539 or check for upstream bug reports and workarounds.
- Decide where you'll keep the ToME source code. You'll need about half a gigabyte of space. Let's assume you're going to use /usr/local/src/t-engine4. Make this directory and make sure you have write permission.
cd /usr/local/src (the parent of wherever you are putting t-engine4)
svn co http://svn.net-core.org/repos/t-engine4
Edit premake4.lua and build/te4core.lua to reflect the location of your SDL installation, as described in http://forums.te4.org/viewtopic.php?p=114539#p114539
That's all the setup stuff. Apart from the svn update -r NUMBER commands, you don't need to do any of that ever again. (Phew!) Whenever you want to build a new version, you just do:
cd /usr/local/src/t-engine4
svn update -r REVISIONNUMBER
make clean; premake4 clean # Don't worry if these fail.
premake4 gmake && make
Linux Ubuntu
These instructions are for beta 31 and earlier. They need to be updated.
deb http://lgp203.free.fr/ubuntu maverick universe
deb-src http://lgp203.free.fr/ubuntu maverick universe
- If you get GPG error do (change key number if needed):
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 5D3F763EB8620CD6
sudo apt-get update
sudo apt-get install premake4
sudo apt-get install build-essential
sudo apt-get install libsdl1.2debian libsdl1.2-dev libsdl-image1.2 libsdl-image1.2-dev libsdl-mixer1.2 libsdl-mixer1.2-dev libsdl-ttf2.0-0 libsdl-ttf2.0-dev mesa-common-dev libglu1-mesa-dev
- Unpack the source code, cd into the folder you unpacked your code to and run the following:
premake4 gmake
make
- If you get the following error : /usr/bin/ld: cannot find -luuid
Then run synaptic package manager and install uuid-dev
Linux Gentoo
- Get the latest source code from
- Get SDL requires
$ emerge -uND media-libs/libsdl media-libs/sdl-gfx media-libs/sdl-image media-libs/sdl-mixer media-libs/sdl-net media-libs/sdl-ttf
- I have USE="-* <others> mmx gif jpeg png tiff flac mad mikmod mp3 vorbis X" as far as Jan 14th, 2011 is concerned.
Recent comments
1 day 9 hours ago
2 days 11 hours ago
3 days 13 hours ago
4 days 14 hours ago
1 week 2 days ago
1 week 2 days ago
1 week 3 days ago
1 week 3 days ago
1 week 3 days ago
1 week 5 days ago