Difference between revisions of "Compiling ScummVM/MinGW"

Jump to navigation Jump to search
no edit summary
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{| 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"
|Compiling with MinGW is not working out of the box. It is recommended that you use [[Compiling_ScummVM/MinGW-w64|MinGW-w64]] instead, which is far easier to set up and get working.
|}
== Compiling ScummVM with Minimalist GNU for Windows (MinGW) ==
== Compiling ScummVM with Minimalist GNU for Windows (MinGW) ==


Line 20: Line 28:


* [https://github.com/libsdl-org/SDL-1.2 SDL 1.2]. For Windows 95/98/ME support
* [https://github.com/libsdl-org/SDL-1.2 SDL 1.2]. For Windows 95/98/ME support
** You need the latest SDL 1.2 source code revision from GitHub ([https://github.com/libsdl-org/SDL-1.2/tree/27d991f356a2712feba0d7749f11807849665491 27d991f356a2712feba0d7749f11807849665491] at the time of writing).
** You need the latest SDL 1.2 source code revision from GitHub ([https://github.com/libsdl-org/SDL-1.2/tree/d06a1eb74acf96ded8898b8507cc568c862c9d74 d06a1eb74acf96ded8898b8507cc568c862c9d74] at the time of writing).


* [https://www.libsdl.org/projects/SDL_net/ SDL2_net]. Optional, for network support.
* [https://www.libsdl.org/projects/SDL_net/ SDL2_net]. Optional, for network support.
Line 41: Line 49:


* [http://downloads.xiph.org/releases/ogg/ libogg] and [http://downloads.xiph.org/releases/vorbis/ libvorbis] Optional, for OGG support
* [http://downloads.xiph.org/releases/ogg/ libogg] and [http://downloads.xiph.org/releases/vorbis/ libvorbis] Optional, for OGG support
** You need the latest libogg source code ([https://downloads.xiph.org/releases/ogg/libogg-1.3.4.tar.xz v1.3.4] at the time of writing).
** You need the latest libogg source code ([https://downloads.xiph.org/releases/ogg/libogg-1.3.5.tar.xz v1.3.5] at the time of writing).
** You need the latest libvorbis (not vorbis) source code ([https://downloads.xiph.org/releases/vorbis/libvorbis-1.3.7.tar.xz v1.3.7] at the time of writing).
** You need the latest libvorbis (not vorbis) source code ([https://downloads.xiph.org/releases/vorbis/libvorbis-1.3.7.tar.xz v1.3.7] at the time of writing).


Line 58: Line 66:
* [http://www.libpng.org/pub/png/libpng.html libpng]. Optional, for PNG support.
* [http://www.libpng.org/pub/png/libpng.html libpng]. Optional, for PNG support.
** You need the latest libpng source code ([https://download.sourceforge.net/libpng/libpng-1.6.37.tar.xz v1.6.37] at the time of writing).
** You need the latest libpng source code ([https://download.sourceforge.net/libpng/libpng-1.6.37.tar.xz v1.6.37] at the time of writing).
* [http://giflib.sourceforge.net/ giflib]. Optional, for GIF support.
** You need at least [https://downloads.sourceforge.net/giflib/giflib-5.1.4.tar.gz v5.1.4].


* [http://download.savannah.gnu.org/releases/freetype/ freetype]. Optional, for TTF support.
* [http://download.savannah.gnu.org/releases/freetype/ freetype]. Optional, for TTF support.
** You need the latest freetype source code ([http://download.savannah.gnu.org/releases/freetype/freetype-2.10.4.tar.xz v2.10.4] at the time of writing).
** You need the latest freetype source code ([http://download.savannah.gnu.org/releases/freetype/freetype-2.10.4.tar.xz v2.10.4] at the time of writing).


* [http://www.fluidsynth.org/ fluidsynth]. Optional, for soundfont MIDI support.
* [https://github.com/divideconcept/FluidLite FluidLite]. Optional, for soundfont MIDI support.
** You need at least [https://sourceforge.net/projects/fluidsynth/files/older%20releases/fluidsynth-1.0.9.tar.gz/download v1.0.9]. Newer versions than this should work, but require GTK's glib and CMAKE to build.
** You need the latest FluidLite source code revision from GitHub ([https://github.com/divideconcept/FluidLite/tree/37e812d31d9f6b712e4385f6134084b5803a74a3 37e812d31d9f6b712e4385f6134084b5803a74a3] at the time of writing).


* [https://github.com/fribidi/fribidi FriBiDi]. Optional, for bidirectional text in languages that need it (e.g. Hebrew)
* [https://github.com/fribidi/fribidi FriBiDi]. Optional, for bidirectional text in languages that need it (e.g. Hebrew)
Line 69: Line 80:


* [https://libjpeg-turbo.org/ libjpeg-turbo]. Optional, for JPEG support.
* [https://libjpeg-turbo.org/ libjpeg-turbo]. Optional, for JPEG support.
** You need the latest libjpeg-turbo source code ([https://sourceforge.net/projects/libjpeg-turbo/files/2.0.6/libjpeg-turbo-2.0.6.tar.gz/download v2.0.6] at the time of writing).
** You need the latest libjpeg-turbo source code ([https://sourceforge.net/projects/libjpeg-turbo/files/2.1.0/libjpeg-turbo-2.1.0.tar.gz/download v2.1.0] at the time of writing).


* [http://liba52.sourceforge.net/ liba52]. Optional, for AC-3 support.
* [http://liba52.sourceforge.net/ liba52]. Optional, for AC-3 support.
Line 78: Line 89:


* [https://curl.se/ libcurl]. Optional, for cloud support.
* [https://curl.se/ libcurl]. Optional, for cloud support.
** You need the latest libcurl source code ([https://curl.se/download/curl-7.76.0.tar.xz 7.76.0] at the time of writing).
** You need the latest libcurl source code ([https://curl.se/download/curl-7.77.0.tar.xz v7.77.0] at the time of writing).


* [https://github.com/nigels-com/glew GLEW]. Optional, for hardware acceleration in 3D games.
* [https://github.com/nigels-com/glew GLEW]. Optional, for hardware acceleration in 3D games.
Line 153: Line 164:
Unzip the SDL2 archive in a folder, open MSYS, go to the SDL2 folder and issue this command to install the library:
Unzip the SDL2 archive in a folder, open MSYS, go to the SDL2 folder and issue this command to install the library:


  make install-package arch=i686-w64-mingw32 prefix=$PREFIX
  make install-package arch=i686-w64-mingw32 prefix=/mingw




Line 204: Line 215:




=== FluidSynth ===
=== FluidLite ===


We use fluidsynth 1.0.9, since later versions requires GTK.
Unzip the fluidlite archive in a folder, open MSYS, go to the fluidlite folder and issue these commands to compile and install the library:
 
Unzip the fluidsynth archive in a folder, open MSYS, go to the fluidsynth folder and apply the following patch:
 
<syntaxhighlight lang="diff">
--- include/fluidsynth.h
+++ include/fluidsynth.h
@@ -28,13 +28,7 @@
#endif
#if defined(WIN32)
-#if defined(FLUIDSYNTH_DLL_EXPORTS)
-#define FLUIDSYNTH_API __declspec(dllexport)
-#elif defined(FLUIDSYNTH_NOT_A_DLL)
-#define FLUIDSYNTH_API
-#else
-#define FLUIDSYNTH_API __declspec(dllimport)
-#endif
+#define FLUIDSYNTH_API
#elif defined(MACOS9)
#define FLUIDSYNTH_API __declspec(export)
--- fluidsynth.pc.in
+++ fluidsynth.pc.in
@@ -7,4 +7,5 @@
Description: Software SoundFont synth
Version: @VERSION@
Libs: -L${libdir} -lfluidsynth
+Libs.private: @LIBFLUID_LIBS@
Cflags: -I${includedir}
</syntaxhighlight>


Then issue these commands to compile and install the library:
  cmake -G "MSYS Makefiles" -DFLUIDLITE_BUILD_SHARED=OFF -DCMAKE_INSTALL_PREFIX=/mingw -DCMAKE_BUILD_TYPE=Release .
  ./configure --disable-shared --prefix=/mingw
  make
  make
  make install
  make install
Line 251: Line 231:
  make pnglibconf.h
  make pnglibconf.h
  sed -i 's/\x0D//' pnglibconf.h
  sed -i 's/\x0D//' pnglibconf.h
make
make install
=== giflib ===
Unzip the giflib archive in a folder, open MSYS, go to the giflib folder and issue these commands to compile and install the library:
./configure --disable-shared --prefix=/mingw
  make
  make
  make install
  make install
Line 407: Line 396:
Then issue these commands to compile and install the library:
Then issue these commands to compile and install the library:


  CPPFLAGS=-D_WIN32_WINNT=0x400 cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=$PREFIX -DCMAKE_BUILD_TYPE=Release -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF .
  CPPFLAGS=-D_WIN32_WINNT=0x400 cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=/mingw -DCMAKE_BUILD_TYPE=Release -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF .
  make
  make
  make install
  make install
Line 449: Line 438:
Then issue these commands to compile and install the library:
Then issue these commands to compile and install the library:


  make install.all GLEW_PREFIX=$PREFIX GLEW_DEST=$PREFIX GLEW_NO_GLU=-DGLEW_NO_GLU
  make install.all GLEW_PREFIX=/mingw GLEW_DEST=/mingw GLEW_NO_GLU=-DGLEW_NO_GLU




Line 464: Line 453:
== Compiling with Console/Text Output ==
== Compiling with Console/Text Output ==


By default ScummVM is compiled as a Windows subsystem application with no console output. If you need the console, you will need to apply the following patch:
By default ScummVM now compiles with console output. If for some reason you do NOT want console output (which was the default behavior until recently), use the follow flag when running the configure script:
<syntaxhighlight lang="diff">
./configure --disable-windows-console
diff --git a/configure b/configure
index 838c759b75..04cfd361dd 100755
--- a/configure
+++ b/configure
@@ -6070,6 +6070,9 @@ case $_host_os in
append_var CXXFLAGS "-fdata-sections"
append_var LDFLAGS "-Wl,--gc-sections"
;;
+ mingw*)
+ LIBS=`echo $LIBS | sed -e 's/-mconsole//g' -e 's/-mwindows//g'`
+ ;;
n64)
# Move some libs down here, otherwise some symbols requires by libvorbis aren't found
# during linking stage
</syntaxhighlight>
 
Save it to your root directory and apply it with <code>patch -p1 -i path-to-patch.diff</code>.


== Ready to go! ==
== Ready to go! ==


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

edits

Navigation menu