Compiling Z88DK on the Raspberry Pi

Compiling Z88DK on the Raspberry Pi

The Z88DK project provides C compilers and libraries for over 100 Z80 machines, including the RC2014, ZX Spectrum and ZX Spectrum Next. Here are some quick notes showing how I got Z88DK working on my Raspberry Pi 4.

Just installing z88dk via apt resulted in an old version, so I opted to install from source instead.

Dependencies

First I installed some dependencies: –

sudo apt install libxml2-dev
sudo apt install bison
sudo apt install flex
sudo apt install libboost-all-dev

Code Download

Then I downloaded and uncompressed it: –

wget http://nightly.z88dk.org/z88dk-latest.tgz
tar -xzf z88dk-latest.tgz
cd z88dk/

Compilation

Here is how I compiled the software (it took a while!) : –

export BUILD_SDCC=1
export BUILD_SDCC_HTTP=1
./build.sh

Environment

Once everything is compiled, you need to run the following commands to ensure that the executables and libraries can be found (it’s probably a good idea to add these lines to your ~/.profile file).

export PATH=${PATH}:${HOME}/z88dk/bin
export ZCCCFG=${HOME}/z88dk/lib/config

Checks

You should then have the necessary tools available, which you can check by running the following commands, separately: –

zcc

zsdcc -v

z80asm

appmake

Once you’ve got everything ready, check out my post on programming in C for the ZX Spectrum.

2 thoughts on “Compiling Z88DK on the Raspberry Pi

Leave a Reply

Your email address will not be published. Required fields are marked *