TrustedUser
2,147
edits
(→Further reading: Fix README link) |
(→Obtaining the required libraries: add instructions for manual compilation) |
||
Line 46: | Line 46: | ||
TODO | TODO | ||
</source> | </source> | ||
=== 4. Manual compilation === | |||
Get the source code from the libraries. With this method you will not only need to get the libraries ScummVM uses directly, but also those they depend on. | |||
* Required: | |||
** [https://www.libsdl.org SDL 1.2 or SDL 2] | |||
*Optional: | |||
** [http://zlib.net zlib] | |||
** [http://www.ijg.org/ jpeg] | |||
** [http://www.libpng.org/pub/png/libpng.html libpng] | |||
** [http://www.xiph.org/vorbis/ libogg and libvorbis] | |||
** [http://www.xiph.org/flac FLAC] | |||
** [http://www.underbit.com/products/mad/ libmad] | |||
** [http://libmpeg2.sourceforge.net mpeg2] | |||
** [http://www.audiocoding.com/faad2.html FAAD2] | |||
** [https://theora.org Theora] | |||
** For Freetype | |||
*** [http://www.bzip.org bzip2] | |||
*** [http://www.freetype.org/ FreeType] | |||
** For Fluidsynth | |||
*** [https://www.freedesktop.org/wiki/Software/pkg-config/ pkg-config] | |||
*** [https://sourceware.org/libffi/ libffi] | |||
*** [https://www.gnu.org/software/gettext/ gettext] | |||
*** [https://git.gnome.org/browse/glib glib] | |||
*** [http://www.fluidsynth.org FluidSynth] | |||
All the libraries are compiled and installed in the same way: | |||
<source lang="bash"> | |||
cd thelib-src | |||
./configure --prefix=/path/to/install | |||
make | |||
make install | |||
</source> | |||
The default installation path is /usr/local, but you will need admin privileges to install the libraries in this location. | |||
<source lang="bash"> | |||
cd thelib-src | |||
./configure | |||
make | |||
sudo make install | |||
</source> | |||
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: | |||
<source lang="bash"> | |||
export LDFLAGS="-arch i386 -mmacosx-version-min=10.5" | |||
export CFLAGS="-arch i386 -mmacosx-version-min=10.5" | |||
export CXXFLAGS="-arch i386 -mmacosx-version-min=10.5" | |||
</source> | |||
bzip2 is an exception. There is no configure and you directly call make with options. For example: | |||
<source lang="bash"> | |||
make CFLAGS="-arch i386 -mmacosx-version-min=10.5 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64" LDFLAGS="-arch i386 -mmacosx-version-min=10.5" | |||
make install PREFIX=/Users/criezy/Dev/scummvm-releases/libs | |||
</source> | |||
If you plan to build the ScummVM app bundle, you will need to generate static libraries. For most of the libraries this is done by default, but for a few you need to specify you want static libraries when invoking configure. Here are suggested configure options for each library. If the library is not listed in the table below this means the default is fine. | |||
{| cellspacing="2" cellpadding="5" width=100% style="border: 1px solid #333333;" | |||
|- style="background:#efefef" | |||
! width=100|Library !! configure flags !! Comments | |||
|- style="background-color: #fafafa;" | |||
| align=center valign=top| pkg-config || --with-internal-glib || | |||
|- style="background-color: #fafafa;" | |||
| align=center valign=top| glib || --enable-static || | |||
|- style="background-color: #fafafa;" | |||
| align=center valign=top| libmpeg2 || --disable-sdl || | |||
Need to add -std=gnu89 to CFLAGS (for example 'export CFLAGS="-std=gnu89"' before invoking configure) | |||
|- style="background-color: #fafafa;" | |||
| align=center valign=top| FLAC || --enable-static --disable-asm-optimizations || | |||
|- style="background-color: #fafafa;" | |||
| align=center valign=top| Theora || --disable-examples || | |||
* Need to edit configure before running it to remove flag -fforce-addr | |||
* Examples do not compile with libpng 1.6 | |||
|} | |||
== Compiling ScummVM via the command line == | == Compiling ScummVM via the command line == |