From 9a2c6d95c80b849e70fd3428d5e7c672fe2b607e Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 1 Apr 2015 00:04:03 +1100 Subject: [PATCH] Restore NO_USE_MIDI and some more OS support from the old SDL makefile --- makefile | 4 ++++ scripts/genie.lua | 3 --- scripts/src/osd/sdl.lua | 48 +++++++++++++++++++++++++++++++++---- scripts/src/osd/sdl_cfg.lua | 26 +++++++++++++++++++- 4 files changed, 73 insertions(+), 8 deletions(-) diff --git a/makefile b/makefile index 710e4469baa..0a0443a576c 100644 --- a/makefile +++ b/makefile @@ -336,6 +336,10 @@ ifdef NO_USE_XINPUT PARAMS += --NO_USE_XINPUT='$(NO_USE_XINPUT)' endif +ifdef NO_USE_MIDI +PARAMS += --NO_USE_MIDI='$(NO_USE_MIDI)' +endif + ifdef SDL_LIBVER PARAMS += --SDL_LIBVER='$(SDL_LIBVER)' endif diff --git a/scripts/genie.lua b/scripts/genie.lua index 0bc8050bd39..2511d22668e 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -696,7 +696,6 @@ configuration { "nacl*" } configuration { "linux-*" } links { - "asound", "dl", "GL", } @@ -714,8 +713,6 @@ configuration { "linux-*" } configuration { "osx*" } links { - "CoreAudio.framework", - "CoreMIDI.framework", "pthread", } flags { diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua index 8aa7f387937..93de0e87dfd 100644 --- a/scripts/src/osd/sdl.lua +++ b/scripts/src/osd/sdl.lua @@ -59,16 +59,32 @@ function maintargetosdoptions(_target) } end elseif _OPTIONS["targetos"]=="linux" then - if (USE_QT == 1) then + if USE_QT == 1 then + linkoptions { + "$(shell pkg-config --libs QtGui)", + } links { "QtGui", "QtCore", } - + end + if _OPTIONS["NO_USE_MIDI"]~="1" then linkoptions { - "$(shell pkg-config --libs QtGui)", + string.gsub(os.outputof("pkg-config --libs alsa"), '[\r\n]+', ' '), } end + elseif _OPTIONS["targetos"]=="macosx" then + if _OPTIONS["NO_USE_MIDI"]~="1" then + links { + "CoreAudio.framework", + "CoreMIDI.framework", + } + end + elseif _OPTIONS["targetos"]=="haiku" then + links { + "network", + "bsd", + } end configuration { "mingw*" or "vs*" } @@ -82,7 +98,7 @@ function sdlconfigcmd() if not _OPTIONS["SDL_INSTALL_ROOT"] then return _OPTIONS["SDL_LIBVER"] .. "-config" else - return _OPTIONS["SDL_INSTALL_ROOT"] .. "/bin/" .. _OPTIONS["SDL_LIBVER"] .. "-config" + return path.join(_OPTIONS["SDL_INSTALL_ROOT"],"bin",_OPTIONS["SDL_LIBVER"]) .. "-config" end end @@ -117,6 +133,23 @@ if not _OPTIONS["NO_USE_XINPUT"] then _OPTIONS["NO_USE_XINPUT"] = "1" end +newoption { + trigger = "NO_USE_MIDI", + description = "Disable MIDI I/O", + allowed = { + { "0", "Enable MIDI" }, + { "1", "Disable MIDI" }, + }, +} + +if not _OPTIONS["NO_USE_MIDI"] then + if _OPTIONS["targetos"]=="freebsd" or _OPTIONS["targetos"]=="openbsd" or _OPTIONS["targetos"]=="netbsd" or _OPTIONS["targetos"]=="solaris" or _OPTIONS["targetos"]=="haiku" or _OPTIONS["targetos"] == "emscripten" or _OPTIONS["targetos"] == "os2" then + _OPTIONS["NO_USE_MIDI"] = "1" + else + _OPTIONS["NO_USE_MIDI"] = "0" + end +end + newoption { trigger = "SDL_LIBVER", description = "Choose SDL version", @@ -244,6 +277,13 @@ if BASE_TARGETOS=="unix" then end end end +elseif BASE_TARGETOS=="os2" then + linkoptions { + string.gsub(os.outputof(sdlconfigcmd() .. " --libs"), '[\r\n]+', ' '), + } + links { + "pthread" + } end configuration { "mingw*" } diff --git a/scripts/src/osd/sdl_cfg.lua b/scripts/src/osd/sdl_cfg.lua index af4df5de87f..909816b56a4 100644 --- a/scripts/src/osd/sdl_cfg.lua +++ b/scripts/src/osd/sdl_cfg.lua @@ -28,6 +28,16 @@ else } end +if _OPTIONS["NO_USE_MIDI"]=="1" then + defines { + "NO_USE_MIDI", + } +elseif _OPTIONS["targetos"]=="linux" then + buildoptions { + string.gsub(os.outputof("pkg-config --cflags alsa"), '[\r\n]+', ' '), + } +end + if _OPTIONS["SDL_LIBVER"]=="sdl2" then defines { "SDLMAME_SDL2=1", @@ -108,7 +118,6 @@ elseif _OPTIONS["targetos"]=="linux" then "USE_QTDEBUG=" .. USE_QT, "SDLMAME_NET_TAPTUN", } - buildoptions { '$(shell pkg-config --cflags QtGui)', } @@ -120,8 +129,23 @@ elseif _OPTIONS["targetos"]=="macosx" then "USE_QTDEBUG=0", "SDLMAME_NET_PCAP", } +elseif _OPTIONS["targetos"]=="freebsd" then + defines { + "NO_AFFINITY_NP", + } + buildoptions { + -- /usr/local/include is not considered a system include director on FreeBSD. GL.h resides there and throws warnings + "-isystem /usr/local/include", + } +elseif _OPTIONS["targetos"]=="solaris" then + defines { + "NO_AFFINITY_NP", + } elseif _OPTIONS["targetos"]=="os2" then defines { "SDLMAME_OS2", } + buildoptions { + string.gsub(os.outputof(sdlconfigcmd() .. " --cflags"), '[\r\n]+', ' '), + } end