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

5 Comment

    Greg

    I have try to follow you tutorial but
    I have the following error when I do make :

    DiskStation> make
    make[1]: Entering directory `/root/games/openttd-1.3.0-RC1/openttd-1.2.3/objs/lang’
    [LANG] Compiling and Linking endian_check
    /opt/lib/gcc/powerpc-linux-gnuspe/3.4.6/../../../../powerpc-linux-gnuspe/lib/libm.so: undefined reference to `__adddf3@GLIBC_2.3.3′
    /opt/lib/gcc/powerpc-linux-gnuspe/3.4.6/../../../../powerpc-linux-gnuspe/lib/libm.so: undefined reference to `__muldf3@GLIBC_2.3.3′
    /opt/lib/gcc/powerpc-linux-gnuspe/3.4.6/../../../../powerpc-linux-gnuspe/lib/libm.so: undefined reference to `__fixunsdfsi@GLIBC_2.3.3′
    /opt/lib/gcc/powerpc-linux-gnuspe/3.4.6/../../../../powerpc-linux-gnuspe/lib/libm.so: undefined reference to `__floatsidf@GLIBC_2.3.3′
    /opt/lib/gcc/powerpc-linux-gnuspe/3.4.6/../../../../powerpc-linux-gnuspe/lib/libm.so: undefined reference to `__extendsfdf2@GLIBC_2.3.3′
    /opt/lib/gcc/powerpc-linux-gnuspe/3.4.6/../../../../powerpc-linux-gnuspe/lib/libm.so: undefined reference to `__subdf3@GLIBC_2.3.3′
    collect2: ld returned 1 exit status
    make[1]: *** [endian_check] Error 1
    make[1]: Leaving directory `/root/games/openttd-1.3.0-RC1/openttd-1.2.3/objs/lang’
    make: *** [all] Error 1

    do you know why I have this error ?

    Thanks a lot for you response

    11 Mar 2013 | Reply

    • Strange, not sure why this is happening (seems like a missing lib). Are you trying to compile 1.3.0-RC1 or 1.2.3? Your path name is a bit confusing. Perhaps try to install the package “optware-devel” and try again?

      14 Mar 2013 | Reply

      • Greg

        I have try to compile the version 1.3.0 (last stable version) and the 1.2.3. I have the same issue with both.
        The strange path is because I have try first with 1.3.0 and then with 1.2.3 (downloaded in the directory of 1.3.0).
        The first line of the tuto is “sudo ipkg install optware-devel” so I have already install this package.

        I’m completely loss I don’t know why it doesn’t works

        16 Mar 2013 | Reply

  1. Greg

    I forgot to specified that I try on a DS413

    11 Mar 2013 | Reply

  2. Jeffrey

    Hello,

    I am able to make a server and run it without LZMA but without it I can’t save the map.

    So now I want to make a server with LZMA installed but I keep getting the following error:

    you supplied ‘/usr/lib/liblzma.so.5′, but it seems invalid

    I am using the following command:

    ./configure –enable-dedicated –with-zlib=/opt/lib/libz.so.1 –with-
    liblzo2=/opt/lib/liblzo2.a –with-lzma=/opt/lib/liblzma.so.5

    I have installed all libs and updated them.

    28 May 2013 | Reply

    Leave a reply