Cross-compiling / 2016-01-10 13:35:12
One possibility is to use a PC, running Windows and Cygwin, to develop, compile, and test Classic AmigaOS programs, using WinUAE, before transferring them to a Classic Amiga. To cross-compile classic AmigaOS programs on Windows, there are two choices:
AmiDevCpp
TBP
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:
- 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.
- 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:
- 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/.
- 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.
- Download the LibNIX v1.2 libraries at libnix-1.2.tar.bz2. Extract the content of libnix-1.2.tar into /usr/local/.
- Download the IXEmul v48.0 libraries at ixemul-48.0.tar.bz2. Extract the content of ixemul-48.0.tar.bz2 into /usr/local/.
- At this point, in Cygwin, typing:
/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
Update 2016/01/10: if you receive:
C:/Cygwin/usr/local/amiga/bin/m68k-amigaos-gcc.exe:
error while loading shared libraries: cygintl-3.dll:
cannot open shared object file:
No such file or directory
then copy the file cygintl-3.dll into C:\Cygwin\bin.
- Then, the following piece of code should compile and run on your classic Amiga or in WinUAE:
#include <stdio.h>
int main()
{
printf("Hello World!\n");
return 0;
}
- Enjoy!
|