1,310
edits
(Add a separate notes section and move the less important notes there, keeping the important ones on top) |
Praetorian (talk | contribs) (→Setup MinGW-w64 and MSYS2: Added libmikmod to library packages downloaded with pacman) |
||
(10 intermediate revisions by 4 users not shown) | |||
Line 13: | Line 13: | ||
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]. | 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]. | ||
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). | The MinGW packages are named <code>mingw-<env>-<package></code>, where <code><env></code> is either x86_64 or i686, depending on your architecture (64-bit and 32-bit, respectively). | ||
To create an i686 or x86_64 build environment, we need to first update the already installed packages and the MSYS2 environment itself. | To create an i686 or x86_64 build environment, we need to first update the already installed packages and the MSYS2 environment itself. | ||
Line 23: | Line 23: | ||
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. | 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. | ||
In order to install all required tools and libraries, open the MinGW shell matching the architecture you want to build for (32 or 64 bits) and use the following command: | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
pacman -S --needed --noconfirm base-devel git | pacman -S --needed --noconfirm base-devel git ${MINGW_PACKAGE_PREFIX}-{a52dec,binutils,ccache,cairo,curl-winssl,faad2,freetype,flac,fluidsynth,fribidi,libjpeg-turbo,libogg,libvorbis,libvpx,libmad,libmpeg2-git,libtheora,libpng,lld,nasm,readline,SDL2,SDL2_net,toolchain,winsparkle,zlib,ntldd-git,libmikmod} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
These commands will fetch and install the packages needed for compiling, including (but not limited to) GCC 12.x, GDB, and libwinpthread-git. | |||
These commands will fetch and install the packages needed for compiling, including (but not limited to) GCC | |||
Additionally, if you would like to include Discord Rich Presence support, the pre-compiled libraries are [https://github.com/discord/discord-rpc/releases here]. Simply copy the files into your base MinGW directory. | |||
== Let's get compiling! == | == Let's get compiling! == | ||
Line 76: | Line 43: | ||
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: | ||
strip scummvm.exe | strip scummvm.exe | ||
Please note that using this step is not necessary if you build a distributable package. | |||
That's it, you successfully compiled ScummVM from the source code. | That's it, you successfully compiled ScummVM from the source code. | ||
Line 83: | Line 52: | ||
In case you want to distribute your builds to machines without a running MSYS2 installation or if you excluded MSYS2/Mingw-w64 from your PATH, you need to bundle the required .dll files with the executable - otherwise, running ScummVM will fail due to missing dependencies. | In case you want to distribute your builds to machines without a running MSYS2 installation or if you excluded MSYS2/Mingw-w64 from your PATH, you need to bundle the required .dll files with the executable - otherwise, running ScummVM will fail due to missing dependencies. | ||
If you intend to build a ScummVM package that includes all the necessary files, you can build such a redistributable package by using | |||
make win32dist-mingw WIN32PATH=<target> | |||
where <code><target></code> specifies the directory that will contain the redistributable packages. | |||
== Common Issues == | == Common Issues == | ||
* If configure fails to find required libraries such as SDL, make sure that you have all the required libraries available for the target system and that you are using the correct MinGW shell (32-bit vs 64-bit) | |||
* 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 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/ | ||
Line 94: | Line 67: | ||
* Despite the name, MinGW-w64 works on both 32-bit and 64-bit systems, but the latest versions cannot be installed on Windows XP anymore. '''However, builds produced will still work on Windows XP.''' | * Despite the name, MinGW-w64 works on both 32-bit and 64-bit systems, but the latest versions cannot be installed on Windows XP anymore. '''However, builds produced will still work on Windows XP.''' | ||
* MinGW-w64 and MSYS2 is a fork of MinGW. If you wish to compile with the (older) MinGW toolset, check out [[Compiling_ScummVM/MinGW|MinGW and MSYS]] | * MinGW-w64 and MSYS2 is a fork of MinGW. If you wish to compile with the (older) MinGW toolset, e.g. to support versions older than Windows XP, check out [[Compiling_ScummVM/MinGW|MinGW and MSYS]] | ||
* MinGW-w64 makes heavy use of the pacman package manager, which may not be available under other MinGW setups | * MinGW-w64 makes heavy use of the pacman package manager, which may not be available under other MinGW setups | ||
edits