Wiki

Clone wiki

agtools / Host Development Environments

All Host Systems

Requirement for user- or system-configured environment variables has recently been removed! Please make sure that AGTROOT, AGTBIN env vars are no longer defined globally in your environment.

Integration with Atari GCC compiler toolchains has also been simplified.

If you are using Vincent Rivière's Atari-MiNT GCC 4.6.4, you must ensure GCC is on your $PATH. Confirm this is the case with:

> m68k-atari-mint-gcc -v

If you are using ggn's ELF GCC compiler builds or Mikro's GCC builds, these can be installed locally anywhere and it is not required that they are on $PATH. They should be configured via agtools/makedefs. See details below.

Please also make sure that any pre-existing agtools/bin directory is no longer on your $PATH. This could interfere with recent versions of the project which should operate in a self-contained way.

Configuring various GCC compiler versions

1) Vincent's MiNT GCC v4.6.4 (this is the AGT default-configured toochain):

IMPORTANT: This is a system-wide install to /opt/cross-mint/ which must have the gcc bin/ directory on $PATH

# 'default'(or 'vincentcc')/'browncc'/'mikrocc'
USE_COMPILER=default

# set GCC version here
GCC_VERSION=4.6.4

# set=yes if GCC install is portable/install-anywhere (=no for default/vincentcc)
GCC_PORTABLE_PACKAGE=no

2) Mikro's GCC builds. These are fully-localised/install-anywhere builds. They are configured differently. They do not need to be installed on the $PATH.

# 'default'(or 'vincentcc')/'browncc'/'mikrocc'
USE_COMPILER=mikrocc

# set GCC version here
# [4.6.4], [7.5.0]
GCC_VERSION=7.5.0

# set=yes if GCC install is portable/install-anywhere (=no for default/vincentcc)
GCC_PORTABLE_PACKAGE=yes

# set GCC install path for portable/install-anywhere case (browncc/mikrocc)
GCC_INSTALL=~/gnu-tools/m68000
#GCC_INSTALL=~/gnu-tools-464/m68000

3) ggn's ELF compiler builds, also install-anywhere (supports up to GCC version 12.1.0 !!!)

IMPORTANT: This version produces ELF binaries which we convert to TOS using a special tool (shipped with AGT and also in the compiler package). The conversion step is automatic in AGT.

# 'default'(or 'vincentcc')/'browncc'/'mikrocc'
USE_COMPILER=browncc

# set GCC version here
# [4.6.4], [6.2.0], [7.1.0], [10.2.0], [12.1.0]
GCC_VERSION=12.1.0

# set=yes if GCC install is portable/install-anywhere (=no for default/vincentcc)
GCC_PORTABLE_PACKAGE=yes

# set GCC install path for portable/install-anywhere case (browncc/mikrocc)
GCC_INSTALL=$(AGTROOT)/gcc/browncc-12.1

ggn's latest GCC (v12.1.0 at time of writing, for Windows).

Just extract the browncc-x.y/ subdirectory somewhere and point GCC_INSTALL (in makedefs) at this.

Windows 32bit or 64bit:

Cygwin/32:

Compiler Tools:

Atari MiNT GCC 4.6.4 is initially recommended

Vincent's GCC package for Cygwin

This is the recommended place to start for Cygwin since the compiler package is ready to use after installation with no other changes. There are newer compilers available which also work with Cygwin but may require some minor config changes. See GCC configuration guide above.

Assuming that you are using Vincent's GCC 4.6.4 with Cygwin, check your compiler is ready with:

> m68k-atari-mint-gcc --version

GNU Make:

Use the Cygwin package installer to set this up if missing. Check it with:

> make --version

GIT SCM:

Optional, but preferred for keeping the source repo up-to-date, compared with downloading the .zip snapshots. If you don't have experience with GIT, better stick with the .zip files until you're comfortable with it.

(There are also several GUIs available for GIT on Windows).

MacOSX/Darwin:

AGT has been tested on MacOS/x64. Native M1 support is not yet provided but native binaries of most tools can be built locally from the repo if required.

Note: Tweaks to config.sh may be required to allow AGT to find the bin/Darwin/aarch64 tool directory for that architecture as they will currently be redirected to the x64 binaries. Also note that a few optional binaries are not available as source so it may be better to stick with x64 to retain access to more of the tools.

MacOS has been tested with Vincent's Atari-MiNT GCC 4.6.4 but should also work with Mikro's builds.

Linux:

Setup requirements for Linux have significantly changed (for the better).

Linux has recently been tested with Mikro's GCC builds and is the recommended place to start.

AGT was also tested some time ago with a version of Vincent's GCC distro for Ubuntu. If support for this stops or is incompatible with your distro, some self-build options are indicated on his page (or consider Mikro's builds).

The main prerequisite for AGT is the compiler toolchain. Some recommended options listed towards the end.

The most recently tested environment is actually RaspberryPI OS 64bit (aarch64). Tool binaries are provided for this in the repo itself since it is a very specific case. Other Linux environments will need to build their own tools locally. (See notes/patch below for building an RPI-hosted 68k compiler).

Note that not all tool binaries are available currently on Linux. Most can be compiled directly from the repo but a few optional tools are not available as source. If these are required they can still be used on x86 Linux systems by wrapping the Windows binaries with WINE.

