mirror of
https://github.com/holub/mame
synced 2025-10-04 16:34:53 +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"
|
archivesplit_size "20"
|
||||||
|
|
||||||
configuration { "linux-*" }
|
configuration { "linux-*" }
|
||||||
linkoptions {
|
|
||||||
"`sdl2-config --libs`",
|
|
||||||
}
|
|
||||||
links {
|
links {
|
||||||
"pthread",
|
|
||||||
"SDL2",
|
|
||||||
"SDL2_ttf",
|
|
||||||
"asound",
|
"asound",
|
||||||
"dl",
|
"dl",
|
||||||
"fontconfig",
|
|
||||||
"freetype",
|
|
||||||
"GL",
|
"GL",
|
||||||
"m",
|
|
||||||
"util",
|
|
||||||
}
|
}
|
||||||
defines
|
defines
|
||||||
{
|
{
|
||||||
@ -724,8 +714,6 @@ configuration { "linux-*" }
|
|||||||
|
|
||||||
configuration { "osx*" }
|
configuration { "osx*" }
|
||||||
links {
|
links {
|
||||||
"Cocoa.framework",
|
|
||||||
"OpenGL.framework",
|
|
||||||
"CoreAudio.framework",
|
"CoreAudio.framework",
|
||||||
"CoreMIDI.framework",
|
"CoreMIDI.framework",
|
||||||
"pthread",
|
"pthread",
|
||||||
|
@ -13,6 +13,21 @@ function maintargetosdoptions(_target)
|
|||||||
}
|
}
|
||||||
end
|
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
|
if _OPTIONS["targetos"]=="windows" then
|
||||||
linkoptions{
|
linkoptions{
|
||||||
"-municode",
|
"-municode",
|
||||||
@ -47,6 +62,15 @@ function maintargetosdoptions(_target)
|
|||||||
end
|
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 {
|
newoption {
|
||||||
trigger = "NO_X11",
|
trigger = "NO_X11",
|
||||||
description = "Disable use of X11",
|
description = "Disable use of X11",
|
||||||
@ -122,27 +146,87 @@ if not _OPTIONS["MACOSX_USE_LIBSDL"] then
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if _OPTIONS["NO_X11"]~="1" and _OPTIONS["SDL_LIBVER"]=="sdl" then
|
BASE_TARGETOS = "unix"
|
||||||
links {
|
SDLOS_TARGETOS = "unix"
|
||||||
"X11"
|
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
|
end
|
||||||
|
|
||||||
if _OPTIONS["targetos"]=="macosx" and _OPTIONS["MACOSX_USE_LIBSDL"]~="1" then
|
if _OPTIONS["NO_X11"]~="1" then
|
||||||
buildoptions {
|
|
||||||
"-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"],
|
|
||||||
}
|
|
||||||
linkoptions {
|
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 {
|
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
|
else
|
||||||
links {
|
linkoptions {
|
||||||
"SDL.framework",
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -350,6 +434,7 @@ if _OPTIONS["with-tools"] then
|
|||||||
targetdir(MAME_DIR)
|
targetdir(MAME_DIR)
|
||||||
|
|
||||||
links {
|
links {
|
||||||
|
"utils",
|
||||||
"ocore_" .. _OPTIONS["osd"],
|
"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 {
|
forcedincludes {
|
||||||
MAME_DIR .. "src/osd/sdl/sdlprefix.h"
|
MAME_DIR .. "src/osd/sdl/sdlprefix.h"
|
||||||
}
|
}
|
||||||
@ -59,6 +35,7 @@ if _OPTIONS["SDL_LIBVER"]=="sdl2" then
|
|||||||
else
|
else
|
||||||
defines {
|
defines {
|
||||||
"SDLMAME_SDL2=0",
|
"SDLMAME_SDL2=0",
|
||||||
|
"SYNC_IMPLEMENTATION=" .. SYNC_IMPLEMENTATION,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -76,6 +53,30 @@ if BASE_TARGETOS=="unix" then
|
|||||||
defines {
|
defines {
|
||||||
"SDLMAME_UNIX",
|
"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
|
end
|
||||||
|
|
||||||
if _OPTIONS["targetos"]=="windows" then
|
if _OPTIONS["targetos"]=="windows" then
|
||||||
|
Loading…
Reference in New Issue
Block a user