I guess I'm not the only one that doesn't have access to a classic Amiga anymore, but still would like to compile the odd program for it. I setup cross-compilers to do so and thought I should share the experience and binaries I have.
First you need to get the files for your plattform. Provided on this page are the following (only binaries, source or diffs are available at GeekGadgets):
These archives should be unpacked into /usr/local. Normally done with 'tar jxf /path/to/binutils-2.14.tar.bz2', 'tar jxf /path/to/gcc-2.95.3.tar.bz2' and 'tar jxf /path/to/gcc-3.4.0.tar.bz2' if /usr/local is the current directory. If you installed the OS4 cross-compilers already these will happily live in the same folder as those. If you didn't, issue this command after extraction: 'export PATH=/usr/local/amiga/bin:$PATH'. Add it to .bashrc or where you seem fit. Try the newly installed cross-compiler with this command: 'm68k-amigaos-gcc -v' it will tell you what version of gcc you have installed.
Version 2.95.3 of gcc contains the c and c++ compilers, except
for ppc-linux, couldn't get c++ to compile there. I will see if I can
fix that anytime soon. Lack of ppc-linux doesn't help :). gcc 3.4.0
includes c, c++ and objc support.
First off, get ixemul, libnix and libamiga and unpack these in /usr/local. They should install includes and libs into /usr/local/amiga/m68k-amigaos/include and /usr/local/amiga/m68k-amigaos/lib.
Second, get NDK
(includes only) and unpack into /usr/local, it
should install includes into /usr/local/amiga/m68k-amigaos/sys-include.
These linklinbs are pretty common as well (I've compiled these,
except libm, but haven't been able to test them properly. Can't see why
they shouldn't work though):
libm, zlib, bzip2, libpng, jpeg, libmad, libogg and libvorbis. These
should all be extrated into /usr/local.
This should be enough to compile programs. To test enter this small program:
Save as hello.c and issue this command: 'm68k-amigaos-gcc hello.c -o hello' ('m68k-amigaos-gcc hello.c -o hello -noixemul' to compile with libnix instead). If everything was setup correctly, this should've built the hello program.
That's about all there is to it. Now start hacking away :)