Compiling for the 276 in 1 JAMMA board

These instructions show how to build binaries for the 276 in 1 JAMMA board. These instructions probably do work for the other XXX in 1 JAMMA boards that have an SD card on the board.

This is a bit of a crash course in cross-compiling. Before we dive in here is the objective: Get the build process for whatever you are building to use the compiler and libraries in the toolchain we will install. This might happen via changes to the Makefile, CFLAGS, LDFLAGS, or options to the configure script.

I ran all of these instructions on an install of Ubuntu 12.04(Precise Pangolin) on  32bit install. If you are using a 64bit install you will probably need to install the ia32-libs package via apt-get to make the cross compile toolchain work.

Setup

  1. Install the build-essential package: sudo apt-get install build-essential
    build-essential is a meta package which installs a few very common and always needed tools and libraries for compilation.
  2. Get the cross compile toolchain from the mini6410-debian project
  3. Extract the tar.gz file downloaded to root /: sudo tar xzvf arm-linux-gcc-4.5.1-v6-vfp-20101103.tar.gz -C /
  4. Add /opt/FriendlyARM/toolschain/4.5.1/bin/ to your PATH: export PATH=$path:/opt/FriendlyARM/toolschain/4.5.1/bin
    It would be a good idea to add this to your .bashrc or .profile

Build prerequisite SDL library

  1. Get the source for SDL 1.2 from the SDL project.
  2. Extract the source code: tar -zxvf SDL-1.2.15.tar.gz
  3. cd SDL-1.12.15/
  4. Run the configure utility with some extra options: CFLAGS=”-mno-thumb-interwork” ./configure –host=arm-none-linux-gnueabi –enable-static –prefix=/opt/FriendlyARM/toolschain/4.5.1 –disable-pulseaudio
    The option in CFLAGS was required to get the gcc compiler to not use certain assembly instructions the board doesn’t support. The –host option tells the configure script this is a cross compile for arm-none-linux-gnueabi. –enable-static means that all the dependencies for and resulting executables will be built-in. –prefix makes it install the resulting libraries and code in the location provided. –disable-pulseaudio does exactly what it says. I found that pulseaudio was not easy for me to get built so I dropped it since none of the original emulators used it.
  5. Run: make
    This does the compile. It will take bit to finish.
  6. Run: sudo make install
    This installs all the stuff built by make.
  7. Make a symlink for sdl-config: ln /opt/FriendlyARM/toolschain/4.5.1/sdl-config /opt/FriendlyARM/toolschain/4.5.1/bin/arm-none-linux-gnueabi-sdl-config
    This link is required so that when we are doing cross compiles that the sdl-config executable looks like it is part of the toolchain

Note that if you building anything other than AdvanceMame you might need other dependencies. These instructions intend to be a rough outline and not a script. Its very likely that they won’t work if anything is different.

Building AdvanceMAME

  1. Get the source for AdvanceMame.
  2. Extract it: tar -zxvf <filename>
  3. cd advancemame-1.2/
  4. Run the configure script with a bunch of options: CFLAGS=”-mno-thumb-interwork” LDFLAGS=”-L /opt/FriendlyARM/toolschain/4.5.1/lib/” ./configure –host=arm-none-linux-gnueabi –enable-static –enable-sdl –disable-kraw  –prefix=<SOMETHING IN YOUR HOME DIRECTORY>
    The LDFLAGS are needed to make sure the linker can find the libraries we installed for SDL. –enable-sdl makes sure we build AdvanceMAME with SDL support. –disable-kraw disables the raw keyboard input type since it doesn’t work right on the board. –prefix is the install target. Make a directory in your home directory to install to so its easy to get the entire install of AdvanceMame over to the SD card. Use this path for the prefix.
  5. Run: make
  6. Run: make install
  7. You have a complete install of AdvanceMame now in the prefix directory you specified. You can copy the contents of that over to your sdcard and use it.

I did not cover how to modify a Makefile for cross compilation because it is considerable more involved than just an option to configure. The short version is that you’ll need to go in the file and make sure it uses the libraries and utilities in the /opt/FriendlyARM/toolschain/4.5.1 directory instead of the ones on your system.

Comments are closed.