There are multiple ways to create your own Homebrew for the Sega Saturn, one is to use the official SDK but a much better way is to use one of the open-source modern development kits available.
LibYaul is an open source SDK based on GCC 8.2.0 and is supported on Windows, Linux and MacOSX, although I couldn’t fully run it on OSX but the toolchain executables themselves build fine.
Compiler name - GCC Compiler Version - 8.2.0
We need to clone the repository and initialise the submodules before building the SDK.
git clone https://github.com/ijacquez/libyaul.git
cd libyaul
cp yaul.env.in .yaul.env
source .yaul.env
git submodule init
git submodule update -f --recursive
For Mac OSX make sure you have brew install and run the follopwing in a new terminal window:
brew install make gcc wget unzip zip p7zip diffutils dos2unix gpatch
Before building the rest of the SDK you have a choice, you can either downloads the pre-build SDK if its available for your platform or compile it yourself. Honestly I would just download the pre-built version if OSX was supported but sadly I had to go through these steps:
cd build-scripts
cp -v config{.in,}
./build-compiler
If it fails with missing dependencies such as gpg
then use your platforms package manager to install it, for example on OSX:
brew install gpg md5sha1sum
If it fails with errors about isl
functions missing then you will need to apply this patch by finding the downloaded gcc source (normally in tmp) and using this diff:
--- .../gcc/graphite.h 2018-01-03 11:03:58.000000000 +0000
+++ .../gcc/graphite.h 2018-07-29 17:42:55.836121000 +0000
@@ -37,6 +37,8 @@
#include <isl/schedule.h>
#include <isl/ast_build.h>
#include <isl/schedule_node.h>
+#include <isl/id.h>
+#include <isl/space.h>
This fix is from the official GCC Bugzilla 86724 – Compilation error with new isl 0.20 (missing includes)
To build run the following command:
SILENT=1 make install-release
Unfortunately I couldn’t get this to work on OSX but for anyone interested in getting further I have added some notes below.
Strangely even when you have clearly defined $YAUL_INSTALL_ROOT
to a valid non-relative path such as /opt/tool-chains/sh2eb-elf
it will still give this error.
Even running mkdir to make sure it exists doesn’t help but you can try if you want:
mkdir -p $YAUL_INSTALL_ROOT
Not sure how to fix this yet, apparent from commenting out the check for this in env.mk
. Or just changing the ifneq
to ifeq
.
If you get the following error:
/opt/tool-chains/sh2eb-elf/bin/sh2eb-elf-as
sh2eb-elf tool-chain has not been installed properly (see build-scripts/)
make[1]: *** [check-tool-chain] Error 1
make: *** [/Users/alasdairmorrison/libyaul/build] Error 2
Then you need to make sure you have followed the Toolchain build instructions above and it is able to find the environment variables.