Downloads Forums IESDP
Downloads Forums IESDP
4 Pages V   1 2 3 > »   
Reply to this topicStart new topic
> HOWTO : easy way to build GemRB on windows
zefklop
post Jan 25 2008, 08:19 AM
Post #1





Group: Members
Posts: 113
Joined: 2-December 06
Member No.: 1326



This topic is the result of my work to compile GemRB on windows.
It uses the CMake and MinGW tools.

NOTE : The CMake configuration files I made were tested with MinGW and only MinGW. Although CMake is a very powerful cross-platform tool, I do not provide any warranty about its behaviour with UNIX, visual studio, cygwin ... If avenger is OK with that, I could expand it to use other platforms in replacement of the (ugly) autotools toolchain.

So get some coffee... here we go.

1) Installing the needed tools

First thing you will need is the Cmake executable. Get it here :
CMake download page
Download the Cmake win32 installer and install it.
During Installation, it will ask if you want to add the cmake executable into the PATH. Answer yes !

Then get the MinGW compiler toolchain from MinGW download Page

You will need :

the mingw automated installer : run it and choose MinGW base tools, g++ compiler and MinGW make.
Install it wherever you want in a directory without ANY spaces in its name. From here, I guess you've installed it in c:\mingw.

MinGW utilities : These are some utilities we will use later. Download the package terminating with .tar.gz (Do NOT download the one with src.tar.gz : you probably don't need the source of those tools ). Uncompress it into c:\mingw.

OPTIONAL (but you probably do want this) :
Get a Subversion client for windows.
TortoiseSVN TortoiseSVN homepage for those who prefer a graphical frontend.
The original SVN Subversion homepage for you, command-line crazy guys.

You will need a subversion client if you want to compile the most up-to-date sources. I would recommand this : lots of features have been added to the current trunk.


2) Installing the needed libraries

Libraries needed by GemRB are SDL, python, libPNG, Zlib and openAL.

The easiest to get is Python : go there Python download page and choose the Win32 Installer. Install it, you're done.

Other development libraries are there :
https://sourceforge.net/project/showfiles.p...ackage_id=96552
Download the "GemRB dependencies for MinGW (libs)" package. All that you need is in thie zip.

3)Getting the GemRB source code

You have two choices :

Get the (old) source archive from the gemrb sourceforge page. This is not recommanded : you will encounter bugs/missing features which are already fixed into the current trunk.

Get the latest trunk from the subversion repository. You will have the most up-to-date version and your bug reports will be relevant.

First choice : decompress the source archive where you want the source code to be.

Second choice :
Using tortoiseSVN (graphical svn client) : create a new directory, enter it, right click in this empty new folder and choose "SVN checkout". Under "URL of repository", put
CODE
https://gemrb.svn.sourceforge.net/svnroot/gemrb/gemrb/trunk

That's it, you now have the source code.

Using command line SVN : open the windows terminal, go to a new empty directory, and type
CODE
svn co https://gemrb.svn.sourceforge.net/svnroot/gemrb/gemrb/trunk



4) Last tweakings

This nice title is almost a lie. There is still work to be done.

Open the notepad (start/programs/accessories/notepad).
Copy/paste this :
CODE
set PATH=%PATH%;c:\mingw\bin;c:\mingw\include;c:\mingw\lib;c:\mingw\include\SDL;c:\mingw\include\AL;

cd "Where you put the gemrb source code"

start cmd

Don't forget to change any relevant piece of information.

Save this to something like "gemrb-build.bat" (delete the .txt suffix notepad gives you when saving file), wherever you like.

Download the file gemrb-cmake.zip from here : Patch page
TortoiseSVN : Right click your gemRB source directory, choose "tortoiseSVN/apply patch". You get a small window with a list of files : right click on it and select "patch all". You're done.

Command line SVN :
Don't know how to do this with command-line svn. I use the patch utility on linux, but there is nothing like that on windows. I welcome any suggestion.

All this is not needed anymore, patches have been included to trunk.

Here we are ...

5) Where the magic happens

Double click gemrb-build.bat.
It opens a command line : you are in the source directory. First, we will create a build directory :
CODE
mkdir build

