Home Page

Sticky: How to compile SDLMAME! (Read me first!)

Posted By: R. Belmont

Sticky: How to compile SDLMAME! (Read me first!) - 10/29/07 03:48 PM

Like I said elsewhere, this thread is for people to post what needs to be done to compile SDLMAME on a base install of an OS or Linux distro. It is NOT for discussion or support - if you are unable to build SDLMAME with these instructions, please start a new thread!

To kick off, for Fedora 18/19/20:
Code:
yum install gcc gcc-c++ SDL-devel libXinerama-devel qt-devel expat-devel fontconfig-devel SDL_ttf SDL_ttf-devel


If you are using a joypad or joystick (including wired USB Xbox 360 controllers), you'll need to make sure those drivers are installed as well:
Code:
yum install kernel-modules-extra


Updated Dec, 2013: Updated for Fedora 20 and latest MAME/MESS.
Posted By: play0r

Re: SDLMAME distro cookbook - 10/29/07 04:17 PM

Ubuntu 11.10 (should also work for Kubuntu)
Code:
sudo apt-get install build-essential subversion libsdl1.2-dev libgtk2.0-dev libgconf2-dev libsdl-ttf2.0-dev 


For Ubuntu 12.10 make that:
Code:
sudo apt-get install build-essential subversion libsdl1.2-dev libgtk2.0-dev libgconf2-dev libsdl-ttf2.0-dev gcc-4.6 g++-4.6


And for 14.04 make that:
Code:
sudo apt-get install build-essential subversion libsdl1.2-dev libgtk2.0-dev libgconf2-dev libsdl-ttf2.0-dev gcc-4.6 g++-4.6
sudo apt-get install libqt4-*


On 12.10, for MAME versions 0.147u5 and later 12.10 will be auto-detected and it will prompt you to install gcc-4.6 and g++-4.6 if you haven't already. If you do have them installed, it will build automatically. For 0.147u4 and earlier, you must "make DISTRO=gcc46-generic".

I believe this should be all you need, if not please correct me.

play0r

[RB - updated July 2014 for 14.04 and latest MAME/MESS]
Posted By: judge

Re: SDLMAME distro cookbook - 10/29/07 07:34 PM

OS X:
- Install latest Xcode
- Install latest SDL development libraries
- make TARGETOS=macosx
- Add BIGENDIAN=1 to the line above when building for a PowerMac system

[RB - updated PPC instructions]
Posted By: judge

Re: SDLMAME distro cookbook - 10/30/07 07:33 AM

For a FreeBSD system with an up to date ports tree:
- cd /usr/ports/emulators/sdlmame
- su
- make
- make install

That will automatically download, compile, and install sdlmame and all needed dependencies.

If you want to build from the latest u-update, make sure you have done the above at least once to get the needed dependencies and from there on it's just a matter of issuing the appropriate make commands.


Sadly enough, there doesn't seem to be a PBI for pcbsd yet for either sdlmame or sdlmess.
Posted By: billb

Re: SDLMAME distro cookbook - 05/24/08 02:32 PM

For Yellow Dog 6 (assuming Software Development checked during install)

Code:
yum install gcc SDL-devel expat-devel zlib-devel mesa-libGL-devel gtk2-devel GConf2-devel


Detailed instructions
Posted By: couriersud

Re: SDLMAME distro cookbook - 07/19/08 10:04 PM

Ubuntu 8.04 (Hardy Heron)
Code:
sudo apt-get install build-essential libsdl1.2-dev libgtk2.0-dev libxinerama-dev libgconf2-dev


Tested on a fresh install from the Live-CD.

Posted By: R. Belmont

Re: SDLMAME distro cookbook - 08/26/08 02:12 AM

For Debian and friends with OSS4, you may not get sound using the default libsdl1.2debian-alsa package. Replacing it with libsdl1.2debian-oss and specifying the sound driver for SDLMAME as "dsp" should work. (Thanks Rhapsody!)
Posted By: jrcmilanez

Re: SDLMAME distro cookbook - 09/06/08 06:20 PM

