VirtualBox

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

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

HostServices/SharedOpenGL/OpenGLTestApp: Additional linux fix for r130405

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 13.1 KB
Line 
1# $Id: Makefile.kmk 78415 2019-05-06 22:01:52Z 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
27LIBRARIES += VBoxOGLcrserverlib VBoxOGLcrunpacker VBoxOGLrenderspu
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 -framework IOKit
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 $(PATH_STAGE_LIB)/VBoxOGLhostcrutil$(VBOX_SUFF_LIB) \
75 $(PATH_STAGE_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB) \
76 $(PATH_STAGE_LIB)/VBoxOGLrenderspu$(VBOX_SUFF_LIB) \
77 $(PATH_STAGE_LIB)/VBoxOGLhosterrorspu$(VBOX_SUFF_LIB) \
78 $(PATH_STAGE_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \
79 $(LIB_RUNTIME) \
80 $(LIB_VMM)
81VBoxSharedCrOpenGL_LIBS.darwin = \
82 $(LIB_REM)
83ifdef VBOX_WITH_XPCOM
84 VBoxSharedCrOpenGL_LIBS += \
85 $(LIB_XPCOM)
86endif
87ifdef VBOX_WITH_CRHGSMI
88VBoxSharedCrOpenGL_DEFS += VBOX_WITH_CRHGSMI
89endif
90
91#
92# VBoxOGLcrserverlib
93#
94VBoxOGLcrserverlib_TEMPLATE = VBOXCROGLR3HOSTLIB
95VBoxOGLcrserverlib_INCS = \
96 . \
97 crserverlib \
98 $(VBOX_GRAPHICS_INCS)
99VBoxOGLcrserverlib_INTERMEDIATES = \
100 $(VBOX_PATH_CROGL_GENFILES)/spu_dispatch_table.h \
101 $(VBOX_PATH_CROGL_GENFILES)/server_dispatch.h \
102 $(VBOX_PATH_CROGL_GENFILES)/cr_opcodes.h \
103 $(VBOX_PATH_CROGL_GENFILES)/state/cr_currentpointers.h \
104 $(VBOX_PATH_CROGL_GENFILES)/state/cr_statefuncs.h
105
106VBoxOGLcrserverlib_SOURCES := \
107 crserverlib/server_main.cpp \
108 crserverlib/server_boundsinfo.cpp \
109 crserverlib/server_bufferobject.cpp \
110 crserverlib/server_clear.cpp \
111 crserverlib/server_clip.cpp \
112 crserverlib/server_config.cpp \
113 crserverlib/server_context.cpp \
114 crserverlib/server_gentextures.cpp \
115 crserverlib/server_getmap.cpp \
116 crserverlib/server_getstring.cpp \
117 crserverlib/server_getpointer.cpp \
118 crserverlib/server_getpixelmap.cpp \
119 crserverlib/server_getteximage.cpp \
120 crserverlib/server_lists.cpp \
121 crserverlib/server_misc.cpp \
122 crserverlib/server_occlude.cpp \
123 crserverlib/server_papi.cpp \
124 crserverlib/server_projmatrix.cpp \
125 crserverlib/server_readpixels.cpp \
126 crserverlib/server_stream.cpp \
127 crserverlib/server_viewport.cpp \
128 crserverlib/server_window.cpp \
129 crserverlib/server_winpos.cpp \
130 crserverlib/server_writeback.cpp \
131 crserverlib/server_getshaders.cpp \
132 crserverlib/server_framebuffer.cpp \
133 crserverlib/server_glsl.cpp \
134 crserverlib/server_muralfbo.cpp \
135 crserverlib/server_texture.cpp \
136 crserverlib/presenter/server_presenter.cpp \
137 crserverlib/presenter/display_base.cpp \
138 crserverlib/presenter/display_composite.cpp \
139 crserverlib/presenter/window.cpp \
140 crserverlib/presenter/display_window.cpp \
141 crserverlib/presenter/display_window_rootvr.cpp \
142 crserverlib/presenter/display_vrdp.cpp \
143 crserverlib/server_rpw.cpp \
144 $(VBOX_PATH_CROGL_GENFILES)/server_dispatch.cpp \
145 $(VBOX_PATH_CROGL_GENFILES)/server_retval.cpp \
146 $(VBOX_PATH_CROGL_GENFILES)/server_get.cpp \
147 $(VBOX_PATH_CROGL_GENFILES)/server_simpleget.cpp
148VBoxOGLcrserverlib_CLEAN = \
149 $(VBOX_PATH_CROGL_GENFILES)/server_dispatch.cpp \
150 $(VBOX_PATH_CROGL_GENFILES)/server_retval.cpp \
151 $(VBOX_PATH_CROGL_GENFILES)/server_get.cpp \
152 $(VBOX_PATH_CROGL_GENFILES)/server_simpleget.cpp \
153 $(VBOX_PATH_CROGL_GENFILES)/server_dispatch.h
154ifdef VBOXCR_LOGFPS
155VBoxOGLcrserverlib_DEFS += VBOXCR_LOGFPS
156endif
157ifdef VBOX_WITH_CRHGSMI
158VBoxOGLcrserverlib_DEFS += ifdef VBOX_WITH_CRHGSMI
159endif
160ifdef VBOX_WITH_CRDUMPER
161VBoxOGLcrserverlib_DEFS += VBOX_WITH_CRDUMPER
162endif
163ifdef VBOX_WITH_CRSERVER_DUMPER
164VBoxOGLcrserverlib_DEFS += VBOX_WITH_CRSERVER_DUMPER
165endif
166
167
168#
169# Generate files for VBoxOGLcrserverlib
170#
171$(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 $$@)
172 $(call MSG_GENERATE,python,$@,$<)
173 $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
174
175$(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 $$@)
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_retval.cpp: $(addprefix $(PATH_SUB_CURRENT)/crserverlib/, server_retval.py server_special) $(VBOX_CROGL_API_FILES) | $$(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_get.cpp: $(addprefix $(PATH_SUB_CURRENT)/crserverlib/, server_get.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_simpleget.cpp: $(addprefix $(PATH_SUB_CURRENT)/crserverlib/, server_simpleget.py get_sizes.py) $(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
192#
193# VBoxOGLcrunpacker
194#
195VBoxOGLcrunpacker_TEMPLATE = VBOXCROGLR3HOSTLIB
196VBoxOGLcrunpacker_INCS = \
197 unpacker \
198 $(VBOX_GRAPHICS_INCS)
199VBoxOGLcrunpacker_INTERMEDIATES = \
200 $(VBOX_PATH_CROGL_GENFILES)/spu_dispatch_table.h \
201 $(VBOX_PATH_CROGL_GENFILES)/cr_opcodes.h \
202 $(VBOX_PATH_CROGL_GENFILES)/unpack_extend.h \
203 $(VBOX_PATH_CROGL_GENFILES)/state/cr_currentpointers.h \
204 $(VBOX_PATH_CROGL_GENFILES)/state/cr_statefuncs.h
205VBoxOGLcrunpacker_SOURCES = \
206 unpacker/unpack_arrays.cpp \
207 unpacker/unpack_bounds.cpp \
208 unpacker/unpack_bufferobject.cpp \
209 unpacker/unpack_calllists.cpp \
210 unpacker/unpack_clipplane.cpp \
211 unpacker/unpack_context.cpp \
212 unpacker/unpack_drawpixels.cpp \
213 unpacker/unpack_fence.cpp \
214 unpacker/unpack_fog.cpp \
215 unpacker/unpack_lights.cpp \
216 unpacker/unpack_map.cpp \
217 unpacker/unpack_materials.cpp \
218 unpacker/unpack_matrices.cpp \
219 unpacker/unpack_misc.cpp \
220 unpacker/unpack_pixelmap.cpp \
221 unpacker/unpack_point.cpp \
222 unpacker/unpack_program.cpp \
223 unpacker/unpack_readpixels.cpp \
224 unpacker/unpack_regcombiner.cpp \
225 unpacker/unpack_stipple.cpp \
226 unpacker/unpack_texture.cpp \
227 unpacker/unpack_writeback.cpp \
228 unpacker/unpack_visibleregion.cpp \
229 unpacker/unpack_shaders.cpp \
230 unpacker/unpack_framebuffer.cpp \
231 $(VBOX_PATH_CROGL_GENFILES)/unpack.cpp
232VBoxOGLcrunpacker_CLEAN = \
233 $(VBOX_PATH_CROGL_GENFILES)/unpack.cpp \
234 $(VBOX_PATH_CROGL_GENFILES)/unpack_extend.h
235
236#
237# Generate files for VBoxOGLcrunpacker.
238#
239$(VBOX_PATH_CROGL_GENFILES)/unpack.cpp: \
240 $(addprefix $(PATH_SUB_CURRENT)/unpacker/, unpack.py unpacker_special) \
241 $(VBOX_PATH_CROGL_GENFILES)/unpack_extend.h \
242 $(VBOX_CROGL_API_FILES) \
243 | $$(dir $$@)
244 $(call MSG_GENERATE,python,$@,$<)
245 $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
246
247$(VBOX_PATH_CROGL_GENFILES)/unpack_extend.h: \
248 $(addprefix $(PATH_SUB_CURRENT)/unpacker/, unpack_extend.py unpacker_special) \
249 $(VBOX_CROGL_API_FILES) \
250 | $$(dir $$@)
251 $(call MSG_GENERATE,python,$@,$<)
252 $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
253
254
255#
256# VBoxOGLrenderspu
257#
258VBoxOGLrenderspu_TEMPLATE = VBOXCROGLR3HOSTLIB
259VBoxOGLrenderspu_INTERMEDIATES = \
260 $(VBOX_PATH_CROGL_GENFILES)/state/cr_currentpointers.h \
261 $(VBOX_PATH_CROGL_GENFILES)/state/cr_statefuncs.h
262VBoxOGLrenderspu_INCS = $(VBOX_GRAPHICS_INCS)
263VBoxOGLrenderspu_SOURCES = \
264 render/renderspu.c \
265 render/renderspu_config.c \
266 render/renderspu_init.c
267VBoxOGLrenderspu_SOURCES.win = \
268 render/renderspu_wgl.c
269VBoxOGLrenderspu_SOURCES.linux = render/renderspu_glx.c
270VBoxOGLrenderspu_SOURCES.solaris = render/renderspu_glx.c
271VBoxOGLrenderspu_SOURCES.freebsd = render/renderspu_glx.c
272VBoxOGLrenderspu_OBJCFLAGS.darwin = -Wno-shadow
273VBoxOGLrenderspu_SOURCES.darwin = \
274 OpenGLTest/OpenGLTestDarwin.cpp \
275 render/renderspu_cocoa.c \
276 render/renderspu_cocoa_helper.m
277ifdef VBOX_WITH_CRHGSMI
278VBoxOGLrenderspu_DEFS += VBOX_WITH_CRHGSMI
279endif
280ifdef VBOX_WITH_VDMA
281VBoxOGLrenderspu_DEFS += VBOX_WITH_VDMA
282endif
283if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris) # the X11 gang
284 VBoxOGLrenderspu_LIBS += \
285 Xmu \
286 X11 \
287 Xext
288 VBoxOGLrenderspu_LIBPATH = \
289 $(VBOX_LIBPATH_X11)
290endif
291
292LIBRARIES += VBoxOGLTest
293VBoxOGLTest_TEMPLATE = VBOXR3NP
294ifneq ($(KBUILD_TARGET),darwin)
295 VBoxOGLTest_SOURCES = OpenGLTest/OpenGLTest.cpp
296endif
297VBoxOGLTest_SOURCES.darwin = OpenGLTest/OpenGLTestDarwin.cpp
298
299#
300# VBoxTestOGL - OpenGL support test app.
301# Note! Doesn't link with VBOX_WITH_DEBUG_VCC_CRT defined because it uses Qt.
302#
303if ( defined(VBOX_WITH_QTGUI) \
304 && (defined(VBOX_WITH_CROGL) || defined(VBOX_WITH_VIDEOHWACCEL)) \
305 && !defined(VBOX_WITH_DEBUG_VCC_CRT))
306 ifneq ($(KBUILD_TARGET),darwin)
307 ifdef VBOX_WITH_VIDEOHWACCEL
308 USES += qt5
309 endif
310 PROGRAMS += VBoxTestOGL
311 VBoxTestOGL_TEMPLATE = $(if $(VBOX_WITH_VIDEOHWACCEL),$(if $(VBOX_WITH_HARDENING),VBOXQTGUI,VBOXQTGUIEXE),VBOXMAINEXE)
312 VBoxTestOGL_INCS += $(VBOX_PATH_CROGL_INCLUDE) $(VBOX_PATH_CROGL_GENFILES)
313 VBoxTestOGL_DEFS.win = _WIN32_WINNT=0x0500 WINDOWS=1
314 VBoxTestOGL_DEFS.linux = Linux=1 _GNU_SOURCE
315 VBoxTestOGL_DEFS.solaris = SunOS=1 _GNU_SOURCE #GLEXT_64_TYPES_DEFINED
316 VBoxTestOGL_DEFS.darwin = DARWIN=1 GL_GLEXT_LEGACY _GNU_SOURCE
317 VBoxTestOGL_DEFS.freebsd = FreeBSD=1 _GNU_SOURCE
318 VBoxTestOGL_SOURCES = OpenGLTest/OpenGLTestApp.cpp
319 VBoxTestOGL_SOURCES.win = OpenGLTest/VBoxTestOGL.rc
320 VBoxTestOGL_LIBS = \
321 $(if $(VBOX_WITH_CROGL), \
322 $(PATH_STAGE_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB) \
323 $(PATH_STAGE_LIB)/VBoxOGLhosterrorspu$(VBOX_SUFF_LIB) \
324 $(PATH_STAGE_LIB)/VBoxOGLrenderspu$(VBOX_SUFF_LIB) \
325 $(PATH_STAGE_LIB)/VBoxOGLhostcrutil$(VBOX_SUFF_LIB),) \
326 $(if $(VBOX_WITH_VIDEOHWACCEL), $(PATH_STAGE_LIB)/VBoxOGL2D$(VBOX_SUFF_LIB),) \
327 $(LIB_RUNTIME)
328 VBoxTestOGL_DEFS += \
329 VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\" \
330 $(if $(VBOX_WITH_CROGL), VBOX_WITH_CROGL,) \
331 $(if $(VBOX_WITH_VIDEOHWACCEL), VBOX_WITH_VIDEOHWACCEL,)
332 ifdef VBOX_WITH_VIDEOHWACCEL
333 VBoxTestOGL_QT_MODULES += Core Gui OpenGL Widgets
334 VBoxTestOGL_LIBS.linux += xcb
335 VBoxTestOGL_LIBS.solaris += xcb
336 VBoxTestOGL_LIBS.freebsd += xcb
337 VBoxTestOGL_LDFLAGS.darwin += -framework OpenGL -framework IOKit
338 VBoxTestOGL_LIBS.win += $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/Opengl32.lib
339 if1of ($(KBUILD_TARGET), solaris linux freebsd)
340 # must come after VBoxOGL2D, therefore don't set the arch-specific LIBS variable here!
341 VBoxTestOGL_LIBS += GL pthread dl
342 endif
343 endif
344 # Don't let ld strip out explicitly linked libraries even when they are not needed.
345 # This was causing some dynamic library loading problems in case of indirect dependencies
346 # in systems where RUNPATH instead of RPATH is utilized.
347 VBoxTestOGL_LDFLAGS.linux = -Wl,--no-as-needed
348 VBoxTestOGL_LDFLAGS.win = /SUBSYSTEM:windows
349 endif
350endif
351
352include $(FILE_KBUILD_SUB_FOOTER)
353
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