barryharris.me.uk
Wednesday, 10 March 2010, 19:36
4dwarrio

Guide to Compiling FB Alpha using MinGW with GCC 4.4.1 (Experimental)

This guide will help you to setup an environment to compile FB Alpha using MinGW and GCC version 4.4.1. For some people, version 4 of GCC is still considered experimental. That said it is now progressing and appears to be reliable, though this still remains an experimental way to build FB Alpha.

I have listed the version number of each package used, these are current at the time of writing and it is advised that you use these versions unless you are capable of fixing any problems that arise from not using them.

The guide is aimed at people who have basic Windows skills and can understand instructions such as download and extract.

Note - this guide is intended for use with FB Alpha versions 0.2.97.05 and newer.

Initial Setup

Create a folder on your computer for the MinGW files. For the purpose of this guide, the folder we will be using is c:\mingw441.

MinGW

The first thing we need to do is download the MinGW packages that we will be using. These can all be downloaded at http://www.mingw.org. Currently, GCC 4.4.1 is not officially available at the MinGW website. Instead, this will need to be obtained from http://www.tdragon.net/recentgcc/. You will need the following packages to build FB Alpha:

MinGW RunTime (3.16)
Both the dll and dev packages.
BinUtils (2.19.1)
Win32API (3.13)
MinGW32Make (3.81-20090910)
GCC 4.4.1 Core (4.4.1-tdm-1)
GCC 4.4.1 G++ (4.4.1-tdm-1)

These packages need to be extracted to the folder created in the Initial Setup stage. If you extract them in the above order (replacing any files when prompted) you should have no problems.

DirectX 8.0 for MinGW

The kind people of the Allegro project have made DirectX 8.0 files for MinGW available. You can download them at http://alleg.sourceforge.net/wip.html under the Miscellaneous Files section. The file is called dx80_mgw.zip. Download this file and extract it into your MinGW folder, again replacing any files when prompted.

GNU Utils

We need some small helper programs to help with the build. The MAME project also uses these programs and they can be downloaded at http://mamedev.org/tools/. The file is called mame-gnulike.exe. Download this file and extract it into your c:\mingw441\bin folder.

NASM

We also need NASM to assemble some of the CPU cores, and other modules. NASM can be downloaded at http://www.nasm.us. The version used in this guide is 2.07. The file to download is nasm-2.07-win32.zip. Download this file and extract it to a temporary location. Place the nasm.exe file in your c:\mingw441\bin folder.

Perl

Perl is required to dynamically generate the driverlist and some other modules. Perl can be downloaded at http://www.activestate.com/activeperl/. The version used in this guide is 5.10. Setup is as easy as downloading and installing. The installer should add it's bin folder to your PATH environment variable.

FB Alpha Source

Download the FB Alpha source code and extract it into a folder on your machine. For the purpose of this guide we will be using c:\fbasrc. After the source is extracted open a command prompt window and change to the c:\fbasrc folder. This can be achieved by typing (substitute your FB Alpha source folder where appropriate);

cd \fbasrc

and pressing Enter.

Next, we need to add the compile environment to our path. To do this, type the following (substitute your MinGW folder where appropriate);

path=c:\mingw441\bin;%PATH%

and press Enter.

Finally, type;

mingw32-make mingw441

and press Enter.

This will build the program and take between 5 and 15 minutes depending on your computer. When the build is complete you will have an fba.exe to run.

If you are looking to do any development work, then it may be useful to turn on the debug features. Simply uncomment the

DEBUG = 1

line in the main makefile to build a debug version of the program.