Mingw compilationFrom Globulation2Revision as of 09:59, 31 July 2010 by FoxyBurner (talk | contribs) (→HIGH-WAY COMPILATION -Toll free-) This page explains how to compile Globulation 2 on windows using mingw.
Contents
OVERVIEW -READ ME- to get smartly started
I Wanted to have a Quick Wiki to get through and While First time I followed it I got many pain due to many Errors Returned back to me from the compilation process, We fixed the most of them, and I wanted to help the people to know Why those Bug came from and sometime it was just another question, like How to choose my source to compile, since the First tutorial was really with none other explanations, I got lost. On The other Hand Now,with a lot of investigation&time, the Tutorial is getting a kind a small Book, and this could bored, or discouraged many of Windows Users, (linux users are more use to read documentations to do staff on their machines, and this is an advantage, they do understand quite well their machine behavior. So I decided to create A Fast-way to get ride of compilation faster than never, because I'm convince that many of you want to spend time on playing/testing the new release than reading the manual and the compilation.
PLEASE NOTE IF YOU HAVE SOME INTEREST ON COMPILATION AND HOW IT WORKS OR HOW IT DOES NOT WORKS --BUG CASES--- even HOW TO CUSTOMISE YOUR COMPILATION PICKING YOUR SOURCE PLEASE FOLLOW THE MAIN TUTORIAL TWO WAYS ARE The old command line WAY and THE MS windows way PLEASE NOTE THAT WE NEED TO USE COMMAND LINE FOR LAUNCHING THE COMPILATION SOFTWARE By HAND (2 code lines, quasi nothing) and making the bundle (3 more lines)
HIGH-WAY COMPILATION -Toll free-HERE YOU WILL GET NO <bla bla bla> BUT IF YOU DO NOT STRICTLY OBSERVE THE DIRECTION YOU MIGHT FAIL DURING THE PROCESS ! Also if some step are obscure and you can't achieve it please Get off from the HIGH-Way to the next EXIT -free toll- and follow the MAIN TUTORIAL. That said let's start it now !
We'll get the 'Original-Project'
This Will take a lot of CPU energy and internet bandwidth, internet broadband is recommended ! -about 3mins@ 6Mi-bit/s -
Remember , no <bla bla bla>.clony do an update anyways -from the source path set above. Al right, this could help you anyway after few months has been past:
When you update as you r not a dev,
Alright budy, now time to let's free your Engine HORSES, shifting the third gears :)
hint: The "TAB KEY" help you to finish to fill up the path name use it to save time and mistake. cd /glob-compilation/glob2_source_building scons The process -compilation- Could take a while (minimum 10 mins on recent computer)The cursor or prompter is blinking and a lot of information quickly print out.The process ending when no more information are printing in the "yellow command line" windows and the prompter is not blinking and Marine-blue you should normally find the glob2.exe in the folder glob2_source_building if not you need to take the next exit, getting off the High-way, and follow the MAIN TUTORIAL, sorry.
If you read this is because all things goes well, congratulation, you are a fine compilitor-pilot, now let's shift the fourth gears.
At first start the application, the game, is freezing , because it is setting many parameters, so on a slow/busy machine this could take a while.
Budy is the Test was good? You 'r certainly feeling good, right now ! Let's shift the 5th Gears, Do we need it? Well if you do want to set an installation-bundle-pack, yes you need it!
cd /glob-compilation/glob2_source_building cd bundle glob2_make_win32.sh
If all things goes well, an binary(.exe) is ready, making installation on windows computers easier than ever ! Look in the bundle folder. Test it (install and play), and if it works, send it to your friends ;)
I hope this first trip was AwEsOmE, if you need to customize your baby take your way off by the MAIN TUTORIAL EXIT, thank you for riding on our compilation-High-way, We wish to you a Happy & nice day :D
. MAIN TUTORIALHere you will Have, I wish, all the informations you need for learning on how to compile Globulation2-project to get a binary(.exe).If you don't care about this please do follow the earlier (above) HIGH-WAY Tutorial/stage.
Setting up Python, Scons, Mercurial, and NSISNOW THE COMMAND LINE IS REDUCED to the minimal -while the command line method remain in the wiki for the linux-lover-, This wiki may seems long to read, but it does contain many information to go deeper later than a simple compilation, and this will be really a hand when a question like, Can I choose my source to compile ?, How I patch it thought ?.... exciting is'n it.
PLEASE INSTALL ONLY ONE Mercurial ! The Mercurial version 1.6.0 with Turtoise or not work perfectly ! EITHER
OR
TortoiseHg is a set of graphical tools and a shell extension for the Mercurial distributed revision control system. On Windows, TortoiseHg consists of a shell extension, which provides overlay icons and context menus in your file explorer, and a command line program named hgtk.exe which can launch the TortoiseHg tools. Binary packages of TortoiseHg for Windows come with Mercurial and a merge tool and are thus completely ready for use “Out of the Box”. It's a powerful Graphical User Interface (GUI) for developer, and give to the simple user an overview easiest and simplest ever ! Even better than Globulation2 Hg Web site, in my opinion, I just love it. After Testing, No trouble has been noticed and you can continue to use Minimalist Gnu for Windows and Hg command line to perform it by hand like this tutorial teach you to do. Soon we will use this powerful GUI for even less command lines ! :)
OPTIONAL DOWNLOAD: (To create a windows installer)
(To be proud of using MS WINDOWS GUI for tarballing archives matter) (In case of Bug or Issues, who knows ? )
Setting up MinGW and MSYS
Compiling Prerequisites
NOTE: On Windows VISTA and Above you might need the Administrators Right to access copy or drag and drop files into the C Drive trees. an inheritance from linux chmod :( ONCE Done, close the Archiver, and Windows that we opened for the drag and drop.
OLD_METHODE , 'command line geek' -This will be cleared soon- :
tar jxf glob2_required_libs_mingw-scons.tar.bz2 -C / ON The Way to get Ready for Compiling Globulation 2Step 1: Choosing from What Source Code to compileINFO: 'Mercurial source' is a well known expression but at my sens are an Idiom abuse, What People called here mercurial Sources,is designing in reality the Globulation Source Development Pool using Mercurial, and that is the way I would prefer to name it "Project source files".Mercurial is indeed a Sotfware who organized the Globulation project development and not The project name itself, but I will sometime refer to "mercurial sources" idiom inside this wiki, since this is a pretty common well-known-expression. Follow the
Follow only one of those step and after done it , got to go to the appropriate STEP2
STEP1 A - Official Web site Released source code
STEP1 B - The "Project source files" [NO TURTOISE API](known formerly as Mercurial Source)
hg clone http://hg.globulation2.org/glob2-new glob2-local-repository
DESCRIPTION:
hg clone -r [branch name you picked above e.g beta5-rc] glob2-local-repository glob2_source_building cd glob2_source_building Hg clone HELP here.
The [OPTION] -C will assure you that no Hybrid code will be made by any merge branching uncommitted 'revision'. if the update tag chosen is an no consequent one like you choose to apply a Revision design for Beta3-series on your chosen branch beta5-rc , The updater will abort with no modification -If I correctly get the meaning in the manual see: Hg manual. Hint: Branch name could be alias as 'Feature-pool' and tag as 'Revision' ,both are proper called 'changeset' in the Hg manual. hg update -C [tag 'revision' name you'd like to have e.g tip or beta4.5 ] Hints: The list of tags are listed with the command "hg tags" To get more information about How Mercurial Work have look there :Mercurial. STEP1 C - The "Project source files" [USING TURTOISE API](known formerly as Mercurial Source)
This Will take a lot of CPU energy and internet bandwidth, internet broadband is recommanded (size is over 100MB)!
Now Here you can see The project source board is a bit complicated to explain all things though , I will limited myself to the basic staff, feel free to read the Software HELP. Now let 's get the list of those branches,On the middle under the task-bar of Turtoise, you can see a kind of button following by an arrow called "branches" if you click on the next by arrow you can see a list of the actual branches in the repository you are actually exploring.
(you can skip it if you don't care about How the code is organized) Branches are like a small-working-pool which is based on an existing release ( game source_code) so branches are set to define some news BIG changes or features like 'replay' or 'market_bug' or why not AI_changes ,They are used to mark a sequence of revisions that are not necessarily all stable, they come from parent and lead to children unless if the got merge in or off. Why this definition is important for you? Because you need to choose a branch, remember a (small-working-pool), where you will put some -if available- Patch or Revision , called also Tags. So your job is to choose the branch for YOUR NEED ! What needs ? Well Do you compile under-windows just for the fun ? Of course not, its because the Binary (Glob2.exe) is not yet release and downloadable, you know , The game version fixing the Last Horrible Bug ,that all Linux-user already get free of (because some linux-distros community are more reactive than under windows for this game-binary) ! Now we can Get ride of those Bug too, as they do, or get some news also as they do, using the common Project source pool orgazined with the Mercury sytem, than we use trough Turtoise! Because apart from some Stable Game Code, who is released long ago on unix system prior to Windows, that is why you are here to compile your own Binary from the lastest stable Code that the Unix community use, or even to see the latest cool staff the devs have just implemented with their new bug too :( All the "cooking" could lead to a compile failure, or a more instable game-client , YoU know it ,you tried to apply a patch fixing one things ,but a news Big Bug appear, who is more annoying than the first one ! So way to speak the Decision belong to you !
The 'Default' is the last one where every one look at for improvement.not necessary stable. after come the 'betaX-rc' who the X represent the Game Core Version along with the suffix -rc , meaning Release Candidate are usualy stable and less buggy, good for gaming ! And the other are mostly dedicated for debugger, tester, and other geeks!
(for a clean Re-compilation in case of Failure )
This stage , in my opinion as I am writing, is optional, the purpose is to get the last Revision that has been coded for our branch, they are called Tags, Revision, Changesets, or patch. When using a stable version most likely your branch is an -rc one, the update is not very needed, expect if you want to apply a patch who is reputed to work well with no side-effect. If you update to an "Revision",who is buggy or old, you could create some version who is really not WANTED, because of the bug they can create and the hight risk of compilation failures.To prevent this check the box , "discard local changes,nobackup -C/--clean" option, and always show log ( to get a traceback of any change that will be done). USING the -C option will avoid any bad update ! it's a safe way to update, I think. I'm not really confident with updating, but some do , with no trouble. The Tags, or "Revison"; tip is really adapted to the default branch, for a good 'cooking' ask the devs or look upon the forum to see what update Revision to use with what Branch. On the Update setting windows you can choose your Tags, and see the target description below , who will change for each different one. The parent part will inform you about the actual branch you are updating from.
Once done, close the windows.
STEP 2: COMPILATIONPLEASE NOTE: The compilation Stage could lead to some ISSUES,they are disccuss in the proper section below. Don't worry about the warnings while compiling. If something is wrong, it will grind to a halt and it will let you know why.Also Depending on the machine characteristic the process could take more or less longer. from 5min from a rocker computer to I guess over 192 mins for a old and tired computer When You have Followed the
Pretty easy , right.... Step 2 A&B Direction
cd glob2_source_building scons Step 2 C Direction
cd /glob-compilation/glob2_source_building scons HINT: The "TAB KEY" help you to finish to fill up the path name use it to save time and mistake. Step 2 A&B&C The TEST After a Success compilation
At first start the application, the game, is freezing , because it is setting many parameters, so on a slow/busy machine this could take a while. Building a Globulation 2 NSIS installerWhen You had run the STEP2 A&B:
cd glob2_source_building cd bundle glob2_make_win32.sh When You had run the STEP2 C:
cd /glob-compilation/glob2_source_building cd bundle glob2_make_win32.sh
Possible Issues
Make sure you have no hidden GNU-GCC installed somewhere. GCC is for example included in the FreePascal-Compiler. (You won't find any Lib anymore if another GCC is activ.)
Make sure path to GCC is set in Path Enviroment Variable. The Scons-Script just aborts (can't find libSDL) if it is not.
(Wrote in Summer-2010)
I got this trouble as many other people look there. It is not quite easy to explain how to make-it-works,The solution could be fixed easily but have to be dynamic with ever new python & scons product version . So this Trouble could come over again later.
This comes from a "unix-kind-link" who has been designed for Python 2.6 AND scons-1.1.0 Versions ONLY due to the fact that today the Python version and scons have and will evolve their name, their path will too, breaking the scons unix-type-link ! That said, as you see The Trouble will come over and over if the way to bond the scons to mingw sh (unix command bash, & emulated environment) will stay like that -none dynamic-
Here some ideas: We need to maintain a right scons file provided in the tarball file call 'Prerequisites' (glob2_required_libs_mingw).
Remove the actual Python and scons program from your computer, then download and install the old python2.6 **AND** scons1.1.0 version for windows if they are still available for download.
Scons File with no Extension and normaly "located" at "c:\msys\1.0\bin\" or might also work or be found there at "c:\mingw\bin\" You should use a proper Text Editor , do not even think to use the MS notepad because it does sometime files coruption, at least you may use MS WORDPAD at your own files risk !,Better to use the Free Notepad++ -get it now- who really edit well available as portable application also.
FOR THIS WORK YOU NEED TO USE notepad++ (gnu) get it now.
#! C:/Python26/python , by your real python version (it is either 26 or 27 , newer version are not compatible) : #! Drive:/Python_version_location/python
by your actual 'scons-version.x.x.x.' example: Original scons link: #! C:/Python26/python from os.path import join import sys sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-1.1.0'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-1.1.0'), join(sys.prefix, 'scons')] + sys.path import SCons.Script SCons.Script.main() Modified Scons for using Python2.7 and scons-2.0.0.final.0 as: #! C:/Python27/python from os.path import join import sys sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-2.0.0.final.0'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-2.0.0.final.0'), join(sys.prefix, 'scons')] + sys.path import SCons.Script SCons.Script.main() (3 entry has been changed, for this example)
you might need to check and found the file 'SConscript.pyc' on the right path following this model "Drive:\Python_version_path\Lib\site-packages\scons-version.x.x.x\SCons\Script\SConscript.pyc" IF the problem persist uninstall scons first and python after, and INSTALL PYTHON2.6 and SCONS-1.1.0 , that will fixed your trouble, no need to uninstall MSys neither MinGW.
Its more likely you got the right python26 but the scons is not the scons-1.1.0 version, if this version is not any longer available to download, try to EDIT the scons file with the your exact scons version. you can know it by looking for the file SConscript.py in your computer and look closely the path the name you look for is right after the "....site-packages\scons-1.3.0\SCons\Script\SConscript.pyc" . YOU NEED to have installed as an Administrator "scons-1.1.0" this exact version IF not the Issue will occur The Error look like : "../bin/scons", line 7, in <module> import SCons.Script ImportError: No module named SCons.Script and then a painful debugging process will be engage :( More details on the Issue#3 who is related to.
Your Python Version installed in your Windows is not compatible with scons , ALL Python v3.x.x.x Are NOT COMPATIBLE with Scons v1.1.0 or v2.0.0.final.0 (as I am typing this help august-2010), please consider to un-install it and get the python26 and scons-1.1.0 who is the best bet ! Also the Python SHOULD BE a V2.x.x release not The V3.x.x.x who break compatibility with scons ! Error code look like : File "c:\Python26\Lib\site-packages\scons-2.0.0.final.0\SCons\__init__.py", line 43, <in module> import SCons.compat ImportError: No module named SCons.compat (same things with) _scons_builtins The Python Website -official- clearly show that even the __init__.py file, line 42 ! (related to Issue#3)
( users made mistake ) This is because your are not in the working source directoring to compile or The Source code has been altered or missing ! re-do step by step the wiki skipping the Download & settings stages. a cd glob2_source_building scons might help thoough !
This Help is there and is provided AS IS , its works on my Windows Vista 32bit, and this Details Help should stay here long enough as long the file glob2_required_libs_mingw-scons.tar.bz2 contain the **OUTDATED** 'scons unix-link' ! Thank you for the reading ConclusionThat concludes this Mingw compilation tutorial. When I will know How to use friendly the GUI Hgturtoise , I will Update this Tutorial, that mean it will have less command line ever, in fact command line will be limited to the ONLY Source code compilation , up to this comming day , take this Wiki has a reliable and Stable one , since I made effort to correct the main errors people got while folllowing it. Surely, Section designing need yet to be perform, and it will be .
Also to give you and idea on a 4 cores pentium cpu @ 2.33GHZ the compilation of the RC beta5 got 12 minutes and the binary (Glob2.exe file) "pound" 133MB !! well the other geek guys made one at 98MB so we are 1.32 time more weighty with this type of compilation. But clearly as today the comparison between Beta4 & Beta 5 is amazing by the Glob2 binary file size ! from 4.8kb to 100Mb .
If you have any NEW Trouble, please write a bug report and one of the Windows maintainers should be able to help you. More information on bug reports can be found at the Bug Reports page. Also think about the IRC , easy connexion via YOG. Happy compiling. | |||||||