HOWTO

Development tools

Build an Atari cross-compiler for Linux

gcc 3.3.3 and binutils 2.13.2.1

This text tries to explain the steps to follow to setup the necessary tools to cross-compile m68k-atari-mint software on a different machine.
I have used the available patches from the Sparemint site, along with the original (gcc & binutils) archives.
These are the steps I followed to build these utilities. The power of recent machines are well superior to the Ataris, the compilation time for heavy software is greatly reduced, so we might as well use them.
Note: The mintlib is necessary (binaries and include files) to compile a cross-compiler. If you know how to build a cross-compiler only with sources files, please let me know.

Step 1: Get the necessary archives

The whole thing will be installed in a user directory, so we can compile all, without being root. For me, tools will be installed in /home/patrice/cross-tools. You can choose another one if you want. Don't mix tools for the native machine, and those for cross-compilation.
We create a cross-build directory (/home/patrice/cross-build). We change dir in it to start the work (cd /home/patrice/cross-build).

Step 2: Install binutils (for host and for mint target) (sources: 60Mb)

tar xvzf binutils-2.13.2.1.tar.gz

Step 3: Build and install the binutils for the host (compilation: 9Mb)

This step is optional, do it only if your binutils are too old, or if you don't have them. But I recommend it. If you can not do this step, maybe you can not continue further.

mkdir binutils-2.13.2.1-host
cd binutils-2.13.2.1-host
../binutils-2.13.2.1/configure
  --prefix=/home/patrice/cross-tools
make
make install
cd ..
rm -rf binutils-2.13.2.1-host

Step 4: Setup the new PATH

From now on, we must use the tools we will compile, so we add the PATH where the new tools are in front of the PATH environment variable. The same for newly build libraries (only for the host system).

export PATH=/home/patrice/cross-tools/bin:$PATH
export LD_LIBRARY_PATH=/home/patrice/cross-tools/lib:$LD_LIBRARY_PATH

Step 5: Build and install the binutils for m68k-atari-mint (compilation: 9 Mb)

cd binutils-2.13.2.1
gunzip -c ../binutils-2.13.2.1-mint-2.diff.gz | patch -p1
cd ..

mkdir binutils-2.13.2.1-mint
cd binutils-2.13.2.1-mint
../binutils-2.13.2.1/configure
  --prefix=/home/patrice/cross-tools
  --target=m68k-atari-mint
make
make install
cd ..
rm -rf binutils-2.13.2.1-mint

Step 6: Compile and install gcc for the host (sources: 148Mb, compilation: 93Mb)

tar xvzf gcc-3.3.3.tar.gz
mkdir gcc-3.3.3-host
cd gcc-3.3.3-host
../gcc-3.3.3/configure
  --prefix=/home/patrice/cross-tools
  --enable-languages=c++
make
make install
cd ..
rm -rf gcc-3.3.3-host

Step 7: Patch gcc for MiNT

cd gcc-3.3.3
gunzip -c ../gcc-3.3.3-mint.diff.gz | patch -p1
cd ..

Step 8: Compile gcc for MiNT (compilation: 66Mb)

tar xvzf mintlib-devel-0.57.4.tar.gz

mkdir gcc-3.3.3-mint
cd gcc-3.3.3-mint
../gcc-3.3.3/configure
  --prefix=/home/patrice/cross-tools
  --target=m68k-atari-mint
  --enable-languages=c++
  --with-sysroot=/absolute/path/to/mintlib-devel-0.57.4
make
make install
cd ..

Note: You must give an absolute path to the mintlib-devel root directory. This mintlib-devel directory must contains a 'usr' directory with 'usr/include' and 'usr/lib' with contains the mintlib headers and libraries files. The libraries must also have the corresponding debug version ('libc_g.a' for example).

Etape 9: Test cross-compilation

If you want to install mint libraries, you must put them, in the directory m68k-atari-mint created in the installation directory (i.e. /home/patrice/cross-tools/m68k-atari-mint). You find here the specific tree with bin, include, lib, and other directories.
When you want to cross-compile something for Atari, add '--prefix=/home/patrice/cross-tools/m68k-atari-mint' to the './configure' command-line.
Other necessary tools, available on Sparemint, to install:

News
Personnal productions
Patches
Ports
Projects
HOW-TOs
Development tools
Create a patch for binutils (binutils 2.16.1)
Create a patch for gcc (gcc 3.3.6, C language only)
Create a patch for gcc (gcc 3.3.6, C++ language)
Misc stuff

HTML 4.0 valide ! La montée de Pikes Peak Non aux brevets logiciels Nectarine demoscene radio
Write me to pmandin(at)caramail(point)com
(Address modified for spam protection)