|
|
Line 1: |
Line 1: |
|
__TOC__ |
|
|
This page explains how to compile Globulation 2 on windows using [http://www.mingw.org/ mingw]. |
|
This page explains how to compile Globulation 2 on windows using [http://www.mingw.org/ mingw]. |
|
|
|
|
{{Warning|Versions 0.8.23 and previous|As of 0.9.0 and future versions, Globulation 2 no longer uses autotools, and make for compiling the source. We have switched to Scons (which is the guide you see below). If you are wanting to compile an older version, then you will need to recompile all the required libraries when you install MinGW (0.2.23 is no longer support on MinGW).}} |
|
|
|
|
|
|
|
|
|
==Setting up Python, Scons, and Mercurial== |
|
==Setting up Python, Scons, and Mercurial== |
Line 9: |
Line 5: |
|
:* Download and install [http://prdownloads.sourceforge.net/scons/scons-0.97.win32.exe scons-0.97.win32.exe] into the same directory as the python install (C:\Python25\) |
|
:* Download and install [http://prdownloads.sourceforge.net/scons/scons-0.97.win32.exe scons-0.97.win32.exe] into the same directory as the python install (C:\Python25\) |
|
:* Download and install [http://mercurial.berkwood.com/binaries/Mercurial-0.9.4-f48290864625.exe Mercurial-0.9.4-f48290864625.exe] locally (to any directory, preferably default C:\Mercurial though) so the command hg will work. When you get to the end of the install, make sure you check "add mercurial to your computers search path" or something similar. And now you are ready to go. |
|
:* Download and install [http://mercurial.berkwood.com/binaries/Mercurial-0.9.4-f48290864625.exe Mercurial-0.9.4-f48290864625.exe] locally (to any directory, preferably default C:\Mercurial though) so the command hg will work. When you get to the end of the install, make sure you check "add mercurial to your computers search path" or something similar. And now you are ready to go. |
|
|
|
|
|
|
|
|
==Setting up MinGW and MSYS== |
|
==Setting up MinGW and MSYS== |
Line 15: |
Line 10: |
|
:*And, download and install [http://prdownloads.sf.net/mingw/MSYS-1.0.10.exe MSYS-1.0.10.exe] into the directory c:\msys\1.0\ (lower case). At the end of the installation, it will ask you if you want to continue with the post-install. Select yes, and yes again when it ask if you have mingw installed. When it ask you to indicate the directory where it is installed, type in c:/mingw (yes, with a forward slash as the program prefers it that way). |
|
:*And, download and install [http://prdownloads.sf.net/mingw/MSYS-1.0.10.exe MSYS-1.0.10.exe] into the directory c:\msys\1.0\ (lower case). At the end of the installation, it will ask you if you want to continue with the post-install. Select yes, and yes again when it ask if you have mingw installed. When it ask you to indicate the directory where it is installed, type in c:/mingw (yes, with a forward slash as the program prefers it that way). |
|
<!-- :*And lastly, download and install [http://prdownloads.sf.net/mingw/msysDTK-1.0.1.exe msysDTK-1.0.1.exe] in the same directory as msys (c:\msys\1.0\) --> |
|
<!-- :*And lastly, download and install [http://prdownloads.sf.net/mingw/msysDTK-1.0.1.exe msysDTK-1.0.1.exe] in the same directory as msys (c:\msys\1.0\) --> |
|
|
|
|
|
|
|
|
==Compiling Prerequisites== |
|
==Compiling Prerequisites== |
Line 21: |
Line 15: |
|
:*Double click the MSYS icon that has been placed on your desktop during MSYS's installation. |
|
:*Double click the MSYS icon that has been placed on your desktop during MSYS's installation. |
|
:*Go in the directory where you put the glob2_required_libs_mingw-scons.tar.bz2 (for example cd ~) and untar the libraries using the command below. This process could take a while: |
|
:*Go in the directory where you put the glob2_required_libs_mingw-scons.tar.bz2 (for example cd ~) and untar the libraries using the command below. This process could take a while: |
|
::<table width="90%"><tr valign="top"><td style="border: 1px dashed #FFFFFF; padding: .3em .9em .3em; color: #FFFFFF; background-color: #114700">tar jxf glob2_required_libs_mingw-scons.tar.bz2 -C /</td></tr></table>
|
|
tar jxf glob2_required_libs_mingw-scons.tar.bz2 -C / |
|
|
|
|
|
|
|
|
==Compiling Globulation 2== |
|
==Compiling Globulation 2== |
Line 28: |
Line 21: |
|
====Compiling from Released source code==== |
|
====Compiling from Released source code==== |
|
:*Download and extract the release to c:\msys\1.0\home\XXX\ (where XXX is the username), then run (changing the version numbers): |
|
:*Download and extract the release to c:\msys\1.0\home\XXX\ (where XXX is the username), then run (changing the version numbers): |
|
|
mv glob2-x.x.xx glob2_source |
|
::<table width="90%"><tr valign="top"><td style="border: 1px dashed #FFFFFF; padding: .3em .9em .3em; color: #FFFFFF; background-color: #114700">mv glob2-x.x.xx glob2_source</td></tr></table> |
|
|
====Compiling from Mercurial source files==== |
|
====Compiling from Mercurial source files==== |
|
:*Download Globulation 2 from mercurial: |
|
:*Download Globulation 2 from mercurial: |
|
::<table width="90%"><tr valign="top"><td style="border: 1px dashed #FFFFFF; padding: .3em .9em .3em; color: #FFFFFF; background-color: #114700">hg clone http://hg.globulation2.org/glob2/</td></tr></table> |
|
:: hg clone http://hg.globulation2.org/glob2/ |
|
:*Extract the master (the stable branch) from the mercurial download (this can also be used to extract other branches, such as core_rewrite_2007): |
|
:*Extract the master (the stable branch) from the mercurial download (this can also be used to extract other branches, such as core_rewrite_2007): |
|
|
:: hg clone -r master glob2 glob2_source |
|
::<table width="90%"><tr valign="top"><td style="border: 1px dashed #FFFFFF; padding: .3em .9em .3em; color: #FFFFFF; background-color: #114700">hg clone -r master glob2 glob2_source</td></tr></table> |
|
|
:*To get the data, maps, and campaigns needed to play the game, run the following commands: |
|
:*To get the data, maps, and campaigns needed to play the game, run the following commands: |
|
|
cd glob2_source |
|
::<table width="90%"><tr valign="top"><td style="border: 1px dashed #FFFFFF; padding: .3em .9em .3em; color: #FFFFFF; background-color: #114700">cd glob2_source</td></tr></table> |
|
|
|
hg update tip |
|
::<table width="90%"><tr valign="top"><td style="border: 1px dashed #FFFFFF; padding: .3em .9em .3em; color: #FFFFFF; background-color: #114700">hg update tip</td></tr></table> |
|
|
|
./syncdata |
|
::<table width="90%"><tr valign="top"><td style="border: 1px dashed #FFFFFF; padding: .3em .9em .3em; color: #FFFFFF; background-color: #114700">./syncdata</td></tr></table> |
|
|
|
./syncmaps |
|
::<table width="90%"><tr valign="top"><td style="border: 1px dashed #FFFFFF; padding: .3em .9em .3em; color: #FFFFFF; background-color: #114700">./syncmaps</td></tr></table> |
|
|
===Step 2: Continue compiling=== |
|
===Step 2: Continue compiling=== |
|
:*Before compiling glob2, run these commands from the mingw console: |
|
:*Before compiling glob2, run these commands from the mingw console: |
|
|
:: cd glob2_source |
|
::<table width="90%"><tr valign="top"><td style="border: 1px dashed #FFFFFF; padding: .3em .9em .3em; color: #FFFFFF; background-color: #114700">cd glob2_source</td></tr></table> |
|
|
:*Now to start compiling globulation 2. Don't worry about the warnings. If something is wrong, it will grind to a halt and it will let you know why. |
|
:*Now to start compiling globulation 2. Don't worry about the warnings. If something is wrong, it will grind to a halt and it will let you know why. |
|
|
scons |
|
::<table width="90%"><tr valign="top"><td style="border: 1px dashed #FFFFFF; padding: .3em .9em .3em; color: #FFFFFF; background-color: #114700">scons</td></tr></table> |
|
|
:::If there are any problems, run it one more time using the following line. If problems persist, write a bug report. |
|
:::If there are any problems, run it one more time using the following line. If problems persist, write a bug report. |
|
|
:::: scons --no-cache mingw-true |
|
::::<table width="90%"><tr valign="top"><td style="border: 1px dashed #FFFFFF; padding: .3em .9em .3em; color: #FFFFFF; background-color: #114700">scons --no-cache mingw-true</td></tr></table> |
|
|
:*To make the executable smaller in size, run the following command: |
|
:*To make the executable smaller in size, run the following command: |
|
|
strip ./src/glob2.exe |
|
::<table width="90%"><tr valign="top"><td style="border: 1px dashed #FFFFFF; padding: .3em .9em .3em; color: #FFFFFF; background-color: #114700">strip ./src/glob2.exe</td></tr></table> |
|
|
|
|
|
|
|
|
|
==Testing Globulation 2 on windows== |
|
==Testing Globulation 2 on windows== |
|
:*Drag the required dll's into the root source folder: |
|
:*Drag the required dll's into the root source folder: |
|
|
cd glob2_source |
|
::<table width="90%"><tr valign="top"><td style="border: 1px dashed #FFFFFF; padding: .3em .9em .3em; color: #FFFFFF; background-color: #114700">cd glob2_source</td></tr></table> |
|
|
::<table width="90%"><tr valign="top"><td style="border: 1px dashed #FFFFFF; padding: .3em .9em .3em; color: #FFFFFF; background-color: #114700">cp -a /local/bin/SDL.dll /local/lib/*.dll .</td></tr></table>
|
|
cp -a /local/bin/SDL.dll /local/lib/*.dll . |
|
===Running Globulation from compiled source=== |
|
===Running Globulation from compiled source=== |
|
:*Drag the glob2 executable into the root source folder: |
|
:*Drag the glob2 executable into the root source folder: |
|
|
cp -a ./src/glob2.exe . |
|
::<table width="90%"><tr valign="top"><td style="border: 1px dashed #FFFFFF; padding: .3em .9em .3em; color: #FFFFFF; background-color: #114700">cp -a ./src/glob2.exe .</td></tr></table> |
|
|
:*Run glob2.exe from the glob2_source directory and play :) |
|
:*Run glob2.exe from the glob2_source directory and play :) |
|
===Building a Globulation 2 NSIS installer=== |
|
===Building a Globulation 2 NSIS installer=== |
Line 62: |
Line 54: |
|
:*Go to (using windows explorer) the windows folder, located inside the glob2_source directory and drag and drop win32_installer.nsi onto the NSIS icon to initialize the build process. |
|
:*Go to (using windows explorer) the windows folder, located inside the glob2_source directory and drag and drop win32_installer.nsi onto the NSIS icon to initialize the build process. |
|
:*If all things go well, an exe ready for installation on windows computers is now ready within the windows folder. Test it (install and play), and if it works, send it to your friends ;) |
|
:*If all things go well, an exe ready for installation on windows computers is now ready within the windows folder. Test it (install and play), and if it works, send it to your friends ;) |
|
|
|
|
|
|
|
|
==Conclusion== |
|
==Conclusion== |
|
That concludes this Mingw compilation tutorial. If you have any problems, 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. Happy compiling. |
|
That concludes this Mingw compilation tutorial. If you have any problems, 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. Happy compiling. |
|
|
|
|
|
|
|
|
[[Category:Developer Resources]] |
|
[[Category:Developer Resources]] |