trunk/scripts/src/osd/sdl.lua
r245337 | r245338 | |
13 | 13 | } |
14 | 14 | end |
15 | 15 | |
| 16 | if BASE_TARGETOS=="unix" and _OPTIONS["targetos"]~="macosx" then |
| 17 | if _OPTIONS["SDL_LIBVER"]=="sdl2" then |
| 18 | links { |
| 19 | "SDL2_ttf", |
| 20 | } |
| 21 | else |
| 22 | links { |
| 23 | "SDL_ttf", |
| 24 | } |
| 25 | end |
| 26 | linkoptions { |
| 27 | string.gsub(os.outputof("pkg-config --libs fontconfig"), '[\r\n]+', ' '), |
| 28 | } |
| 29 | end |
| 30 | |
16 | 31 | if _OPTIONS["targetos"]=="windows" then |
17 | 32 | linkoptions{ |
18 | 33 | "-municode", |
r245337 | r245338 | |
47 | 62 | end |
48 | 63 | |
49 | 64 | |
| 65 | function sdlconfigcmd() |
| 66 | if not _OPTIONS["SDL_INSTALL_ROOT"] then |
| 67 | return _OPTIONS["SDL_LIBVER"] .. "-config" |
| 68 | else |
| 69 | return _OPTIONS["SDL_INSTALL_ROOT"] .. "/bin/" .. _OPTIONS["SDL_LIBVER"] .. "-config" |
| 70 | end |
| 71 | end |
| 72 | |
| 73 | |
50 | 74 | newoption { |
51 | 75 | trigger = "NO_X11", |
52 | 76 | description = "Disable use of X11", |
r245337 | r245338 | |
122 | 146 | end |
123 | 147 | |
124 | 148 | |
125 | | if _OPTIONS["NO_X11"]~="1" and _OPTIONS["SDL_LIBVER"]=="sdl" then |
126 | | links { |
127 | | "X11" |
128 | | } |
| 149 | BASE_TARGETOS = "unix" |
| 150 | SDLOS_TARGETOS = "unix" |
| 151 | SYNC_IMPLEMENTATION = "tc" |
| 152 | if _OPTIONS["targetos"]=="openbsd" then |
| 153 | SYNC_IMPLEMENTATION = "ntc" |
| 154 | elseif _OPTIONS["targetos"]=="netbsd" then |
| 155 | SYNC_IMPLEMENTATION = "ntc" |
| 156 | elseif _OPTIONS["targetos"]=="haiku" then |
| 157 | SYNC_IMPLEMENTATION = "ntc" |
| 158 | elseif _OPTIONS["targetos"]=="emscripten" then |
| 159 | SYNC_IMPLEMENTATION = "mini" |
| 160 | elseif _OPTIONS["targetos"]=="windows" then |
| 161 | BASE_TARGETOS = "win32" |
| 162 | SDLOS_TARGETOS = "win32" |
| 163 | SYNC_IMPLEMENTATION = "windows" |
| 164 | elseif _OPTIONS["targetos"]=="macosx" then |
| 165 | SDLOS_TARGETOS = "macosx" |
| 166 | SYNC_IMPLEMENTATION = "ntc" |
| 167 | elseif _OPTIONS["targetos"]=="os2" then |
| 168 | BASE_TARGETOS = "os2" |
| 169 | SDLOS_TARGETOS = "os2" |
| 170 | SYNC_IMPLEMENTATION = "os2" |
129 | 171 | end |
130 | 172 | |
131 | | if _OPTIONS["targetos"]=="macosx" and _OPTIONS["MACOSX_USE_LIBSDL"]~="1" then |
132 | | buildoptions { |
133 | | "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"], |
134 | | } |
| 173 | if _OPTIONS["NO_X11"]~="1" then |
135 | 174 | linkoptions { |
136 | | "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"], |
| 175 | "-L/usr/X11/lib", |
| 176 | "-L/usr/X11R6/lib", |
| 177 | "-L/usr/openwin/lib", |
137 | 178 | } |
138 | | if _OPTIONS["SDL_LIBVER"]=="sdl2" then |
| 179 | if _OPTIONS["SDL_LIBVER"]=="sdl" then |
139 | 180 | links { |
140 | | "SDL2.framework", |
| 181 | "X11", |
141 | 182 | } |
142 | | else |
| 183 | end |
| 184 | end |
| 185 | |
| 186 | if BASE_TARGETOS=="unix" then |
| 187 | if _OPTIONS["targetos"]=="macosx" then |
143 | 188 | links { |
144 | | "SDL.framework", |
| 189 | "Cocoa.framework", |
| 190 | "OpenGL.framework", |
145 | 191 | } |
| 192 | if _OPTIONS["MACOSX_USE_LIBSDL"]~="1" then |
| 193 | linkoptions { |
| 194 | "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"], |
| 195 | } |
| 196 | if _OPTIONS["SDL_LIBVER"]=="sdl2" then |
| 197 | links { |
| 198 | "SDL2.framework", |
| 199 | } |
| 200 | else |
| 201 | links { |
| 202 | "SDL.framework", |
| 203 | } |
| 204 | end |
| 205 | else |
| 206 | linkoptions { |
| 207 | string.gsub(os.outputof(sdlconfigcmd() .. " --libs | sed 's/-lSDLmain//'"), '[\r\n]+', ' '), |
| 208 | } |
| 209 | end |
| 210 | else |
| 211 | linkoptions { |
| 212 | string.gsub(os.outputof(sdlconfigcmd() .. " --libs"), '[\r\n]+', ' '), |
| 213 | } |
| 214 | if _OPTIONS["targetos"]~="haiku" then |
| 215 | links { |
| 216 | "m", |
| 217 | "pthread", |
| 218 | } |
| 219 | if _OPTIONS["targetos"]=="solaris" then |
| 220 | links { |
| 221 | "socket", |
| 222 | "nsl", |
| 223 | } |
| 224 | else |
| 225 | links { |
| 226 | "util", |
| 227 | } |
| 228 | end |
| 229 | end |
146 | 230 | end |
147 | 231 | end |
148 | 232 | |
r245337 | r245338 | |
350 | 434 | targetdir(MAME_DIR) |
351 | 435 | |
352 | 436 | links { |
| 437 | "utils", |
353 | 438 | "ocore_" .. _OPTIONS["osd"], |
354 | 439 | } |
355 | 440 | |
trunk/scripts/src/osd/sdl_cfg.lua
r245337 | r245338 | |
1 | | BASE_TARGETOS = "unix" |
2 | | SDLOS_TARGETOS = "unix" |
3 | | SYNC_IMPLEMENTATION = "tc" |
4 | | if _OPTIONS["targetos"]=="openbsd" then |
5 | | SYNC_IMPLEMENTATION = "ntc" |
6 | | elseif _OPTIONS["targetos"]=="netbsd" then |
7 | | SYNC_IMPLEMENTATION = "ntc" |
8 | | elseif _OPTIONS["targetos"]=="haiku" then |
9 | | SYNC_IMPLEMENTATION = "ntc" |
10 | | elseif _OPTIONS["targetos"]=="emscripten" then |
11 | | SYNC_IMPLEMENTATION = "mini" |
12 | | elseif _OPTIONS["targetos"]=="windows" then |
13 | | BASE_TARGETOS = "win32" |
14 | | SDLOS_TARGETOS = "win32" |
15 | | SYNC_IMPLEMENTATION = "windows" |
16 | | elseif _OPTIONS["targetos"]=="macosx" then |
17 | | SDLOS_TARGETOS = "macosx" |
18 | | SYNC_IMPLEMENTATION = "ntc" |
19 | | elseif _OPTIONS["targetos"]=="os2" then |
20 | | BASE_TARGETOS = "os2" |
21 | | SDLOS_TARGETOS = "os2" |
22 | | SYNC_IMPLEMENTATION = "os2" |
23 | | end |
24 | | |
25 | 1 | forcedincludes { |
26 | 2 | MAME_DIR .. "src/osd/sdl/sdlprefix.h" |
27 | 3 | } |
r245337 | r245338 | |
59 | 35 | else |
60 | 36 | defines { |
61 | 37 | "SDLMAME_SDL2=0", |
| 38 | "SYNC_IMPLEMENTATION=" .. SYNC_IMPLEMENTATION, |
62 | 39 | } |
63 | 40 | end |
64 | 41 | |
r245337 | r245338 | |
76 | 53 | defines { |
77 | 54 | "SDLMAME_UNIX", |
78 | 55 | } |
| 56 | if _OPTIONS["targetos"]=="macosx" then |
| 57 | if _OPTIONS["MACOSX_USE_LIBSDL"]~="1" then |
| 58 | buildoptions { |
| 59 | "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"], |
| 60 | } |
| 61 | else |
| 62 | defines { |
| 63 | "NO_SDL_GLEXT", |
| 64 | "MACOSX_USE_LIBSDL", |
| 65 | } |
| 66 | buildoptions { |
| 67 | string.gsub(os.outputof(sdlconfigcmd() .. " --cflags | sed 's:/SDL::'"), '[\r\n]+', ' '), |
| 68 | } |
| 69 | end |
| 70 | else |
| 71 | buildoptions { |
| 72 | string.gsub(os.outputof(sdlconfigcmd() .. " --cflags"), '[\r\n]+', ' '), |
| 73 | } |
| 74 | if _OPTIONS["targetos"]~="emscripten" then |
| 75 | buildoptions { |
| 76 | string.gsub(os.outputof("pkg-config --cflags fontconfig"), '[\r\n]+', ' '), |
| 77 | } |
| 78 | end |
| 79 | end |
79 | 80 | end |
80 | 81 | |
81 | 82 | if _OPTIONS["targetos"]=="windows" then |