VirtualBox

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

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

HostServices/SharedOpenGL: Another linux build fix for r130405

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 13.3 KB
Line 
1# $Id: Makefile.kmk 78416 2019-05-06 22:26:02Z 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
87if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris) # the X11 gang
88 VBoxSharedCrOpenGL_LIBS += \
89 Xmu \
90 X11 \
91 Xext
92 VBoxSharedCrOpenGL_LIBPATH = \
93 $(VBOX_LIBPATH_X11)
94endif
95ifdef VBOX_WITH_CRHGSMI
96VBoxSharedCrOpenGL_DEFS += VBOX_WITH_CRHGSMI
97endif
98
99#
100# VBoxOGLcrserverlib
101#
102VBoxOGLcrserverlib_TEMPLATE = VBOXCROGLR3HOSTLIB
103VBoxOGLcrserverlib_INCS = \
104 . \
105 crserverlib \
106 $(VBOX_GRAPHICS_INCS)
107VBoxOGLcrserverlib_INTERMEDIATES = \
108 $(VBOX_PATH_CROGL_GENFILES)/spu_dispatch_table.h \
109 $(VBOX_PATH_CROGL_GENFILES)/server_dispatch.h \
110 $(VBOX_PATH_CROGL_GENFILES)/cr_opcodes.h \
111 $(VBOX_PATH_CROGL_GENFILES)/state/cr_currentpointers.h \
112 $(VBOX_PATH_CROGL_GENFILES)/state/cr_statefuncs.h
113
114VBoxOGLcrserverlib_SOURCES := \
115 crserverlib/server_main.cpp \
116 crserverlib/server_boundsinfo.cpp \
117 crserverlib/server_bufferobject.cpp \
118 crserverlib/server_clear.cpp \
119 crserverlib/server_clip.cpp \
120 crserverlib/server_config.cpp \
121 crserverlib/server_context.cpp \
122 crserverlib/server_gentextures.cpp \
123 crserverlib/server_getmap.cpp \
124 crserverlib/server_getstring.cpp \
125 crserverlib/server_getpointer.cpp \
126 crserverlib/server_getpixelmap.cpp \
127 crserverlib/server_getteximage.cpp \
128 crserverlib/server_lists.cpp \
129 crserverlib/server_misc.cpp \
130 crserverlib/server_occlude.cpp \
131 crserverlib/server_papi.cpp \
132 crserverlib/server_projmatrix.cpp \
133 crserverlib/server_readpixels.cpp \
134 crserverlib/server_stream.cpp \
135 crserverlib/server_viewport.cpp \
136 crserverlib/server_window.cpp \
137 crserverlib/server_winpos.cpp \
138 crserverlib/server_writeback.cpp \
139 crserverlib/server_getshaders.cpp \
140 crserverlib/server_framebuffer.cpp \
141 crserverlib/server_glsl.cpp \
142 crserverlib/server_muralfbo.cpp \
143 crserverlib/server_texture.cpp \
144 crserverlib/presenter/server_presenter.cpp \
145 crserverlib/presenter/display_base.cpp \
146 crserverlib/presenter/display_composite.cpp \
147 crserverlib/presenter/window.cpp \
148 crserverlib/presenter/display_window.cpp \
149 crserverlib/presenter/display_window_rootvr.cpp \
150 crserverlib/presenter/display_vrdp.cpp \
151 crserverlib/server_rpw.cpp \
152 $(VBOX_PATH_CROGL_GENFILES)/server_dispatch.cpp \
153 $(VBOX_PATH_CROGL_GENFILES)/server_retval.cpp \
154 $(VBOX_PATH_CROGL_GENFILES)/server_get.cpp \
155 $(VBOX_PATH_CROGL_GENFILES)/server_simpleget.cpp
156VBoxOGLcrserverlib_CLEAN = \
157 $(VBOX_PATH_CROGL_GENFILES)/server_dispatch.cpp \
158 $(VBOX_PATH_CROGL_GENFILES)/server_retval.cpp \
159 $(VBOX_PATH_CROGL_GENFILES)/server_get.cpp \
160 $(VBOX_PATH_CROGL_GENFILES)/server_simpleget.cpp \
161 $(VBOX_PATH_CROGL_GENFILES)/server_dispatch.h
162ifdef VBOXCR_LOGFPS
163VBoxOGLcrserverlib_DEFS += VBOXCR_LOGFPS
164endif
165ifdef VBOX_WITH_CRHGSMI
166VBoxOGLcrserverlib_DEFS += ifdef VBOX_WITH_CRHGSMI
167endif
168ifdef VBOX_WITH_CRDUMPER
169VBoxOGLcrserverlib_DEFS += VBOX_WITH_CRDUMPER
170endif
171ifdef VBOX_WITH_CRSERVER_DUMPER
172VBoxOGLcrserverlib_DEFS += VBOX_WITH_CRSERVER_DUMPER
173endif
174
175
176#
177# Generate files for VBoxOGLcrserverlib
178#
179$(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 $$@)
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_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 $$@)
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_retval.cpp: $(addprefix $(PATH_SUB_CURRENT)/crserverlib/, server_retval.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_get.cpp: $(addprefix $(PATH_SUB_CURRENT)/crserverlib/, server_get.py server_special) $(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$(VBOX_PATH_CROGL_GENFILES)/server_simpleget.cpp: $(addprefix $(PATH_SUB_CURRENT)/crserverlib/, server_simpleget.py get_sizes.py) $(VBOX_CROGL_API_FILES) | $$(dir $$@)
196 $(call MSG_GENERATE,python,$@,$<)
197 $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
198
199
200#
201# VBoxOGLcrunpacker
202#
203VBoxOGLcrunpacker_TEMPLATE = VBOXCROGLR3HOSTLIB
204VBoxOGLcrunpacker_INCS = \
205 unpacker \
206 $(VBOX_GRAPHICS_INCS)
207VBoxOGLcrunpacker_INTERMEDIATES = \
208 $(VBOX_PATH_CROGL_GENFILES)/spu_dispatch_table.h \
209 $(VBOX_PATH_CROGL_GENFILES)/cr_opcodes.h \
210 $(VBOX_PATH_CROGL_GENFILES)/unpack_extend.h \
211 $(VBOX_PATH_CROGL_GENFILES)/state/cr_currentpointers.h \
212 $(VBOX_PATH_CROGL_GENFILES)/state/cr_statefuncs.h
213VBoxOGLcrunpacker_SOURCES = \
214 unpacker/unpack_arrays.cpp \
215 unpacker/unpack_bounds.cpp \
216 unpacker/unpack_bufferobject.cpp \
217 unpacker/unpack_calllists.cpp \
218 unpacker/unpack_clipplane.cpp \
219 unpacker/unpack_context.cpp \
220 unpacker/unpack_drawpixels.cpp \
221 unpacker/unpack_fence.cpp \
222 unpacker/unpack_fog.cpp \
223 unpacker/unpack_lights.cpp \
224 unpacker/unpack_map.cpp \
225 unpacker/unpack_materials.cpp \
226 unpacker/unpack_matrices.cpp \
227 unpacker/unpack_misc.cpp \
228 unpacker/unpack_pixelmap.cpp \
229 unpacker/unpack_point.cpp \
230 unpacker/unpack_program.cpp \
231 unpacker/unpack_readpixels.cpp \
232 unpacker/unpack_regcombiner.cpp \
233 unpacker/unpack_stipple.cpp \
234 unpacker/unpack_texture.cpp \
235 unpacker/unpack_writeback.cpp \
236 unpacker/unpack_visibleregion.cpp \
237 unpacker/unpack_shaders.cpp \
238 unpacker/unpack_framebuffer.cpp \
239 $(VBOX_PATH_CROGL_GENFILES)/unpack.cpp
240VBoxOGLcrunpacker_CLEAN = \
241 $(VBOX_PATH_CROGL_GENFILES)/unpack.cpp \
242 $(VBOX_PATH_CROGL_GENFILES)/unpack_extend.h
243
244#
245# Generate files for VBoxOGLcrunpacker.
246#
247$(VBOX_PATH_CROGL_GENFILES)/unpack.cpp: \
248 $(addprefix $(PATH_SUB_CURRENT)/unpacker/, unpack.py unpacker_special) \
249 $(VBOX_PATH_CROGL_GENFILES)/unpack_extend.h \
250 $(VBOX_CROGL_API_FILES) \
251 | $$(dir $$@)
252 $(call MSG_GENERATE,python,$@,$<)
253 $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
254
255$(VBOX_PATH_CROGL_GENFILES)/unpack_extend.h: \
256 $(addprefix $(PATH_SUB_CURRENT)/unpacker/, unpack_extend.py unpacker_special) \
257 $(VBOX_CROGL_API_FILES) \
258 | $$(dir $$@)
259 $(call MSG_GENERATE,python,$@,$<)
260 $(QUIET)$(call VBOX_CROGL_PYTHON_ENV,$(VBOX_PATH_CROGL_PYTHON_INCLUDE),$@) $(VBOX_BLD_PYTHON) $< $(VBOX_PATH_CROGL_GLAPI) $(<D)
261
262
263#
264# VBoxOGLrenderspu
265#
266VBoxOGLrenderspu_TEMPLATE = VBOXCROGLR3HOSTLIB
267VBoxOGLrenderspu_INTERMEDIATES = \
268 $(VBOX_PATH_CROGL_GENFILES)/state/cr_currentpointers.h \
269 $(VBOX_PATH_CROGL_GENFILES)/state/cr_statefuncs.h
270VBoxOGLrenderspu_INCS = $(VBOX_GRAPHICS_INCS)
271VBoxOGLrenderspu_SOURCES = \
272 render/renderspu.c \
273 render/renderspu_config.c \
274 render/renderspu_init.c
275VBoxOGLrenderspu_SOURCES.win = \
276 render/renderspu_wgl.c
277VBoxOGLrenderspu_SOURCES.linux = render/renderspu_glx.c
278VBoxOGLrenderspu_SOURCES.solaris = render/renderspu_glx.c
279VBoxOGLrenderspu_SOURCES.freebsd = render/renderspu_glx.c
280VBoxOGLrenderspu_OBJCFLAGS.darwin = -Wno-shadow
281VBoxOGLrenderspu_SOURCES.darwin = \
282 OpenGLTest/OpenGLTestDarwin.cpp \
283 render/renderspu_cocoa.c \
284 render/renderspu_cocoa_helper.m
285ifdef VBOX_WITH_CRHGSMI
286VBoxOGLrenderspu_DEFS += VBOX_WITH_CRHGSMI
287endif
288ifdef VBOX_WITH_VDMA
289VBoxOGLrenderspu_DEFS += VBOX_WITH_VDMA
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)/VBoxOGLhosterrorspu$(VBOX_SUFF_LIB) \
323 $(PATH_STAGE_LIB)/VBoxOGLrenderspu$(VBOX_SUFF_LIB) \
324 $(PATH_STAGE_LIB)/VBoxOGLhostspuload$(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 if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris) # the X11 gang
345 VBoxTestOGL_LIBS += \
346 Xmu \
347 X11 \
348 Xext
349 VBoxTestOGL_LIBPATH = \
350 $(VBOX_LIBPATH_X11)
351endif
352 # Don't let ld strip out explicitly linked libraries even when they are not needed.
353 # This was causing some dynamic library loading problems in case of indirect dependencies
354 # in systems where RUNPATH instead of RPATH is utilized.
355 VBoxTestOGL_LDFLAGS.linux = -Wl,--no-as-needed
356 VBoxTestOGL_LDFLAGS.win = /SUBSYSTEM:windows
357 endif
358endif
359
360include $(FILE_KBUILD_SUB_FOOTER)
361
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