Previous 199869 Revisions Next

r36826 Tuesday 31st March, 2015 at 09:46:51 UTC by Vasantha Crabb
Get NO_X11, NO_USE_XINPUT and SDL_LIBVER working on Linux
[scripts]genie.lua
[scripts/src/osd]sdl.lua sdl_cfg.lua

trunk/scripts/genie.lua
r245337r245338
695695   archivesplit_size "20"
696696
697697configuration { "linux-*" }
698      linkoptions {
699         "`sdl2-config --libs`",
700      }
701698      links {
702         "pthread",
703         "SDL2",
704         "SDL2_ttf",
705699         "asound",
706700         "dl",
707         "fontconfig",
708         "freetype",
709701         "GL",
710         "m",
711         "util",
712702      }
713703      defines
714704      {
r245337r245338
724714
725715configuration { "osx*" }
726716      links {
727         "Cocoa.framework",
728         "OpenGL.framework",
729717         "CoreAudio.framework",
730718         "CoreMIDI.framework",
731719         "pthread",
trunk/scripts/src/osd/sdl.lua
r245337r245338
1313      }
1414   end
1515
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
1631   if _OPTIONS["targetos"]=="windows" then
1732      linkoptions{
1833         "-municode",
r245337r245338
4762end
4863
4964
65function 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
71end
72
73
5074newoption {
5175   trigger = "NO_X11",
5276   description = "Disable use of X11",
r245337r245338
122146end
123147
124148
125if _OPTIONS["NO_X11"]~="1" and _OPTIONS["SDL_LIBVER"]=="sdl" then
126   links {
127      "X11"
128   }
149BASE_TARGETOS = "unix"
150SDLOS_TARGETOS = "unix"
151SYNC_IMPLEMENTATION = "tc"
152if _OPTIONS["targetos"]=="openbsd" then
153   SYNC_IMPLEMENTATION = "ntc"
154elseif _OPTIONS["targetos"]=="netbsd" then
155   SYNC_IMPLEMENTATION = "ntc"
156elseif _OPTIONS["targetos"]=="haiku" then
157   SYNC_IMPLEMENTATION = "ntc"
158elseif _OPTIONS["targetos"]=="emscripten" then
159   SYNC_IMPLEMENTATION = "mini"
160elseif _OPTIONS["targetos"]=="windows" then
161   BASE_TARGETOS = "win32"
162   SDLOS_TARGETOS = "win32"
163   SYNC_IMPLEMENTATION = "windows"
164elseif _OPTIONS["targetos"]=="macosx" then
165   SDLOS_TARGETOS = "macosx"
166   SYNC_IMPLEMENTATION = "ntc"
167elseif _OPTIONS["targetos"]=="os2" then
168   BASE_TARGETOS = "os2"
169   SDLOS_TARGETOS = "os2"
170   SYNC_IMPLEMENTATION = "os2"
129171end
130172
131if _OPTIONS["targetos"]=="macosx" and _OPTIONS["MACOSX_USE_LIBSDL"]~="1" then
132   buildoptions {
133      "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"],
134   }
173if _OPTIONS["NO_X11"]~="1" then
135174   linkoptions {
136      "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"],
175      "-L/usr/X11/lib",
176      "-L/usr/X11R6/lib",
177      "-L/usr/openwin/lib",
137178   }
138   if _OPTIONS["SDL_LIBVER"]=="sdl2" then
179   if _OPTIONS["SDL_LIBVER"]=="sdl" then
139180      links {
140         "SDL2.framework",
181         "X11",
141182      }
142   else
183   end
184end
185
186if BASE_TARGETOS=="unix" then
187   if _OPTIONS["targetos"]=="macosx" then
143188      links {
144         "SDL.framework",
189         "Cocoa.framework",
190         "OpenGL.framework",
145191      }
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
146230   end
147231end
148232
r245337r245338
350434      targetdir(MAME_DIR)
351435
352436      links {
437         "utils",
353438         "ocore_" .. _OPTIONS["osd"],
354439      }
355440
trunk/scripts/src/osd/sdl_cfg.lua
r245337r245338
1BASE_TARGETOS = "unix"
2SDLOS_TARGETOS = "unix"
3SYNC_IMPLEMENTATION = "tc"
4if _OPTIONS["targetos"]=="openbsd" then
5   SYNC_IMPLEMENTATION = "ntc"
6elseif _OPTIONS["targetos"]=="netbsd" then
7   SYNC_IMPLEMENTATION = "ntc"
8elseif _OPTIONS["targetos"]=="haiku" then
9   SYNC_IMPLEMENTATION = "ntc"
10elseif _OPTIONS["targetos"]=="emscripten" then
11   SYNC_IMPLEMENTATION = "mini"
12elseif _OPTIONS["targetos"]=="windows" then
13   BASE_TARGETOS = "win32"
14   SDLOS_TARGETOS = "win32"
15   SYNC_IMPLEMENTATION = "windows"
16elseif _OPTIONS["targetos"]=="macosx" then
17   SDLOS_TARGETOS = "macosx"
18   SYNC_IMPLEMENTATION = "ntc"
19elseif _OPTIONS["targetos"]=="os2" then
20   BASE_TARGETOS = "os2"
21   SDLOS_TARGETOS = "os2"
22   SYNC_IMPLEMENTATION = "os2"
23end
24
251forcedincludes {
262   MAME_DIR .. "src/osd/sdl/sdlprefix.h"
273}
r245337r245338
5935else
6036   defines {
6137      "SDLMAME_SDL2=0",
38      "SYNC_IMPLEMENTATION=" .. SYNC_IMPLEMENTATION,
6239   }
6340end
6441
r245337r245338
7653   defines {
7754      "SDLMAME_UNIX",
7855   }
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
7980end
8081
8182if _OPTIONS["targetos"]=="windows" then


Previous 199869 Revisions Next


© 1997-2024 The MAME Team