For Mandriva users:

1 - install your system with development packages
2 - get libsdl-devel package via urpmi
3 - edit SDLMAME makefile with your requirements
4 - make!
Posted By: Cyberzinho Punk

Re: SDLMAME distro cookbook - 10/11/08 10:33 AM

For Slackware Linux users:

$ unzip sdlmamexxx.zip
$ cd ./sdlmamexxx
$ mcedit makefile //and edit for your requirements
$ make

Dependencies:

GConf (ftp://ftp.gnome.org/pub/GNOME/sources/GConf/)
ORBit2 (ftp://ftp.gnome.org/pub/GNOME/sources/ORBit2/)
intltool (ftp://ftp.gnome.org/pub/GNOME/sources/intltool/)
Posted By: ElBarto

Re: SDLMAME distro cookbook - 12/05/08 01:20 AM

Originally Posted By judge
For a FreeBSD system with an up to date ports tree:
- cd /usr/ports/emulators/sdlmame
- su
- make
- make install

That will automatically download, compile, and install sdlmame and all needed dependencies.

If you want to build from the latest u-update, make sure you have done the above at least once to get the needed dependencies and from there on it's just a matter of issuing the appropriate make commands.


Sadly enough, there doesn't seem to be a PBI for pcbsd yet for either sdlmame or sdlmess.


I've updated the ports for sdlmame and sdlmess and also created a sdlmame-devel ports for u release.
They are not in the current ports-tree yet (I've opened PR but the original commiter seems dead ...).
Just get the tgz at http://distfiles.arcadebsd.org/ports rm the current directory and extract the new one.
I've removed the useless wrapper script and sdlmame and sdlmess use .mame and .mess respectively (sdlmame-devel use .mame-devel to avoid configuration problems).
Posted By: couriersud

Re: SDLMAME distro cookbook - 12/06/08 01:16 PM

Ubuntu 8.10 (Intrepid Ibex) (also applies to Kubuntu 8.10 and Xubuntu 8.10 and any other *buntu 8.10)
Code:
sudo apt-get install build-essential libsdl1.2-dev libgtk2.0-dev libxinerama-dev libgconf2-dev
sudo apt-get install gcc-4.2

On 32bit:
Code:
make CC=@gcc-4.2 LD=@gcc-4.2

On 64bit:
Code:
make CC=@gcc-4.2 LD=@gcc-4.2 PTR64=1

You may of course edit the makefile as well.

gcc 4.3 exhibits certain bugs when compiling mame both in 32bit and 64bit. Therefore we need to explicitly specify CC and LD to use gcc 4.2.

Tested on a fresh install from the Live-CD as well as on my regular system.

Note: If you do not need pbuilder you may "apt-get remove" gcc-4.3 as well. But then you have to create the link "/usr/bin/gcc" yourself. mad
Posted By: R. Belmont

Re: SDLMAME distro cookbook - 12/10/08 04:19 PM

Please do not ask questions in this thread, it is for reference only.
Posted By: Cyberzinho Punk

Re: SDLMAME distro cookbook - 12/24/08 09:58 PM

For Slackware Linux 12.2 users:

$ unzip sdlmamexxx.zip
$ cd ./sdlmamexxx
$ mcedit makefile //and edit for your requirements
$ make

Dependencies:

GConf (ftp://ftp.gnome.org/pub/GNOME/sources/GConf/)
ORBit2 (ftp://ftp.gnome.org/pub/GNOME/sources/ORBit2/)

Note: intltool is no more a dependence to compile SDLMAME on Slackware Linux 12.2 because this package is included on this Slackware release.........
Posted By: roothorick

Re: SDLMAME distro cookbook - 12/29/08 12:53 PM

Gentoo:

The Gentoo official method is:

mkdir -p /etc/portage
echo "app-emulation/sdlmame ~arch" >> /etc/portage/package.keywords
emerge sdlmame

That will get you 0.127 installed on your system. It looks like there's no set location for ROMs; just keep them in your home dir I guess.

Personally, 0.127 isn't new enough for me, so I added a location in my home directory to my PATH, and I manually compile sdlmame, and copy the binary there.
Posted By: Juryiel

Re: SDLMAME distro cookbook - 03/10/09 08:29 AM

PPC64 (done in Gentoo and version sdlmame0.130 here):

Code:
In src/emu/eigccppc.h, change all instances of bne-- to bne-
In src/osd/sdl/osinline.h, change all instances of bne-- to bne-

then with a terminal in the sdlmame directory just do
Code:
make BIGENDIAN=1 PTR64=1


Should work well smile
Posted By: powtrix

Re: SDLMAME distro cookbook - 06/08/09 04:27 PM

Hi all
I use a script to do all in one time (tested on slamd64/slackware64). No Gconf needed.


How to use:
Code:
source$ ./sdlupdate.sh ~/your/stuff/sdlmame0132.zip


Code:
#!/bin/bash
#Script para atualizar o SDLMAME
#data: 2009.04.07 22:25 25'

SDLMAMEDIR=~/emu/sdlmame   #where it will copy the binary files
SDLMAMEFILE=`echo $1 | cut -d "/" -f8`   #get only filename, fix w/ your dir
SDLMAMEVER=`echo $SDLMAMEFILE | cut -d "." -f1`   #return version

if [ ! -e "$1" ]; then
  echo OOPs! arquivo \"$1\" inexistente. && exit 1
#fi
elif [ -e $SDLMAMEVER ]; then
  echo Removendo $SDLMAMEVER atual...
  sleep 2
  rm -rfv $SDLMAMEVER || exit 1
  echo && sleep 2
fi

echo Descompactando $SDLMAMEVER ...
unzip $1 && cd $SDLMAMEVER || exit 1
echo

if [ -e makefile ]; then

  echo Aplicando patch para compilar sem Gnome ...
  patch -p1 -i ../sdlfix-2.diff || exit 1
  echo
  
  time make -s PTR64=1 -j5 || exit 1
  echo

  for file in `find . -type f -maxdepth 1`; do 
    if [ -x $file ]; then
      echo Copiando $file ...
      cp -rfv $file $SDLMAMEDIR || exit 1
      md5sum -b $file && md5sum -b $SDLMAMEDIR/$file || exit
    fi
  done
  
fi

Posted By: R. Belmont

Re: SDLMAME distro cookbook - 06/08/09 04:31 PM

Yeah, that will break the debugger. SDLMAME is for developers first, game players second. I've removed your patch. I've repeatedly outlined the parameters of a patch that would be acceptable to make that dependancy optional and the patch posted is NOT it. You GNOME-o-phobes need to do it right.
Posted By: Cyberzinho Punk

Re: SDLMAME distro cookbook - 09/01/09 07:08 PM

For Slackware Linux 13.0 users:

$ unzip sdlmamexxx.zip
$ cd ./sdlmamexxx
$ mcedit makefile //and edit for your requirements
$ make

Dependencies:

GConf (ftp://ftp.gnome.org/pub/GNOME/sources/GConf/)
ORBit2 (ftp://ftp.gnome.org/pub/GNOME/sources/ORBit2/)
Posted By: Fuzzypig

Re: SDLMAME distro cookbook - OSX Snow Leopard - 09/12/09 09:13 PM

Apple OSX 10.6 Snow Leopard

Changed the compilation routine slightly:

This is what I did:

OS X:
- Install latest Xcode
- Install latest SDL development libraries
- Unzip SDL Mame ZIP

Edit supplied makefile:

change both lines starting with CFLAGS ( lines 305 and 307 )
append to end of both lines the directive: -m32

Then after line 597 ( $(AR) -cr $@ $^ ) add this line:

ranlib $@

Then compile as normal: make TARGETOS=macosx
Posted By: R. Belmont

Re: SDLMAME distro cookbook - OSX Snow Leopard - 09/12/09 10:11 PM

What is the intent of those changes? I am able to build on 10.6.1 without any modifications to the makefile.
Posted By: judge

Re: SDLMAME distro cookbook - OSX Snow Leopard - 09/22/09 07:22 AM

I only had to add the -m32 option to the LDFLAGS to make it link on a macbook pro. Without it I was getting architecture related errors (x86_64 missing from SDL for instance).

Posted By: ENFDO1

Re: SDLMAME distro cookbook - 12/20/09 03:31 PM

Hi all.
Yesterday O downloaded SDLmame for N900. Iīm trying to compile for my tablet. But i canīt.

I searched all over the net, but i didīt get luck.

Iīll apreciate every advice you can give.

ENFDO.
Posted By: R. Belmont

Re: SDLMAME distro cookbook - 12/20/09 04:14 PM

Hi, the N900 is not yet supported. That work is in progress and hindered by the fact that none of us working on it have the hardware yet.
Posted By: mizapf

Re: SDLMAME distro cookbook - OpenSUSE 11.2 - 01/17/10 10:39 PM

I tried this for a fairly new installation of OpenSUSE 11.2:

Code:
zypper install subversion make gcc gconf2-devel gtk2-devel libSDL-devel


This should allow to check out from Subversion and to build successfully.

Michael
Posted By: bgm

Re: Sticky: How to compile SDLMAME! (Read me first!) - 03/01/11 03:02 PM

These are the dependencies I had to install on a debian wheezy (testing):

as root:
Code:
aptitude install build-essential libsdl1.2-dev libgtk2.0-dev libsdl-ttf2.0-dev


Posted By: BiafraRepublic

Re: Sticky: How to compile SDLMAME! (Read me first!) - 03/05/12 05:07 PM

For some inane reason, the source needed to have its line endings changed from CRLF to LF using dos2unix whenever I compiled SDLMAME using openSUSE 12.1, in addition, GNOME 3 is now the official GNOME...

So the list would be for openSUSE 12.1

Code:
$ sudo zypper install subversion make gcc gconf2-devel gtk2-devel gtk3-devel libSDL-devel dos2unix
.

After that, decompress the source tree and .diff patch files and run the following where you decompressed the source and applicable patches.

Code:
$ dos2unix -o *
$ patch -p0 -E < patchfile.diff /* for each patch to apply*/
$ make
Posted By: R. Belmont

Re: Sticky: How to compile SDLMAME! (Read me first!) - 03/05/12 05:17 PM

patch --binary will allow the patching to work even with the original line endings.

ETA: MAME still explicitly uses GTK+ 2.x, so you shouldn't need gtk3-devel.
Posted By: BiafraRepublic

Re: Sticky: How to compile SDLMAME! (Read me first!) - 03/05/12 09:59 PM

Originally Posted By R. Belmont
patch --binary will allow the patching to work even with the original line endings.


So will running the following in the ...

Quote:
for i in 'ls -Ar *'; do sed 's/^M//g' $i :> $i; done /* to output a ^M (ctrl-m), type ctrl-v then ctrl-m */


...but dos2unix has never failed me yet.

Also, openSUSE 12.1 requires gtk3-devel with gcc unless you don't install GNOME (due to the switch to GNOME 3).
Posted By: R. Belmont

Re: Sticky: How to compile SDLMAME! (Read me first!) - 03/05/12 10:07 PM

If you actually understand sed syntax, you probably don't need this guide in the first place.

For everyone else, patch --binary is much, much easier smile

ETA: Also, there have been issues reported in the past where mass conversions like that hit some binary files in the source tree and caused the compile to fail and/or the resulting binary to not work properly. Restrict to *.c, *.h, and *.mak for safety.
Posted By: belegdol

Re: Sticky: How to compile SDLMAME! (Read me first!) - 03/05/12 10:33 PM

Code:
find . -type f -not -name *.png -exec sed -i 's/\r//' {} \;

This is what mame RPM Fusion package currently uses.
Posted By: R. Belmont

Re: Sticky: How to compile SDLMAME! (Read me first!) - 03/05/12 11:14 PM

Speaking of which, does RPMFusion package u releases or just integer?
Posted By: qmc2

Re: Sticky: How to compile SDLMAME! (Read me first!) - 03/06/12 07:38 AM

Originally Posted By R. Belmont
Speaking of which, does RPMFusion package u releases or just integer?

Apparently also u-releases, for example:
http://download1.rpmfusion.org/nonfree/fedora/updates/testing/16/x86_64/repoview/mame.html
Posted By: belegdol

Re: Sticky: How to compile SDLMAME! (Read me first!) - 03/06/12 04:40 PM

Yeah, u releases never leave -testing but they are there.
Posted By: R. Belmont

Re: Sticky: How to compile SDLMAME! (Read me first!) - 03/06/12 04:45 PM

Ahh, ok. I don't normally have -testing added, so that's why I didn't see it.
Posted By: BiafraRepublic

Re: Sticky: How to compile SDLMAME! (Read me first!) - 03/17/12 12:48 AM

Originally Posted By R. Belmont
Also, there have been issues reported in the past where mass conversions like that hit some binary files in the source tree and caused the compile to fail and/or the resulting binary to not work properly. Restrict to *.c, *.h, and *.mak for safety.


Another reason why I prefer dos2unix. It is fairly accurate at ignoring anything that appears to be a non-text file.

Also, I'm looking about on software.opensuse.org, and while there are packages available, the releases are almost a year old year old (I don't know which one it is at the moment as I'm dualbooted into Windows at present)...

openSUSE 12.1: http://download.opensuse.org/repositories/Emulators/openSUSE_12.1/
openSUSE 11.4: http://download.opensuse.org/repositories/Emulators/openSUSE_11.4/
Posted By: R. Belmont

Re: Sticky: How to compile SDLMAME! (Read me first!) - 03/17/12 03:02 AM

That's actually a good point - I have no idea who's doing the SuSE packaging right now, if anyone. All the other "name" distros and the *BSDs are actively updated.
Posted By: qmc2

Re: Sticky: How to compile SDLMAME! (Read me first!) - 03/17/12 10:17 AM

The MAME package for openSUSE is usually taken from PackMan since there's apparently no 'official' package that's up to date:

http://packman.links2linux.org/package/mame

(EDIT: I was considering to add MAME and MESS packages to "my" QMC2 repository just because of this, but I've actually better things to do smile )
Posted By: torturedutopian

Re: Sticky: How to compile SDLMAME! (Read me first!) - 05/29/14 05:25 PM

Hi ! Are there some additional build options that could be used in order to speed up emulation (x64 target in my case) ? I didn't realize my i3 CPU would be too slow for Cave SH3 emulation... Just a little, but it is !
Posted By: R. Belmont

Re: Sticky: How to compile SDLMAME! (Read me first!) - 05/29/14 11:05 PM

Default options are as good as it gets usually, and GCC tends to get buggy fast if you go off the beaten path. Cave SH3 is quite heavy - it's a miracle it runs fast on any PC at all right now.
Posted By: mixmaster

Re: Sticky: How to compile SDLMAME! (Read me first!) - 10/14/15 04:40 PM

Arch Linux instructions:

Code:
sudo pacman -S base-devel git sdl2 gtk2 gconf sdl2_ttf gcc qt4


GCC comes with G++ by default in Pacman! laugh
Posted By: R. Belmont

Re: Sticky: How to compile SDLMAME! (Read me first!) - 10/14/15 05:39 PM

Arch has reliable, quickly-updated binary packages of MAME as well, which is one thing that definitely recommends them smile
Posted By: Braintrash

Re: Sticky: How to compile SDLMAME! (Read me first!) - 12/02/15 03:44 PM

How do I compile the tools under OS X?
I compile MAME (complete, arcade only and mess only) without any slight issue, but the tools are never built and the old ways to compile them are not working anymore...
Posted By: qmc2

Re: Sticky: How to compile SDLMAME! (Read me first!) - 12/02/15 04:06 PM

Use "make TOOLS=1". Add "REGENIE=1" to rerun genie if necessary.
Posted By: Braintrash

Re: Sticky: How to compile SDLMAME! (Read me first!) - 12/02/15 04:12 PM

Thank you, will try it once my current compile is done.

Originally Posted By qmc2
Add "REGENIE=1" to rerun genie if necessary.


What's this for?
Posted By: qmc2

Re: Sticky: How to compile SDLMAME! (Read me first!) - 12/02/15 04:15 PM

Well, GENie generates the make-files, and this would force them to be regenerated in case they already exist. The tools are no longer a direct "make target" but an option (TOOLS=1) that will add the required rules to the produced make-files.
Posted By: Braintrash

Re: Sticky: How to compile SDLMAME! (Read me first!) - 12/02/15 04:18 PM

Still compiling, but while I'm there, I know I'm way long overdue on this (well, after surgery, job loss, wife loss and basically shitty life :-), finally back into the game. So, is a French translator needed to QMC2? If so, I'll register an account and fill in this evening.
Posted By: Braintrash

Re: Sticky: How to compile SDLMAME! (Read me first!) - 12/02/15 04:30 PM

Seems to be working, without needing the REGENIE.
Thanks!
Posted By: R. Belmont

Re: Sticky: How to compile SDLMAME! (Read me first!) - 12/26/15 07:43 PM

For Debian Jessie, including the Raspbian variant for the RPi 2, and MAME 0.170+:

Code:
apt-get install git build-essentials libsdl2-dev libsdl2-ttf-dev libfontconfig-dev qt5-default


This should also work on the ODROID U3 and XU4 running Debian. Do NOT attempt on the original Pi!

For instance, to build an Apple II-only MAME on the Pi 2:
Code:
make SOURCES=src/mame/drivers/apple2.cpp,src/mame/drivers/apple2e.cpp,src/mame/video/apple2.cpp REGENIE=1 -j5


The Pi 2 has 4 CPU cores, so -j5 will (slightly) help compilation speeds.

A fast harddisk or SSD connected to the Pi 2's USB ports will greatly outperform most microSD cards, so it's worthwhile to put the MAME source tree on such a drive.
Posted By: max holz

Re: Sticky: How to compile SDLMAME! (Read me first!) - 12/27/15 12:30 PM

I just see that the debugger was upgraded to qt5.
Which packages I need to install on Ubuntu 14.04?
Or better is there an option to completely skip debugger compilation?
Posted By: R. Belmont

Re: Sticky: How to compile SDLMAME! (Read me first!) - 12/27/15 12:53 PM

Looks like it's qt5-default for both Ubuntu and Debian.

Skipping the debugger doesn't buy you anything unless you're targeting something without a window system.
Posted By: etabeta78

Re: Sticky: How to compile SDLMAME! (Read me first!) - 05/23/16 12:55 PM

small note to point out that as of current git repo, MAME requires Xcode 7.x (and thus OSX >= 10.10.4) to compile on OSX due to some flags which are set by BGFX library which are not recognized by older clang.

not a big deal since update to 10.11 is free, but still worth a not for whoever is stuck for any reason to 10.10.3 (as I am for another couple of weeks)
Posted By: dan81

Re: SDLMAME distro cookbook - 06/20/17 06:59 AM

Originally Posted by judge
OS X:
- Install latest Xcode
- Install latest SDL development libraries
- make TARGETOS=macosx
- Add BIGENDIAN=1 to the line above when building for a PowerMac system

[RB - updated PPC instructions]


hi judge , where i can find ppc instructions ?
Posted By: Vas Crabb

Re: SDLMAME distro cookbook - 06/20/17 07:24 AM

PPC isn't really supported at this point, but the instructions for Snow Leopard may give you some guidance: http://docs.mamedev.org/initialsetup/compilingmame.html
Posted By: dan81

Re: SDLMAME distro cookbook - 06/20/17 07:38 AM

Originally Posted by Vas Crabb
PPC isn't really supported at this point, but the instructions for Snow Leopard may give you some guidance: http://docs.mamedev.org/initialsetup/compilingmame.html

thanks i have already read this link frown make doesn't work for my ppc frown
© 2020 Forums