diff options
author | 2015-03-31 20:27:33 +1100 | |
---|---|---|
committer | 2015-03-31 20:46:51 +1100 | |
commit | 1f163a762e2bf02355d820a16d6baf4a189be714 (patch) | |
tree | b92ff9a584ddc2090735006af4cd4bdd4451e66d /scripts/src/osd/sdl.lua | |
parent | ea348ff9f1f8e57ba4be2f3a4dc597fdcc01b1c1 (diff) |
Get NO_X11, NO_USE_XINPUT and SDL_LIBVER working on Linux
Diffstat (limited to 'scripts/src/osd/sdl.lua')
-rw-r--r-- | scripts/src/osd/sdl.lua | 111 |
1 files changed, 98 insertions, 13 deletions
diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua index 1a5d30bf2ea..9299e437a72 100644 --- a/scripts/src/osd/sdl.lua +++ b/scripts/src/osd/sdl.lua @@ -13,6 +13,21 @@ function maintargetosdoptions(_target) } end + if BASE_TARGETOS=="unix" and _OPTIONS["targetos"]~="macosx" then + if _OPTIONS["SDL_LIBVER"]=="sdl2" then + links { + "SDL2_ttf", + } + else + links { + "SDL_ttf", + } + end + linkoptions { + string.gsub(os.outputof("pkg-config --libs fontconfig"), '[\r\n]+', ' '), + } + end + if _OPTIONS["targetos"]=="windows" then linkoptions{ "-municode", @@ -47,6 +62,15 @@ function maintargetosdoptions(_target) end +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" + end +end + + newoption { trigger = "NO_X11", description = "Disable use of X11", @@ -122,27 +146,87 @@ if not _OPTIONS["MACOSX_USE_LIBSDL"] then end -if _OPTIONS["NO_X11"]~="1" and _OPTIONS["SDL_LIBVER"]=="sdl" then - links { - "X11" - } +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 -if _OPTIONS["targetos"]=="macosx" and _OPTIONS["MACOSX_USE_LIBSDL"]~="1" then - buildoptions { - "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"], - } +if _OPTIONS["NO_X11"]~="1" then linkoptions { - "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"], + "-L/usr/X11/lib", + "-L/usr/X11R6/lib", + "-L/usr/openwin/lib", } - if _OPTIONS["SDL_LIBVER"]=="sdl2" then + if _OPTIONS["SDL_LIBVER"]=="sdl" then links { - "SDL2.framework", + "X11", } - else + end +end + +if BASE_TARGETOS=="unix" then + if _OPTIONS["targetos"]=="macosx" then links { - "SDL.framework", + "Cocoa.framework", + "OpenGL.framework", } + if _OPTIONS["MACOSX_USE_LIBSDL"]~="1" then + linkoptions { + "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"], + } + if _OPTIONS["SDL_LIBVER"]=="sdl2" then + links { + "SDL2.framework", + } + else + links { + "SDL.framework", + } + end + else + linkoptions { + string.gsub(os.outputof(sdlconfigcmd() .. " --libs | sed 's/-lSDLmain//'"), '[\r\n]+', ' '), + } + end + else + linkoptions { + string.gsub(os.outputof(sdlconfigcmd() .. " --libs"), '[\r\n]+', ' '), + } + if _OPTIONS["targetos"]~="haiku" then + links { + "m", + "pthread", + } + if _OPTIONS["targetos"]=="solaris" then + links { + "socket", + "nsl", + } + else + links { + "util", + } + end + end end end @@ -350,6 +434,7 @@ if _OPTIONS["with-tools"] then targetdir(MAME_DIR) links { + "utils", "ocore_" .. _OPTIONS["osd"], } |