summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/sdl
diff options
context:
space:
mode:
author R. Belmont <rb6502@users.noreply.github.com>2013-01-01 16:58:48 +0000
committer R. Belmont <rb6502@users.noreply.github.com>2013-01-01 16:58:48 +0000
commit13c3e056aac56a8733db9b20c23609437c430c17 (patch)
treeb4af294840974cca307d3cf767ddb4b75dd62be7 /src/osd/sdl
parentad80ff6c3f58529f95ca71d4ec397df6cb7eb25d (diff)
Enable compiling PortMidi (nw)
Tested on: Linux x64, Mac OS X 10.8, Windows 8 x64 w/latest toolchain for both OSD=windows and OSD=sdl. MIDI should auto-disable on other OSes (*BSD) but there may be problems. Works fine on Linux when set to use the system's copy of the library as well, which many distros prefer.
Diffstat (limited to 'src/osd/sdl')
-rw-r--r--src/osd/sdl/sdl.mak28
-rw-r--r--src/osd/sdl/sdlmain.c4
2 files changed, 29 insertions, 3 deletions
diff --git a/src/osd/sdl/sdl.mak b/src/osd/sdl/sdl.mak
index fba05ac24e1..02faa903b51 100644
--- a/src/osd/sdl/sdl.mak
+++ b/src/osd/sdl/sdl.mak
@@ -79,6 +79,9 @@ NO_USE_XINPUT = 1
# uncomment to try the experimental new Qt debugger
#USE_QTDEBUG = 1
+# uncomment to disable MIDI
+#NO_USE_MIDI = 1
+
###########################################################################
################## END USER-CONFIGURABLE OPTIONS ######################
###########################################################################
@@ -185,6 +188,12 @@ ifeq ($(TARGETOS),linux)
BASE_TARGETOS = unix
SYNC_IMPLEMENTATION = tc
SDL_NETWORK = taptun
+
+ifndef NO_USE_MIDI
+INCPATH += `pkg-config --cflags alsa`
+LIBS += `pkg-config --libs alsa`
+endif
+
endif
ifeq ($(TARGETOS),freebsd)
@@ -198,24 +207,28 @@ CCOMFLAGS += -isystem /usr/local/include
# No clue here. There is a popmessage(NULL) in uimenu.c which
# triggers a non-null format warning on FreeBSD only.
CCOMFLAGS += -Wno-format
+NO_USE_MIDI = 1
endif
ifeq ($(TARGETOS),openbsd)
BASE_TARGETOS = unix
SYNC_IMPLEMENTATION = ntc
LIBS += -lutil
+NO_USE_MIDI = 1
endif
ifeq ($(TARGETOS),netbsd)
BASE_TARGETOS = unix
SYNC_IMPLEMENTATION = ntc
LIBS += -lutil
+NO_USE_MIDI = 1
endif
ifeq ($(TARGETOS),solaris)
BASE_TARGETOS = unix
DEFS += -DNO_AFFINITY_NP -UHAVE_VSNPRINTF -DNO_vsnprintf
SYNC_IMPLEMENTATION = tc
+NO_USE_MIDI = 1
endif
ifeq ($(TARGETOS),haiku)
@@ -223,6 +236,7 @@ BASE_TARGETOS = unix
SYNC_IMPLEMENTATION = ntc
NO_X11 = 1
NO_USE_XINPUT = 1
+NO_USE_MIDI = 1
LIBS += -lnetwork -lbsd
endif
@@ -230,6 +244,10 @@ ifeq ($(TARGETOS),macosx)
BASE_TARGETOS = unix
DEFS += -DSDLMAME_UNIX -DSDLMAME_MACOSX -DSDLMAME_DARWIN
+ifndef NO_USE_MIDI
+LIBS += -framework CoreAudio -framework CoreMIDI
+endif
+
ifndef USE_QTDEBUG
DEBUGOBJS = $(SDLOBJ)/debugosx.o
endif
@@ -324,6 +342,7 @@ SYNC_IMPLEMENTATION = os2
NO_DEBUGGER = 1
NO_X11 = 1
NO_USE_XINPUT = 1
+NO_USE_MIDI = 1
# OS/2 can't have OpenGL (aww)
NO_OPENGL = 1
endif
@@ -371,7 +390,12 @@ OSDOBJS = \
$(SDLOBJ)/drawsdl.o \
$(SDLOBJ)/window.o \
$(SDLOBJ)/output.o \
- $(SDLOBJ)/watchdog.o
+ $(SDLOBJ)/watchdog.o \
+ $(SDLOBJ)/sdlmidi.o
+
+ifdef NO_USE_MIDI
+DEFS += "-DDISABLE_MIDI=1"
+endif
# Add SDL2.0 support
@@ -765,6 +789,8 @@ testkeys$(EXE): $(TESTKEYSOBJS) $(LIBUTIL) $(LIBOCORE) $(SDLUTILMAIN)
@echo Linking $@...
$(LD) $(LDFLAGS) $^ $(LIBS) -o $@
+$(SDLOBJ)/sdlmidi.o: $(SRC)/osd/portmedia/pmmidi.c
+
#-------------------------------------------------
# clean up
#-------------------------------------------------
diff --git a/src/osd/sdl/sdlmain.c b/src/osd/sdl/sdlmain.c
index 4ab5262bb3b..a42089a4217 100644
--- a/src/osd/sdl/sdlmain.c
+++ b/src/osd/sdl/sdlmain.c
@@ -362,7 +362,7 @@ int main(int argc, char *argv[])
}
#endif
-// osd_init_midi(); // this is a blues riff in B, watch me for the changes and try to keep up...
+ osd_init_midi(); // this is a blues riff in B, watch me for the changes and try to keep up...
{
sdl_osd_interface osd;
@@ -388,7 +388,7 @@ int main(int argc, char *argv[])
#endif
#endif
-// osd_shutdown_midi();
+ osd_shutdown_midi();
exit(res);