mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
Get NO_X11, NO_USE_XINPUT and SDL_LIBVER working on Linux
This commit is contained in:
parent
ea348ff9f1
commit
1f163a762e
@ -695,20 +695,10 @@ configuration { "nacl*" }
|
||||
archivesplit_size "20"
|
||||
|
||||
configuration { "linux-*" }
|
||||
linkoptions {
|
||||
"`sdl2-config --libs`",
|
||||
}
|
||||
links {
|
||||
"pthread",
|
||||
"SDL2",
|
||||
"SDL2_ttf",
|
||||
"asound",
|
||||
"dl",
|
||||
"fontconfig",
|
||||
"freetype",
|
||||
"GL",
|
||||
"m",
|
||||
"util",
|
||||
}
|
||||
defines
|
||||
{
|
||||
@ -724,8 +714,6 @@ configuration { "linux-*" }
|
||||
|
||||
configuration { "osx*" }
|
||||
links {
|
||||
"Cocoa.framework",
|
||||
"OpenGL.framework",
|
||||
"CoreAudio.framework",
|
||||
"CoreMIDI.framework",
|
||||
"pthread",
|
||||
|
@ -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",
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
if BASE_TARGETOS=="unix" then
|
||||
if _OPTIONS["targetos"]=="macosx" then
|
||||
links {
|
||||
"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
|
||||
links {
|
||||
"SDL.framework",
|
||||
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"],
|
||||
}
|
||||
|
||||
|
@ -1,27 +1,3 @@
|
||||
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"
|
||||
}
|
||||
@ -59,6 +35,7 @@ if _OPTIONS["SDL_LIBVER"]=="sdl2" then
|
||||
else
|
||||
defines {
|
||||
"SDLMAME_SDL2=0",
|
||||
"SYNC_IMPLEMENTATION=" .. SYNC_IMPLEMENTATION,
|
||||
}
|
||||
end
|
||||
|
||||
@ -76,6 +53,30 @@ if BASE_TARGETOS=="unix" then
|
||||
defines {
|
||||
"SDLMAME_UNIX",
|
||||
}
|
||||
if _OPTIONS["targetos"]=="macosx" then
|
||||
if _OPTIONS["MACOSX_USE_LIBSDL"]~="1" then
|
||||
buildoptions {
|
||||
"-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"],
|
||||
}
|
||||
else
|
||||
defines {
|
||||
"NO_SDL_GLEXT",
|
||||
"MACOSX_USE_LIBSDL",
|
||||
}
|
||||
buildoptions {
|
||||
string.gsub(os.outputof(sdlconfigcmd() .. " --cflags | sed 's:/SDL::'"), '[\r\n]+', ' '),
|
||||
}
|
||||
end
|
||||
else
|
||||
buildoptions {
|
||||
string.gsub(os.outputof(sdlconfigcmd() .. " --cflags"), '[\r\n]+', ' '),
|
||||
}
|
||||
if _OPTIONS["targetos"]~="emscripten" then
|
||||
buildoptions {
|
||||
string.gsub(os.outputof("pkg-config --cflags fontconfig"), '[\r\n]+', ' '),
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if _OPTIONS["targetos"]=="windows" then
|
||||
|
Loading…
Reference in New Issue
Block a user