This wiki has been moved to https://github.com/SuperTux/wiki into the mediawiki branch.

Building on Windows

From SuperTux
Revision as of 07:15, 16 October 2009 by WolfgangB (Talk | contribs)

Jump to: navigation, search

Introduction

If you want to build the current development version on Windows, these step-by-step instructions are for you.

Warnings

Before you proceed, however, carefully read the following warnings:

  • You will be building a highly unstable development version of SuperTux. This might cause permanent damage to your system, your brain or both!
  • Do not try these instructions out on a production system. Use a virtual machine (e.g. VMWare or VirtualBox) instead.
  • Most developers currently focus on getting SuperTux stable for Linux. Feel free to try getting it to work on Windows, but do not expect much support down this road.
  • Read these instructions to the end before starting your install. If any step makes you feel unsure, better wait for a Windows release of SuperTux.
  • The whole build process takes about one hour to complete, depending on your internet connection and processor power. Why not do something more productive in that hour? Maybe do some housework?
  • The build process fails on Windows Vista sometimes. (please open a bug in our bug tracker to help us figure out why)

Preparation

OK, enough of that. Here are the exact steps for building SuperTux on a fresh Windows installation:

  • Create or pick a working folder. Its path should not contain any spaces. (The root of a drive, such as C:\ or D:\, is fine)
    • I chose D:\Build_SuperTux; change the commands to match your choice.
    • Every non-absolute path I give is relative to this directory

Checking Things Out

  • begin your checkout and wait - this might take some time, so to the next step...

It's Download Time

Download I chose
MinGW

gmp-4.2.4-mingw32-dll.tar.gz

mpfr-2.4.1-mingw32-dll.tar.gz

pthreads-w32-2.8.0-mingw32-dll.tar.gz

libiconv-1.13-mingw32-dll-2.tar.gz

gcc-core-4.4.0-mingw32-dll.tar.gz

gcc-core-4.4.0-mingw32-bin.tar.gz

gcc-c++-4.4.0-mingw32-dll.tar.gz

gcc-c++-4.4.0-mingw32-bin.tar.gz

binutils-2.19.1-mingw32-bin.tar.gz

w32api-3.13-mingw32-dev.tar.gz

mingwrt-3.15.2-mingw32-dev.tar.gz

MSYS

msysCORE-1.0.11-bin.tar.gz

Bison and flex (only for building miniswig)

bison-2.3-MSYS-1.0.11-1.tar.bz2

flex-2.5.33-MSYS-1.0.11-1.tar.bz2

Gettext (only for translations)

gettext-0.16.1-1-bin.tar.bz2

OpenSSH (only if you want to commit)

openssh-4.7p1-MSYS-1.0.11-1-bin.tar.gz

openssl-0.9.8g-1-MSYS-1.0.11-2-bin.tar.gz

openssl-0.9.8g-1-MSYS-1.0.11-2-dll098.tar.gz

zlib-1.2.3-MSYS-1.0.11-1.tar.bz2

CMake cmake-2.6.4-win32-x86.zip
cURL (only for using the add-on manager) curl-7.19.5-devel-mingw32.zip
SDL SDL-devel-1.2.13-mingw32.tar.gz
SDL_image SDL_image-devel-1.2.7-VC9.zip
PhysFS physfs-2.0.0.tar.gz
7-zip or your favorite extraction program 7z465.exe
OpenAL, Vorbis, and Ogg OpenAL11CoreSDK.zip

Getting Busy

  • Run the 7-zip and OpenAL SDK installers. (OpenAL requires administrative privileges)
  • Select all the archives from the MinGW project, right click, and select "Extract here". Repeat with the generated *.tar files. Answer "no to all" if prompted to overwrite.
  • Move usr\local to local if it exists, otherwise create local
  • Extract into local from all the remaining packages the folders bin, lib, include, and share such that the folders are local\bin, local\lib, local\include, and so on. Ignore any overwrite prompts (the files that are being overwritten don't matter)
  • Copy dll's from local\lib into local\bin, saying "no" to overwrite
  • Go to C:\Program Files\OpenAL 1.1 SDK
  • Copy the include directory there to local
  • Copy \samples\playoggvorbis\include\* to local\include\*
  • Copy the Ogg and Vorbis DLL's to local\bin
  • Launch MSYS with msys.bat
    • Tip: If you don't want to type in everything manually, copy it using the normal keys of your browser (Ctrl-C) and paste into MSYS by clicking on the icon in the title bar and selecting Edit->Paste to paste in.

Building

  • PhysFS 2.0.0 needs a patch to make it compile without warnings under Windows. Change
IF(PHYSFS_IS_GCC4)
  ADD_DEFINITIONS(-fvisibility=hidden)
ENDIF(PHYSFS_IS_GCC4)

to

IF(PHYSFS_IS_GCC4 AND NOT WINDOWS)
  ADD_DEFINITIONS(-fvisibility=hidden)
ENDIF(PHYSFS_IS_GCC4 AND NOT WINDOWS)

in local/phyfs-2.0.0/CMakeLists.txt

  • We're ready to build PhysFS. Type in the following:
cd /local/physfs*
mkdir build
cd build
cmake .. -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=/local
make
make install
  • We're ready to build SuperTux.
  • Change to the SuperTux checkout directory
cd /supertux
  • Copy useful dll's from /local/lib and /bin (or from a copy of SuperTux 0.3.1) - not all are needed, try moving the dll's elsewhere and moving them back one at a time to reduce them.
cp /local/bin/*.dll .
cp /bin/libgcc_*.dll .

  • Make a build directory to store generated files
mkdir build
cd build
  • Start the actual build (everything else was libraries)
INCLUDE="/local/include/SDL" cmake -G "MSYS Makefiles" -DDEBUG=ON ..
make
  • Optional: if those "missing sound" messages annoy you, and you don't care about licensing issues, run
cd ../data/sounds
svn update -r5392 bump-upgrade.wav iceblock_bump.wav kick.wav squish.wav stomp.wav
  • Now run supertux2.exe, sit back, and enjoy the game.

Building the editor

There's a new gtk-sharp based editor in development which can also be built on windows. To do so you first have to get and install the following dependencies:

Dependencies

Building

  • Get the sourcecode from svn
  • Open supertux-sharp.sln by double clicking on it (it should open in Visual C# Express now).
  • Build the project in debug and release mode (use F6 and then F5 for example)
  • Copy SDL.dll and SDL_image.dll into the bin\Debug and bin\Release directory that has just been created
  • You can now go back to Visual Studio Express and start the editor with F11. Note that the debug mode is quite slow for the OpenGL calls, so if you actually want to use the editor instead of developing it start it in release mode (CTRL+F11)

You might want to read the Editor FAQ at this point.

Snapshots

MMLosh has some snapshots on his website: http://elektromaniak.wz.cz/download.html