Bring back some SDL OSD configurability (WIP)

This commit is contained in:
Vas Crabb 2015-03-31 18:34:57 +11:00
parent 49545f9e84
commit ea348ff9f1
5 changed files with 297 additions and 85 deletions

View File

@ -328,6 +328,30 @@ endif
endif
PARAMS += --USE_QT=$(USE_QT)
ifdef NO_X11
PARAMS += --NO_X11='$(NO_X11)'
endif
ifdef NO_USE_XINPUT
PARAMS += --NO_USE_XINPUT='$(NO_USE_XINPUT)'
endif
ifdef SDL_LIBVER
PARAMS += --SDL_LIBVER='$(SDL_LIBVER)'
endif
ifdef SDL_INSTALL_ROOT
PARAMS += --SDL_INSTALL_ROOT='$(SDL_INSTALL_ROOT)'
endif
ifdef SDL_FRAMEWORK_PATH
PARAMS += --SDL_FRAMEWORK_PATH='$(SDL_FRAMEWORK_PATH)'
endif
ifdef MACOSX_USE_LIBSDL
PARAMS += --MACOSX_USE_LIBSDL='$(MACOSX_USE_LIBSDL)'
endif
ifdef LDOPTS
PARAMS += --LDOPTS='$(LDOPTS)'
endif

View File

