Skip to content

Instantly share code, notes, and snippets.

@brutuscat
Last active January 1, 2016 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brutuscat/8163526 to your computer and use it in GitHub Desktop.
Save brutuscat/8163526 to your computer and use it in GitHub Desktop.
Instructions and patch to compile MAME 0.151 in OSX using Homebrew

Easily compile your own MAME 0.151v

Requirements

Instructions

With homebrew installed, execute:

brew install https://raw.github.com/brutuscat/homebrew-games/master/mame.rb

That's it!

Details

Below you can see the patch that will be applied by homebrew to the mame source code in order to comply with libSDL best practices and be able to compile the mame binary.

diff --git a/src/osd/sdl/osd_opengl.h b/src/osd/sdl/osd_opengl.h
index c7709f7..250f0ad 100644
--- a/src/osd/sdl/osd_opengl.h
+++ b/src/osd/sdl/osd_opengl.h
@@ -16,7 +16,7 @@
* #include <GL/glext.h>
*/
#if (SDLMAME_SDL2)
- #include <SDL2/SDL_version.h>
+ #include "SDL_version.h"
#else
#include <SDL/SDL_version.h>
#endif
@@ -27,7 +27,7 @@
#define __INTRIN_H_
#endif
#if (SDLMAME_SDL2)
- #include <SDL2/SDL_opengl.h>
+ #include "SDL_opengl.h"
#else
#include <SDL/SDL_opengl.h>
#endif
diff --git a/src/osd/sdl/sdlinc.h b/src/osd/sdl/sdlinc.h
index ca10b79..077eb00 100644
--- a/src/osd/sdl/sdlinc.h
+++ b/src/osd/sdl/sdlinc.h
@@ -2,11 +2,11 @@
#define _sdlinc_h_
#if (SDLMAME_SDL2)
-#include <SDL2/SDL.h>
-#include <SDL2/SDL_version.h>
+#include "SDL.h"
+#include "SDL_version.h"
// on win32 this includes windows.h by itself and breaks us!
#ifndef SDLMAME_WIN32
-#include <SDL2/SDL_syswm.h>
+#include "SDL_syswm.h"
#endif
#else
#include <SDL/SDL.h>
diff --git a/src/osd/sdl/sdlmain.c b/src/osd/sdl/sdlmain.c
index b8e00ba..a588160 100644
--- a/src/osd/sdl/sdlmain.c
+++ b/src/osd/sdl/sdlmain.c
@@ -13,7 +13,7 @@
#ifdef SDLMAME_UNIX
#if (!defined(SDLMAME_MACOSX)) && (!defined(SDLMAME_EMSCRIPTEN))
#if (SDLMAME_SDL2)
-//#include <SDL2/SDL_ttf.h>
+//#include "SDL_ttf.h"
#else
#include <SDL/SDL_ttf.h>
#endif
diff --git a/src/osd/sdl/window.c b/src/osd/sdl/window.c
index e050237..2fa2082 100644
--- a/src/osd/sdl/window.c
+++ b/src/osd/sdl/window.c
@@ -13,7 +13,7 @@
#include "sdlinc.h"
#if (SDLMAME_SDL2)
-#include <SDL2/SDL_thread.h>
+#include "SDL_thread.h"
#else
#include <SDL/SDL_thread.h>
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment