Building the 68000 cross compiler - Automated

I've made the 68000 cross compiler build process previously described here into an automated script that will download, unpack and compile all of the necessary components to get a fully working 68000 C/C++ toolchain up and running. The only prerequisite is that you have MinGW/MSYS installed, and have an internet connection to download the rest. The whole process takes about 3-4 hours on my I7 920 machine, but if you would strip out the C++ compilers and libraries, it'd be much faster.

The script installs into c:\outrun\gcc by default. You can modify it by changing the following line in the script: # Settings.
PREFIX=/c/outrun/gcc

Installing MinGW

Required:

Download the installer from www.mingw.org, run it and click Install. Leave the installation directory at c:\mingw (or change it, it doesn't really matter). For convenience, make sure 'install the graphical user interface' is selected and click 'continue'. Wait for the download and click 'continue' again.

The MinGW Installation Manager will start. Pick the following packages from 'Basic Setup':

Select 'Update Catalogue' from the Installation menu, click 'Review changes' and 'Apply'. Download will start and packages will be installed. You can always restart the installation manager later if you need additional packages. Once complete, click 'Close' twice.

Alternatively, if you didn't install the graphical user interface, or anything except the bare MinGW, you can run the following from its installation folder: bin\mingw-get.exe install msys-base mingw32-base

Now navigate to the MSYS installation folder (c:\mingw\msys\1.0).

If your Windows user name contains spaces or other non 7-bit ASCII characters, edit msys.bat and add the following line at the top: SET USERNAME=SomeUser

Now start msys.bat and make sure you have sufficient user privileges or the thing may just hang. In the prompt, type: /postinstall/pi.sh Type 'y' twice, and enter 'c:/mingw' for the MinGW installation directory.

Running the automated build script

Required:

Download the script above and place it in your MSYS home folder. Modify the output path if you need to as specified above, and run the script. If your user name didn't contain any spaces (as mentioned above) it'll start downloading packages and building binutils, gcc and the standard libraries.

In the odd case that you get a popup asking to insert a disk in a removable drive E: or I:, this is some sort of quirk of the MinGW prebuilt GCC binaries - at least at version 4.8.1-4/2013072200. The easiest way around that is to either insert some disk or change its drive letter.

Wait for it

Once complete, you'll have a functional 68000 assembler and C/C++ compiler, and standard libraries. All you'll need from here is a linker script and some startup code to build some basic executable.

For convenience, you can add c:\outrun\gcc\bin to your Windows %PATH% variable, either in the user settings (Computer → Properties → Advanced system settings → Advanced → Environment variables), or in a batch file you'll be using later on to set up your build environment.

This should complete the set; a cross-assembler, C and C++ compilers, linker, and standard C and C++ libraries. Provided that everything succeeded, you'll only need the destination folder you used (through --prefix), and you can throw away the temporary folders in the MSYS home directory.

References

Contact