@ -50,7 +50,7 @@ BUSES = {}
newoption {
trigger = "with-tools",
description = "Enable building tools.",
}
}
newoption {
trigger = "osd",
@ -709,8 +709,6 @@ configuration { "linux-*" }
"GL",
"m",
"util",
"X11",
"Xinerama",
}
defines
{
@ -726,19 +724,12 @@ configuration { "linux-*" }
configuration { "osx*" }
links {
"SDL2.framework",
"Cocoa.framework",
"OpenGL.framework",
"CoreAudio.framework",
"CoreMIDI.framework",
"pthread",
}
buildoptions {
"-F/Library/Frameworks/",
}
linkoptions {
"-F/Library/Frameworks/",
}
flags {
"Symbols",
}

View File

@ -1,4 +1,18 @@
function maintargetosdoptions(_target)
if _OPTIONS["NO_X11"]~="1" then
links {
"X11",
"Xinerama",
}
end
if _OPTIONS["NO_USE_XINPUT"]~="1" then
links {
"Xext",
"Xi",
}
end
if _OPTIONS["targetos"]=="windows" then
linkoptions{
"-municode",
@ -13,8 +27,7 @@ function maintargetosdoptions(_target)
"QtCore4",
}
end
end
if _OPTIONS["targetos"]=="linux" then
elseif _OPTIONS["targetos"]=="linux" then
if (USE_QT == 1) then
links {
"QtGui",
@ -34,6 +47,105 @@ function maintargetosdoptions(_target)
end
newoption {
trigger = "NO_X11",
description = "Disable use of X11",
allowed = {
{ "0", "Enable X11" },
{ "1", "Disable X11" },
},
}
if not _OPTIONS["NO_X11"] then
if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="macosx" or _OPTIONS["targetos"]=="haiku" or _OPTIONS["targetos"]=="emscripten" or _OPTIONS["targetos"]=="os2" then
_OPTIONS["NO_X11"] = "1"
else
_OPTIONS["NO_X11"] = "0"
end
end
newoption {
trigger = "NO_USE_XINPUT",
description = "Disable use of Xinput",
allowed = {
{ "0", "Enable Xinput" },
{ "1", "Disable Xinput" },
},
}
if not _OPTIONS["NO_USE_XINPUT"] then
_OPTIONS["NO_USE_XINPUT"] = "1"
end
newoption {
trigger = "SDL_LIBVER",
description = "Choose SDL version",
allowed = {
{ "sdl", "SDL" },
{ "sdl2", "SDL 2" },
},
}
if not _OPTIONS["SDL_LIBVER"] then
if _OPTIONS["targetos"]=="os2" then
_OPTIONS["SDL_LIBVER"] = "sdl"
else
_OPTIONS["SDL_LIBVER"] = "sdl2"
end
end
newoption {
trigger = "SDL_INSTALL_ROOT",
description = "Equivalent to the ./configure --prefix=<path>",
}
newoption {
trigger = "SDL_FRAMEWORK_PATH",
description = "Location of SDL framework for custom OS X installations",
}
if not _OPTIONS["SDL_FRAMEWORK_PATH"] then
_OPTIONS["SDL_FRAMEWORK_PATH"] = "/Library/Frameworks/"
end
newoption {
trigger = "MACOSX_USE_LIBSDL",
description = "Use SDL library on OS (rather than framework)",
allowed = {
{ "0", "Use framework" },
{ "1", "Use library" },
},
}
if not _OPTIONS["MACOSX_USE_LIBSDL"] then
_OPTIONS["MACOSX_USE_LIBSDL"] = "0"
end
if _OPTIONS["NO_X11"]~="1" and _OPTIONS["SDL_LIBVER"]=="sdl" then
links {
"X11"
}
end
if _OPTIONS["targetos"]=="macosx" and _OPTIONS["MACOSX_USE_LIBSDL"]~="1" then
buildoptions {
"-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"],
}
linkoptions {
"-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"],
}
if _OPTIONS["SDL_LIBVER"]=="sdl2" then
links {
"SDL2.framework",
}
else
links {
"SDL.framework",
}
end
end
configuration { "mingw*" }
linkoptions {
"-Wl,--allow-multiple-definition",
@ -78,7 +190,6 @@ project ("osd_" .. _OPTIONS["osd"])
if _OPTIONS["targetos"]=="macosx" then
files {
--MAME_DIR .. "src/osd/sdl/SDLMain_tmpl.m",
MAME_DIR .. "src/osd/modules/debugger/debugosx.m",
MAME_DIR .. "src/osd/modules/debugger/osx/breakpointsview.m",
MAME_DIR .. "src/osd/modules/debugger/osx/consoleview.m",
@ -98,6 +209,12 @@ project ("osd_" .. _OPTIONS["osd"])
MAME_DIR .. "src/osd/modules/debugger/osx/registersview.m",
MAME_DIR .. "src/osd/modules/debugger/osx/watchpointsview.m",
}
if _OPTIONS["SDL_LIBVER"]=="sdl" then
-- SDLMain_tmpl isn't necessary for SDL2
files {
MAME_DIR .. "src/osd/sdl/SDLMain_tmpl.m",
}
end
end
files {
@ -107,20 +224,36 @@ project ("osd_" .. _OPTIONS["osd"])
MAME_DIR .. "src/osd/sdl/window.c",
MAME_DIR .. "src/osd/sdl/output.c",
MAME_DIR .. "src/osd/sdl/watchdog.c",
MAME_DIR .. "src/osd/modules/lib/osdobj_common.c",
MAME_DIR .. "src/osd/modules/render/drawsdl.c",
--ifeq ($(SDL_LIBVER),sdl2)
MAME_DIR .. "src/osd/modules/render/draw13.c",
--endif
MAME_DIR .. "src/osd/modules/render/drawogl.c",
MAME_DIR .. "src/osd/modules/debugger/none.c",
MAME_DIR .. "src/osd/modules/debugger/debugint.c",
MAME_DIR .. "src/osd/modules/debugger/debugwin.c",
MAME_DIR .. "src/osd/modules/debugger/debugqt.c",
MAME_DIR .. "src/osd/modules/render/drawogl.c",
MAME_DIR .. "src/osd/modules/opengl/gl_shader_tool.c",
MAME_DIR .. "src/osd/modules/opengl/gl_shader_mgr.c",
MAME_DIR .. "src/osd/modules/font/font_sdl.c",
MAME_DIR .. "src/osd/modules/font/font_windows.c",
MAME_DIR .. "src/osd/modules/font/font_osx.c",
MAME_DIR .. "src/osd/modules/font/font_none.c",
MAME_DIR .. "src/osd/modules/netdev/taptun.c",
MAME_DIR .. "src/osd/modules/netdev/pcap.c",
MAME_DIR .. "src/osd/modules/netdev/none.c",
MAME_DIR .. "src/osd/modules/midi/portmidi.c",
MAME_DIR .. "src/osd/modules/midi/none.c",
MAME_DIR .. "src/osd/modules/sound/js_sound.c",
MAME_DIR .. "src/osd/modules/sound/direct_sound.c",
MAME_DIR .. "src/osd/modules/sound/sdl_sound.c",
MAME_DIR .. "src/osd/modules/sound/none.c",
}
if _OPTIONS["SDL_LIBVER"]=="sdl2" then
files {
MAME_DIR .. "src/osd/modules/render/draw13.c",
}
end
if (USE_QT == 1) then
if USE_QT == 1 then
files {
MAME_DIR .. "src/osd/modules/debugger/qt/debuggerview.c",
MAME_DIR .. "src/osd/modules/debugger/qt/windowqt.c",
@ -144,29 +277,13 @@ project ("osd_" .. _OPTIONS["osd"])
}
end
if (USE_BGFX == 1) then
if USE_BGFX == 1 then
files {
MAME_DIR .. "src/osd/modules/render/drawbgfx.c",
}
end
files {
MAME_DIR .. "src/osd/modules/lib/osdobj_common.c",
MAME_DIR .. "src/osd/modules/font/font_sdl.c",
MAME_DIR .. "src/osd/modules/font/font_windows.c",
MAME_DIR .. "src/osd/modules/font/font_osx.c",
MAME_DIR .. "src/osd/modules/font/font_none.c",
MAME_DIR .. "src/osd/modules/netdev/taptun.c",
MAME_DIR .. "src/osd/modules/netdev/pcap.c",
MAME_DIR .. "src/osd/modules/netdev/none.c",
MAME_DIR .. "src/osd/modules/midi/portmidi.c",
MAME_DIR .. "src/osd/modules/midi/none.c",
MAME_DIR .. "src/osd/modules/sound/js_sound.c",
MAME_DIR .. "src/osd/modules/sound/direct_sound.c",
MAME_DIR .. "src/osd/modules/sound/sdl_sound.c",
MAME_DIR .. "src/osd/modules/sound/none.c",
}
project ("ocore_" .. _OPTIONS["osd"])
uuid (os.uuid("ocore_" .. _OPTIONS["osd"]))
kind "StaticLib"
@ -189,24 +306,6 @@ project ("ocore_" .. _OPTIONS["osd"])
MAME_DIR .. "src/osd/sdl",
}
if _OPTIONS["targetos"]=="linux" then
BASE_TARGETOS = "unix"
SDLOS_TARGETOS = "unix"
SYNC_IMPLEMENTATION = "tc"
end
if _OPTIONS["targetos"]=="windows" then
BASE_TARGETOS = "win32"
SDLOS_TARGETOS = "win32"
SYNC_IMPLEMENTATION = "windows"
end
if _OPTIONS["targetos"]=="macosx" then
BASE_TARGETOS = "unix"
SDLOS_TARGETOS = "macosx"
SYNC_IMPLEMENTATION = "ntc"
end
files {
MAME_DIR .. "src/osd/strconv.c",
MAME_DIR .. "src/osd/sdl/sdldir.c",
@ -228,3 +327,49 @@ project ("ocore_" .. _OPTIONS["osd"])
MAME_DIR .. "src/osd/sdl/osxutils.m",
}
end
--------------------------------------------------
-- testkeys
--------------------------------------------------
if _OPTIONS["with-tools"] then
project("testkeys")
uuid ("744cec21-c3b6-4d69-93cb-6811fed0ffe3")
kind "ConsoleApp"
options {
"ForceCPP",
}
dofile("sdl_cfg.lua")
includedirs {
MAME_DIR .. "src/lib/util",
}
targetdir(MAME_DIR)
links {
"ocore_" .. _OPTIONS["osd"],
}
includeosd()
files {
MAME_DIR .. "src/osd/sdl/testkeys.c",
}
if _OPTIONS["targetos"]=="windows" then
linkoptions{
"-municode",
}
files {
MAME_DIR .. "src/osd/sdl/main.c",
}
elseif _OPTIONS["targetos"]=="macosx" and _OPTIONS["SDL_LIBVER"]=="sdl" then
-- SDLMain_tmpl isn't necessary for SDL2
files {
MAME_DIR .. "src/osd/sdl/SDLMain_tmpl.m",
}
end
end

