Cross-compiling / 2015-05-09 06:28:51

Cross-compiling

To cross-compile classic AmigaOS programs on Windows, there are two choices:

 

AmiDevCpp

TO BE CONTINUED...

 

Cygwin and GCC

To cross-compile AmigaOS programs on Windows using Cygwin, you essentially need Cygwin and an AmigaOS cross-compiler and utils. So, you must have:

  1. A Window-operated computer and Cygwin installed: Cygwin provides a good documentation so I won't repeat it here. I will assume that Cygwin is correctly installed and works. You should include some development tools as needed, for example Flex and Bison.
  2. A cross-compiler: Zerohero provides everything that you need on this Web page, which provides all the details to install the cross-compiler without problems. Unfortunately, as of 2012/02/13, Zerohero's page is down, so I try to reproduce the steps as well as provide the required files below:
    1. Download the cross-compiler GCC v3.4.0 at m68k-amigaos-gcc-3.4.0.tar.bz2. Extract the content of m68k-amigaos-gcc-3.4.0.tar.bz2 into /usr/local/.
    2. Download the cross-compiler utils v2.14 at m68k-amigaos-binutils-2.14.tar.bz2. Extract the content of m68k-amigaos-binutils-2.14.tar.bz2 into /usr/local/amiga/bin.
    3. Download the LibNIX v1.2 libraries at libnix-1.2.tar.bz2. Extract the content of libnix-1.2.tar into /usr/local/.
    4. Download the IXEmul v48.0 libraries at ixemul-48.0.tar.bz2. Extract the content of ixemul-48.0.tar.bz2 into /usr/local/.
    5. At this point, in Cygwin, typing:
    6. /usr/local/amiga/bin/m68k-amigaos-gcc.exe -v
      

      should return:

      Reading specs from /usr/local/amiga/lib/gcc/m68k-amigaos/3.4.0/specs
      
      Configured with: ../gcc-3.4.0/configure 
                       --prefix=/usr/local/amiga
                       --target=m68k-amigaos
                       --enable-languages=c,c++,objc 
                       --enable-haifa
                       --enable-sjlj-exceptions
                       --disable-shared 
                       --disable-libstdcxx-pch
      Thread model: single
      gcc version 3.4.0
      
    7. Then, the following piece of code should compile and run on your classic Amiga or in WinUAE:
    8. #include <stdio.h>
      int main()
      {
          printf("Hello World!\n");
          return 0;
      }
      
    9.  Enjoy!