VirtualBox

source: vbox/trunk/src/VBox/Additions/3D/Config.kmk@ 103795

Last change on this file since 103795 was 99213, checked in by vboxsync, 19 months ago

Add/3D/Config.kmk: Fix for linking regression from r156294, where VBOX_LIB_VBGL_R3_SHARED(_X86) got into the LIBS list of the parent template. This breaks VBoxNine and others using VBoxMesa3DGuestR3DllMinVista, because they have to provide their own version of some of the stuff in there due to CreateFile and friends being off limits in some of the execution contexts. bugref:10348

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.2 KB
Line 
1# $Id: Config.kmk 99213 2023-03-29 20:26:03Z vboxsync $
2## @file
3# kBuild Configuration file for the Mesa3D.
4#
5
6#
7# Copyright (C) 2016-2023 Oracle and/or its affiliates.
8#
9# This file is part of VirtualBox base platform packages, as
10# available from https://www.virtualbox.org.
11#
12# This program is free software; you can redistribute it and/or
13# modify it under the terms of the GNU General Public License
14# as published by the Free Software Foundation, in version 3 of the
15# License.
16#
17# This program is distributed in the hope that it will be useful, but
18# WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20# General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, see <https://www.gnu.org/licenses>.
24#
25# SPDX-License-Identifier: GPL-3.0-only
26#
27
28VBOX_MESA3D_CONFIG_KMK_INCLUDED := 1
29
30# Include the top-level configure file.
31ifndef VBOX_ROOT_CONFIG_KMK_INCLUDED
32 include $(PATH_ROOT)/Config.kmk
33endif
34
35VBOX_MESA := mesa-21.3.8
36VBOX_PATH_3D := $(PATH_ROOT)/src/VBox/Additions/3D
37VBOX_PATH_MESA := $(PATH_ROOT)/src/VBox/Additions/3D/mesa/$(VBOX_MESA)
38VBOX_PATH_WDDM := $(PATH_ROOT)/src/VBox/Additions/WINNT/Graphics/Video
39VBOX_PATH_VMSVGA_INC := $(VBOX_PATH_MESA)/src/gallium/drivers/svga/include
40
41
42#
43# Base template for Mesa3D code and code which uses Mesa3D libraries.
44#
45TEMPLATE_VBoxMesa3DGuestR3Dll = VBox Mesa 3D Guest User Mode DLL
46TEMPLATE_VBoxMesa3DGuestR3Dll_EXTENDS = NewerVccVBoxGuestR3Dll
47TEMPLATE_VBoxMesa3DGuestR3Dll_INST = $(INST_ADDITIONS)
48TEMPLATE_VBoxMesa3DGuestR3Dll_SDKS.win = $(TEMPLATE_NewerVccVBoxGuestR3Dll_SDKS) $(VBOX_WINDDK_GST_W8)
49TEMPLATE_VBoxMesa3DGuestR3Dll_DEFS = $(TEMPLATE_NewerVccVBoxGuestR3Dll_DEFS) \
50 VBOX_WITH_MESA3D
51ifdef VBOX_WITH_VMSVGA
52 TEMPLATE_VBoxMesa3DGuestR3Dll_DEFS += VBOX_WITH_VMSVGA
53endif
54# VirtualBox specific modifications of the Mesa3D code.
55# All modified places can be found by searching for VBOX
56#
57# Each define represents a group of related modifications.
58# The purpose of the separation is to document why each modification was necessary.
59#
60# Modifications which would be nice to have in upstream Mesa code are marked with '*' here.
61#
62# VBOX Modifications in headers shared with VBox WDDM driver code (see comments).
63# VBOX_WITH_MESA3D_COMPILE Tweaks to compile Mesa as part of VBox WDDM.
64# VBOX_WITH_MESA3D_D3D_FROM_SYSTEMMEM Create D3DPOOL_SYSTEMMEM textures from provided system memory pointer.
65# VBOX_WITH_MESA3D_D3D_THREADPOOL (No) threadpool for VBox build.
66# VBOX_WITH_MESA3D_DBG Tweaks for easier debugging and better logging.
67# VBOX_WITH_MESA3D_HACKS Hacks to make it work (need a proper solutions).
68# *VBOX_WITH_MESA3D_MSC Tweaks for Microsoft VCC.
69# VBOX_WITH_MESA3D_NINE_SVGA Make the D3D state tracker to work together with VMSVGA.
70# VBOX_WITH_MESA3D_SVGA_GPU_FINISHED PIPE_QUERY_GPU_FINISHED in VMSVGA driver.
71# VBOX_WITH_MESA3D_SVGA_HALFZ D3D Z coord [0.0;1.0] in the Gallium SVGA driver (VGPU9 only).
72# VBOX_WITH_MESA3D_SVGA_INSTANCING Instancing for DrawPrimitives in the Gallium SVGA driver
73# (VGPU9 only, VGPU10 has it).
74TEMPLATE_VBoxMesa3DGuestR3Dll_DEFS += \
75 VBOX_WITH_MESA3D_COMPILE \
76 VBOX_WITH_MESA3D_D3D_FROM_SYSTEMMEM \
77 VBOX_WITH_MESA3D_D3D_THREADPOOL \
78 VBOX_WITH_MESA3D_DBG \
79 VBOX_WITH_MESA3D_HACKS \
80 VBOX_WITH_MESA3D_MSC \
81 VBOX_WITH_MESA3D_NINE_SVGA \
82 VBOX_WITH_MESA3D_SVGA_GPU_FINISHED \
83 VBOX_WITH_MESA3D_SVGA_HALFZ \
84 VBOX_WITH_MESA3D_SVGA_INSTANCING
85ifdef VBOX_WITH_NOCRT_STATIC
86 TEMPLATE_VBoxMesa3DGuestR3Dll_DEFS += \
87 IPRT_NO_CRT_FOR_3RD_PARTY \
88 RT_WITHOUT_NOCRT_WRAPPERS \
89 RT_WITHOUT_NOCRT_WRAPPER_ALIASES
90endif
91TEMPLATE_VBoxMesa3DGuestR3Dll_DEFS.win = $(TEMPLATE_NewerVccVBoxGuestR3Dll_DEFS.win) \
92 _USE_MATH_DEFINES \
93 WINAPI=__stdcall \
94 _WIN32
95ifdef VBOX_WITH_VMSVGA
96 # treat as error: warning C4013: 'close' undefined; assuming extern returning int
97 TEMPLATE_VBoxMesa3DGuestR3Dll_CFLAGS = $(TEMPLATE_NewerVccVBoxGuestR3Dll_CFLAGS) -we4013
98endif
99TEMPLATE_VBoxMesa3DGuestR3Dll_INCS = $(TEMPLATE_NewerVccVBoxGuestR3Dll_INCS) \
100 $(VBOX_PATH_MESA)/include \
101 $(VBOX_PATH_MESA)/include/c99 \
102 $(VBOX_PATH_MESA)/src \
103 $(VBOX_PATH_MESA)/src/mesa \
104 $(VBOX_PATH_MESA)/src/gallium/auxiliary \
105 $(VBOX_PATH_MESA)/src/gallium/include \
106 $(VBOX_PATH_3D)/win/VBoxWddmUmHlp
107ifdef VBOX_WITH_NOCRT_STATIC # Only the softfloat libs are added here as mesa includes a softfloat.h and we wish for no conflicts.
108 TEMPLATE_VBoxMesa3DGuestR3Dll_LIBS.x86 = \
109 $(filter-out $(VBOX_LIB_VBGL_R3_SHARED_X86),$(TEMPLATE_NewerVccVBoxGuestR3Dll_LIBS.x86)) \
110 $(VBOX_LIB_IPRT_GUEST_R3_SHARED_X86) \
111 $(SDK_VBoxSoftFloatGuestR3Shared_LIBS.x86)
112 TEMPLATE_VBoxMesa3DGuestR3Dll_LIBS.$(KBUILD_TARGET_ARCH) = \
113 $(filter-out $(VBOX_LIB_VBGL_R3_SHARED),$(TEMPLATE_NewerVccVBoxGuestR3Dll_LIBS.$(KBUILD_TARGET))) \
114 $(VBOX_LIB_IPRT_GUEST_R3_SHARED) \
115 $(SDK_VBoxSoftFloatGuestR3Shared_LIBS.$(KBUILD_TARGET_ARCH))
116 TEMPLATE_VBoxMesa3DGuestR3Dll_LDFLAGS.win += $(TEMPLATE_NewerVccVBoxGuestR3Dll_LDFLAGS.win)
117 # The -Oi- disable optimizations of math functions like sqrt(), that takes all
118 # parameters on the stack, into calls to __CIsqrt that takes parameters in FPU
119 # registers. While we could implement the __CIxxxx functions too, they would
120 # be difficult to test properly given that they're not directly callable from
121 # C. Also, there could be other aspects to these functions that we don't know
122 # about, given that they aren't documented all that well. See:
123 # https://docs.microsoft.com/en-us/cpp/preprocessor/intrinsic?view=msvc-160#intrinsic-floating-point-functions
124 # https://docs.microsoft.com/en-us/cpp/build/reference/oi-generate-intrinsic-functions?view=msvc-160
125 # Unforutnately, this does mean that we will miss out on a little bit of
126 # performance in 32-bit binaries.
127 TEMPLATE_VBoxMesa3DGuestR3Dll_CFLAGS.win.x86 += $(TEMPLATE_NewerVccVBoxGuestR3Dll_CFLAGS.win.x86) -Oi-
128 TEMPLATE_VBoxMesa3DGuestR3Dll_CXXFLAGS.win.x86 += $(TEMPLATE_NewerVccVBoxGuestR3Dll_CXXFLAGS.win.x86) -Oi-
129endif
130
131
132#
133# Variant of VBoxMesa3DGuestR3Dll that requires Windows Vista or later.
134#
135TEMPLATE_VBoxMesa3DGuestR3DllMinVista = VBox Mesa 3D Guest User Mode DLL (Windows Vista or newer)
136TEMPLATE_VBoxMesa3DGuestR3DllMinVista_EXTENDS = VBoxMesa3DGuestR3Dll
137TEMPLATE_VBoxMesa3DGuestR3DllMinVista_VBOX_IMPORT_CHECKER.win.x86 := vista
138TEMPLATE_VBoxMesa3DGuestR3DllMinVista_VBOX_IMPORT_CHECKER.win.amd64 := vista
139ifeq ($(KBUILD_TARGET),win)
140 TEMPLATE_VBoxMesa3DGuestR3DllMinVista_LDFLAGS.win.x86 = $(filter-out -Section:.bss$(COMMA)RW!K,$(TEMPLATE_VBoxMesa3DGuestR3Dll_LDFLAGS.win.x86))
141 TEMPLATE_VBoxMesa3DGuestR3DllMinVista_POST_CMDS.win.x86 = $(subst $(VBOX_PE_SET_VERSION), $(VBOX_PE_SET_VERSION) --vista,$(TEMPLATE_VBoxMesa3DGuestR3Dll_POST_CMDS.win.x86))
142 TEMPLATE_VBoxMesa3DGuestR3DllMinVista_POST_CMDS.win.amd64 = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION) --vista $(out)$$(NLTAB)$(TEMPLATE_VBoxMesa3DGuestR3Dll_POST_CMDS.win.amd64))
143 TEMPLATE_VBoxMesa3DGuestR3DllMinVista_LNK_DEPS.win.amd64 = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION)) $(TEMPLATE_VBoxMesa3DGuestR3Dll_LNK_DEPS.win.amd64)
144endif
145
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