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

From ScummVM :: Wiki
Jump to navigation Jump to search
(→‎Common Issues: Note about msys mode)
(→‎Setup MinGW-w64 and MSYS2: Point to MSYS2 webpage for installation instructions)
Line 15: Line 15:
=== Setup MinGW-w64 and MSYS2 ===
=== Setup MinGW-w64 and MSYS2 ===


'''NOTE:''' This guide is a vast simplification of that found [https://sourceforge.net/p/msys2/wiki/MSYS2%20installation/ here]. While this article should be enough, we recommend you read through the entire guide.
You can find MSYS2 and installation instructions on the [[https://msys2.github.io/ MSYS2 webpage]].


==== Download ====
==== Download and install the mingw-w64 compilation toolchain====
'''Download''' and '''execute''' the MSYS2 bundle for your architecture from [http://msys2.github.io/ here].
 
==== Update the core of MSYS2 ====
In the installation folder run msys2-shell.bat, which should open a MSYS2 terminal.
Type the following command, to update the core dependencies of the environment:
 
<syntax type="bash">
$> update-core
</syntax>
 
''Restart the MSYS2 terminal.''
Type the following command, to update the managed packages:
<syntax type="bash">
$> pacman -Su
</syntax>
 
==== Download and install the compilation toolchain====
In the MSYS2 terminal, type:
In the MSYS2 terminal, type:
<syntax type="bash">
<syntax type="bash">

Revision as of 23:45, 8 March 2016

NOTE
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.

Our officially supported MinGW build instructions are at Compiling_ScummVM/MinGW.

Things needed

Setup MinGW-w64 and MSYS2

You can find MSYS2 and installation instructions on the [MSYS2 webpage].

Download and install the mingw-w64 compilation toolchain

In the MSYS2 terminal, type: <syntax type="bash"> $> pacman -S mingw-w64-<env>-toolchain </syntax> 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.

Install make

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:

<syntax type="bash"> $> pacman -S make </syntax>

Install the needed libraries

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: <syntax type="bash"> $> pacman -S mingw-w64-<env>-<library> </syntax> 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):

  • SDL Mandatory.
  • nasm Optional, for faster compile of scalers.
  • flac. Optional, for FLAC support.
  • libogg and libvorbis Optional, for OGG support.
  • libmad Optional, for MP3 support.
  • libmpeg2 Optional, for MPEG2 cutscene support.
  • zlib. Optional, for compressed saved games.
  • libtheora. Optional, for Broken Sword 2.5.
  • libfaad2. Optional, for AAC support.
  • libpng. Optional, for PNG support.
  • freetype. Optional, for TTF support.
  • fluidsynth. Optional, for soundfont MIDI support.

Let's get compiling!

Finally, we are ready to compile the project! To do that, just open a MSYS2 console, navigate to the source folder where you have cloned scummvm.git, and type the following commands: <syntax type="bash"> $> ./configure # Executes a bash script that helps you configure. $> make # Executes the make program, which triggers the compilation. </syntax>

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: <syntax type="bash"> $> strip scummvm.exe </syntax>

Ready to go!

OK this should be all of it (hopefully), so you should be good to go.

Common Issues

  • If the executable compiles correctly, but you get a "somelibrary.dll missing" error when executing it, you just need to add the following path to your PATH variable: <installdir>/msys<env>/mingw64/bin/
  • If the configure scripts gives an error about using msys mode, please make sure you are running the mingw-w64 win32 shell or the mingw-w64 win64 shell, and not the msys2 shell from the MSYS2 package, when building ScummVM.