Compiling ToME4 on Windows
We do not recommend compiling ToME4 on Windows from sources. The process is considerably more involved than under OS X and Linux -- probably due to the lack of out-of-the-box build tools and support under Windows.BETA 41
Compiled using SVN 5343 Version. For this part I'll assume Libs are in E:\Libs folder, Mingw is in E:\Libs\MinGW, and t-engine is in E:\t-engine.Building libs
Requirements:- The source from SVN
- Premake4.exe (http://industriousone.com/premake/download) version 4.3 should work
- Extract this to the root folder where your source is
- install mingw with "MSYS Basic System" option from http://sourceforge.net/projects/mingw/files/Installer/
- install mercurial from http://mercurial.selenic.com/downloads/
- install cmake from http://www.cmake.org/cmake/resources/software.html
- install dxsdk (i used 9.0c) and copy dsound.h to mingw/include and dsound.lib to mingw/lib otherwise suffer 1 channel sound curse!
- add paths to MinGW/bin and MinGW/msys/1.0/bin make sure about semicolon ';' at end
- you can use "Set PATH=%PATH%E:\Libs\MinGW\bin;E:\Libs\MinGW\msys\1.0\bin;" command or refer to pic below
- restart computer
- windows START -> run -> "cmd"
in cmd shell type:
e:
cd Libs
hg clone http://hg.libsdl.org/SDL_image/
hg clone http://hg.libsdl.org/SDL_ttf/
explanation - ill explain commands that occurs for first time:
"e:" - change drive
"cd e:\Libs" - Change current Directory to Libs
"hg clone http://hg.libsdl.org/SDL_image/" use mercurial to get newest version from mercurial deposit - NOTE at the time im writhing this its last change Mon, 30 Jan 2012 21:40:54 -0500 so NEWEST might not work
http://hg.libsdl.org/SDL_ttf/ last change Sat, 07 Jul 2012 09:00:50 -0400
- SDL-2.0.0-6373 http://www.libsdl.org/hg.php the SDL-2.0 archive
- freetype-2.4.10 http://sourceforge.net/projects/freetype/files/freetype2/
- zlib-1.2.7 http://sourceforge.net/projects/libpng/files/zlib/1.2.7/
- libpng-1.5.12 http://www.libpng.org/pub/png/libpng.html Source code ONLY .tar.gz or .tar.xz
- openal-soft-1.13 http://connect.creativelabs.com/openal/Downloads/Forms/AllItems.aspx at the bottom of page
- libogg-1.3.0 http://xiph.org/downloads/
- libVorbis-1.3.3 http://xiph.org/downloads/
SDL2
requires: nothing
required by: SDL_ttf, SDL_image, t-engine
e:
cd e:\Libs
cd SDL-2.0.0-6373
sh configure --prefix=/e/libs/mingw --disable-directx
make install
"sh configure --prefix=/e/libs/mingw" - configures makefile to suit our system the
- "--prefix=" switch is telling where our build will land
- "--disable-directx" switch is telling our build to not use any directx features(since t-engine is using only OpenGL we dont care)
"make install" - builds libraries and moves files to suitable directories like (MinGW\include or MinGW\lib)
zlib
requires: nothing
required by: libpng and t-engine
e:
cd e:\Libs
ren zlib-1.2.7 zlib
cd zlib
copy .\win32\makefile.gcc .\makefile
make
explanation:
"ren zlib-1.2.7 zlib" - rename directory to help libpng find it
"copy .\win32\makefile.gcc .\makefile" copy premade makefile for gcc compiler
"make" build zlib libraries (static .a and dynamic .dll)
libpng
requires: zlib
required by: SDL_image
e:
cd e:\Libs\libpng-1.5.12
sh configure --prefix=/e/libs/mingw
make install
explanation:
"sh configure --prefix=/e/libs/mingw" - configures makefile to suit our system the "--prefix=" switch is telling where our build will land
requires: libpng, SDL2
required by: t-engine
e:
cd e:\Libs\SDL_image
sh configure --prefix=/e/libs/mingw
make install
freetype
requires: nothingrequired by: SDL_ttf
e:
cd e:\Libs\freetype-2.4.10
sh configure --prefix=/e/libs/mingw
make install
SDL_ttf
requires: freetype, SDL2required by: t-engine
e:
cd e:\Libs\SDL_ttf-2.0.11
sh configure --prefix=/e/libs/mingw
make install
OpenAL
requires: nothing
required by: t-engine
e:
cd e:\Libs\openal-soft-1.13
cmake -DCMAKE_INSTALL_PREFIX:PATH=e:/libs/mingw -G "MSYS Makefiles" ..
make install
explanation:
"cmake -DCMAKE_INSTALL_PREFIX:PATH=e:/libs/mingw -G "MSYS Makefiles" .." - another make program this time CMake -DCMAKE_INSTALL_PREFIX:PATH switch is identical to --prefix in configure -G "MSYS Makefiles" tells for which compiler make makefile and .. is root directory of our application
if you happen to hear only 1 channel after successfully building this lib its cause it coudnt find dsound.h and/or dsound.lib - true story it happend to me - if you want you can copy this one (.dll file) from t-engine BETA 41
libogg
requires: nothingrequired by: libvorbisfile
e:
cd e:\Libs\libogg-1.3.0
sh configure --prefix=/e/libs/mingw
make install
libVorbis
requires: liboggrequired by: t-engine
e:
cd e:\Libs\libVorbis-1.3.3
sh configure --prefix=/e/libs/mingw
make install
building t-engine
edit file "premake4.lua"find code block
configuration "windows"
if you did everything in this guide all you need to do is point our build dirs for:
- libs in MinGW directory
- SDL includes
- GL includes (should be shipped with MinGW)
- and rest of includes (in MinGW/include)
in the end that code block should look like
libdirs {
"/e/libs/mingw/lib",
}
includedirs {
"/e/libs/mingw/include",
"/e/libs/mingw/include/SDL2",
"/e/libs/mingw/include/GL",
}
now lets build our t-engine!
e:
cd t-engine
premake4 gmake
make -e CC=gcc
in my directory ive 8 dll's most of them can be found in "MinGW/bin" directory only "zlib1.dll" is in its native place
- libfreetype-6.dll
- libogg-0.dll
- libvorbisfile-3.dll
- OpenAL32.dll
- SDL2.dll
- SDL2_image.dll
- SDL2_ttf.dll
- zlib1.dll
I NOTICED that it lacks of 7 files that are in BETA-41 but it works (i hope not only for me) also you'll notice that most of our files are MUCH larger that those shipped in t-engine (probably its cause of default -O3 switch - optimize speed as much as it can by disregarding file size)