Wine Windows emulator

> sudo apt-get install wine-stable

GIT: Non-Windows Systems:

If using GIT from the commandline, obtain an initial clone of the source repo with the command below. You only need to do this once.

> git clone https://d_m_l@bitbucket.org/d_m_l/agtools.git

To pull new changes from BitBucket use:

> git pull

Note: GIT can be 'fun' at times, so practise & experimentation is recommended if you are not familiar with it.

GIT: Windows Systems:

On Windows you may use TortoiseGit, Tower, SmartGIT or any other GUI version you happen to like. Otherwise you can use GIT in the same way as for non-windows systems (commandline version) after installing it via the Cygwin package mananger or as native Windows tools.

CAREFUL: when fetching/building repos under Cygwin, make sure GIT is configured to keep line endings in Unix form. By default, GIT for Windows tends to convert to DOS/CRLF and will break all bash scripts.

Set autocrlf to input (or false) in your GIT user or repo config to prevent auto conversion.

[core]
    autocrlf = input

Omitting this change can break builds of browncc, mikrocc and other tools.

GCC Compiler Toolchains

For systems which support it (particularly Cygwin), Vincent's GCC 4.6.4 is probably the best place to start.

For other systems, or where a newer compiler is preferred (and with a little extra effort) it is possible to use other options. Newer compiler versions can generate better code (certainly not always - but performance improvements have been seen in the samples with GCC 6.2 onwards).

Mikro's GCC repo (build from source)

One alternative is Mikro's 4.6.4 repo, which is perhaps the next closest equivalent to Vincent's package. This one however installs locally in the user's home directory under ~/gnu-tools-4.6.4 instead of globally under /opt/cross-mint as Vincent's package does.

Mikro's version has been tested with AGT on RaspberryPI OS 64bit

https://github.com/mikrosk/m68k-atari-mint-build/tree/gcc-4.6.4

This can be built with the following make command:

make m68000-skip-native

This package requires some configuration changes to agtools/makedefs. See configuration guide above for details on configuring AGT to use this.

The master branch of this repo provides a newer version of GCC (v7.5.0 at time of writing) and is available here:

https://github.com/mikrosk/m68k-atari-mint-build/tree/master

Again, see configuration guide above for details on configuring AGT to use this.

Special note for RaspberryPI-OS/64

It is possible to build the mikrocc toolchain for RPI with a minor script patch, available from downloads:

https://bitbucket.org/d_m_l/agtools/downloads/mikrocc-rpi64-4.6.4.diff

The BrownELF repo (ggn/kua & dml)

This repo can produce a wide range of GCC versions (up to v12.x at time of writing) and is also built locally from source.

AGT has been previously tested with v6.2, v7.2, v10.2, v12.1

https://github.com/ggnkua/bigbrownbuild-git

Windows builds of this distro should be made using the MinGW environment. This produces statically-linked executables which can run anywhere, including under any version of Cygwin. Note that it may not build under Cygwin at all. If in doubt, grab pre-built install from ggn's site (see link above).

There are some important differences with this package - it does not produce TOS executables directly. It produces ELF binaries which are converted to TOS with an additional post-build step (integrated with AGT). This approach does not rely on patched binutils for TOS support since the post-build conversion step works for any ELF and therefore any version of GCC which can produce 68k ELF binaries. This generally means access to the latest compilers, sooner.

Other options

There are still other options for building your own compiler but I have not tested these with AGT:

https://tho-otto.de/crossmint.php

Also this link offered by Vincent Riviere:

https://launchpad.net/~vriviere/+archive/ubuntu/arm

List of tools to build from the AGT repo

These are the main tools you will need to build natively, if required:

agtools/tools/agtcut

agtools/tools/packwrap

You will also need a working version of RMAC, which can be downloaded from here:

ggn's RMAC page

...or can be built from source as required.

It is also recommended to build:

agtools/tools/3rdparty/lz77

It is recommended to obtain & build (on Linux systems or any system unable to use the provided binary):

https://github.com/emmanuel-marty/lzsa

...for access to LZSA-1, LZSA-2 asset compression

Binaries for the PhotoChrome (PCS) tool are provided in the repo but I am working to make this available as source as part of the AGT project. For now, it will need to be used from WINE if your host env does not work with the provided binaries - or just avoided. It is a useful colour mapping tool but not essential to build and use the samples.

Troubleshooting:

At least one of the sprite cutting formats (.emx) requires the 68k assembler rmac to generate the binary data for each sprite frame. agtcut will try to shell out to rmac.exe in order to do this. It expects to find rmac in the same bin directory from which it is executed - which should be the case on all systems tested so far. It is possible this could go awry on untested environments, particularly if attempting to use something like WINE to wrap agtcut for Windows on a Linux distro (hint: in this case, just build the tool natively from the repo).

If you see errors from agtcut trying to invoke rmac on a supported environment, check that rmac actually exists in the correct bin/<os>/<arch> subdirectory. Also check the content of hostinfo.txt which the config.sh script should emit when used.

Note that while I'm happy to try to support the more commonly used environments, oddball environments can be very time consuming to support and 100% host compatibility is not the point of the project - so please keep this in mind.

Updated