Building the BB2 C port
Before this page you should know what the port is (Introduction).
There are no ready-made downloads of the port, so this page is where
everything starts. At the end you have a blitz2 directory with the
compiler, the editor and the libraries, ready to be copied to an Amiga
or an emulator.
What you need
- A Linux machine on x86-64. This is the platform the port is built and tested on.
- CMake 4.3 or newer, Ninja, Git, and a C and C++ compiler for your machine.
- The cross compiler m68k-amigaos-gcc, version 16.2-rc21 or newer, with its assembler vasm.
Install the build tools
CMake, Ninja, Git and the host compiler come with every Linux distribution. On Debian and Ubuntu:
sudo apt install cmake ninja-build git gcc g++The port needs CMake 4.3 or newer. Ubuntu 26.04 LTS ships 4.2.3, so there and on
older distributions install a newer CMake from Kitware’s
binaries at cmake.org, with pip install cmake, or with snap install cmake --classic.
Install the cross compiler
The cross compiler is the m68k-amigaos-gcc of the AmigaPorts project.
Its releases on GitHub
have ready archives; take the one for x86_64-linux of version 16.2-rc21
or newer. It contains the compiler, the libraries of AmigaOS and the
assembler vasm, which the build needs as well.
Unpack it, for example under /opt, and put its bin directory into
your PATH:
sudo tar xJf m68k-amigaos-gcc-16.2-rc25-x86_64-linux.tar.xz -C /opt
export PATH=/opt/m68k-amigaos-gcc-16.2/bin:$PATHInstead of the PATH, you can tell the build where the cross compiler is
with -DAMIGA_TOOLCHAIN_PREFIX=/opt/m68k-amigaos-gcc-16.2 when you
configure, or with the environment variable of the same name. Without
either, the build looks for m68k-amigaos-gcc in the PATH and then in
/opt/amiga and /opt/m68k-amigaos.
Get the sources
git clone https://github.com/fubar-coder/bb2-c.git
cd bb2-cConfigure
cmake --preset amigaThis prepares the build in build/amiga/. It checks that the cross
compiler is recent enough and stops with a message if it is not.
Build
cmake --build --preset amigaThe build makes the tools for your machine first, then the Amiga programs and libraries. It checks every result in the same step that makes it: a file that fails a check counts as not built, and the build stops with an error. A clean build has no warnings.
Look at the result
The blitz2 directory is build/amiga/blitz2/:
- blitz2
- ted
- acidlibs
- deflibs
- blitz2-ab3
- ab3cli
cmake --install build/amiga copies the same files into
build/amiga/install/blitz2/, a directory with nothing else in it.
Try it: run the tests that need no emulator. They take seconds and show that the tools and the libraries were built correctly:
ctest --preset hostThis run needs neither the emulator nor the original material. The full
run, ctest --preset all, also needs the emulator set up, but no
original material apart from a few tests, which are skipped without it
(Tests).
Other build variants
The preset amiga-debug builds the same code with debug symbols and
without stripping, into build/amiga-debug/. An IDE such as CLion can
use the presets as its CMake profiles; the repository’s
development notes
explain that, and the second profile for the tools of the host side.