1 | # $Id: Makefile.kmk 80360 2019-08-21 08:41:18Z 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.alldomusa.eu.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 |
|
---|
18 | SUB_DEPTH = ../../../..
|
---|
19 | include $(KBUILD_PATH)/subheader.kmk
|
---|
20 |
|
---|
21 |
|
---|
22 | #
|
---|
23 | # Target lists.
|
---|
24 | #
|
---|
25 | ifdef VBOX_WITH_MAIN
|
---|
26 | LIBRARIES += VBoxOGLrenderspu
|
---|
27 | BLDDIRS += \
|
---|
28 | $(VBOX_PATH_CROGL_GENFILES)/
|
---|
29 | endif
|
---|
30 |
|
---|
31 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
32 | #
|
---|
33 | # We have to symlink the system headers of OpenGl cause they have some
|
---|
34 | # different directory hierarchy on Mac OS X (no /GL sub directory).
|
---|
35 | #
|
---|
36 | # See Config.kmk for the global variables.
|
---|
37 | #
|
---|
38 | INSTALLS += DarwinOpenGLHdrs
|
---|
39 | DarwinOpenGLHdrs_INST = $(VBOX_DARWIN_OPENGL_INST)
|
---|
40 | DarwinOpenGLHdrs_SYMLINKS = \
|
---|
41 | $(foreach hdr, $(VBOX_DARWIN_OPENGL_HEADERS),\
|
---|
42 | $(hdr)=>$(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers/$(hdr))
|
---|
43 | endif # darwin
|
---|
44 |
|
---|
45 | #
|
---|
46 | # VBoxOGLrenderspu
|
---|
47 | #
|
---|
48 | VBoxOGLrenderspu_TEMPLATE = VBOXCROGLR3HOSTLIB
|
---|
49 | VBoxOGLrenderspu_INTERMEDIATES = \
|
---|
50 | $(VBOX_PATH_CROGL_GENFILES)/state/cr_currentpointers.h \
|
---|
51 | $(VBOX_PATH_CROGL_GENFILES)/state/cr_statefuncs.h
|
---|
52 | VBoxOGLrenderspu_INCS = $(VBOX_GRAPHICS_INCS)
|
---|
53 | VBoxOGLrenderspu_SOURCES = \
|
---|
54 | render/renderspu.c \
|
---|
55 | render/renderspu_config.c \
|
---|
56 | render/renderspu_init.c
|
---|
57 | VBoxOGLrenderspu_SOURCES.win = \
|
---|
58 | render/renderspu_wgl.c
|
---|
59 | VBoxOGLrenderspu_SOURCES.linux = render/renderspu_glx.c
|
---|
60 | VBoxOGLrenderspu_SOURCES.solaris = render/renderspu_glx.c
|
---|
61 | VBoxOGLrenderspu_SOURCES.freebsd = render/renderspu_glx.c
|
---|
62 | VBoxOGLrenderspu_OBJCFLAGS.darwin = -Wno-shadow
|
---|
63 | VBoxOGLrenderspu_SOURCES.darwin = \
|
---|
64 | OpenGLTest/OpenGLTestDarwin.cpp \
|
---|
65 | render/renderspu_cocoa.c \
|
---|
66 | render/renderspu_cocoa_helper.m
|
---|
67 | ifdef VBOX_WITH_CRHGSMI
|
---|
68 | VBoxOGLrenderspu_DEFS += VBOX_WITH_CRHGSMI
|
---|
69 | endif
|
---|
70 | ifdef VBOX_WITH_VDMA
|
---|
71 | VBoxOGLrenderspu_DEFS += VBOX_WITH_VDMA
|
---|
72 | endif
|
---|
73 |
|
---|
74 | LIBRARIES += VBoxOGLTest
|
---|
75 | VBoxOGLTest_TEMPLATE = VBOXR3NP
|
---|
76 | ifneq ($(KBUILD_TARGET),darwin)
|
---|
77 | VBoxOGLTest_SOURCES = OpenGLTest/OpenGLTest.cpp
|
---|
78 | endif
|
---|
79 | VBoxOGLTest_SOURCES.darwin = OpenGLTest/OpenGLTestDarwin.cpp
|
---|
80 |
|
---|
81 | #
|
---|
82 | # VBoxTestOGL - OpenGL support test app.
|
---|
83 | # Note! Doesn't link with VBOX_WITH_DEBUG_VCC_CRT defined because it uses Qt.
|
---|
84 | #
|
---|
85 | if ( defined(VBOX_WITH_QTGUI) \
|
---|
86 | && (defined(VBOX_WITH_CROGL) || defined(VBOX_WITH_VIDEOHWACCEL)) \
|
---|
87 | && !defined(VBOX_WITH_DEBUG_VCC_CRT))
|
---|
88 | ifneq ($(KBUILD_TARGET),darwin)
|
---|
89 | ifdef VBOX_WITH_VIDEOHWACCEL
|
---|
90 | USES += qt5
|
---|
91 | endif
|
---|
92 | PROGRAMS += VBoxTestOGL
|
---|
93 | VBoxTestOGL_TEMPLATE = $(if $(VBOX_WITH_VIDEOHWACCEL),$(if $(VBOX_WITH_HARDENING),VBOXQTGUI,VBOXQTGUIEXE),VBOXMAINEXE)
|
---|
94 | VBoxTestOGL_INCS += $(VBOX_PATH_CROGL_INCLUDE) $(VBOX_PATH_CROGL_GENFILES)
|
---|
95 | VBoxTestOGL_DEFS.win = _WIN32_WINNT=0x0500 WINDOWS=1
|
---|
96 | VBoxTestOGL_DEFS.linux = Linux=1 _GNU_SOURCE
|
---|
97 | VBoxTestOGL_DEFS.solaris = SunOS=1 _GNU_SOURCE #GLEXT_64_TYPES_DEFINED
|
---|
98 | VBoxTestOGL_DEFS.darwin = DARWIN=1 GL_GLEXT_LEGACY _GNU_SOURCE
|
---|
99 | VBoxTestOGL_DEFS.freebsd = FreeBSD=1 _GNU_SOURCE
|
---|
100 | VBoxTestOGL_SOURCES = OpenGLTest/OpenGLTestApp.cpp
|
---|
101 | VBoxTestOGL_SOURCES.win = OpenGLTest/VBoxTestOGL.rc
|
---|
102 | VBoxTestOGL_LIBS = \
|
---|
103 | $(if $(VBOX_WITH_CROGL), \
|
---|
104 | $(PATH_STAGE_LIB)/VBoxOGLhosterrorspu$(VBOX_SUFF_LIB) \
|
---|
105 | $(PATH_STAGE_LIB)/VBoxOGLrenderspu$(VBOX_SUFF_LIB) \
|
---|
106 | $(PATH_STAGE_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB) \
|
---|
107 | $(PATH_STAGE_LIB)/VBoxOGLhostcrutil$(VBOX_SUFF_LIB),) \
|
---|
108 | $(if $(VBOX_WITH_VIDEOHWACCEL), $(PATH_STAGE_LIB)/VBoxOGL2D$(VBOX_SUFF_LIB),) \
|
---|
109 | $(LIB_RUNTIME)
|
---|
110 | VBoxTestOGL_DEFS += \
|
---|
111 | VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\" \
|
---|
112 | $(if $(VBOX_WITH_CROGL), VBOX_WITH_CROGL,) \
|
---|
113 | $(if $(VBOX_WITH_VIDEOHWACCEL), VBOX_WITH_VIDEOHWACCEL,)
|
---|
114 | ifdef VBOX_WITH_VIDEOHWACCEL
|
---|
115 | VBoxTestOGL_QT_MODULES += Core Gui OpenGL Widgets
|
---|
116 | VBoxTestOGL_LIBS.linux += xcb
|
---|
117 | VBoxTestOGL_LIBS.solaris += xcb
|
---|
118 | VBoxTestOGL_LIBS.freebsd += xcb
|
---|
119 | VBoxTestOGL_LDFLAGS.darwin += -framework OpenGL -framework IOKit
|
---|
120 | VBoxTestOGL_LIBS.win += $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/Opengl32.lib
|
---|
121 | if1of ($(KBUILD_TARGET), solaris linux freebsd)
|
---|
122 | # must come after VBoxOGL2D, therefore don't set the arch-specific LIBS variable here!
|
---|
123 | VBoxTestOGL_LIBS += GL pthread dl
|
---|
124 | endif
|
---|
125 | endif
|
---|
126 | if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris) # the X11 gang
|
---|
127 | VBoxTestOGL_LIBS += \
|
---|
128 | Xmu \
|
---|
129 | X11 \
|
---|
130 | Xext
|
---|
131 | VBoxTestOGL_LIBPATH = \
|
---|
132 | $(VBOX_LIBPATH_X11)
|
---|
133 | endif
|
---|
134 | # Don't let ld strip out explicitly linked libraries even when they are not needed.
|
---|
135 | # This was causing some dynamic library loading problems in case of indirect dependencies
|
---|
136 | # in systems where RUNPATH instead of RPATH is utilized.
|
---|
137 | VBoxTestOGL_LDFLAGS.linux = -Wl,--no-as-needed
|
---|
138 | VBoxTestOGL_LDFLAGS.win = /SUBSYSTEM:windows
|
---|
139 | endif
|
---|
140 | endif
|
---|
141 |
|
---|
142 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
143 |
|
---|