theaquamarine / Saturn-SDK-GCC-SH2

A cross-compiled verison of GCC (targeted at Hitachi SH-2) for creating SEGA Saturn homebrew games

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SEGA SATURN HITACHI SUPERH SH-2 GCC C COMPILER

This is an optimised version of the GCC C compiler for Hitachi SuperH SH-2 microprocessors.

GitHub Actions | miracoli/Saturn-SDK-GCC-SH2

BUILDING

Currently, only GNU/Linux and Windows are actively supported as build targets. Other operating systems may work with modification to the build files. If you have made changes to build on a non-supported operating system, please use GitHub to make a pull request. All new build platforms are very much appreciated.

Mac OS X is supported by way of Misty De Meo.

In order to successfully build GCC, the following environment variables need to be defined:

export SRCDIR=$(pwd)/source

export BUILDDIR=$(pwd)/build

export TARGETMACH=sh-elf

export BUILDMACH=x86_64-pc-linux-gnu

export HOSTMACH=x86_64-pc-linux-gnu

export INSTALLDIR=$(pwd)/toolchain

export SYSROOTDIR=$INSTALLDIR/sysroot

export ROOTDIR=$(pwd)

export DOWNLOADDIR=$(pwd)/download

export PROGRAM_PREFIX=saturn-sh2-

PROGRAM_PREFIX is the prefix used before the tool's name, such as: saturn-sh2-gcc, where gcc is the program, with saturn-sh2- being the prefix. BUILDMACH is the development machine the compiler will run on.

The HOSTMACH is the system architecture the compiler will run on, while the TARGETMARCH is the architecture the program or library created from the Saturn SH-2 compilerwill run on.

BUILDMACH is used for cross-compiling, set it to the current machine's build architecture, and the HOSTMACH to the platform the generated compiler will run on. When not cross-compiling, set both HOSTMACH and BUILDMACH to the same value.

Depending on the operating system the compiler is built on, additional tools may be required. For cross-compiling for Windows, MinGW-w64 (i686 or x86_64) will be required on GNU/Linux systems.

There are no Windows batch files for compilation of the compiler on a native Windows install. MSYS with MinGW-w64 or Cygwin may work, though they have not been tested.

SKIP_DOWNLOAD can be set to any string to skip the call to download.sh, for example if the dependency tarballs have already been downloaded using something else.

After the environment variables are set, run build-elf.sh.

About

A cross-compiled verison of GCC (targeted at Hitachi SH-2) for creating SEGA Saturn homebrew games


Languages

Language:Shell 100.0%