Difference between revisions of "Compiling ScummVM/macOS"

Jump to navigation Jump to search
1,426 bytes added ,  19:23, 4 November 2019
→‎4. Manual compilation: -- removed duplicate
(→‎4. Manual compilation: -- removed duplicate)
(4 intermediate revisions by 3 users not shown)
Line 36: Line 36:
=== 1. Homebrew ===
=== 1. Homebrew ===
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
brew install sdl2 sdl2_net jpeg-turbo libmpeg2 libogg libvorbis flac libmad libpng theora faad2 a52dec freetype lzlib fluid-synth
brew install a52dec curl-openssl faad2 flac fluid-synth freetype jpeg-turbo libmad libmpeg2 libogg libpng libvorbis lzlib pkg-config sdl2 sdl2_net theora
</syntaxhighlight>
</syntaxhighlight>


Line 64: Line 64:
** [http://liba52.sourceforge.net liba52]
** [http://liba52.sourceforge.net liba52]
** [https://theora.org Theora]
** [https://theora.org Theora]
** [https://www.libsdl.org/projects/SDL_net/ SDL_net 2] or [https://www.libsdl.org/projects/SDL_net/release-1.2.html 1.2] (use same version as SDL)
** For cloud support:
*** [https://www.libsdl.org/projects/SDL_net/ SDL_net 2] or [https://www.libsdl.org/projects/SDL_net/release-1.2.html 1.2] (use same version as SDL)
*** [https://curl.haxx.se/ libcurl]
** For Freetype
** For Freetype
*** [http://www.bzip.org bzip2]
*** [http://www.bzip.org bzip2]
Line 91: Line 93:
</syntaxhighlight>
</syntaxhighlight>


If you want your compilation to be compatible with older system, use the -mmacosx-version-min flag (for example -mmacosx-version-min=10.5). To force compilation in 32 bits use -arch i386. You can do that by setting environment variables before compiling all the libraries and ScummVM:
If you want your compilation to be compatible with older systems, use the -mmacosx-version-min flag (for example -mmacosx-version-min=10.5). To force compilation in 32 bits use -arch i386. You can do that by setting environment variables before compiling all the libraries and ScummVM:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
export LDFLAGS="-arch i386 -mmacosx-version-min=10.5"
export LDFLAGS="-arch i386 -mmacosx-version-min=10.5"
Line 132: Line 134:


If no errors come up, you should be ready to compile ScummvM.
If no errors come up, you should be ready to compile ScummvM.
For a list of optional features (eg additional, not yet enabled engines) run:
For a list of optional features (e.g. additional, not yet enabled engines) run:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
./configure --help
./configure --help
Line 145: Line 147:


=== Compiling ScummVM ===
=== Compiling ScummVM ===
Just run make (with -j to compile several files in parallel). For example
Just run make (with -j to compile several files in parallel). For example:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
make -j4
make -j4
Line 170: Line 172:


Also if you run scummvm from the command line, you will need to set the Theme path in the ScummVM options so that it finds the modern theme. The themes are in gui/themes/ in the source code repository.
Also if you run scummvm from the command line, you will need to set the Theme path in the ScummVM options so that it finds the modern theme. The themes are in gui/themes/ in the source code repository.
==== Important note about SDL2 ====
The scummvm compilation assumes that the bundle uses the static SDL library. However if you have both a dynamic and static SDL2 library, SDL2 by default will instruct to use the dynamic library. To make bundles that work on other computers you can do one of two things:
# Locate the installed sdl2-config script (for example ''/usr/local/bin/sdl2-config'') and edit the line after <code>--static-libs)</code>, replace <code>echo -L${exec_prefix}/lib -lSDL2</code> with <code>echo ${exec_prefix}/lib/libSDL2.a</code> (and preserve the rest of the line). This needs to be done before you make the bundle.
# After creating the bundle, copy the dynamic libSDL2 to the bundle and instruct the executable where to find it:
<syntaxhighlight lang="bash">
otool -L ScummVM.app/Contents/MacOS/scummvm  | grep SDL2
  <Note the path for the SDL2 library - below we assume it is /usr/local/lib/libSDL2-2.0.0.dylib>
mkdir ScummVM.app/Contents/Frameworks/
cp /usr/local/lib/libSDL2-2.0.0.dylib ScummVM.app/Contents/Frameworks/
install_name_tool -change /usr/local/lib/libSDL2-2.0.0.dylib "@executable_path/../Frameworks/libSDL2-2.0.0.dylib"  ScummVM.app/Contents/MacOS/scummvm
</syntaxhighlight>
Doing that is not needed if you are only going to use the ScummVM application on the same computer you compiled it on.


== Compiling ScummVM via the Xcode GUI ==
== Compiling ScummVM via the Xcode GUI ==

Navigation menu