Difference between revisions of "Compiling ScummVM/GCC"

From ScummVM :: Wiki
Jump to navigation Jump to search
(→‎Optional: ogg vorbis)
m (Spelling fix for libsdl2-dev package)
 
(23 intermediate revisions by 10 users not shown)
Line 1: Line 1:
 
== Compiling ScummVM with GCC under Linux ==
 
== Compiling ScummVM with GCC under Linux ==
  
== Tools/libraries needed ==
+
==Installing the needed libraries via a package manager==
===Mandatory (these should also install dependencies)===
+
===Debian-based distributions===
* gcc-c++ (under Fedora Core, run "yum install gcc-c++" as root to install the GNU C++ compiler)
+
The following should install all the needed libraries:
* SDL-devel (under Fedora Core, run "yum install SDL-devel" as root to install it)
+
<syntaxhighlight lang="bash">
 +
apt-get install g++ make libsdl2-dev liba52-dev libjpeg62-turbo-dev libmpeg2-4-dev libogg-dev libvorbis-dev libflac-dev libmad0-dev libpng-dev libtheora-dev libfaad-dev libfluidsynth-dev libfreetype6-dev zlib1g-dev libfribidi-dev
 +
</syntaxhighlight>
  
===Optional===
+
For Ubuntu, you can also obtain libunity:
* [http://flac.sourceforge.net/ flac] (Free Lossless Audio Codec, needed if you want to play compressed games without quality loss)
+
<syntaxhighlight lang="bash">
* [http://www.underbit.com/products/mad/ libmad] (MPEG Audio Decoder, needed if you want to play MP3-compressed games)
+
apt-get install libunity-dev
* [http://www.xiph.org/downloads/ libOGG and libVorbis] (OGG Vorbis decoder, needed if you want to play OGG-Vorbis-compressed games)
+
</syntaxhighlight>
* TODO (tremor, libmpeg2, libfluidsynth)
 
  
== Building the libraries ==
+
===Ubuntu 18.04 to 20.04===
todo
+
<syntaxhighlight lang="bash">
 +
apt install g++ make libsdl2-dev liba52-dev libjpeg-turbo8-dev libmpeg2-4-dev libogg-dev libvorbis-dev libflac-dev libmad0-dev libpng-dev libtheora-dev libfaad-dev libfluidsynth-dev libfreetype6-dev zlib1g-dev libfribidi-dev
 +
</syntaxhighlight>
  
 +
For cloud and lan features you also need the SDL2_net and curl libraries:
 +
<syntaxhighlight lang="bash">
 +
apt install libsdl2-net-dev libcurl-openssl1.0-dev
 +
</syntaxhighlight>
 +
 +
You can also obtain libunity (for taskbar integration), libgtk (to use the gtk file browser), and libspeechd (for text to speech):
 +
<syntaxhighlight lang="bash">
 +
apt install libunity-dev libgtk-3-dev libspeechd-dev
 +
</syntaxhighlight>
 +
 +
===RPM-based distributions===
 +
The following should install all the needed libraries (apart from fluidsynth):
 +
<syntaxhighlight lang="bash">
 +
yum install gcc-c++ make SDL-devel libjpeg-turbo-devel libmpeg2-devel libogg-devel libvorbis-devel flac-devel libmad-devel libpng-devel libtheora-devel faad2-devel freetype-devel zlib-devel fribidi-devel
 +
</syntaxhighlight>
 +
 +
===Arch Linux-based distributions===
 +
The following command installs the compiler toolchain and all the needed libraries:
 +
<syntaxhighlight lang="bash">
 +
pacman -S --needed base-devel git curl faad2 freetype2 flac fluidsynth libjpeg-turbo libogg libvorbis libmad libmpeg2 libtheora libpng nasm readline sdl2 sdl2_net zlib fribidi
 +
</syntaxhighlight>
 +
 +
Per default, some Arch based distributions like Manjaro and Antergos require the usage of "sudo" to gain root access.
  
 
== Configuring ScummVM ==
 
== Configuring ScummVM ==
 
Run the configure script - type "./configure" in the directory with the ScummVM source files. If no errors come up, you should be ready to compile ScummvM. Run "./configure --help" for a list of optional features (eg additional, not yet enabled engines).
 
Run the configure script - type "./configure" in the directory with the ScummVM source files. If no errors come up, you should be ready to compile ScummvM. Run "./configure --help" for a list of optional features (eg additional, not yet enabled engines).
 +
 +
''Note:'' If you are building ScummVM on a system with low main memory (for example, lower than 256MB), you might run out of memory during linking. If you use GNU ld for compiling you can try exporting LDFLAGS="-Wl,--no-keep-memory" before running configure. This tells GNU ld to optimize for memory usage.
  
 
== Compiling ScummVM ==
 
== Compiling ScummVM ==
run make
+
run "make clean" and then "make"
 +
 
 +
It is recommended to run parallel make. Run it with command "make -j10" where "10" is the number of your CPUs, including virtual ones +2. Typical Intel Core i7 has 8 CPUs.
  
 
== Installing ScummVM ==
 
== Installing ScummVM ==
Line 26: Line 56:
  
 
== Further reading ==
 
== Further reading ==
* [http://svn.sourceforge.net/viewcvs.py/*checkout*/scummvm/scummvm/trunk/README ScummVM README, Section 9.0]
+
* [https://github.com/scummvm/scummvm/blob/master/README.md#100-compiling ScummVM README, Section 10.0]

Latest revision as of 17:20, 21 May 2020

Compiling ScummVM with GCC under Linux

Installing the needed libraries via a package manager

Debian-based distributions

The following should install all the needed libraries:

apt-get install g++ make libsdl2-dev liba52-dev libjpeg62-turbo-dev libmpeg2-4-dev libogg-dev libvorbis-dev libflac-dev libmad0-dev libpng-dev libtheora-dev libfaad-dev libfluidsynth-dev libfreetype6-dev zlib1g-dev libfribidi-dev

For Ubuntu, you can also obtain libunity:

apt-get install libunity-dev

Ubuntu 18.04 to 20.04

apt install g++ make libsdl2-dev liba52-dev libjpeg-turbo8-dev libmpeg2-4-dev libogg-dev libvorbis-dev libflac-dev libmad0-dev libpng-dev libtheora-dev libfaad-dev libfluidsynth-dev libfreetype6-dev zlib1g-dev libfribidi-dev

For cloud and lan features you also need the SDL2_net and curl libraries:

apt install libsdl2-net-dev libcurl-openssl1.0-dev

You can also obtain libunity (for taskbar integration), libgtk (to use the gtk file browser), and libspeechd (for text to speech):

apt install libunity-dev libgtk-3-dev libspeechd-dev

RPM-based distributions

The following should install all the needed libraries (apart from fluidsynth):

yum install gcc-c++ make SDL-devel libjpeg-turbo-devel libmpeg2-devel libogg-devel libvorbis-devel flac-devel libmad-devel libpng-devel libtheora-devel faad2-devel freetype-devel zlib-devel fribidi-devel

Arch Linux-based distributions

The following command installs the compiler toolchain and all the needed libraries:

pacman -S --needed base-devel git curl faad2 freetype2 flac fluidsynth libjpeg-turbo libogg libvorbis libmad libmpeg2 libtheora libpng nasm readline sdl2 sdl2_net zlib fribidi

Per default, some Arch based distributions like Manjaro and Antergos require the usage of "sudo" to gain root access.

Configuring ScummVM

Run the configure script - type "./configure" in the directory with the ScummVM source files. If no errors come up, you should be ready to compile ScummvM. Run "./configure --help" for a list of optional features (eg additional, not yet enabled engines).

Note: If you are building ScummVM on a system with low main memory (for example, lower than 256MB), you might run out of memory during linking. If you use GNU ld for compiling you can try exporting LDFLAGS="-Wl,--no-keep-memory" before running configure. This tells GNU ld to optimize for memory usage.

Compiling ScummVM

run "make clean" and then "make"

It is recommended to run parallel make. Run it with command "make -j10" where "10" is the number of your CPUs, including virtual ones +2. Typical Intel Core i7 has 8 CPUs.

Installing ScummVM

either run ./scummvm from the current directory or run make install to install ScummVM (you can then run it using "scummvm" from any directory)

Further reading