Go into this one :
CODE
cd build

And type :
CODE
cmake .. -G "MinGW Makefiles"

Let it configure. If you get an error message, then you did something wrong somewhere, or I forgot something.

Build GemRB :
CODE
mingw32-make


Install GemRB :
CODE
mingw32-make install



Here you are : you have a complete gemrb install. The gemrb executable is placed in c:\Program Files\GemRB

Here, open the gemrb.cfg.sample file with wordpad. Tweak it according to the comments in this file.

6) Running GemRB

If you try to double-click gemrb.exe, you will have an error : some libraries are missing.
Download them at http://gemrb.sourceforge.net/download/
pick the latest gemrb_deps_dlls_yyyymmdd.zip and extract it into c:\windows\system32 or into the gemrb installation directory. I don't have any opinion about this.

The OpenAL library is not in this archive, since some manufacturers provide an accelerated version with their drivers. If this is not your case, dowload the windows iinstaller at www.openal.org

Here you are : double-click gemrb.exe and enjoy !

Some Comments
The installation directory is arbitrarily set by cmake. You can overwrite it using "-DCMAKE_INSTALL_PREFIX=Your\directory" when running cmake.

On my notebook, GemRB hangs when launching it with the latest SDL version. This bug is corrected in the SDL trunk. That's why the one shipped in the zip file is 1.2.11. You can try an older version if you want to.

Staying up-to-date : simply right click on your source folder and choose "SVN update", or for command-line lovers, go to this directory and type "svn update". Recompile, play gemrb and see what's new.

This post has been edited by zefklop: Jun 28 2009, 01:56 PM


--------------------
GemRB!
All that you know about the infinity Engine should go to IESDP, that would really help us.
Go to the top of the page
 
+Quote Post
Guest_lynx_*
post Jan 26 2008, 11:48 AM
Post #2





Guests






Nice job! thumbsup.gif

Please add this to the wiki at gemrb.sf.net. I can help with the formatting and restructuration (there is no need to repeat the generic stuff).

By using plugins-prepare.sh and playing with the paths in the config, the installation step is not needed and gemrb can be ran from the source dir.
Go to the top of the page
 
+Quote Post
zefklop
post Jan 26 2008, 12:40 PM
Post #3





Group: Members
Posts: 113
Joined: 2-December 06
Member No.: 1326



QUOTE (lynx @ Jan 26 2008, 08:48 PM) *
Nice job! thumbsup.gif


Thank you. That is the only way I found to build GemRB on windows simply, without having to install msys/cygwin. Cmake is a great tool for quick configurations. I maybe will try to get it work with unix. (don't try it, it simply won't work)

QUOTE (lynx @ Jan 26 2008, 08:48 PM) *
By using plugins-prepare.sh and playing with the paths in the config, the installation step is not needed and gemrb can be ran from the source dir.


The fact is that windows does not have any support for sh scripts, except the ones provided with cygwin/msys, which both emulates an unix environment (especially about paths), and you probably don't want that.

Maybe tweaking some options in CMake configuration files would be helpful.


--------------------
GemRB!
All that you know about the infinity Engine should go to IESDP, that would really help us.
Go to the top of the page
 
+Quote Post
Guest_lynx_*
post Jan 29 2008, 01:40 AM
Post #4





Guests






btw, doesn't cmake support specifying files with glob patterns? It is tedious to update the build system after every file addition.
Go to the top of the page
 
+Quote Post
zefklop
post Jan 29 2008, 11:03 AM
Post #5





Group: Members
Posts: 113
Joined: 2-December 06
Member No.: 1326



QUOTE (lynx @ Jan 29 2008, 10:40 AM) *
btw, doesn't cmake support specifying files with glob patterns? It is tedious to update the build system after every file addition.


Of course it does. It's the way used to install every file of the override / GUIScripts direcories; It could be extended to other directories, but I preferred to follow the way it was made in Makefile.am.

Adding a source file is not so frequent. Adding it to CMakeLists.txt is not a big amount of work. I could do it anyway, that would not be so difficult.

Oh, BTW, are you interested in an UNIX-friendly set of files ?


