How to compile OpenTTD for a Synology DS212+

This guide explains how to compile and install an OpenTTD server on your Synology DS212+ NAS.

Installing dependencies

Compiler packages

sudo ipkg install optware-devel

Zlib

wget http://zlib.net/zlib-1.2.7.tar.gz
tar zxvf zlib-1.2.7.tar.gz
cd zlib-1.2.7
./configure --prefix=/opt --static
make
sudo make install

LZO

wget http://www.oberhumer.com/opensource/lzo/download/lzo-2.06.tar.gz
tar zxvf lzo-2.06.tar.gz
cd lzo-2.06
./configure --prefix=/opt
make
sudo make install

LZMA

wget http://tukaani.org/xz/xz-5.0.4.tar.gz
tar zxvf xz-5.0.4.tar.gz
cd xz-5.0.4
./configure --prefix=/opt
make
sudo make install

Create a symlink to the liblzma.so.5 to prevent start up errors later on.

sudo ln -s /opt/lib/liblzma.so.5 /usr/lib/liblzma.so.5

Last thing you need to do is patch the pc file since the installed pkg-config version doesnt understand the URL entry.

sudo nano /opt/lib/pkgconfig/liblzma.pc

Change
URL: http://tukaani.org/xz/
to
#URL: http://tukaani.org/xz/

Save the file

Compiling OpenTTD

cd ~
mkdir games
cd games
wget http://binaries.openttd.org/releases/1.2.2/openttd-1.2.2-source.tar.gz
tar zxvf openttd-1.2.2-source.tar.gz
cd openttd-1.2.2
./configure --enable-dedicated --with-zlib=/opt/lib/libz.a --with-liblzo2=/opt/lib/liblzo2.a

Now you can compile OpenTTD (this might take a while…)

make

Done!

Launching OpenTTD

  • Install a base graphics set (or install OpenGFX). Copy the files to:
    ~/.openttd/baseset
  • Change to the bin directory
    cd bin
  • Launch openttd in server mode:
    ./openttd -D

Leave a reply