Difference between revisions of "Compiling ScummVM/RPI"

Jump to navigation Jump to search
→‎Configuring ScummVM: Mention --no-keep-memory option for linking on a RPi itself.
(→‎Configuring ScummVM: Mention --no-keep-memory option for linking on a RPi itself.)
(20 intermediate revisions by 2 users not shown)
Line 5: Line 5:
We will clone the Raspberry Pi tools repository which includes the cross-compiler we need:
We will clone the Raspberry Pi tools repository which includes the cross-compiler we need:


git clone git://github.com/raspberrypi/tools.git
git clone https://github.com/raspberrypi/tools.git
It will get cloned to a directory called tools at your current location.


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 tools at my home directory, I would do:


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/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin
 
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.
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.
Line 20: Line 19:
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.
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:
First we export the path where we will copy these into, and then we will manually copy them. I choose /opt/rpi_root, but any other path with the right permissions for your user and common sense is going to be ok:
 
mkdir -p /opt/rpi_root


cp -R <SD_mountpoint_directory>/usr /home/manuel/rpi_root
cd <SD_mountpoint_directory>


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


cp -R <SD_mountpoint_directory>/opt /home/manuel/rpi_root
export RPI_ROOT=/opt/rpi_root


== Configuring ScummVM ==
== 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:
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.
 
./configure --host=raspberrypi --with-sdl-prefix=$RPI_ROOT/usr  --disable-debug --enable-release --enable-optimizations --disable-mt32emu --disable-flac --disable-mad --disable-vorbis --disable-tremor --disable-fluidsynth --disable-taskbar --disable-timidity --disable-alsa
 
Remember you should have exported the RPI_ROOT enviroment variable previously.
On the raspberrypi host, SDL2 will be always used since it provides graphics acceleration.


RPI_ROOTDIR="/home/manuel/rpi_root" ./configure --host=raspberrypi --enable-gles-rpi --disable-debug --enable-release --enable-optimizations --disable-mt32emu --disable-flac \
''Note:'' If you are building ScummVM on your RPi itself, 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.
--disable-mad --disable-vorbis --disable-tremor \
--disable-fluidsynth --disable-taskbar --disable-timidity --disable-alsa


== Compiling ScummVM ==
== Compiling ScummVM ==
561

edits

Navigation menu