--------------------
GemRB!
All that you know about the infinity Engine should go to IESDP, that would really help us.
Go to the top of the page
 
+Quote Post
Guest_lynx_*
post Jan 29 2008, 01:25 PM
Post #6





Guests






people like unix for the choice. wink.gif
Go to the top of the page
 
+Quote Post
Guest_lynx_*
post Jan 30 2008, 01:04 AM
Post #7





Guests






Still with globs it would require even less maintenance.
Go to the top of the page
 
+Quote Post
mozvip
post Feb 8 2008, 04:14 AM
Post #8





Group: Members
Posts: 2
Joined: 12-February 07
Member No.: 1475



Is there any way to get the libopenal.a file directly ? Maybe openal license forbids it ? The pexports step is actually crashing under vista64.
Go to the top of the page
 
+Quote Post
zefklop
post Feb 8 2008, 04:50 PM
Post #9





Group: Members
Posts: 113
Joined: 2-December 06
Member No.: 1326



QUOTE (mozvip @ Feb 8 2008, 01:14 PM) *
Is there any way to get the libopenal.a file directly ? Maybe openal license forbids it ? The pexports step is actually crashing under vista64.


I can provide you libopenal.a if you need it, I think its license permits it (might be LGPL). I don't have it there, you should wait monday...

Your experience interests me since I don't know what is the behaviour of windows Vista with this way to compile. I hope it is not so different as with winXP...


--------------------
GemRB!
All that you know about the infinity Engine should go to IESDP, that would really help us.
Go to the top of the page
 
+Quote Post
zefklop
post Feb 14 2008, 01:10 PM
Post #10





Group: Members
Posts: 113
Joined: 2-December 06
Member No.: 1326



After a quick look at the openal site, I found that I can redistribute it without any problem. I'm just looking for a safe place for where to put it.

Maybe I'll send this to the gnuwin32 project....

EDIT : Mingw and its tools are only compiled for 32 bits. Make sure you use the file in OPenAL SDK\libs\win32 smile.gif

This post has been edited by zefklop: Feb 14 2008, 01:44 PM


--------------------
GemRB!
All that you know about the infinity Engine should go to IESDP, that would really help us.
Go to the top of the page
 
+Quote Post
zefklop
post Feb 27 2008, 04:21 AM
Post #11





Group: Members
Posts: 113
Joined: 2-December 06
Member No.: 1326



All needed development libraries are now at http://gemrb.sourceforge.net/download/


--------------------
GemRB!
All that you know about the infinity Engine should go to IESDP, that would really help us.
Go to the top of the page
 
+Quote Post
rlilewis
post Mar 7 2008, 05:35 AM
Post #12





Group: Members
Posts: 4
Joined: 6-March 08
Member No.: 2381



Thanks for the tutorial, I intend to get this setup over the weekend thumbsup.gif

Will report any problems (hope I dont get any) here later
Go to the top of the page
 
+Quote Post
Guest_Guest_*
post Apr 5 2008, 10:02 PM
Post #13





Guests






QUOTE
Using command line SVN : open the windows terminal, go to a new empty directory, and type
CODE
svn co https://gemrb.svn.sourceforge.net/svnroot/gemrb/gemrb/trunk


being totally inept to any of this stuff, can someone explain what command line SVN is and what the windows terminal is, in short would it be a bother for step-by step for this bit for me, by PM or something? Thanks in advance.
Go to the top of the page
 
+Quote Post
Guest_Guest_*
post Apr 5 2008, 10:13 PM
Post #14





Guests






QUOTE
being totally inept to any of this stuff, can someone explain what command line SVN is and what the windows terminal is, in short would it be a bother for step-by step for this bit for me, by PM or something? Thanks in advance.


whoops, not logged in, send a PM to Lord Of Al, thanks
Go to the top of the page
 
+Quote Post
Guest_lynx_*
post Apr 6 2008, 12:54 AM
Post #15





Guests






Just use tortoisesvn like suggested. Or any other gui client.
Go to the top of the page
 
+Quote Post

4 Pages V   1 2 3 > » 
Fast ReplyReply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version Time is now: 30th July 2010 - 06:41 PM