Difference between revisions of "Compiling ScummVM/MinGW-w64"

Jump to navigation Jump to search
m
(Update the list of the needed libraries. With this libraries, I was able to compile the latest ScummVM codebase.)
(30 intermediate revisions by 5 users not shown)
Line 6: Line 6:
| This guide covers '''only''' the compilation under MinGW-w64 and MSYS2 (which is very different from MinGW and MSYS), and makes heavy use of the pacman package manager, which may not be available under other MinGW setups.
| This guide covers '''only''' the compilation under MinGW-w64 and MSYS2 (which is very different from MinGW and MSYS), and makes heavy use of the pacman package manager, which may not be available under other MinGW setups.


'''We do not support building in this way''', but if you want to use it, instructions are below.
'''We do not (officially) support building in this way''' and we don't recommend using this method if you want to distribute your ScummVM builds.
 
However, we offer preliminary support for the MSYS2/MinGW-w64 toolchain. Feel free to contact me (rootfather) either via eMail or IRC if you have questions regarding MSYS2/MinGW-w64.


Our officially supported MinGW build instructions are at [[Compiling_ScummVM/MinGW]].
Our officially supported MinGW build instructions are at [[Compiling_ScummVM/MinGW]].
|}
|}


== Things needed ==


=== Setup MinGW-w64 and MSYS2 ===
{| border="0" cellpadding="1" cellspacing="2" style="margin-left:5em; background:#FF9999; width:80%"
|- align="center"
| '''NOTE'''
|- style="margin-left:1em; background:#ffffff;"
|- style="background:#ffffff"
| Please note that current versions of MSYS2/Mingw64 cannot be installed on Windows XP anymore. '''However, builds produced with the MSYS2/Mingw64 toolchain will still work on Windows XP.'''
|}


