Previous 199869 Revisions Next

r36825 Tuesday 31st March, 2015 at 09:46:51 UTC by Vasantha Crabb
Bring back some SDL OSD configurability (WIP)
[/trunk]makefile
[scripts]genie.lua
[scripts/src/osd]sdl.lua sdl_cfg.lua windows.lua

trunk/makefile
r245336r245337
328328endif
329329PARAMS += --USE_QT=$(USE_QT)
330330
331ifdef NO_X11
332PARAMS += --NO_X11='$(NO_X11)'
333endif
334
335ifdef NO_USE_XINPUT
336PARAMS += --NO_USE_XINPUT='$(NO_USE_XINPUT)'
337endif
338
339ifdef SDL_LIBVER
340PARAMS += --SDL_LIBVER='$(SDL_LIBVER)'
341endif
342
343ifdef SDL_INSTALL_ROOT
344PARAMS += --SDL_INSTALL_ROOT='$(SDL_INSTALL_ROOT)'
345endif
346
347ifdef SDL_FRAMEWORK_PATH
348PARAMS += --SDL_FRAMEWORK_PATH='$(SDL_FRAMEWORK_PATH)'
349endif
350
351ifdef MACOSX_USE_LIBSDL
352PARAMS += --MACOSX_USE_LIBSDL='$(MACOSX_USE_LIBSDL)'
353endif
354
331355ifdef LDOPTS
332356PARAMS += --LDOPTS='$(LDOPTS)'
333357endif
trunk/scripts/genie.lua
r245336r245337
5050newoption {
5151   trigger = "with-tools",
5252   description = "Enable building tools.",
53}
53}
5454
5555newoption {
5656   trigger = "osd",
r245336r245337
709709         "GL",
710710         "m",
711711         "util",
712         "X11",
713         "Xinerama",
714712      }
715713      defines
716714      {
r245336r245337
726724
727725configuration { "osx*" }
728726      links {
729         "SDL2.framework",
730727         "Cocoa.framework",
731728         "OpenGL.framework",
732729         "CoreAudio.framework",
733730         "CoreMIDI.framework",
734731         "pthread",
735732      }
736      buildoptions {
737         "-F/Library/Frameworks/",
738      }
739      linkoptions {
740         "-F/Library/Frameworks/",
741      }
742733      flags {
743734         "Symbols",
744735      }
trunk/scripts/src/osd/sdl.lua
r245336r245337
11function maintargetosdoptions(_target)
2   if _OPTIONS["NO_X11"]~="1" then
3      links {
4         "X11",
5         "Xinerama",
6      }
7   end
8
9   if _OPTIONS["NO_USE_XINPUT"]~="1" then
10      links {
11         "Xext",
12         "Xi",
13      }
14   end
15
216   if _OPTIONS["targetos"]=="windows" then
317      linkoptions{
418         "-municode",
r245336r245337
1327            "QtCore4",
1428         }
1529      end
16   end
17   if _OPTIONS["targetos"]=="linux" then
30   elseif _OPTIONS["targetos"]=="linux" then
1831      if (USE_QT == 1) then
1932         links {
2033            "QtGui",
r245336r245337
3447end
3548
3649
50newoption {
51   trigger = "NO_X11",
52   description = "Disable use of X11",
53   allowed = {
54      { "0",  "Enable X11"  },
55      { "1",  "Disable X11" },
56   },
57}
58
59if not _OPTIONS["NO_X11"] then
60   if _OPTIONS["targetos"]=="windows" or _OPTIONS["targetos"]=="macosx" or _OPTIONS["targetos"]=="haiku" or _OPTIONS["targetos"]=="emscripten" or _OPTIONS["targetos"]=="os2" then
61      _OPTIONS["NO_X11"] = "1"
62   else
63      _OPTIONS["NO_X11"] = "0"
64   end
65end
66
67newoption {
68   trigger = "NO_USE_XINPUT",
69   description = "Disable use of Xinput",
70   allowed = {
71      { "0",  "Enable Xinput"  },
72      { "1",  "Disable Xinput" },
73   },
74}
75
76if not _OPTIONS["NO_USE_XINPUT"] then
77   _OPTIONS["NO_USE_XINPUT"] = "1"
78end
79
80newoption {
81   trigger = "SDL_LIBVER",
82   description = "Choose SDL version",
83   allowed = {
84      { "sdl",   "SDL"   },
85      { "sdl2",  "SDL 2" },
86   },
87}
88
89if not _OPTIONS["SDL_LIBVER"] then
90   if _OPTIONS["targetos"]=="os2" then
91      _OPTIONS["SDL_LIBVER"] = "sdl"
92   else
93      _OPTIONS["SDL_LIBVER"] = "sdl2"
94   end
95end
96
97newoption {
98   trigger = "SDL_INSTALL_ROOT",
99   description = "Equivalent to the ./configure --prefix=<path>",
100}
101
102newoption {
103   trigger = "SDL_FRAMEWORK_PATH",
104   description = "Location of SDL framework for custom OS X installations",
105}
106
107if not _OPTIONS["SDL_FRAMEWORK_PATH"] then
108   _OPTIONS["SDL_FRAMEWORK_PATH"] = "/Library/Frameworks/"
109end
110
111newoption {
112   trigger = "MACOSX_USE_LIBSDL",
113   description = "Use SDL library on OS (rather than framework)",
114   allowed = {
115      { "0",  "Use framework"  },
116      { "1",  "Use library" },
117   },
118}
119
120if not _OPTIONS["MACOSX_USE_LIBSDL"] then
121   _OPTIONS["MACOSX_USE_LIBSDL"] = "0"
122end
123
124
125if _OPTIONS["NO_X11"]~="1" and _OPTIONS["SDL_LIBVER"]=="sdl" then
126   links {
127      "X11"
128   }
129end
130
131if _OPTIONS["targetos"]=="macosx" and _OPTIONS["MACOSX_USE_LIBSDL"]~="1" then
132   buildoptions {
133      "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"],
134   }
135   linkoptions {
136      "-F" .. _OPTIONS["SDL_FRAMEWORK_PATH"],
137   }
138   if _OPTIONS["SDL_LIBVER"]=="sdl2" then
139      links {
140         "SDL2.framework",
141      }
142   else
143      links {
144         "SDL.framework",
145      }
146   end
147end
148
37149configuration { "mingw*" }
38150      linkoptions {
39151         "-Wl,--allow-multiple-definition",
r245336r245337
78190
79191   if _OPTIONS["targetos"]=="macosx" then
80192      files {
81         --MAME_DIR .. "src/osd/sdl/SDLMain_tmpl.m",
82193         MAME_DIR .. "src/osd/modules/debugger/debugosx.m",
83194         MAME_DIR .. "src/osd/modules/debugger/osx/breakpointsview.m",
84195         MAME_DIR .. "src/osd/modules/debugger/osx/consoleview.m",
r245336r245337
98209         MAME_DIR .. "src/osd/modules/debugger/osx/registersview.m",
99210         MAME_DIR .. "src/osd/modules/debugger/osx/watchpointsview.m",
100211      }
212      if _OPTIONS["SDL_LIBVER"]=="sdl" then
213         -- SDLMain_tmpl isn't necessary for SDL2
214         files {
215            MAME_DIR .. "src/osd/sdl/SDLMain_tmpl.m",
216         }
217      end
101218   end
102219
103220   files {
r245336r245337
107224      MAME_DIR .. "src/osd/sdl/window.c",
108225      MAME_DIR .. "src/osd/sdl/output.c",
109226      MAME_DIR .. "src/osd/sdl/watchdog.c",
227      MAME_DIR .. "src/osd/modules/lib/osdobj_common.c",
110228      MAME_DIR .. "src/osd/modules/render/drawsdl.c",
111      --ifeq ($(SDL_LIBVER),sdl2)
112      MAME_DIR .. "src/osd/modules/render/draw13.c",
113      --endif
229      MAME_DIR .. "src/osd/modules/render/drawogl.c",
114230      MAME_DIR .. "src/osd/modules/debugger/none.c",
115231      MAME_DIR .. "src/osd/modules/debugger/debugint.c",
116232      MAME_DIR .. "src/osd/modules/debugger/debugwin.c",
117233      MAME_DIR .. "src/osd/modules/debugger/debugqt.c",
118      MAME_DIR .. "src/osd/modules/render/drawogl.c",
119234      MAME_DIR .. "src/osd/modules/opengl/gl_shader_tool.c",
120235      MAME_DIR .. "src/osd/modules/opengl/gl_shader_mgr.c",
236      MAME_DIR .. "src/osd/modules/font/font_sdl.c",
237      MAME_DIR .. "src/osd/modules/font/font_windows.c",
238      MAME_DIR .. "src/osd/modules/font/font_osx.c",
239      MAME_DIR .. "src/osd/modules/font/font_none.c",
240      MAME_DIR .. "src/osd/modules/netdev/taptun.c",
241      MAME_DIR .. "src/osd/modules/netdev/pcap.c",
242      MAME_DIR .. "src/osd/modules/netdev/none.c",
243      MAME_DIR .. "src/osd/modules/midi/portmidi.c",
244      MAME_DIR .. "src/osd/modules/midi/none.c",
245      MAME_DIR .. "src/osd/modules/sound/js_sound.c",
246      MAME_DIR .. "src/osd/modules/sound/direct_sound.c",
247      MAME_DIR .. "src/osd/modules/sound/sdl_sound.c",
248      MAME_DIR .. "src/osd/modules/sound/none.c",
121249   }
250   if _OPTIONS["SDL_LIBVER"]=="sdl2" then
251      files {
252         MAME_DIR .. "src/osd/modules/render/draw13.c",
253      }
254   end
122255
123   if (USE_QT == 1) then
256   if USE_QT == 1 then
124257      files {
125258         MAME_DIR .. "src/osd/modules/debugger/qt/debuggerview.c",
126259         MAME_DIR .. "src/osd/modules/debugger/qt/windowqt.c",
r245336r245337
144277      }
145278   end
146279
147   if (USE_BGFX == 1) then
280   if USE_BGFX == 1 then
148281      files {
149282         MAME_DIR .. "src/osd/modules/render/drawbgfx.c",
150283      }
151284   end
152285
153   files {
154      MAME_DIR .. "src/osd/modules/lib/osdobj_common.c",
155      MAME_DIR .. "src/osd/modules/font/font_sdl.c",
156      MAME_DIR .. "src/osd/modules/font/font_windows.c",
157      MAME_DIR .. "src/osd/modules/font/font_osx.c",
158      MAME_DIR .. "src/osd/modules/font/font_none.c",
159      MAME_DIR .. "src/osd/modules/netdev/taptun.c",
160      MAME_DIR .. "src/osd/modules/netdev/pcap.c",
161      MAME_DIR .. "src/osd/modules/netdev/none.c",
162      MAME_DIR .. "src/osd/modules/midi/portmidi.c",
163      MAME_DIR .. "src/osd/modules/midi/none.c",
164      MAME_DIR .. "src/osd/modules/sound/js_sound.c",
165      MAME_DIR .. "src/osd/modules/sound/direct_sound.c",
166      MAME_DIR .. "src/osd/modules/sound/sdl_sound.c",
167      MAME_DIR .. "src/osd/modules/sound/none.c",
168   }
169   
286
170287project ("ocore_" .. _OPTIONS["osd"])
171288   uuid (os.uuid("ocore_" .. _OPTIONS["osd"]))
172289   kind "StaticLib"
r245336r245337
189306      MAME_DIR .. "src/osd/sdl",
190307   }
191308
192   if _OPTIONS["targetos"]=="linux" then
193      BASE_TARGETOS = "unix"
194      SDLOS_TARGETOS = "unix"
195      SYNC_IMPLEMENTATION = "tc"
196   end
197
198   if _OPTIONS["targetos"]=="windows" then
199      BASE_TARGETOS = "win32"
200      SDLOS_TARGETOS = "win32"
201      SYNC_IMPLEMENTATION = "windows"
202   end
203
204   if _OPTIONS["targetos"]=="macosx" then
205      BASE_TARGETOS = "unix"
206      SDLOS_TARGETOS = "macosx"
207      SYNC_IMPLEMENTATION = "ntc"
208   end
209
210309   files {
211310      MAME_DIR .. "src/osd/strconv.c",
212311      MAME_DIR .. "src/osd/sdl/sdldir.c",
r245336r245337
228327         MAME_DIR .. "src/osd/sdl/osxutils.m",
229328      }
230329   end
330
331
332--------------------------------------------------
333-- testkeys
334--------------------------------------------------
335
336if _OPTIONS["with-tools"] then
337   project("testkeys")
338      uuid ("744cec21-c3b6-4d69-93cb-6811fed0ffe3")
339      kind "ConsoleApp"
340
341      options {
342         "ForceCPP",
343      }
344
345      dofile("sdl_cfg.lua")
346
347      includedirs {
348         MAME_DIR .. "src/lib/util",
349      }
350      targetdir(MAME_DIR)
351
352      links {
353         "ocore_" .. _OPTIONS["osd"],
354      }
355
356      includeosd()
357
358      files {
359         MAME_DIR .. "src/osd/sdl/testkeys.c",
360      }
361
362      if _OPTIONS["targetos"]=="windows" then
363         linkoptions{
364            "-municode",
365         }
366         files {
367            MAME_DIR .. "src/osd/sdl/main.c",
368         }
369      elseif _OPTIONS["targetos"]=="macosx" and _OPTIONS["SDL_LIBVER"]=="sdl" then
370         -- SDLMain_tmpl isn't necessary for SDL2
371         files {
372            MAME_DIR .. "src/osd/sdl/SDLMain_tmpl.m",
373         }
374      end
375end
trunk/scripts/src/osd/sdl_cfg.lua
r245336r245337
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
125forcedincludes {
226   MAME_DIR .. "src/osd/sdl/sdlprefix.h"
327}
r245336r245337
226
27if _OPTIONS["NO_X11"]=="1" then
28   defines {
29      "SDLMAME_NO_X11",
30   }
31else
32   defines {
33      "SDLMAME_X11",
34   }
35   includedirs {
36      "/usr/X11/include",
37      "/usr/X11R6/include",
38      "/usr/openwin/include",
39   }
40end
41
42if _OPTIONS["NO_USE_XINPUT"]=="1" then
43   defines {
44      "USE_XINPUT=0",
45   }
46else
47   defines {
48      "USE_XINPUT=1",
49      "USE_XINPUT_DEBUG=0",
50   }
51end
52
53if _OPTIONS["SDL_LIBVER"]=="sdl2" then
54   defines {
55      "SDLMAME_SDL2=1",
56   }
57else
58   defines {
59      "SDLMAME_SDL2=0",
60   }
61end
62
63if USE_BGFX == 1 then
64   defines {
65      "USE_BGFX"
66   }
67end
68
69defines {
70   "OSD_SDL",
71}
72
73if BASE_TARGETOS=="unix" then
74   defines {
75      "SDLMAME_UNIX",
76   }
77end
78
379if _OPTIONS["targetos"]=="windows" then
480   defines {
5      "OSD_SDL",
681      "SDLMAME_WIN32",
782      "UNICODE",
883      "_UNICODE",
9      "SDLMAME_SDL2=1",
10      "USE_XINPUT=0",
1184      "USE_OPENGL=1",
r245336r245337
2194      "-I$(shell qmake -query QT_INSTALL_HEADERS)/QtGui",
2295      "-I$(shell qmake -query QT_INSTALL_HEADERS)",
2396   }
24end
25
26if _OPTIONS["targetos"]=="linux" then
97elseif _OPTIONS["targetos"]=="linux" then
2798   defines {
28      "OSD_SDL",
29      "SDLMAME_UNIX",
30      "SDLMAME_X11",
31      "SDLMAME_SDL2=1",
32      "USE_XINPUT=0",
3399      "USE_OPENGL=1",
34100      "USE_QTDEBUG=" .. USE_QT,
35101      "SDLMAME_NET_TAPTUN",
36102   }
37103
38   if (USE_BGFX == 1) then
39      defines {
40         "USE_BGFX"
41      }
42   end
43
44104   buildoptions {
45105      '$(shell pkg-config --cflags QtGui)',
46106   }
47end
48
49if _OPTIONS["targetos"]=="macosx" then
107elseif _OPTIONS["targetos"]=="macosx" then
50108   defines {
51      "OSD_SDL",
52      "SDLMAME_UNIX",
53109      "SDLMAME_MACOSX",
54110      "SDLMAME_DARWIN",
55      "SDLMAME_SDL2=1",
56      "USE_XINPUT=0",
57111      "USE_OPENGL=1",
58112      "USE_QTDEBUG=0",
59113      "SDLMAME_NET_PCAP",
60114   }
61
62   if (USE_BGFX == 1) then
63      defines {
64         "USE_BGFX"
65      }
66   end
115elseif _OPTIONS["targetos"]=="os2" then
116   defines {
117      "SDLMAME_OS2",
118   }
67119end
trunk/scripts/src/osd/windows.lua
r245336r245337
171171
172172      files {
173173         MAME_DIR .. "src/osd/windows/ledutil.c",
174   }
174      }
175175end


Previous 199869 Revisions Next


© 1997-2024 The MAME Team