View File

@ -1,15 +1,88 @@
BASE_TARGETOS = "unix"
SDLOS_TARGETOS = "unix"
SYNC_IMPLEMENTATION = "tc"
if _OPTIONS["targetos"]=="openbsd" then
SYNC_IMPLEMENTATION = "ntc"
elseif _OPTIONS["targetos"]=="netbsd" then
SYNC_IMPLEMENTATION = "ntc"
elseif _OPTIONS["targetos"]=="haiku" then
SYNC_IMPLEMENTATION = "ntc"
elseif _OPTIONS["targetos"]=="emscripten" then
SYNC_IMPLEMENTATION = "mini"
elseif _OPTIONS["targetos"]=="windows" then
BASE_TARGETOS = "win32"
SDLOS_TARGETOS = "win32"
SYNC_IMPLEMENTATION = "windows"
elseif _OPTIONS["targetos"]=="macosx" then
SDLOS_TARGETOS = "macosx"
SYNC_IMPLEMENTATION = "ntc"
elseif _OPTIONS["targetos"]=="os2" then
BASE_TARGETOS = "os2"
SDLOS_TARGETOS = "os2"
SYNC_IMPLEMENTATION = "os2"
end
forcedincludes {
MAME_DIR .. "src/osd/sdl/sdlprefix.h"
}
if _OPTIONS["NO_X11"]=="1" then
defines {
"SDLMAME_NO_X11",
}
else
defines {
"SDLMAME_X11",
}
includedirs {
"/usr/X11/include",
"/usr/X11R6/include",
"/usr/openwin/include",
}
end
if _OPTIONS["NO_USE_XINPUT"]=="1" then
defines {
"USE_XINPUT=0",
}
else
defines {
"USE_XINPUT=1",
"USE_XINPUT_DEBUG=0",
}
end
if _OPTIONS["SDL_LIBVER"]=="sdl2" then
defines {
"SDLMAME_SDL2=1",
}
else
defines {
"SDLMAME_SDL2=0",
}
end
if USE_BGFX == 1 then
defines {
"USE_BGFX"
}
end
defines {
"OSD_SDL",
}
if BASE_TARGETOS=="unix" then
defines {
"SDLMAME_UNIX",
}
end
if _OPTIONS["targetos"]=="windows" then
defines {
"OSD_SDL",
"SDLMAME_WIN32",
"UNICODE",
"_UNICODE",
"SDLMAME_SDL2=1",
"USE_XINPUT=0",
"USE_OPENGL=1",
"USE_QTDEBUG=" .. USE_QT,
"SDLMAME_NET_PCAP",
@ -21,47 +94,26 @@ if _OPTIONS["targetos"]=="windows" then
"-I$(shell qmake -query QT_INSTALL_HEADERS)/QtGui",
"-I$(shell qmake -query QT_INSTALL_HEADERS)",
}
end
if _OPTIONS["targetos"]=="linux" then
elseif _OPTIONS["targetos"]=="linux" then
defines {
"OSD_SDL",
"SDLMAME_UNIX",
"SDLMAME_X11",
"SDLMAME_SDL2=1",
"USE_XINPUT=0",
"USE_OPENGL=1",
"USE_QTDEBUG=" .. USE_QT,
"SDLMAME_NET_TAPTUN",
}
if (USE_BGFX == 1) then
defines {
"USE_BGFX"
}
end
buildoptions {
'$(shell pkg-config --cflags QtGui)',
}
end
if _OPTIONS["targetos"]=="macosx" then
elseif _OPTIONS["targetos"]=="macosx" then
defines {
"OSD_SDL",
"SDLMAME_UNIX",
"SDLMAME_MACOSX",
"SDLMAME_DARWIN",
"SDLMAME_SDL2=1",
"USE_XINPUT=0",
"USE_OPENGL=1",
"USE_QTDEBUG=0",
"SDLMAME_NET_PCAP",
}
if (USE_BGFX == 1) then
defines {
"USE_BGFX"
}
end
elseif _OPTIONS["targetos"]=="os2" then
defines {
"SDLMAME_OS2",
}
end

View File

@ -171,5 +171,5 @@ if _OPTIONS["with-tools"] then
files {
MAME_DIR .. "src/osd/windows/ledutil.c",
}
}
end