You can find MSYS2 and installation instructions on the [[https://msys2.github.io/ MSYS2 webpage]].


==== Download and install the mingw-w64 compilation toolchain====
In the MSYS2 terminal, type:
<source lang="bash">
$> pacman -S mingw-w64-<env>-toolchain
</source>
where <env> is either x86_64 or i686, depending on your architecture (64-bit and 32-bit, respectively).


This command will fetch and install the packages needed for compiling, including (but not limited to) GCC 5.x, GDB, and libwinpthread-git.
== Things needed ==


==== Install make ====
=== Setup MinGW-w64 and MSYS2 ===
ScummVM uses Makefiles to build the project. Makefiles are build configuration files that the compiler uses to compile, link and solve dependencies. "make" is the software that runs the Makefiles.


MSYS2 does not support make out of the box, but it has its own implementation. Install it by typing:
You can find [[https://www.msys2.org/ MSYS2 on the official webpage]] and detailed installation instructions on the [[https://github.com/msys2/msys2/wiki/MSYS2-installation MSYS2 github wiki]].


<source lang="bash">
==== Download and install the necessary packages ====
$> pacman -S make
The MinGW packages are named mingw-<env>-<package>, where <env> is either x86_64 or i686, depending on your architecture (64-bit and 32-bit, respectively).
</source>


=== Install the needed libraries ===
To create an i686 or x86_64 build environment, we need to first update the already installed packages and the MSYS2 environment itself.
In order to compile properly, ScummVM needs you to have certain libraries installed. All the libraries in the list can be installed with similar commands:
To do that, type the following in the MSYS2 terminal:
<source lang="bash">
<syntaxhighlight lang="bash">
$> pacman -S mingw-w64-<env>-<library>
pacman -Syuu
</source>
</syntaxhighlight>
where <env> is the environment as previously stated, and <library> is the name of the library, as stated in the list (e.g. pacman -S mingw-w64-x86_64-SDL):


* '''SDL2'''. Mandatory. ''We recently switched to SDL2. SDL 1 is still available as fallback option.''
Follow the instructions (one upgrade step may require that the MSYS2 terminal window is closed directly from the window's e(X)it button on the top right. Keep issuing the above command in the MSYS2 terminal until there's no more updating tasks to be done.


* '''nasm'''. Optional, for faster compile of scalers.
For i686 (32-bit), type the following in the MSYS2 terminal to automatically install all packages/libraries needed to compile ScummVM:
<syntaxhighlight lang="bash">
pacman -S --needed --noconfirm base-devel git mingw-w64-i686-{a52dec,ccache,curl,faad2,freetype,flac,fluidsynth,libjpeg-turbo,libogg,libvorbis,libmad,libmpeg2-git,libtheora,libpng,nasm,readline,SDL2,SDL2_net,toolchain,winsparkle,zlib}
</syntaxhighlight>


* '''flac'''. Optional, for FLAC support.
For x86_64 (64-bit), type the following in the MSYS2 terminal to automatically install all packages/libraries needed to compile ScummVM:
<syntaxhighlight lang="bash">
pacman -S --needed --noconfirm base-devel git mingw-w64-x86_64-{a52dec,ccache,curl,faad2,freetype,flac,fluidsynth,libjpeg-turbo,libogg,libvorbis,libmad,libmpeg2-git,libtheora,libpng,nasm,readline,SDL2,SDL2_net,toolchain,winsparkle,zlib}
</syntaxhighlight>


* '''libjpeg-turbo'''. Optional, for JPEG support. Required for Groovie 2, Starship Titanic and Wintermute.
These commands will fetch and install the packages needed for compiling, including (but not limited to) GCC 9.x, GDB, and libwinpthread-git.


* '''libogg''' and '''libvorbis'''. Optional, for OGG support.
=== Install the needed libraries ===


* '''libmad'''. Optional, for MP3 support.
''You only have to install the libraries manually if you prefer not to use the automated way in the section above. For most users, installing all packages automatically will just work fine.''


* '''libmpeg2'''. Optional, for MPEG2 cutscene support.


* '''zlib'''. Optional, for compressed saved games.
In order to compile properly, ScummVM needs you to have certain libraries installed. The command in the above section installs all of the needed packages automatically. All the libraries in the list can be installed with similar commands:
 
<syntaxhighlight lang="bash">
* '''libtheora'''. Optional, for Broken Sword 2.5.
pacman -S mingw-w64-<env>-<library>
</syntaxhighlight>
where <env> is the environment as previously stated, and <library> is the name of the library, as stated in the list (e.g. pacman -S mingw-w64-x86_64-SDL):


* '''SDL2'''. Mandatory. ''We recently switched to SDL2. SDL 1 is still available as fallback option.''
* '''curl''' and '''SDL2_net'''. Optional, for cloud integration support.
* '''faad2'''. Optional, for AAC support.
* '''faad2'''. Optional, for AAC support.
 
* '''flac'''. Optional, for FLAC support.
* '''fluidsynth'''. Optional, for soundfont MIDI support.
* '''freetype'''. Optional, for TTF support.
* '''libjpeg-turbo'''. Optional, for JPEG support. Required for Groovie 2, Starship Titanic and Wintermute.
* '''libmad'''. Optional, for MP3 support.
* '''libmpeg2-git'''. Optional, for MPEG2 cutscene support.
* '''libogg''' and '''libvorbis'''. Optional, for OGG support.
* '''libpng'''. Optional, for PNG support.
* '''libpng'''. Optional, for PNG support.
 
* '''libtheora'''. Optional, for Broken Sword 2.5.
* '''freetype'''. Optional, for TTF support.
* '''nasm'''. Optional, for faster compile of scalers.
 
* '''fluidsynth'''. Optional, for soundfont MIDI support.
 
* '''curl''' and '''SDL2_net'''. Optional, for cloud integration support.
 
* '''winsparkle'''. Optional, for application updates via the WinSparkle framework.
* '''winsparkle'''. Optional, for application updates via the WinSparkle framework.
* '''zlib'''. Optional, for compressed saved games.


=== Let's get compiling! ===
=== Let's get compiling! ===
Line 76: Line 84:
Finally, we are ready to compile the project!
Finally, we are ready to compile the project!
To do that, just open a '''MinGW-w64''' shell (''not'' the MSYS2 shell), [http://gvsigce.sourceforge.net/wiki/index.php/Getting_started_with_MSYS#Navigating_the_file_system navigate] to the source folder where you have cloned scummvm.git, and type the following commands:
To do that, just open a '''MinGW-w64''' shell (''not'' the MSYS2 shell), [http://gvsigce.sourceforge.net/wiki/index.php/Getting_started_with_MSYS#Navigating_the_file_system navigate] to the source folder where you have cloned scummvm.git, and type the following commands:
<source lang="bash">
<syntaxhighlight lang="bash">
$> ./configure # Executes a bash script that helps you configure.
$> ./configure # Executes a bash script that helps you configure.
$> make # Executes the make program, which triggers the compilation.
$> make # Executes the make program, which triggers the compilation.
</source>
</syntaxhighlight>


If everything went well, you should have a big executable in the compilation folder, named scummvm.exe. The size of the executable comes from the debug symbols embedded in the file, so you can run the following command to shrink it:
If everything went well, you should have a big executable in the compilation folder, named scummvm.exe. The size of the executable comes from the debug symbols embedded in the file, so you can run the following command to shrink it:
<source lang="bash">
<syntaxhighlight lang="bash">
$> strip scummvm.exe
$> strip scummvm.exe
</source>
</syntaxhighlight>


== Ready to go! ==
== Ready to go! ==
Line 102: Line 110:
The following list assumes that you are building ScummVM with default settings and all engines enabled, so chances that this list will suit your needs are pretty high.  
The following list assumes that you are building ScummVM with default settings and all engines enabled, so chances that this list will suit your needs are pretty high.  


* liba52-0.dll
* libbz2-1.dll
* libbz2-1.dll
* libfaad-2.dll
* libfaad-2.dll
1,310

edits

Navigation menu