Building MAME

From Ninerpedia
Revision as of 00:51, 1 April 2016 by Mizapf (talk | contribs) (Ubuntu)
Jump to navigation Jump to search

Here are some instructions for building MESS from source.

Windows

TODO

OSX

TODO

Linux and other Unix variants

If you decide to build MESS from source code in Linux, you should probably directly use the git repository on Github since bugs are corrected very quickly (and new ones are as quickly introduced ...).

Version 0.171 and higher

You need

  • gcc / gcc-c++ version 5
  • git
  • make
  • Development package of alsa
  • Development package of gconf2
  • Development package of gtk2
  • Development package of the SDL2 library
  • Development package of the SDL2_ttf library
  • Development package of the Qt5Core library

Use git to clone the repository to your local drive:

git clone https://github.com/mamedev/mame.git

Ubuntu

Ubuntu users need to make use of the apt-get command or check the software repository tools. For Ubuntu 11.10 and newer, the following packages are required:

**outdated**
sudo apt-get install git
sudo apt-get install libqt4-dev 
sudo apt-get install libsdl2.0-dev 
sudo apt-get install libgtk2.0-dev 
sudo apt-get install libgconf2-dev 
sudo apt-get install libsdl2-ttf-dev 
sudo apt-get install libasound2-dev
sudo apt-get install libfontconfig1-dev

This set of package installations also imports gcc/gcc-c++ and make.

openSUSE

For an openSUSE installation, either use YaST or (if not already installed) follow this path:

zypper install git-core
zypper install gcc
zypper install gcc5-c++
zypper install libSDL2_ttf-devel
zypper install libQt5Core-devel 
zypper install libQt5Widgets-devel
zypper install fontconfig-devel
zypper install alsa-devel

Compiling

You can just build the complete MAME package by running make; it includes the whole MESS emulator. If you only want the MESS part, use

make SUBTARGET=mess

For a 64-bit environment you may add PTR64=1, but it should be automatically set when you compile it on such a machine. For a quad-core machine, you can greatly speed up the compile process with -j4 (start 4 jobs).

make SUBTARGET=mess -j4

Some systems use gcc 4.8; you must upgrade to gcc 4.9 at least; better even gcc 5. Since gcc5 may co-exist with gcc 4.x by offering a special gcc-5 command, you have to explicitly specify that you want to use gcc 5 by

make SUBTARGET=mess -j4 OVERRIDE_CC=gcc-5 OVERRIDE_CXX=g++-5

When you want to get a current version, use the git pull command. Cleaning the build environment is optional, but if you experience problems when compiling, try to clean first.

git pull
make clean SUBTARGET=mess 
make SUBTARGET=mess -j4 OVERRIDE_CC=gcc-5 OVERRIDE_CXX=g++-5

Now you should have a freshly built mess executable file. Unlike previous versions, the tools like imgtool or chdman are not included. If your want to get the tools (chdman, imgtool), just specify "TOOLS=1" to make:

make SUBTARGET=mess -j4 TOOLS=1 OVERRIDE_CC=gcc-5 OVERRIDE_CXX=g++-5