Difference between revisions of "Compiling ScummVM/macOS"

Jump to navigation Jump to search
1,343 bytes added ,  02:46, 14 October 2019
Typos.
(Typos.)
(One intermediate revision by one other user not shown)
Line 91: Line 91:
</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 132:


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 145:


=== 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 170:


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 ==
736

edits

Navigation menu