VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedOpenGL/Makefile.kmk@ 78192

Last change on this file since 78192 was 78192, checked in by vboxsync, 6 years ago

Build fix for OS X, set VBoxOGLTest_TEMPLATE to VBOXR3NP as we use a deprecated function (gluCheckExtension), the VBOX_WITH_COCOA_QT define was removed which disabled the code block previously because it is not defined in the flags of the target (@todo Check whether VBoxOGLTest is really required for OS X or whether it can be disabled completely)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 12.8 KB
Line 
1# $Id: Makefile.kmk 78192 2019-04-18 00:32:34Z vboxsync $
2## @file
3# Sub-Makefile for the Shared OpenGL Host Service.
4#
5
6#
7# Copyright (C) 2008-2019 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17
18SUB_DEPTH = ../../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21
22#
23# Target lists.
24#
25ifdef VBOX_WITH_MAIN
26DLLS += VBoxSharedCrOpenGL VBoxOGLrenderspu
27LIBRARIES += VBoxOGLcrserverlib VBoxOGLcrunpacker
28BLDDIRS += \
29 $(VBOX_PATH_CROGL_GENFILES)/
30endif
31
32ifeq ($(KBUILD_TARGET),darwin)
33 #
34 # We have to symlink the system headers of OpenGl cause they have some
35 # different directory hierarchy on Mac OS X (no /GL sub directory).
36 #
37 # See Config.kmk for the global variables.
38 #
39 INSTALLS += DarwinOpenGLHdrs
40 DarwinOpenGLHdrs_INST = $(VBOX_DARWIN_OPENGL_INST)
41 DarwinOpenGLHdrs_SYMLINKS = \
42 $(foreach hdr, $(VBOX_DARWIN_OPENGL_HEADERS),\
43 $(hdr)=>$(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/$(hdr))
44endif # darwin
45
46#
47# VBoxSharedCrOpenGL
48#
49VBoxSharedCrOpenGL_TEMPLATE = VBOXCROGLR3HOSTDLL
50ifdef VBOX_WITH_XPCOM
51 VBoxSharedCrOpenGL_DEFS = VBOX_WITH_XPCOM
52 VBoxSharedCrOpenGL_CXXFLAGS = -Wno-non-virtual-dtor -fshort-wchar $(VBOX_GCC_std)
53endif
54VBoxSharedCrOpenGL_INTERMEDIATES = \
55 $(TEMPLATE_VBOXMAINEXE_INTERMEDIATES)
56VBoxSharedCrOpenGL_INCS = $(VBOX_GRAPHICS_INCS)
57VBoxSharedCrOpenGL_INCS.win = \
58 $(VBOX_PATH_SDK)/bindings/mscom/include
59ifdef VBOX_WITH_XPCOM
60VBoxSharedCrOpenGL_INCS += \
61 $(VBOX_XPCOM_INCS)
62endif
63VBoxSharedCrOpenGL_SOURCES = \
64 crserver/crservice.cpp
65VBoxSharedCrOpenGL_SOURCES.win = \
66 crserver/VBoxSharedCrOpenGL.rc
67VBoxSharedCrOpenGL_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxSharedCrOpenGL.dylib
68VBoxSharedCrOpenGL_LIBS = \
69 $(PATH_STAGE_LIB)/VBoxOGLcrserverlib$(VBOX_SUFF_LIB) \
70 $(PATH_STAGE_LIB)/VBoxOGLhostcrstate$(VBOX_SUFF_LIB) \
71 $(PATH_STAGE_LIB)/VBoxOGLcrunpacker$(VBOX_SUFF_LIB) \
72 $(PATH_STAGE_LIB)/VBoxOGLhostcrpacker$(VBOX_SUFF_LIB) \
73 $(PATH_STAGE_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB) \
74 $(VBOX_LIB_OGL_HOSTCRUTIL) \
75 $(PATH_STAGE_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \
76 $(LIB_RUNTIME) \
77 $(LIB_VMM)
78VBoxSharedCrOpenGL_LIBS.darwin = \
79 $(LIB_REM)
80ifeq ($(KBUILD_TARGET),win)
81 VBoxSharedCrOpenGL_LIBS += \
82 $(PATH_OBJ)/VBoxOGLrenderspu/VBoxOGLrenderspu$(VBOX_SUFF_LIB)
83else
84 VBoxSharedCrOpenGL_LIBS += \
85 $(PATH_STAGE_BIN)/VBoxOGLrenderspu$(VBOX_SUFF_DLL)
86endif
87ifdef VBOX_WITH_XPCOM
88 VBoxSharedCrOpenGL_LIBS += \
89 $(LIB_XPCOM)
90endif
91ifdef VBOX_WITH_CRHGSMI
92VBoxSharedCrOpenGL_DEFS += VBOX_WITH_CRHGSMI
93endif
94
95#
96# VBoxOGLcrserverlib
97#
98VBoxOGLcrserverlib_TEMPLATE = VBOXCROGLR3HOSTLIB
99VBoxOGLcrserverlib_INCS = \
100 . \
101 crserverlib \
102 $(VBOX_GRAPHICS_INCS)
103VBoxOGLcrserverlib_INTERMEDIATES = \
104 $(VBOX_PATH_CROGL_GENFILES)/spu_dispatch_table.h \
105 $(VBOX_PATH_CROGL_GENFILES)/server_dispatch.h \
106 $(VBOX_PATH_CROGL_GENFILES)/cr_opcodes.h \
107 $(VBOX_PATH_CROGL_GENFILES)/state/cr_currentpointers.h \
108 $(VBOX_PATH_CROGL_GENFILES)/state/cr_statefuncs.h
109
110VBoxOGLcrserverlib_SOURCES := \
111 crserverlib/server_main.cpp \
112 crserverlib/server_boundsinfo.cpp \
113 crserverlib/server_bufferobject.cpp \
114 crserverlib/server_clear.cpp \
115 crserverlib/server_clip.cpp \
116 crserverlib/server_config.cpp \
117 crserverlib/server_context.cpp \
118 crserverlib/server_gentextures.cpp \
119 crserverlib/server_getmap.cpp \
120 crserverlib/server_getstring.cpp \
121 crserverlib/server_getpointer.cpp \
122 crserverlib/server_getpixelmap.cpp \
123 crserverlib/server_getteximage.cpp \
124 crserverlib/server_lists.cpp \
125 crserverlib/server_misc.cpp \
126 crserverlib/server_occlude.cpp \
127 crserverlib/server_papi.cpp \
128 crserverlib/server_projmatrix.cpp \
129 crserverlib/server_readpixels.cpp \
130 crserverlib/server_stream.cpp \
131 crserverlib/server_viewport.cpp \
132 crserverlib/server_window.cpp \
133 crserverlib/server_winpos.cpp \
134 crserverlib/server_writeback.cpp \
135 crserverlib/server_getshaders.cpp \
136 crserverlib/server_framebuffer.cpp \
137 crserverlib/server_glsl.cpp \
138 crserverlib/server_muralfbo.cpp \
139 crserverlib/server_texture.cpp \
140 crserverlib/presenter/server_presenter.cpp \
141 crserverlib/presenter/display_base.cpp \
142 crserverlib/presenter/display_composite.cpp \
143 crserverlib/presenter/window.cpp \
144 crserverlib/presenter/display_window.cpp \
145 crserverlib/presenter/display_window_rootvr.cpp \
146 crserverlib/presenter/display_vrdp.cpp \
147 crserverlib/server_rpw.cpp \
148 $(VBOX_PATH_CROGL_GENFILES)/server_dispatch.cpp \
149 $(VBOX_PATH_CROGL_GENFILES)/server_retval.cpp \
150 $(VBOX_PATH_CROGL_GENFILES)/server_get.cpp \
151 $(VBOX_PATH_CROGL_GENFILES)/server_simpleget.cpp
152VBoxOGLcrserverlib_CLEAN = \
153 $(VBOX_PATH_CROGL_GENFILES)/server_dispatch.cpp \
154 $(VBOX_PATH_CROGL_GENFILES)/server_retval.cpp \
155 $(VBOX_PATH_CROGL_GENFILES)/server_get.cpp \
156 $(VBOX_PATH_CROGL_GENFILES)/server_simpleget.cpp \
157 $(VBOX_PATH_CROGL_GENFILES)/server_dispatch.h
158ifdef VBOXCR_LOGFPS
159VBoxOGLcrserverlib_DEFS += VBOXCR_LOGFPS
160endif
161ifdef VBOX_WITH_CRHGSMI
162VBoxOGLcrserverlib_DEFS += ifdef VBOX_WITH_CRHGSMI
163endif
164ifdef VBOX_WITH_CRDUMPER
165VBoxOGLcrserverlib_DEFS += VBOX_WITH_CRDUMPER
166endif
167ifdef VBOX_WITH_CRSERVER_DUMPER
168VBoxOGLcrserverlib_DEFS += VBOX_WITH_CRSERVER_DUMPER
169endif
170
171
172#
173# Generate files for VBoxOGLcrserverlib
174#
175$(VBOX_PATH_CROGL_GENFILES)/server_dispatch.h: $(addprefix $(PATH_SUB_CURRENT)/crserverlib/, server_dispatch_header.py server_special) $(VBOX_CROGL_API_FILES) $(PATH_ROOT)/src/VBox/GuestHost/OpenGL/state_tracker/state_special | $$(dir $$@)
176 $(call MSG_GENERATE,python,$@,$<)
177 $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
178
179$(VBOX_PATH_CROGL_GENFILES)/server_dispatch.cpp: $(addprefix $(PATH_SUB_CURRENT)/crserverlib/, server_dispatch.py server_special) $(VBOX_CROGL_API_FILES) $(PATH_ROOT)/src/VBox/GuestHost/OpenGL/state_tracker/state_special | $$(dir $$@)
180 $(call MSG_GENERATE,python,$@,$<)
181 $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
182
183$(VBOX_PATH_CROGL_GENFILES)/server_retval.cpp: $(addprefix $(PATH_SUB_CURRENT)/crserverlib/, server_retval.py server_special) $(VBOX_CROGL_API_FILES) | $$(dir $$@)
184 $(call MSG_GENERATE,python,$@,$<)
185 $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
186
187$(VBOX_PATH_CROGL_GENFILES)/server_get.cpp: $(addprefix $(PATH_SUB_CURRENT)/crserverlib/, server_get.py server_special) $(VBOX_CROGL_API_FILES) | $$(dir $$@)
188 $(call MSG_GENERATE,python,$@,$<)
189 $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
190
191$(VBOX_PATH_CROGL_GENFILES)/server_simpleget.cpp: $(addprefix $(PATH_SUB_CURRENT)/crserverlib/, server_simpleget.py get_sizes.py) $(VBOX_CROGL_API_FILES) | $$(dir $$@)
192 $(call MSG_GENERATE,python,$@,$<)
193 $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
194
195
196#
197# VBoxOGLcrunpacker
198#
199VBoxOGLcrunpacker_TEMPLATE = VBOXCROGLR3HOSTLIB
200VBoxOGLcrunpacker_INCS = \
201 unpacker \
202 $(VBOX_GRAPHICS_INCS)
203VBoxOGLcrunpacker_INTERMEDIATES = \
204 $(VBOX_PATH_CROGL_GENFILES)/spu_dispatch_table.h \
205 $(VBOX_PATH_CROGL_GENFILES)/cr_opcodes.h \
206 $(VBOX_PATH_CROGL_GENFILES)/unpack_extend.h \
207 $(VBOX_PATH_CROGL_GENFILES)/state/cr_currentpointers.h \
208 $(VBOX_PATH_CROGL_GENFILES)/state/cr_statefuncs.h
209VBoxOGLcrunpacker_SOURCES = \
210 unpacker/unpack_arrays.cpp \
211 unpacker/unpack_bounds.cpp \
212 unpacker/unpack_bufferobject.cpp \
213 unpacker/unpack_calllists.cpp \
214 unpacker/unpack_clipplane.cpp \
215 unpacker/unpack_context.cpp \
216 unpacker/unpack_drawpixels.cpp \
217 unpacker/unpack_fence.cpp \
218 unpacker/unpack_fog.cpp \
219 unpacker/unpack_lights.cpp \
220 unpacker/unpack_map.cpp \
221 unpacker/unpack_materials.cpp \
222 unpacker/unpack_matrices.cpp \
223 unpacker/unpack_misc.cpp \
224 unpacker/unpack_pixelmap.cpp \
225 unpacker/unpack_point.cpp \
226 unpacker/unpack_program.cpp \
227 unpacker/unpack_readpixels.cpp \
228 unpacker/unpack_regcombiner.cpp \
229 unpacker/unpack_stipple.cpp \
230 unpacker/unpack_texture.cpp \
231 unpacker/unpack_writeback.cpp \
232 unpacker/unpack_visibleregion.cpp \
233 unpacker/unpack_shaders.cpp \
234 unpacker/unpack_framebuffer.cpp \
235 $(VBOX_PATH_CROGL_GENFILES)/unpack.cpp
236VBoxOGLcrunpacker_CLEAN = \
237 $(VBOX_PATH_CROGL_GENFILES)/unpack.cpp \
238 $(VBOX_PATH_CROGL_GENFILES)/unpack_extend.h
239
240#
241# Generate files for VBoxOGLcrunpacker.
242#
243$(VBOX_PATH_CROGL_GENFILES)/unpack.cpp: \
244 $(addprefix $(PATH_SUB_CURRENT)/unpacker/, unpack.py unpacker_special) \
245 $(VBOX_PATH_CROGL_GENFILES)/unpack_extend.h \
246 $(VBOX_CROGL_API_FILES) \
247 | $$(dir $$@)
248 $(call MSG_GENERATE,python,$@,$<)
249 $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
250
251$(VBOX_PATH_CROGL_GENFILES)/unpack_extend.h: \
252 $(addprefix $(PATH_SUB_CURRENT)/unpacker/, unpack_extend.py unpacker_special) \
253 $(VBOX_CROGL_API_FILES) \
254 | $$(dir $$@)
255 $(call MSG_GENERATE,python,$@,$<)
256 $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
257
258
259#
260# VBoxOGLrenderspu
261#
262VBoxOGLrenderspu_TEMPLATE = VBOXCROGLR3HOSTDLL
263VBoxOGLrenderspu_INTERMEDIATES = \
264 $(VBOX_PATH_CROGL_GENFILES)/state/cr_currentpointers.h \
265 $(VBOX_PATH_CROGL_GENFILES)/state/cr_statefuncs.h
266VBoxOGLrenderspu_INCS = $(VBOX_GRAPHICS_INCS)
267VBoxOGLrenderspu_SOURCES = \
268 render/renderspu.c \
269 render/renderspu_config.c \
270 render/renderspu_init.c
271VBoxOGLrenderspu_SOURCES.win = \
272 render/renderspu_wgl.c \
273 render/render.def \
274 render/VBoxOGLrenderspu.rc
275VBoxOGLrenderspu_SOURCES.linux = render/renderspu_glx.c
276VBoxOGLrenderspu_SOURCES.solaris = render/renderspu_glx.c
277VBoxOGLrenderspu_SOURCES.freebsd = render/renderspu_glx.c
278VBoxOGLrenderspu_OBJCFLAGS.darwin = -Wno-shadow
279VBoxOGLrenderspu_SOURCES.darwin = \
280 OpenGLTest/OpenGLTestDarwin.cpp \
281 render/renderspu_cocoa.c \
282 render/renderspu_cocoa_helper.m
283ifdef VBOX_WITH_CRHGSMI
284VBoxOGLrenderspu_DEFS += VBOX_WITH_CRHGSMI
285endif
286ifdef VBOX_WITH_VDMA
287VBoxOGLrenderspu_DEFS += VBOX_WITH_VDMA
288endif
289VBoxOGLrenderspu_LDFLAGS.darwin += -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxOGLrenderspu.dylib -framework IOKit
290VBoxOGLrenderspu_LIBS = \
291 $(PATH_STAGE_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB) \
292 $(VBOX_LIB_OGL_HOSTCRUTIL) \
293 $(LIB_RUNTIME)
294if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris) # the X11 gang
295 VBoxOGLrenderspu_LIBS += \
296 Xmu \
297 X11 \
298 Xext
299 VBoxOGLrenderspu_LIBPATH = \
300 $(VBOX_LIBPATH_X11)
301endif
302
303LIBRARIES += VBoxOGLTest
304VBoxOGLTest_TEMPLATE = VBOXR3NP
305ifneq ($(KBUILD_TARGET),darwin)
306 VBoxOGLTest_SOURCES = OpenGLTest/OpenGLTest.cpp
307endif
308VBoxOGLTest_SOURCES.darwin = OpenGLTest/OpenGLTestDarwin.cpp
309
310#
311# VBoxTestOGL - OpenGL support test app.
312# Note! Doesn't link with VBOX_WITH_DEBUG_VCC_CRT defined because it uses Qt.
313#
314if ( defined(VBOX_WITH_QTGUI) \
315 && (defined(VBOX_WITH_CROGL) || defined(VBOX_WITH_VIDEOHWACCEL)) \
316 && !defined(VBOX_WITH_DEBUG_VCC_CRT))
317 ifneq ($(KBUILD_TARGET),darwin)
318 ifdef VBOX_WITH_VIDEOHWACCEL
319 USES += qt5
320 endif
321 PROGRAMS += VBoxTestOGL
322 VBoxTestOGL_TEMPLATE = $(if $(VBOX_WITH_VIDEOHWACCEL),$(if $(VBOX_WITH_HARDENING),VBOXQTGUI,VBOXQTGUIEXE),VBOXMAINEXE)
323 VBoxTestOGL_SOURCES = OpenGLTest/OpenGLTestApp.cpp
324 VBoxTestOGL_SOURCES.win = OpenGLTest/VBoxTestOGL.rc
325 VBoxTestOGL_LIBS = \
326 $(if $(VBOX_WITH_CROGL), \
327 $(PATH_STAGE_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB) \
328 $(VBOX_LIB_OGL_HOSTCRUTIL),) \
329 $(if $(VBOX_WITH_VIDEOHWACCEL), $(PATH_STAGE_LIB)/VBoxOGL2D$(VBOX_SUFF_LIB),) \
330 $(LIB_RUNTIME)
331 VBoxTestOGL_DEFS += \
332 VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\" \
333 $(if $(VBOX_WITH_CROGL), VBOX_WITH_CROGL,) \
334 $(if $(VBOX_WITH_VIDEOHWACCEL), VBOX_WITH_VIDEOHWACCEL,)
335 ifdef VBOX_WITH_VIDEOHWACCEL
336 VBoxTestOGL_QT_MODULES += Core Gui OpenGL Widgets
337 VBoxTestOGL_LIBS.linux += xcb
338 VBoxTestOGL_LIBS.solaris += xcb
339 VBoxTestOGL_LIBS.freebsd += xcb
340 VBoxTestOGL_LDFLAGS.darwin += -framework OpenGL
341 VBoxTestOGL_LIBS.win += $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/Opengl32.lib
342 if1of ($(KBUILD_TARGET), solaris linux freebsd)
343 # must come after VBoxOGL2D, therefore don't set the arch-specific LIBS variable here!
344 VBoxTestOGL_LIBS += GL
345 endif
346 endif
347 # Don't let ld strip out explicitly linked libraries even when they are not needed.
348 # This was causing some dynamic library loading problems in case of indirect dependencies
349 # in systems where RUNPATH instead of RPATH is utilized.
350 VBoxTestOGL_LDFLAGS.linux = -Wl,--no-as-needed
351 VBoxTestOGL_LDFLAGS.win = /SUBSYSTEM:windows
352 endif
353endif
354
355include $(FILE_KBUILD_SUB_FOOTER)
356
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette