Difference between revisions of "Compiling ScummVM/RPI"

From ScummVM :: Wiki
Jump to navigation Jump to search
(Created page with "== Cross-compiling ScummVM on for Raspberry Pi == == Installing the official Raspberry Pi cross-compiler on PC == We will clone the Raspberry Pi tools repository which includes...")
(No difference)

Revision as of 18:57, 21 March 2015

Cross-compiling ScummVM on for Raspberry Pi

Installing the official Raspberry Pi cross-compiler on PC

We will clone the Raspberry Pi tools repository which includes the cross-compiler we need:

git clone git://github.com/raspberrypi/tools.git

It will get cloned to a directory called raspberrypi at your current location.

Add it to the path so we have the crosscompiler binaries available from our scummvm building directory. If my raspberrry pi tools repository ended cloned in raspberrrypi at my home directory, I would do:

PATH=$PATH:/home/manuel/raspberrypi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin

After adding the crosscompiler executables directory to the path, we should be able to run arm-linux-gnueabihf-gcc, arm-linux-gnueabihf-g++, etc... just try. They should yield an error because you pass them no input files, but that's expected. It's just a test so we know we've the crosscompiler installed and accesible.

Installing the needed Raspberry Pi headers and libraries on PC

We need to copy over the /usr, /lib and /opt directories from your Raspbian SD to your PC (the computer were you will do the cross-compilation), for the needed headers and libs to be available. Of course, you'll have to install any additonal libs from Raspbian running of the Pi before expecting them to be available, so if you compile scummvm with FLAC support, you should have installed the libflac development libs on the Pi first.

So let's go with the headers and libs copy. I copied them to /home/manuel/rpi_root:

cp -R <SD_mountpoint_directory>/usr /home/manuel/rpi_root cp -R <SD_mountpoint_directory>/lib /home/manuel/rpi_root cp -R <SD_mountpoint_directory>/opt /home/manuel/rpi_root

Configuring ScummVM

Now we configure scummvm buildsystem so it knows what backend we want and where is our raspberry pi local sysroot living, containing the Raspberry Pi headers and libs the cross-compiler and linker will need. In this example configuration, we disable additional libs, and debug symbols since it's intended for final users:

RPI_ROOTDIR="/home/manuel/rpi_root" ./configure --backend=raspberrypi --host=raspberrypi --disable-debug --enable-release --enable-optimizations --disable-mt32emu --disable-flac \ --disable-mad --disable-vorbis --disable-tremor \ --disable-fluidsynth --disable-taskbar --disable-timidity --disable-alsa

Compiling ScummVM

run "make clean" and then "make -j<n>", where n is the number of cores available on your compilation machine x2.

Installing ScummVM

Simply copy over the resulting scummvm executable to your Raspberry Pi sd. A good idea is to create an scummvm folder in your /home/pi directory, and put the executable there along with the games you want to use with it.