Subscribe via RSS

OpenTTD 0.1.4 on TurboLinux 1.1 for Power PC

So, TurboLinux 1.1 is up and running on my Power Computing PowerCenter 180. It took a lot of effort and what is the result? A cobbled-together version of RedHat 2.0 for PPC! Ancient. I should probably stick to tuxracer, but that may even be 'too new'. I want to get OTTD running on this, so I've chosen a really early version that will hopefully mean I don't need to uplift the entire kernel/OS to get running.

Automake and Autoconf

To build OpenTTD, we'll need an appropriate version of SDL. I chose 1.2.1 and, upon trying to build this, found out that it then needs newer versions of Automake and Autoconf. Actually, it requires Autoconf 2.13 and, perfectly, we only had 2.12 from the CD-ROM! One point makes a difference, eh? Linux from scratch has a great tutorial here for autoconf, so I just followed the instructions and installed very easily.

tar -xzvf autoconf-2.13.tar.gz
cd autoconf-2.13
./configure --prefix=/usr
make install

automake 1.4-p6 was then built and installed (same process as above, but with a different archive and folder name)... and now SDL would behave.

SDL 1.2.1

SDL was actually very straight-forward, once I knew what I was doing. I actually initially started down a path of upgrading the compiler and libc, but then quickly decided that it was a dependency-can-of-worms and just left everything as 'stock' as possible. So, back to SDL, downloaded 1.2.1 from here, extract it and try to configure it. Actually, you can't, you need to call first...


With the above auto* tools installed, autogen will sit quietly for a few minutes and then tell you that you're ready to run configure...


This completed cleaning, so now we just make...


This then took hours... and eventually failed! There was a very obvious error: the installed version of RedHat 2.0 (I mean, TurboLinux 1.1) does not have a linux/joystick.h header file! What to do/guess?

./configure --disable-joystick

It didn't complain, and rebuilt the Makefiles... including those in the src/joystick folder... bad sign? Let's quickly build that and see what happens...

cd src/joystick

It compiled fine! Seems that it still needs to create a 'don't make anything' Makefile in there. Also, you could see a new GCC arg of -DDISABLE_JOYSTICK, so my fluke worked perfectly. Anyway, let's go back and re-build.

cd ..

The build continued... And finished! What next?

make install

This also succeeded, with a few warning through it, and a bit of doco which zoomed past, not allowing me to scroll back up! Regardless, the following is used when configuring:

which sdl-config

Nice! But actually, it wasn't... I'd later find out that half of the source was still expecting joysticks and that I should've performed a make clean when I re-configure'd! Also, the SDL bits and bobs landed in the /usr/local folder... not optimal on this system, so at the very start, if you're playing at home, use this configure line instead:

./configure --disable-joystick --prefix=/usr

And then OTTD will build! Or so we hope...

OpenTTD 0.1.4

The source was extracted and I started by trying to configure:

# ./configure
error: permission denied
# chmod a+x configure
# ./configure
: bad option

Actually inspecting the configure script just shows it replacing the SDL variables in a JamFile? Uh oh... not a Makefile... we don't have Jam on here! There's also a Makefile, does that work?

# make
Makefile:113: window.d: No such file or directory

Eh? Started building OTTD and it was quickly apparent that it hated the Makefile. I started creating a new version, and things were working, so I looked at the old one again and realised the line-endings were incorrect! Make sure your Makefile has just \n and not windows endings! Kicking it off again, all was working fine, until it got to minilzo.c/.h.

minilzo.c:249: Invalid token in expression

This file is sprinkled with multi-line \'d source and gcc simply hates it all... so it had to all be collapsed.

#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \
		(m_pos == NULL || (m_off = (lzo_moff_t) (ip - m_pos)) > max_offset)

#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \
		(PTR_LT(m_pos,in) || \
		 (m_off = (lzo_moff_t) PTR_DIFF(ip,m_pos)) <= 0 || \
		  m_off > max_offset) ))

All those slashes weren't allowed... so a quick find/replace in Notepad++ of '\\n' to '' worked a treat. lzoconf.h also had a few... but, with these all collapsed...

unix.c:10: sys/statvfs.h: No such file or directory

Indeed, the file didn't exist! But, statfs.h did, so I did a quick rename! And well, it built! And failed when I ran it as english.lng was missing. Usually you'd build the strings, but I stole the file plus the other required GRFs from my standard TTDX Data Archive.. that was always kept near for emergencies such as this!


And it loaded! Slow, chuggy and crashy with lots of frameskip warning shown in the console. Actually, the whole thing would segfault when I tried to move the window on the screen. From here, I'm happy to have achieved this much, but I'm not going to polish it. Instead, it's time to test a newer version of Linux.

Filed under: Apple Leave a comment
Comments (0) Trackbacks (1)

No comments yet.

Leave a comment