1 | # $Id: Config.kmk 35623 2011-01-18 18:17:04Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # The global build configuration file for VBox.
|
---|
4 | #
|
---|
5 | # This file gets included by all makefiles through the
|
---|
6 | # include $(KBUILD_PATH)/header.kmk statement.
|
---|
7 | #
|
---|
8 |
|
---|
9 | #
|
---|
10 | # Copyright (C) 2006-2011 Oracle Corporation
|
---|
11 | #
|
---|
12 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
13 | # available from http://www.virtualbox.org. This file is free software;
|
---|
14 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
15 | # General Public License (GPL) as published by the Free Software
|
---|
16 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
17 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
18 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
19 | #
|
---|
20 |
|
---|
21 | # Marker.
|
---|
22 | VBOX_ROOT_CONFIG_KMK_INCLUDED = 1
|
---|
23 |
|
---|
24 | #
|
---|
25 | # kBuild stuff
|
---|
26 | #
|
---|
27 |
|
---|
28 | # Experimental
|
---|
29 | .SECONDTARGETEXPANSION:
|
---|
30 |
|
---|
31 | # Enable automatic installation of what's built.
|
---|
32 | KBUILD_DO_AUTO_INSTALL := 1
|
---|
33 | PASSES := $(filter-out PACKING,$(PASSES)) PACKING # temporary hack
|
---|
34 | # Modify the order of the INSTALLS and OTHERS passes.
|
---|
35 | DEFAULT_PASSES := BLDPROGS LIBRARIES DLLS BINARIES INSTALLS OTHERS
|
---|
36 | # Modify the build types.
|
---|
37 | ## @todo checked and dbgopt
|
---|
38 | KBUILD_BLD_TYPES = release profile debug kprofile
|
---|
39 |
|
---|
40 | ## 'strict' builds
|
---|
41 | # Same as release builds, except that RT_STRICT and VBOX_STRICT are defined,
|
---|
42 | # meaning all assertions are in action. (Appending means '.strict' props take
|
---|
43 | # precedence in argument lists.)
|
---|
44 | KBUILD_BLD_TYPES += strict
|
---|
45 | BLD_TYPE_strict_EXTENDS = release
|
---|
46 | BLD_TYPE_strict_EXTENDS_BY = appending
|
---|
47 |
|
---|
48 | ## 'dbgopt' builds
|
---|
49 | # Same as debug builds, except that compiler optimizations are enabled. This
|
---|
50 | # intended for cases where all the debug facitities (logging, assertions, ++)
|
---|
51 | # is wanted but actual source level debugging as important as execution speed.
|
---|
52 | KBUILD_BLD_TYPES += dbgopt
|
---|
53 | BLD_TYPE_dbgopt_EXTENDS = debug
|
---|
54 | BLD_TYPE_dbgopt_EXTENDS_BY = appending
|
---|
55 |
|
---|
56 | # Temporary hack for kBuild ticket #83.
|
---|
57 | ## @todo kBuild: remove after closing ticket #83.
|
---|
58 | PROPS_ACCUMULATE_L_LNK += INTERMEDIATES
|
---|
59 | PROPS_PROGRAMS_ACCUMULATE_L += INTERMEDIATES
|
---|
60 | PROPS_LIBRARIES_ACCUMULATE_L += INTERMEDIATES
|
---|
61 | PROPS_DLLS_ACCUMULATE_L += INTERMEDIATES
|
---|
62 | PROPS_SYSMODS_ACCUMULATE_L += INTERMEDIATES
|
---|
63 | PROPS_MISCBINS_ACCUMULATE_L += INTERMEDIATES
|
---|
64 |
|
---|
65 | # Misc names used bye the install paths below.
|
---|
66 | VBOX_PUEL_MANGLED_NAME := Oracle_VM_VirtualBox_Extension_Pack
|
---|
67 |
|
---|
68 | # Install paths.
|
---|
69 | PATH_INS = $(PATH_OUT)
|
---|
70 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
71 | INST_DIST = dist/
|
---|
72 | INST_SDK = $(INST_DIST)sdk/
|
---|
73 |
|
---|
74 | # the bundles
|
---|
75 | INST_VIRTUALBOX = $(INST_DIST)VirtualBox.app/
|
---|
76 | INST_VBOXDRV = $(INST_DIST)VBoxDrv.kext/
|
---|
77 | INST_VBOXNETFLT = $(INST_DIST)VBoxNetFlt.kext/
|
---|
78 | INST_VBOXNETADP = $(INST_DIST)VBoxNetAdp.kext/
|
---|
79 | INST_VBOXUSB = $(INST_DIST)VBoxUSB.kext/
|
---|
80 |
|
---|
81 | # put everything in the VirtualBox app bundle.
|
---|
82 | INST_BIN = $(INST_VIRTUALBOX)Contents/MacOS/
|
---|
83 | INST_DLL = $(INST_BIN)
|
---|
84 | INST_SYS = $(INST_BIN)
|
---|
85 | INST_TESTCASE = $(INST_BIN)testcase/
|
---|
86 | INST_ADDITIONS = $(INST_BIN)additions/
|
---|
87 | INST_ADDITIONS_ISO = $(INST_BIN)
|
---|
88 |
|
---|
89 | # other paths
|
---|
90 | INST_TESTSUITE = testsuite/
|
---|
91 | INST_LIB = lib/
|
---|
92 | INST_ADDITIONS_LIB = $(INST_LIB)/additions/
|
---|
93 |
|
---|
94 | else
|
---|
95 |
|
---|
96 | INST_BIN = bin/
|
---|
97 | INST_DIST = $(INST_BIN)
|
---|
98 | INST_DLL = $(INST_BIN)
|
---|
99 | INST_SDK = $(INST_BIN)sdk/
|
---|
100 | INST_DLL = $(INST_BIN)
|
---|
101 | INST_SYS = $(INST_BIN)
|
---|
102 | INST_TESTCASE = $(INST_BIN)testcase/
|
---|
103 | INST_ADDITIONS = $(INST_BIN)additions/
|
---|
104 | INST_ADDITIONS_ISO = $(INST_ADDITIONS)
|
---|
105 |
|
---|
106 | INST_TESTSUITE = testsuite/
|
---|
107 | INST_LIB = lib/
|
---|
108 | INST_ADDITIONS_LIB = $(INST_LIB)additions/
|
---|
109 | endif
|
---|
110 | INST_EXTPACK = $(INST_BIN)ExtensionPacks/
|
---|
111 | INST_EXTPACK_CERTS = $(INST_BIN)ExtPackCertificates/
|
---|
112 | INST_EXTPACK_PUEL = $(INST_EXTPACK)$(VBOX_PUEL_MANGLED_NAME)/
|
---|
113 | INST_PACKAGES = packages/
|
---|
114 |
|
---|
115 | PATH_BIN = $(patsubst %/,%,$(PATH_INS)/$(INST_BIN))
|
---|
116 | PATH_DLL = $(patsubst %/,%,$(PATH_INS)/$(INST_DLL))
|
---|
117 | PATH_SYS = $(patsubst %/,%,$(PATH_INS)/$(INST_SYS))
|
---|
118 | PATH_LIB = $(patsubst %/,%,$(PATH_INS)/$(INST_LIB))
|
---|
119 | PATH_DOC = $(PATH_OUT)/doc
|
---|
120 | VBOX_PATH_SDK = $(patsubst %/,%,$(PATH_INS)/$(INST_SDK))
|
---|
121 | VBOX_PATH_DIST = $(patsubst %/,%,$(PATH_INS)/$(INST_DIST))
|
---|
122 | VBOX_PATH_TESTSUITE = $(patsubst %/,%,$(PATH_INS)/$(INST_TESTSUITE))
|
---|
123 | VBOX_PATH_ADDITIONS = $(patsubst %/,%,$(PATH_INS)/$(INST_ADDITIONS))
|
---|
124 | VBOX_PATH_ADDITIONS_ISO = $(patsubst %/,%,$(PATH_INS)/$(INST_ADDITIONS_ISO))
|
---|
125 | VBOX_PATH_ADDITIONS_LIB = $(patsubst %/,%,$(PATH_INS)/$(INST_ADDITIONS_LIB))
|
---|
126 | VBOX_PATH_EXTPACK_PUEL= $(patsubst %/,%,$(PATH_INS)/$(INST_EXTPACK_PUEL))
|
---|
127 | VBOX_PATH_PACKAGES = $(patsubst %/,%,$(PATH_INS)/$(INST_PACKAGES))
|
---|
128 |
|
---|
129 |
|
---|
130 | # Delete targets on failure.
|
---|
131 | .DELETE_ON_ERROR:
|
---|
132 |
|
---|
133 | # Notify about important kBuild updates.
|
---|
134 | ifneq ($(call if-expr, $(KMK_REVISION) >= 2274 && $(KBUILD_KMK_REVISION) >= 2206,fine,old),fine)
|
---|
135 | $(error You must update kBuild! KMK_REVISION=$(KMK_REVISION) KBUILD_KMK_REVISION=$(KBUILD_KMK_REVISION) KBUILD_PATH=$(KBUILD_PATH))
|
---|
136 | endif
|
---|
137 |
|
---|
138 | #
|
---|
139 | # Define USERNAME early on.
|
---|
140 | #
|
---|
141 | ifndef USERNAME
|
---|
142 | ifdef USER
|
---|
143 | USERNAME = $(USER)
|
---|
144 | else
|
---|
145 | $(warning Warning: You must have USERNAME or USER in your environment.)
|
---|
146 | endif
|
---|
147 | endif
|
---|
148 |
|
---|
149 | #
|
---|
150 | # The VirtualBox version.
|
---|
151 | #
|
---|
152 |
|
---|
153 | # Major version.
|
---|
154 | VBOX_VERSION_MAJOR = 4
|
---|
155 | # Minor version.
|
---|
156 | VBOX_VERSION_MINOR = 0
|
---|
157 | # This is the current build number. It should be increased every time we publish a
|
---|
158 | # new build. The define is available in every source file. Only even build numbers
|
---|
159 | # will be published, odd numbers are set during development.
|
---|
160 | VBOX_VERSION_BUILD = 51
|
---|
161 | # Full version string (may include more than just x.y.z, but no spaces or other problematic chars).
|
---|
162 | VBOX_VERSION_STRING = $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
|
---|
163 | # Force the additions.sh script to get an exact additions build when we're doing the release.
|
---|
164 |
|
---|
165 | ifeq ($(int-mod $(VBOX_VERSION_BUILD),2),0)
|
---|
166 | export VBOX_ADDITIONS_SH_MODE = release
|
---|
167 | export VBOX_DOCUMENTATION_SH_MODE = release
|
---|
168 | export VBOX_EFI_SH_MODE = release
|
---|
169 | export VBOX_EXTPACKS_SH_MODE = release
|
---|
170 | endif
|
---|
171 |
|
---|
172 | # Some info on the vendor
|
---|
173 | VBOX_VENDOR = Oracle Corporation
|
---|
174 | VBOX_VENDOR_SHORT = Oracle
|
---|
175 | VBOX_PRODUCT = Oracle VM VirtualBox
|
---|
176 | # Not all could be done automatically. Here is a list of known places which
|
---|
177 | # have to be updated manually, please keep this up to date:
|
---|
178 | # src/VBox/Devices/PC/PXE/client/uinit.asm
|
---|
179 | # src/VBox/RDP/webclient/flash/com/sun/network/rdp/Version.as
|
---|
180 | # src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
|
---|
181 | # src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsLanguage.cpp
|
---|
182 | # src/VBox/Frontends/VirtualBox/nls/*.ts
|
---|
183 | # debian/control
|
---|
184 | # src/VBox/Installer/linux/{debian,rpm}
|
---|
185 | # src/VBox/Installer/linux/virtualbox.desktop
|
---|
186 | # src/VBox/Additions/WINNT/Installer/ISO/ReadmeDrivers.txt
|
---|
187 | # */*.inf, */*.rc
|
---|
188 |
|
---|
189 | # Maybe we want set this manually.
|
---|
190 | VBOX_C_YEAR = $(date-utc %Y)
|
---|
191 |
|
---|
192 | #
|
---|
193 | # The VirtualBox package type.
|
---|
194 | #
|
---|
195 | ifeq ($(KBUILD_TARGET),win)
|
---|
196 | VBOX_PACKAGE_OS = WINDOWS
|
---|
197 | else ifeq ($(KBUILD_TARGET),linux)
|
---|
198 | VBOX_PACKAGE_OS = LINUX
|
---|
199 | else ifeq ($(KBUILD_TARGET),darwin)
|
---|
200 | VBOX_PACKAGE_OS = DARWIN
|
---|
201 | else ifeq ($(KBUILD_TARGET),solaris)
|
---|
202 | VBOX_PACKAGE_OS = SOLARIS
|
---|
203 | else ifeq ($(KBUILD_TARGET),os2)
|
---|
204 | VBOX_PACKAGE_OS = OS2
|
---|
205 | else if1of ($(KBUILD_TARGET), dragonfly freebsd netbsd openbsd)
|
---|
206 | VBOX_PACKAGE_OS = BSD
|
---|
207 | else
|
---|
208 | $(error Cannot determine VBOX_PACKAGE_OS)
|
---|
209 | endif
|
---|
210 | ifeq ($(KBUILD_TARGET_ARCH),x86)
|
---|
211 | VBOX_PACKAGE_ARCH = 32BITS
|
---|
212 | else
|
---|
213 | VBOX_PACKAGE_ARCH = 64BITS
|
---|
214 | endif
|
---|
215 | # distribution, mostly for Linux/Solaris where we support different distributions
|
---|
216 | # this strip will be overridden by the Linux packaging scripts
|
---|
217 | VBOX_PACKAGE_DIST ?= GENERIC
|
---|
218 | # Full string
|
---|
219 | VBOX_PACKAGE_STRING = $(VBOX_PACKAGE_OS)_$(VBOX_PACKAGE_ARCH)_$(VBOX_PACKAGE_DIST)
|
---|
220 |
|
---|
221 |
|
---|
222 | #
|
---|
223 | # The VirtualBox Configuration Defaults.
|
---|
224 | #
|
---|
225 | # We try to document all the build configuration options here, thing which
|
---|
226 | # aren't enabled by default is left commented out just to show that they
|
---|
227 | # exist and which value they should have (usually 1, but anyway).
|
---|
228 | #
|
---|
229 |
|
---|
230 | ## @name Additions
|
---|
231 | ## @{
|
---|
232 | # This indicates that additions (of some kind or another) is being _built_.
|
---|
233 | # VBOX_WITHOUT_ADDITIONS overrides it.
|
---|
234 | #if1of ($(KBUILD_TARGET), freebsd linux os2 solaris win)
|
---|
235 | if1of ($(KBUILD_TARGET), freebsd linux solaris win)
|
---|
236 | VBOX_WITH_ADDITIONS = 1
|
---|
237 | endif
|
---|
238 | # Build the optional ring-0 part of the additions for syntax checking.
|
---|
239 | # (Except when cross-building on linux since we're using /usr/src/...)
|
---|
240 | ifn1of ($(KBUILD_TARGET).$(KBUILD_HOST_ARCH).$(KBUILD_TARGET_ARCH), linux.x86.amd64 linux.amd64.x86)
|
---|
241 | VBOX_WITH_ADDITION_DRIVERS = 1
|
---|
242 | endif
|
---|
243 | # Build X11 additions. Can be disabled separately.
|
---|
244 | if1of ($(KBUILD_TARGET), dragonfly freebsd linux netbsd openbsd solaris)
|
---|
245 | VBOX_WITH_X11_ADDITIONS = 1
|
---|
246 | endif
|
---|
247 | # Enable the building of shared folders in the windows additions.
|
---|
248 | VBOX_WITH_WIN32_ADDITIONS_SHAREDFOLDERS = 1
|
---|
249 | # Take the binaries of the OS/2 Additions.
|
---|
250 | VBOX_WITH_OS2_ADDITIONS_BIN = 1
|
---|
251 | # Use additions from the build server.
|
---|
252 | #VBOX_WITH_ADDITIONS_FROM_BUILD_SERVER = 1
|
---|
253 | # Include additions in the package
|
---|
254 | VBOX_WITH_ADDITIONS_PACKING = 1
|
---|
255 | # Only build the additions (for the additions build server).
|
---|
256 | #VBOX_ONLY_ADDITIONS = 1
|
---|
257 | ifdef VBOX_ADDITIONS_ONLY # typical mistake.
|
---|
258 | $(error It is VBOX_ONLY_ADDITIONS=1 not VBOX_ADDITIONS_ONLY!)
|
---|
259 | endif
|
---|
260 | # Don't bother with additions, overrides VBOX_WITH_ADDITIONS.
|
---|
261 | # This is not used by makefiles, only Config.kmk, see below.
|
---|
262 | ifdef VBOX_ONLY_SDK
|
---|
263 | VBOX_WITHOUT_ADDITIONS = 1
|
---|
264 | endif
|
---|
265 | # Don't create the additions ISO.
|
---|
266 | # (Used by the additions build server, don't invert it.)
|
---|
267 | #VBOX_WITHOUT_ADDITIONS_ISO = 1
|
---|
268 | ## @}
|
---|
269 |
|
---|
270 | ## @name Documentation
|
---|
271 | ## @{
|
---|
272 | # The documentation
|
---|
273 | VBOX_WITH_DOCS = 1
|
---|
274 | # Use documentation from the build server.
|
---|
275 | #VBOX_WITH_DOCS_FROM_BUILD_SERVER = 1
|
---|
276 | # Include documentation in the package
|
---|
277 | VBOX_WITH_DOCS_PACKING = 1
|
---|
278 | # Include CHM when building docs (unset in LocalConfig.kmk to suppress CHM)
|
---|
279 | ifn1of ($(KBUILD_TARGET), linux)
|
---|
280 | VBOX_WITH_DOCS_CHM = 1
|
---|
281 | endif
|
---|
282 | # Don't bother with documentation, overrides VBOX_WITH_DOCS.
|
---|
283 | # This is not used by makefiles, only Config.kmk, see below.
|
---|
284 | #VBOX_WITHOUT_DOCS = 1
|
---|
285 | # Only build the documentation (for the documentation build server).
|
---|
286 | #VBOX_ONLY_DOCS = 1
|
---|
287 | ifdef VBOX_DOCS_ONLY # typical mistake.
|
---|
288 | $(error It is VBOX_ONLY_DOCS=1 not VBOX_DOCS_ONLY!)
|
---|
289 | endif
|
---|
290 | ## @}
|
---|
291 |
|
---|
292 | ## @name VMM related settings.
|
---|
293 | ## @{
|
---|
294 | # Enable the tradition raw-mode virtualization.
|
---|
295 | VBOX_WITH_RAW_MODE = 1
|
---|
296 | # Enable support for 64-bit guests.
|
---|
297 | VBOX_WITH_64_BITS_GUESTS = 1
|
---|
298 | # Enable multi-core VCPUs.
|
---|
299 | VBOX_WITH_MULTI_CORE = 1
|
---|
300 | # Activate this to force the VM to pre-allocate the guest RAM before startup
|
---|
301 | VBOX_WITH_PREALLOC_RAM_BY_DEFAULT =
|
---|
302 | # Enable the debugger.
|
---|
303 | VBOX_WITH_DEBUGGER = 1
|
---|
304 | # Enable the debugger GUI.
|
---|
305 | VBOX_WITH_DEBUGGER_GUI = 1
|
---|
306 | # Enable the PDM Lock and let I/O threads call into the PICs.
|
---|
307 | # TODO: Eliminate VBOX_WITH_PDM_LOCK.
|
---|
308 | VBOX_WITH_PDM_LOCK = 1
|
---|
309 | ## @}
|
---|
310 |
|
---|
311 |
|
---|
312 | ## @name Devices, Drivers,
|
---|
313 | ## @{
|
---|
314 | # Build the Host Guest Communication Manager component.
|
---|
315 | VBOX_WITH_HGCM = 1
|
---|
316 | ## Build the bugcheck detection code.
|
---|
317 | #VBOX_WITH_GUEST_BUGCHECK_DETECTION =
|
---|
318 | # Enable the USB feature. This includes VBOX_WITH_VUSB!
|
---|
319 | VBOX_WITH_USB = 1
|
---|
320 | # Enable the USB 1.1 controller plus virtual USB HID devices.
|
---|
321 | VBOX_WITH_VUSB = 1
|
---|
322 | # Enable the USB 2.0 controller.
|
---|
323 | VBOX_WITH_EHCI = 1
|
---|
324 | # Enable the ISCSI feature.
|
---|
325 | VBOX_WITH_ISCSI = 1
|
---|
326 | # Enable INIP support in the ISCSI feature.
|
---|
327 | VBOX_WITH_INIP = 1
|
---|
328 | # Enable the E1000 feature.
|
---|
329 | VBOX_WITH_E1000 = 1
|
---|
330 | # Enable the Virtio feature.
|
---|
331 | VBOX_WITH_VIRTIO = 1
|
---|
332 | # Enable ALSA support for Linux.
|
---|
333 | VBOX_WITH_ALSA = 1
|
---|
334 | # Enable Pulse support for Linux.
|
---|
335 | VBOX_WITH_PULSE = 1
|
---|
336 | # Enable statically linked dbus support
|
---|
337 | if1of ($(KBUILD_TARGET), linux solaris)
|
---|
338 | VBOX_WITH_DBUS = 1
|
---|
339 | endif
|
---|
340 | # Enable building PAM modules
|
---|
341 | if1of ($(KBUILD_TARGET), linux solaris)
|
---|
342 | VBOX_WITH_PAM = 1
|
---|
343 | endif
|
---|
344 | # Disable WINMM support for Windows (not implemented).
|
---|
345 | VBOX_WITH_WINMM =
|
---|
346 | # Enabled internal networking.
|
---|
347 | VBOX_WITH_INTERNAL_NETWORKING = 1
|
---|
348 | # Enable Host Guest Shared Memory Interface
|
---|
349 | VBOX_WITH_HGSMI = 1
|
---|
350 | # Enable Video 2D Acceleration
|
---|
351 | if1of ($(KBUILD_TARGET), darwin linux win freebsd)
|
---|
352 | VBOX_WITH_VIDEOHWACCEL = 1
|
---|
353 | endif
|
---|
354 | # Enable Wddm Video driver for Vista+ guests
|
---|
355 | VBOX_WITH_WDDM = 1
|
---|
356 | VBOXWDDM_WITH_VBVA = 1
|
---|
357 | VBOX_WITH_VDMA = 1
|
---|
358 | # Disable the Intel PXE ROM (uses Etherboot).
|
---|
359 | VBOX_WITH_INTEL_PXE =
|
---|
360 | # Enable EFI support
|
---|
361 | VBOX_WITH_EFI = 1
|
---|
362 | # Fetch EFI firmware image from the build server
|
---|
363 | #VBOX_WITH_EFIFW_FROM_BUILD_SERVER = 1
|
---|
364 | # Include the EFI firmware into the package
|
---|
365 | VBOX_WITH_EFIFW_PACKING = 1
|
---|
366 | # Use kStuff for MACH-O and LX binary loading.
|
---|
367 | if1of ($(KBUILD_TARGET), darwin os2)
|
---|
368 | IPRT_WITH_KSTUFF = 1
|
---|
369 | endif
|
---|
370 | # Enable Crossbow support for Solaris TAP driver.
|
---|
371 | VBOX_WITH_CROSSBOW = 1
|
---|
372 | # Enable setuid wrapper for Solaris host DVD.
|
---|
373 | #VBOX_WITH_SUID_WRAPPER = 1
|
---|
374 | # Enable the virtual SATA/AHCI controller
|
---|
375 | VBOX_WITH_AHCI = 1
|
---|
376 | # Enable the new async completion manager
|
---|
377 | VBOX_WITH_PDM_ASYNC_COMPLETION = 1
|
---|
378 | # Temporary switch for enabling / disabling the new USB code on Darwin.
|
---|
379 | VBOX_WITH_NEW_USB_CODE_ON_DARWIN = 1
|
---|
380 | ifdef VBOX_WITH_USB
|
---|
381 | VBOX_WITH_VUSB = 1
|
---|
382 | endif
|
---|
383 | # Enable the hal/sysfs USB code on Linux.
|
---|
384 | ifeq ($(KBUILD_TARGET),linux)
|
---|
385 | VBOX_USB_WITH_SYSFS = 1
|
---|
386 | # Disabled for now
|
---|
387 | # VBOX_USB_WITH_DBUS = 1
|
---|
388 | VBOX_USB_WITH_INOTIFY = 1
|
---|
389 | endif
|
---|
390 | # Use the new VBI module on Solaris.
|
---|
391 | #VBOX_WITH_SOLARIS_VBI = 1
|
---|
392 | # Enable performance API.
|
---|
393 | VBOX_WITH_RESOURCE_USAGE_API = 1
|
---|
394 | # Enable BusLogic SCSI host adapter
|
---|
395 | VBOX_WITH_BUSLOGIC = 1
|
---|
396 | # Enable LsiLogic SCSI host adapter
|
---|
397 | VBOX_WITH_LSILOGIC = 1
|
---|
398 | # Enable SCSI drivers
|
---|
399 | VBOX_WITH_SCSI = 1
|
---|
400 | # Enable this setting to force a fallback to default DMI data on configuration errors
|
---|
401 | VBOX_BIOS_DMI_FALLBACK =
|
---|
402 | # Enable the builtin PXE ROM
|
---|
403 | VBOX_WITH_PXE_ROM = 1
|
---|
404 | # Enable MSI support in devices
|
---|
405 | VBOX_WITH_MSI_DEVICES = 1
|
---|
406 | # Enable host network interface API.
|
---|
407 | if1of ($(KBUILD_TARGET), darwin freebsd linux solaris win)
|
---|
408 | VBOX_WITH_HOSTNETIF_API = 1
|
---|
409 | endif
|
---|
410 | ## @}
|
---|
411 |
|
---|
412 |
|
---|
413 | ## @name Other Component
|
---|
414 | ## @{
|
---|
415 | # Build the installer.
|
---|
416 | VBOX_WITH_INSTALLER = 1
|
---|
417 | # The kernel driver/module and related runtime libraries.
|
---|
418 | VBOX_WITH_VBOXDRV = 1
|
---|
419 | # The main api.
|
---|
420 | VBOX_WITH_MAIN = 1
|
---|
421 | # Set this to prefix all C symbols in XPCOM, to avoid dynamic linking problems
|
---|
422 | # caused by our XPCOM library polluting the symbol namespace for system libs.
|
---|
423 | if1of ($(KBUILD_TARGET), linux solaris)
|
---|
424 | VBOX_WITH_XPCOM_NAMESPACE_CLEANUP = 1
|
---|
425 | endif
|
---|
426 | # Set this to not use COM or XPCOM in places where it can be avoided.
|
---|
427 | #VBOX_WITHOUT_COM = 1
|
---|
428 | # The webservices api.
|
---|
429 | VBOX_WITH_WEBSERVICES = 1
|
---|
430 | # The Qt 4 GUI.
|
---|
431 | VBOX_WITH_QTGUI = 1
|
---|
432 | # Indicates the Qt is Cocoa based on the Mac.
|
---|
433 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
434 | VBOX_WITH_COCOA_QT = 1
|
---|
435 | endif
|
---|
436 | # The SDL based GUI.
|
---|
437 | VBOX_WITH_VBOXSDL = 1
|
---|
438 | # Build VBoxSDL with secure label support.
|
---|
439 | ifeq ($(filter win.amd64,$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)),) # too much work with freetype and all that.
|
---|
440 | VBOX_WITH_SECURELABEL = 1
|
---|
441 | endif
|
---|
442 | # The headless frontend.
|
---|
443 | VBOX_WITH_HEADLESS = 1
|
---|
444 | # Enable the build of VRDP server.
|
---|
445 | VBOX_WITH_VRDP = 1
|
---|
446 | # Enable support for video redirection VRDP channel.
|
---|
447 | VBOX_WITH_VRDP_VIDEO_CHANNEL = 1
|
---|
448 | # Enable memory consumption limit in VRDP server.
|
---|
449 | VBOX_WITH_VRDP_SB_LIMIT = 1
|
---|
450 | # Build the VRDP authentication modules.
|
---|
451 | VBOX_WITH_VRDP_AUTHMOD = 1
|
---|
452 | # Build enhanced version of rdesktop.
|
---|
453 | VBOX_WITH_VRDP_RDESKTOP = 1
|
---|
454 | # The basic frontend (w/o Main).
|
---|
455 | VBOX_WITH_VBOXBFE = 1
|
---|
456 | ## The Direct Framebuffer GUI.
|
---|
457 | #VBOX_WITH_VBOXFB = 1
|
---|
458 | # Enables the Python<->XPCOM and Python<->COM bindings.
|
---|
459 | VBOX_WITH_PYTHON ?= 1
|
---|
460 | if1of ($(KBUILD_TARGET), darwin linux solaris)
|
---|
461 | # Enable Java<->XPCOM bridge + glue code
|
---|
462 | VBOX_WITH_JXPCOM ?= 1
|
---|
463 | endif
|
---|
464 | if1of ($(KBUILD_TARGET), )
|
---|
465 | # Enable Java<->MSCOM glue, bridge is provided by an external lib (Jacob)
|
---|
466 | VBOX_WITH_JMSCOM ?= 1
|
---|
467 | endif
|
---|
468 | if1of ($(KBUILD_TARGET), darwin linux solaris)
|
---|
469 | # Enable Java<->JAX-WS bridge
|
---|
470 | VBOX_WITH_JWS ?= 1
|
---|
471 | endif
|
---|
472 | # Use XPIDL instead of XSLT stylesheet
|
---|
473 | VBOX_WITH_JAVA_SUPPORT_IN_XPIDL ?=
|
---|
474 | # Build against multiple Python versions present in the system
|
---|
475 | VBOX_WITH_MULTIVERSION_PYTHON ?= 1
|
---|
476 | # Enable the kchmviewer.
|
---|
477 | VBOX_WITH_KCHMVIEWER = 1
|
---|
478 | # Build the testsuite.
|
---|
479 | VBOX_WITH_TESTSUITE = 1
|
---|
480 | # Build the testcases.
|
---|
481 | VBOX_WITH_TESTCASES = 1
|
---|
482 | # Enables the ffmpeg module for recording test runs.
|
---|
483 | # TODO: Enable this for normal build server builds?
|
---|
484 | #if1of ($(KBUILD_TARGET), linux)
|
---|
485 | # VBOX_WITH_FFMPEG = 1
|
---|
486 | #endif
|
---|
487 | # Enable shared folders
|
---|
488 | VBOX_WITH_SHARED_FOLDERS = 1
|
---|
489 | # Enable shared clipboard
|
---|
490 | VBOX_WITH_SHARED_CLIPBOARD = 1
|
---|
491 | # Enable the host/guest information service (aka guest properties).
|
---|
492 | VBOX_WITH_GUEST_PROPS = 1
|
---|
493 | # Enable this to prevent the guest from writing guest properties.
|
---|
494 | VBOX_WITH_GUEST_PROPS_RDONLY_GUEST =
|
---|
495 | # Enable the guest control service.
|
---|
496 | if1of ($(KBUILD_TARGET), darwin freebsd linux solaris win)
|
---|
497 | VBOX_WITH_GUEST_CONTROL = 1
|
---|
498 | endif
|
---|
499 | # Enable ballooning
|
---|
500 | VBOX_WITH_MEMBALLOON = 1
|
---|
501 | # Enable crOpenGL service
|
---|
502 | if1of ($(KBUILD_TARGET), darwin freebsd linux solaris win)
|
---|
503 | VBOX_WITH_CROGL = 1
|
---|
504 | endif
|
---|
505 | # Enable the VNC server in VBoxHeadless (GPL only).
|
---|
506 | #VBOX_WITH_VNC = 1
|
---|
507 | # Enable S3 support (requires libcurl)
|
---|
508 | VBOX_WITH_S3 = 1
|
---|
509 | ## @}
|
---|
510 |
|
---|
511 |
|
---|
512 | ## @name Networking
|
---|
513 | ## @{
|
---|
514 | # Use VBoxNetFlt for host interface networking.
|
---|
515 | if1of ($(KBUILD_TARGET), darwin freebsd linux solaris win)
|
---|
516 | VBOX_WITH_NETFLT = 1
|
---|
517 | ifeq ($(KBUILD_TARGET),solaris)
|
---|
518 | # Disabled until some Nevada version ships the required headers.
|
---|
519 | # VBOX_WITH_NETFLT_CROSSBOW = 1
|
---|
520 | endif
|
---|
521 | # Use VBoxNetAdp for host only networking.
|
---|
522 | if1of ($(KBUILD_TARGET), darwin freebsd linux solaris) ## @todo this should be set and used on windows too.
|
---|
523 | VBOX_WITH_NETADP = 1
|
---|
524 | endif
|
---|
525 | endif
|
---|
526 | # Enable Virtual Distributed Ethernet or not.
|
---|
527 | if1of ($(KBUILD_TARGET), freebsd linux)
|
---|
528 | VBOX_WITH_VDE = 1
|
---|
529 | endif
|
---|
530 | ## @}
|
---|
531 |
|
---|
532 |
|
---|
533 | ## @name Extension pack
|
---|
534 | ## @{
|
---|
535 | # Enables the extension pack feature.
|
---|
536 | VBOX_WITH_EXTPACK = 1
|
---|
537 | # Enables building of the Oracle VM VirtualBox Extension Pack, dubbed PUEL.
|
---|
538 | VBOX_WITH_EXTPACK_PUEL = 1
|
---|
539 | ## @}
|
---|
540 |
|
---|
541 | ## @name Misc
|
---|
542 | ## @{
|
---|
543 | # Enable Seamless mode
|
---|
544 | VBOX_X11_SEAMLESS_GUEST = 1
|
---|
545 | # Enables all the doxgen bits.
|
---|
546 | VBOX_WITH_ALL_DOXYGEN_TARGETS = 1
|
---|
547 | # Set this to skip installing the redistributable compiler runtime.
|
---|
548 | #VBOX_WITHOUT_COMPILER_REDIST = 1
|
---|
549 | # Set this to enable user mode dtrace probes (darwin & solaris only).
|
---|
550 | if1of ($(KBUILD_TARGET), darwin)
|
---|
551 | VBOX_WITH_DTRACE_R3 = 1
|
---|
552 | endif
|
---|
553 | # Set this to enable kernel driver dtrace probes (darwin & solaris only).
|
---|
554 | #VBOX_WITH_DTRACE_R0DRV = 1
|
---|
555 | # Set this to enable dtrace probes in platform agnostic kernel code.
|
---|
556 | #VBOX_WITH_DTRACE_R0 = 1
|
---|
557 | # Set this to enable dtrace probes raw-mode context code.
|
---|
558 | #VBOX_WITH_DTRACE_RC = 1
|
---|
559 | # Set this to enable support for dtrace probes in guest code.
|
---|
560 | #VBOX_WITH_DTRACE_GST = 1
|
---|
561 | ## @}
|
---|
562 |
|
---|
563 |
|
---|
564 | ## @name Compiler and linker config
|
---|
565 | ## @{
|
---|
566 | # For treating compiler and linker warnings as errors where possible.
|
---|
567 | if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.x86 darwin.amd64 linux.x86 linux.amd64 win.x86 win.amd64)
|
---|
568 | VBOX_WITH_WARNINGS_AS_ERRORS = 1
|
---|
569 | endif
|
---|
570 | ## @}
|
---|
571 |
|
---|
572 |
|
---|
573 | ## @name Hardening
|
---|
574 | ## @{
|
---|
575 | # Enables hardening.
|
---|
576 | # Most developers will want to disable this in their LocalConfig.kmk.
|
---|
577 | ifn1of ($(KBUILD_TARGET), win)
|
---|
578 | VBOX_WITH_HARDENING = 1
|
---|
579 | endif
|
---|
580 | # Where the application files are (going to be) installed.
|
---|
581 | #VBOX_PATH_APP_PRIVATE = /usr/lib/virtualbox
|
---|
582 | ifdef VBOX_WITH_HARDENING
|
---|
583 | if1of ($(KBUILD_TARGET), linux solaris)
|
---|
584 | VBOX_PATH_APP_PRIVATE = /opt/VirtualBox
|
---|
585 | else ifeq ($(KBUILD_TARGET),darwin)
|
---|
586 | VBOX_PATH_APP_PRIVATE = /Applications/VirtualBox.app/Contents/MacOS
|
---|
587 | else ifeq ($(KBUILD_TARGET),freebsd)
|
---|
588 | VBOX_PATH_APP_PRIVATE = /usr/local/lib/virtualbox
|
---|
589 | endif
|
---|
590 | endif
|
---|
591 | # Where the architecture specific application files are (going to be) installed.
|
---|
592 | #VBOX_PATH_APP_PRIVATE_ARCH = /usr/lib/virtualbox
|
---|
593 | ifdef VBOX_WITH_HARDENING
|
---|
594 | if1of ($(KBUILD_TARGET), solaris)
|
---|
595 | VBOX_PATH_APP_PRIVATE_ARCH_TOP = $(VBOX_PATH_APP_PRIVATE)
|
---|
596 | VBOX_PATH_APP_PRIVATE_ARCH = $(VBOX_PATH_APP_PRIVATE_ARCH_TOP)/$(if-expr $(KBUILD_TARGET_ARCH) == "amd64",amd64,i386)
|
---|
597 | else if1of ($(KBUILD_TARGET), darwin)
|
---|
598 | VBOX_PATH_APP_PRIVATE_ARCH = $(VBOX_PATH_APP_PRIVATE)
|
---|
599 | endif
|
---|
600 | endif
|
---|
601 | # Where the shared libraries are (going to be) installed.
|
---|
602 | #VBOX_PATH_SHARED_LIBS = /usr/lib
|
---|
603 | ifdef VBOX_WITH_HARDENING
|
---|
604 | if1of ($(KBUILD_TARGET), solaris)
|
---|
605 | VBOX_PATH_SHARED_LIBS = $(VBOX_PATH_APP_PRIVATE)/$(if-expr $(KBUILD_TARGET_ARCH) == "amd64",amd64,i386)
|
---|
606 | else if1of ($(KBUILD_TARGET), darwin)
|
---|
607 | VBOX_PATH_SHARED_LIBS = $(VBOX_PATH_APP_PRIVATE)
|
---|
608 | endif
|
---|
609 | endif
|
---|
610 | # Where the documentation is (going to be) installed.
|
---|
611 | #VBOX_PATH_APP_DOCS = /usr/share/doc/virtualbox
|
---|
612 | ifdef VBOX_WITH_HARDENING
|
---|
613 | if1of ($(KBUILD_TARGET), darwin solaris)
|
---|
614 | VBOX_PATH_APP_DOCS = $(VBOX_PATH_APP_PRIVATE)
|
---|
615 | endif
|
---|
616 | endif
|
---|
617 | # The DT_RPATH/DT_RUNPATH to embed into the binaries (ELF).
|
---|
618 | # (This one is used for all binaries, there is no need to adjust this
|
---|
619 | # depending on the location of the object.)
|
---|
620 | #VBOX_WITH_RUNPATH = /usr/lib/virtualbox
|
---|
621 | ifdef VBOX_WITH_HARDENING
|
---|
622 | if1of ($(KBUILD_TARGET), solaris)
|
---|
623 | VBOX_WITH_RUNPATH = $(VBOX_PATH_APP_PRIVATE)/$(if-expr $(KBUILD_TARGET_ARCH) == "amd64",amd64,i386)
|
---|
624 | else if1of ($(KBUILD_TARGET), freebsd linux)
|
---|
625 | VBOX_WITH_RUNPATH = $(VBOX_PATH_APP_PRIVATE)
|
---|
626 | endif
|
---|
627 | endif
|
---|
628 | # Enable use of the $ORIGIN DT_RPATH/DT_RUNPATH feature (ELF).
|
---|
629 | # Because of the setuid usage on all ELF platforms when hardening the build
|
---|
630 | # things gets a bit complicated since the $ORIGIN+setuid policy differs.
|
---|
631 | #VBOX_WITH_ORIGIN = 1
|
---|
632 | ifndef VBOX_WITH_HARDENING
|
---|
633 | if1of ($(KBUILD_TARGET), linux solaris)
|
---|
634 | VBOX_WITH_ORIGIN = 1
|
---|
635 | endif
|
---|
636 | endif
|
---|
637 | # Enable the system wide support service/daemon.
|
---|
638 | # Work in progress, but required for hardening on Windows.
|
---|
639 | #VBOX_WITH_SUPSVC = 1
|
---|
640 | ifdef VBOX_WITH_HARDENING
|
---|
641 | if1of ($(KBUILD_TARGET), win)
|
---|
642 | VBOX_WITH_SUPSVC = 1
|
---|
643 | endif
|
---|
644 | endif
|
---|
645 | ## @}
|
---|
646 |
|
---|
647 |
|
---|
648 | # Strip binaries of release and profile builds before packing them into the installer
|
---|
649 | # archive. When building .deb/.rpms, don't strip the symbols as they are required for
|
---|
650 | # the debug packages containing symbols for gdb located in /usr/lib/debug.
|
---|
651 | VBOX_DO_STRIP := $(if $(filter release profile,$(KBUILD_TYPE)),1,)
|
---|
652 | # Strip R0/GC modules (current requirement for our loader)
|
---|
653 | # TODO: This shouldn't be a requirement any longer. FIXME XXX
|
---|
654 | VBOX_DO_STRIP_MODULES = 1
|
---|
655 |
|
---|
656 |
|
---|
657 | #
|
---|
658 | # Config items for enabling work in progress.
|
---|
659 | #
|
---|
660 | # It's good pratice to add stuff here even if it is currently disabled by
|
---|
661 | # default.
|
---|
662 | #
|
---|
663 | # Note! Please, do *not* add stuff to the global DEFS unless it is *really*
|
---|
664 | # necessary! The other guys will hate for it you when they have to
|
---|
665 | # recompile everything when the feature is enabled or disabled. Put
|
---|
666 | # the ifdefs in target or template definitions.
|
---|
667 | #
|
---|
668 |
|
---|
669 | ## For experimenting with disabling preemption instead of interrupts
|
---|
670 | # when working VT-x/AMD-V in VMMR0.
|
---|
671 | ## @todo os2? Reconsider perhaps windows? (see defect) This should be made the default.
|
---|
672 | if1of ($(KBUILD_TARGET), darwin freebsd linux solaris win)
|
---|
673 | VBOX_WITH_VMMR0_DISABLE_PREEMPTION = 1
|
---|
674 | endif
|
---|
675 | # Mask all Local APIC interrupt vectors which are set up to NMI mode when switching
|
---|
676 | # to/from the guest in raw mode. Modern Linux kernels use the performance counter
|
---|
677 | # to raise an NMI from time to time.
|
---|
678 | if1of ($(KBUILD_TARGET), linux)
|
---|
679 | VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI = 1
|
---|
680 | endif
|
---|
681 | ## For testing deadlock detection and lock order validation.
|
---|
682 | # If issues are found, create high priority defects and temporarily comment
|
---|
683 | # the next line.
|
---|
684 | VBOX_WITH_STRICT_LOCKS = 1
|
---|
685 |
|
---|
686 |
|
---|
687 | #
|
---|
688 | # Branding
|
---|
689 | #
|
---|
690 | VBOX_BRAND_BIOS_LOGO := $(PATH_ROOT)/src/VBox/Devices/Graphics/BIOS/puel_logo.bmp
|
---|
691 | VBOX_BRAND_LICENSE_HTML := $(PATH_ROOT)/doc/License-gpl-2.0.html
|
---|
692 | VBOX_BRAND_LICENSE_RTF := $(PATH_ROOT)/doc/License-gpl-2.0.rtf
|
---|
693 | VBOX_BRAND_LICENSE_TXT := $(PATH_ROOT)/doc/License-gpl-2.0.txt
|
---|
694 | VBOX_BRAND_LICENSE_VER :=
|
---|
695 | VBOX_BRAND_GUI_ABOUT_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/NonOSE/about.png
|
---|
696 | VBOX_BRAND_GUI_ABOUT_16PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/NonOSE/about_16px.png
|
---|
697 | VBOX_BRAND_GUI_VBOX_16PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/NonOSE/VirtualBox_16px.png
|
---|
698 | VBOX_BRAND_GUI_VBOX_20PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/NonOSE/VirtualBox_20px.png
|
---|
699 | VBOX_BRAND_GUI_VBOX_32PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/NonOSE/VirtualBox_32px.png
|
---|
700 | VBOX_BRAND_GUI_VBOX_40PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/NonOSE/VirtualBox_40px.png
|
---|
701 | VBOX_BRAND_GUI_VBOX_48PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/NonOSE/VirtualBox_48px.png
|
---|
702 | VBOX_BRAND_GUI_VBOX_64PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/NonOSE/VirtualBox_64px.png
|
---|
703 | VBOX_BRAND_WIN_INST_DLGJPG := $(PATH_ROOT)/src/VBox/Installer/win/Binary/Dialog.jpg
|
---|
704 | VBOX_BRAND_WIN_INST_EXT :=
|
---|
705 | VBOX_BRAND_WIN_ADD_INST_DLGBMP := $(PATH_ROOT)/src/VBox/Additions/WINNT/Installer/welcome.bmp
|
---|
706 | VBOX_BRAND_DARWIN_DISKIMAGE_DS_STORE := $(PATH_ROOT)/src/VBox/Installer/darwin/DiskImage/DS_Store
|
---|
707 | VBOX_BRAND_DARWIN_DISKIMAGE_BG := $(PATH_ROOT)/src/VBox/Installer/darwin/DiskImage/vbox_folder.tiff
|
---|
708 | VBOX_BRAND_DARWIN_INSTALLER_BG := $(PATH_ROOT)/src/VBox/Installer/darwin/VirtualBox_mpkg/background.tif
|
---|
709 |
|
---|
710 | #
|
---|
711 | # Skip stuff.
|
---|
712 | #
|
---|
713 |
|
---|
714 | ifdef VBOX_ONLY_EXTPACKS
|
---|
715 | # Clear some VBOX_WITH_XXX variables instead of adding ifdefs all over the place.
|
---|
716 | VBOX_WITH_DEBUGGER =
|
---|
717 | VBOX_WITH_ADDITIONS =
|
---|
718 | VBOX_WITH_VBOXDRV =
|
---|
719 | VBOX_WITH_TESTCASES =
|
---|
720 | endif
|
---|
721 |
|
---|
722 | # VBOX_QUICK can be used by core developers to speed to the build
|
---|
723 | ifdef VBOX_QUICK
|
---|
724 | # undefine variables by assigning blank.
|
---|
725 | VBOX_WITH_TESTSUITE=
|
---|
726 | VBOX_WITH_TESTCASES=
|
---|
727 | VBOX_WITH_MAIN =
|
---|
728 | VBOX_WITH_VBOXSDL =
|
---|
729 | VBOX_WITH_VBOXBFE =
|
---|
730 | VBOX_WITH_QTGUI =
|
---|
731 | VBOX_WITH_DEBUGGER_GUI =
|
---|
732 | VBOX_WITH_DOCS =
|
---|
733 | endif # VBOX_QUICK
|
---|
734 |
|
---|
735 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
736 | # Don't bother with SDL ttf for now.
|
---|
737 | VBOX_WITH_SECURELABEL=
|
---|
738 | # We'll use the native html/help viewer.
|
---|
739 | VBOX_WITH_KCHMVIEWER=
|
---|
740 | VBOX_WITH_VRDP_RDESKTOP=
|
---|
741 | # Permanent (no working SDL).
|
---|
742 | VBOX_WITH_VBOXSDL=
|
---|
743 | VBOX_WITH_VBOXBFE=
|
---|
744 | endif
|
---|
745 |
|
---|
746 | ifeq ($(KBUILD_TARGET),freebsd)
|
---|
747 | VBOX_WITH_DOCS=
|
---|
748 | endif
|
---|
749 |
|
---|
750 | ifeq ($(KBUILD_TARGET),l4)
|
---|
751 | VBOX_WITH_VBOXDRV=
|
---|
752 | VBOX_WITH_ADDITION_DRIVERS=
|
---|
753 | VBOX_WITH_VRDP=
|
---|
754 | VBOX_WITH_HEADLESS=
|
---|
755 | VBOX_WITH_VBOXSDL=
|
---|
756 | VBOX_WITH_QTGUI=
|
---|
757 | VBOX_WITH_MAIN=
|
---|
758 | VBOX_WITH_DOCS=
|
---|
759 | VBOX_WITH_ISCSI=
|
---|
760 | VBOX_WITH_INIP=
|
---|
761 | VBOX_WITH_INTERNAL_NETWORKING=
|
---|
762 | VBOX_WITH_PDM_ASYNC_COMPLETION=
|
---|
763 | VBOX_WITH_KCHMVIEWER=
|
---|
764 | VBOX_WITH_HARDENING=
|
---|
765 | endif
|
---|
766 |
|
---|
767 | ifeq ($(KBUILD_TARGET),os2)
|
---|
768 | VBOX_WITH_WEBSERVICES=
|
---|
769 | VBOX_WITH_INSTALLER=
|
---|
770 | VBOX_WITH_SECURELABEL=
|
---|
771 | VBOX_WITH_VRDP_AUTHMOD=
|
---|
772 | VBOX_WITH_VRDP_RDESKTOP=
|
---|
773 | VBOX_WITH_TESTSUITE=
|
---|
774 | VBOX_WITH_QTGUI=
|
---|
775 | VBOX_WITH_USB=
|
---|
776 | VBOX_WITH_EHCI=
|
---|
777 | VBOX_WITH_DOCS=
|
---|
778 | VBOX_WITH_PDM_ASYNC_COMPLETION=
|
---|
779 | VBOX_WITH_KCHMVIEWER=
|
---|
780 | VBOX_WITH_HARDENING=
|
---|
781 | endif
|
---|
782 |
|
---|
783 | ifeq ($(KBUILD_TARGET),solaris)
|
---|
784 | VBOX_WITH_SECURELABEL=
|
---|
785 | VBOX_WITH_OGL=
|
---|
786 | endif
|
---|
787 |
|
---|
788 | ifeq ($(KBUILD_TARGET),win)
|
---|
789 | VBOX_WITH_VRDP_RDESKTOP=
|
---|
790 | VBOX_WITH_KCHMVIEWER=
|
---|
791 | endif
|
---|
792 |
|
---|
793 | ifn1of ($(KBUILD_TARGET_ARCH), x86 amd64)
|
---|
794 | VBOX_WITH_ADDITION_DRIVERS=
|
---|
795 | VBOX_WITH_CROGL=
|
---|
796 | VBOX_WITH_DEBUGGER=
|
---|
797 | VBOX_WITH_DOCS=
|
---|
798 | VBOX_WITH_EHCI=
|
---|
799 | VBOX_WITH_HARDENING=
|
---|
800 | VBOX_WITH_HEADLESS=
|
---|
801 | VBOX_WITH_HGCM=
|
---|
802 | VBOX_WITH_HGSMI=
|
---|
803 | VBOX_WITH_INIP=
|
---|
804 | VBOX_WITH_INSTALLER=
|
---|
805 | VBOX_WITH_INTERNAL_NETWORKING=
|
---|
806 | VBOX_WITH_ISCSI=
|
---|
807 | VBOX_WITH_KCHMVIEWER=
|
---|
808 | VBOX_WITH_MAIN=
|
---|
809 | VBOX_WITH_PDM_ASYNC_COMPLETION=
|
---|
810 | VBOX_WITH_QTGUI=
|
---|
811 | VBOX_WITH_RAW_MODE=
|
---|
812 | VBOX_WITH_SECURELABEL=
|
---|
813 | VBOX_WITH_TESTSUITE=
|
---|
814 | VBOX_WITH_USB=
|
---|
815 | VBOX_WITH_VBOXBFE=
|
---|
816 | VBOX_WITH_VBOXDRV=
|
---|
817 | VBOX_WITH_VBOXSDL=
|
---|
818 | VBOX_WITH_WEBSERVICES=
|
---|
819 | VBOX_WITH_XPCOM=
|
---|
820 | VBOX_WITHOUT_HARDENING=1
|
---|
821 | # remove later:
|
---|
822 | VBOX_WITH_VRDP=
|
---|
823 | VBOX_WITH_VRDP_AUTHMOD=
|
---|
824 | VBOX_WITH_VRDP_RDESKTOP=
|
---|
825 | endif
|
---|
826 |
|
---|
827 |
|
---|
828 | #
|
---|
829 | # Include automatic and local config file to override the above settings
|
---|
830 | # and to provide defaults for the settings below this point.
|
---|
831 | #
|
---|
832 | ifndef AUTOCFG
|
---|
833 | AUTOCFG := $(wildcard $(PATH_ROOT)/AutoConfig.kmk)
|
---|
834 | endif
|
---|
835 | ifneq ($(AUTOCFG),)
|
---|
836 | include $(AUTOCFG)
|
---|
837 | endif
|
---|
838 |
|
---|
839 | ifndef LOCALCFG
|
---|
840 | LOCALCFG := $(wildcard $(PATH_ROOT)/LocalConfig.kmk)
|
---|
841 | ifneq ($(LOCALCFG),)
|
---|
842 | include $(LOCALCFG)
|
---|
843 | endif
|
---|
844 | else
|
---|
845 | # Ignore it if it doesn't exist.
|
---|
846 | if exists "$(LOCALCFG)"
|
---|
847 | include $(LOCALCFG)
|
---|
848 | else
|
---|
849 | $(warning LOCALCFG='$(LOCALCFG)' does not exist)
|
---|
850 | override LOCALCFG :=
|
---|
851 | endif
|
---|
852 | endif
|
---|
853 |
|
---|
854 | #
|
---|
855 | # Allow to overwrite the branding information from an external file
|
---|
856 | #
|
---|
857 | ifdef VBOX_BRANDING_CFG
|
---|
858 | include $(VBOX_BRANDING_CFG)
|
---|
859 | endif
|
---|
860 |
|
---|
861 | #
|
---|
862 | # Bitch about old settings.
|
---|
863 | #
|
---|
864 | ifdef VBOX_WITHOUT_LINUX_COMPILER_H
|
---|
865 | $(warning VBOX_WITHOUT_LINUX_COMPILER_H was renamed to VBOX_WITH_LINUX_COMPILER_H, the meaning is inverted.)
|
---|
866 | endif
|
---|
867 |
|
---|
868 | #
|
---|
869 | # For the docs build box.
|
---|
870 | #
|
---|
871 | ifdef VBOX_ONLY_DOCS
|
---|
872 | VBOX_WITH_DOCS_CHM = 1
|
---|
873 | endif
|
---|
874 |
|
---|
875 | #
|
---|
876 | # Disable components that are not open sourced.
|
---|
877 | #
|
---|
878 | ifdef VBOX_OSE
|
---|
879 | VBOX_WITH_VRDP=
|
---|
880 | VBOX_WITH_EHCI=
|
---|
881 | VBOX_WITH_EXTPACK_PUEL=
|
---|
882 | VBOX_WITH_OS2_ADDITIONS_BIN=
|
---|
883 | VBOX_WITH_SECURELABEL=
|
---|
884 | VBOX_WITH_KCHMVIEWER=
|
---|
885 | ifn1of ($(KBUILD_TARGET), linux)
|
---|
886 | VBOX_WITH_DOCS=
|
---|
887 | VBOX_WITH_DOCS_PACKING=
|
---|
888 | endif
|
---|
889 | VBOX_WITH_TESTSUITE=
|
---|
890 | VBOX_WITH_INTEL_PXE=
|
---|
891 | VBOX_WITH_FFMPEG=
|
---|
892 | ifn1of ($(KBUILD_TARGET), darwin linux solaris win)
|
---|
893 | VBOX_WITH_INSTALLER=
|
---|
894 | endif
|
---|
895 | # branding
|
---|
896 | VBOX_BRAND_LICENSE_HTML := $(PATH_ROOT)/doc/License-gpl-2.0.html
|
---|
897 | VBOX_BRAND_LICENSE_RTF := $(PATH_ROOT)/doc/License-gpl-2.0.rtf
|
---|
898 | VBOX_BRAND_LICENSE_TXT := $(PATH_ROOT)/doc/License-gpl-2.0.txt
|
---|
899 | VBOX_BRAND_BIOS_LOGO := $(PATH_ROOT)/src/VBox/Devices/Graphics/BIOS/ose_logo.bmp
|
---|
900 | VBOX_BRAND_GUI_ABOUT_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/about.png
|
---|
901 | VBOX_BRAND_GUI_ABOUT_16PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/about_16px.png
|
---|
902 | VBOX_BRAND_GUI_VBOX_16PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_16px.png
|
---|
903 | VBOX_BRAND_GUI_VBOX_20PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_20px.png
|
---|
904 | VBOX_BRAND_GUI_VBOX_32PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_32px.png
|
---|
905 | VBOX_BRAND_GUI_VBOX_40PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_40px.png
|
---|
906 | VBOX_BRAND_GUI_VBOX_48PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_48px.png
|
---|
907 | VBOX_BRAND_GUI_VBOX_64PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_64px.png
|
---|
908 | VBOX_BRAND_GUI_CUBE_42PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_cube_42px.png
|
---|
909 | endif
|
---|
910 |
|
---|
911 | #
|
---|
912 | # VBOX_WITHOUT_HARDENING is for developers (put in LocalConfig.kmk).
|
---|
913 | # Note that this is a bit rough since hardening governs more than one
|
---|
914 | # variable... Also note that we allow VBOX_WITH_HARDENING=1 on the
|
---|
915 | # command line to overrule VBOX_WITHOUT_HARDENING (the check below).
|
---|
916 | #
|
---|
917 | ifdef VBOX_WITHOUT_HARDENING
|
---|
918 | VBOX_WITH_HARDENING=
|
---|
919 | ifeq ($(VBOX_WITH_HARDENING),)
|
---|
920 | VBOX_PATH_APP_PRIVATE=
|
---|
921 | VBOX_PATH_APP_PRIVATE_ARCH=
|
---|
922 | VBOX_PATH_APP_PRIVATE_ARCH_TOP=
|
---|
923 | VBOX_PATH_SHARED_LIBS=
|
---|
924 | VBOX_PATH_APP_DOCS=
|
---|
925 | VBOX_WITH_RUNPATH=
|
---|
926 | if1of ($(KBUILD_TARGET), linux solaris)
|
---|
927 | VBOX_WITH_ORIGIN=1
|
---|
928 | endif
|
---|
929 | endif
|
---|
930 | endif
|
---|
931 |
|
---|
932 | #
|
---|
933 | # Sanitize the additions build config variables.
|
---|
934 | #
|
---|
935 | ifdef VBOX_WITH_ADDITIONS_FROM_BUILD_SERVER
|
---|
936 | VBOX_WITHOUT_ADDITIONS := 1
|
---|
937 | ifdef VBOX_ONLY_ADDITIONS
|
---|
938 | $(error VBOX_ONLY_ADDITIONS + VBOX_WITH_ADDITIONS_FROM_BUILD_SERVER does not add up!)
|
---|
939 | endif
|
---|
940 | endif
|
---|
941 |
|
---|
942 | ifdef VBOX_ONLY_ADDITIONS
|
---|
943 | ifdef VBOX_WITHOUT_ADDITIONS
|
---|
944 | $(error VBOX_ONLY_ADDITIONS + VBOX_WITHOUT_ADDITIONS does not add up!)
|
---|
945 | endif
|
---|
946 | endif
|
---|
947 |
|
---|
948 | ifdef VBOX_WITHOUT_ADDITIONS
|
---|
949 | # Zap anything that could be contradicting this.
|
---|
950 | VBOX_WITH_ADDITIONS :=
|
---|
951 | endif
|
---|
952 |
|
---|
953 | #
|
---|
954 | # Sanitize the documentation build config variables.
|
---|
955 | #
|
---|
956 | ifdef VBOX_WITH_DOCS_FROM_BUILD_SERVER
|
---|
957 | VBOX_WITHOUT_DOCS := 1
|
---|
958 | ifdef VBOX_ONLY_DOCS
|
---|
959 | $(error VBOX_ONLY_DOCS + VBOX_WITH_DOCS_FROM_BUILD_SERVER does not add up!)
|
---|
960 | endif
|
---|
961 | endif
|
---|
962 |
|
---|
963 | ifdef VBOX_ONLY_DOCS
|
---|
964 | ifdef VBOX_WITHOUT_DOCS
|
---|
965 | $(error VBOX_ONLY_DOCS + VBOX_WITHOUT_DOCS does not add up!)
|
---|
966 | endif
|
---|
967 | endif
|
---|
968 |
|
---|
969 | ifdef VBOX_WITHOUT_DOCS
|
---|
970 | # Zap anything that could be contradicting this.
|
---|
971 | VBOX_WITH_DOCS :=
|
---|
972 | endif
|
---|
973 |
|
---|
974 | #
|
---|
975 | # Disable components for headless
|
---|
976 | #
|
---|
977 | ifdef VBOX_HEADLESS
|
---|
978 | VBOX_WITH_QTGUI=
|
---|
979 | VBOX_WITH_VBOXSDL=
|
---|
980 | VBOX_WITH_VBOXBFE=
|
---|
981 | VBOX_WITH_OGL=
|
---|
982 | VBOX_WITH_KCHMVIEWER=
|
---|
983 | VBOX_WITH_VRDP_RDESKTOP=
|
---|
984 | endif
|
---|
985 |
|
---|
986 | #
|
---|
987 | # Undefined VBOX_WITH_MAIN implies exclusion of a few more items.
|
---|
988 | #
|
---|
989 | ifndef VBOX_WITH_MAIN
|
---|
990 | VBOX_WITH_VBOXSDL=
|
---|
991 | VBOX_WITH_QTGUI=
|
---|
992 | VBOX_WITH_DEBUGGER_GUI=
|
---|
993 | VBOX_WITH_HEADLESS=
|
---|
994 | ifdef VBOX_ONLY_DOCS
|
---|
995 | $(error Oh, does VBOX_ONLY_DOCS actually end up here. sweet.)
|
---|
996 | endif
|
---|
997 | VBOX_WITH_DOCS=
|
---|
998 | endif
|
---|
999 |
|
---|
1000 | ifndef VBOX_WITH_QTGUI
|
---|
1001 | VBOX_WITH_KCHMVIEWER=
|
---|
1002 | endif
|
---|
1003 |
|
---|
1004 | #
|
---|
1005 | # Mark OSE builds clearly, helps figuring out limitations more easily.
|
---|
1006 | #
|
---|
1007 | ifdef VBOX_OSE
|
---|
1008 | VBOX_VERSION_STRING = $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)_OSE
|
---|
1009 | endif
|
---|
1010 |
|
---|
1011 | # Keep in sync with G_virtualBoxPackage in glue-jaxws.xsl and glue-java.xsl
|
---|
1012 | # Changed with every new version, so beware!
|
---|
1013 | if $(VBOX_VERSION_BUILD) < 51
|
---|
1014 | VBOX_API_SUFFIX = _$(VBOX_VERSION_MAJOR)_$(VBOX_VERSION_MINOR)
|
---|
1015 | else
|
---|
1016 | VBOX_API_SUFFIX = _$(VBOX_VERSION_MAJOR)_$(expr $(VBOX_VERSION_MINOR) + 1)
|
---|
1017 | endif
|
---|
1018 | VBOX_JAVA_PACKAGE = org.virtualbox$(VBOX_API_SUFFIX)
|
---|
1019 |
|
---|
1020 | #
|
---|
1021 | # Derived / helper config indicators. Not configurable.
|
---|
1022 | #
|
---|
1023 |
|
---|
1024 | # Use the OpenGL module in qt when the video hardware acceleartion feature
|
---|
1025 | # is enabled.
|
---|
1026 | if defined(VBOX_WITH_VIDEOHWACCEL) && defined(VBOX_WITH_QTGUI)
|
---|
1027 | VBOX_GUI_USE_QGL = 1
|
---|
1028 | else
|
---|
1029 | VBOX_GUI_USE_QGL=
|
---|
1030 | endif
|
---|
1031 |
|
---|
1032 | #
|
---|
1033 | # Image and object format config.
|
---|
1034 | #
|
---|
1035 | if1of ($(KBUILD_TARGET), freebsd linux l4 netbsd openbsd solaris)
|
---|
1036 | VBOX_LDR_FMT = elf
|
---|
1037 | endif
|
---|
1038 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
1039 | VBOX_LDR_FMT = macho
|
---|
1040 | endif
|
---|
1041 | ifeq ($(KBUILD_TARGET),os2)
|
---|
1042 | VBOX_LDR_FMT = lx
|
---|
1043 | VBOX_LDR_FMT32 = lx
|
---|
1044 | VBOX_LDR_FMT64 = elf
|
---|
1045 | DONT_USE_YASM = 1 # yasm doesn't implement omf yet.
|
---|
1046 | endif
|
---|
1047 | ifeq ($(KBUILD_TARGET),win)
|
---|
1048 | VBOX_LDR_FMT = pe
|
---|
1049 | endif
|
---|
1050 | VBOX_LDR_FMT32 ?= $(VBOX_LDR_FMT)
|
---|
1051 | VBOX_LDR_FMT64 ?= $(VBOX_LDR_FMT)
|
---|
1052 |
|
---|
1053 | #
|
---|
1054 | # Assembler setup.
|
---|
1055 | #
|
---|
1056 | # This is a bit complicated since we have to support two different assmblers
|
---|
1057 | # (yasm/nasm) and possibly two different formats (32-bit/64-bit).
|
---|
1058 | #
|
---|
1059 | ifeq ($(VBOX_LDR_FMT),elf)
|
---|
1060 | ifeq ($(KBUILD_TARGET_ARCH),x86)
|
---|
1061 | VBOX_ASFLAGS_FMT = -f elf32 -DASM_FORMAT_ELF
|
---|
1062 | else
|
---|
1063 | VBOX_ASFLAGS_FMT = -f elf64 -DASM_FORMAT_ELF
|
---|
1064 | endif
|
---|
1065 | VBOX_ASFLAGS_DBFINFO = -g dwarf2
|
---|
1066 | endif
|
---|
1067 | ifeq ($(VBOX_LDR_FMT),lx)
|
---|
1068 | VBOX_ASFLAGS_FMT = -f obj -DASM_FORMAT_OMF
|
---|
1069 | VBOX_ASFLAGS_DBFINFO = -g stabs
|
---|
1070 | endif
|
---|
1071 | ifeq ($(VBOX_LDR_FMT),macho)
|
---|
1072 | ifeq ($(KBUILD_TARGET_ARCH),x86)
|
---|
1073 | VBOX_ASFLAGS_FMT = -f macho32 -DASM_FORMAT_MACHO
|
---|
1074 | else
|
---|
1075 | VBOX_ASFLAGS_FMT = -f macho64 -DASM_FORMAT_MACHO
|
---|
1076 | endif
|
---|
1077 | VBOX_ASFLAGS_DBFINFO = -g dwarf2
|
---|
1078 | endif
|
---|
1079 | ifeq ($(VBOX_LDR_FMT),pe)
|
---|
1080 | ifeq ($(KBUILD_TARGET_ARCH),x86)
|
---|
1081 | VBOX_ASFLAGS_FMT = -f win32 -DASM_FORMAT_PE
|
---|
1082 | else
|
---|
1083 | VBOX_ASFLAGS_FMT = -f win64 -DASM_FORMAT_PE
|
---|
1084 | endif
|
---|
1085 | VBOX_ASFLAGS_DBFINFO = -g cv8
|
---|
1086 | endif
|
---|
1087 | ifndef VBOX_ASFLAGS_FMT
|
---|
1088 | $(error VBOX_ASFLAGS_FMT is not defined. VBOX_LDR_FMT=$(VBOX_LDR_FMT))
|
---|
1089 | endif
|
---|
1090 |
|
---|
1091 | ifeq ($(VBOX_LDR_FMT32),elf)
|
---|
1092 | VBOX_ASFLAGS_FMT32 = -f elf32 -DASM_FORMAT_ELF
|
---|
1093 | VBOX_ASFLAGS_DBFINFO32 = -g dwarf2
|
---|
1094 | endif
|
---|
1095 | ifeq ($(VBOX_LDR_FMT32),lx)
|
---|
1096 | VBOX_ASFLAGS_FMT32 = -f obj -DASM_FORMAT_OMF
|
---|
1097 | VBOX_ASFLAGS_DBFINFO32 = -g stabs
|
---|
1098 | endif
|
---|
1099 | ifeq ($(VBOX_LDR_FMT32),macho)
|
---|
1100 | VBOX_ASFLAGS_FMT32 = -f macho32 -DASM_FORMAT_MACHO
|
---|
1101 | VBOX_ASFLAGS_DBFINFO32 = -g dwarf2
|
---|
1102 | endif
|
---|
1103 | ifeq ($(VBOX_LDR_FMT32),pe)
|
---|
1104 | VBOX_ASFLAGS_FMT32 = -f win32 -DASM_FORMAT_PE
|
---|
1105 | VBOX_ASFLAGS_DBFINFO32 = -g cv8
|
---|
1106 | endif
|
---|
1107 | ifndef VBOX_ASFLAGS_FMT32
|
---|
1108 | $(error VBOX_ASFLAGS_FMT32 is not defined. VBOX_LDR_FMT32=$(VBOX_LDR_FMT32))
|
---|
1109 | endif
|
---|
1110 |
|
---|
1111 | ifeq ($(VBOX_LDR_FMT64),elf)
|
---|
1112 | VBOX_ASFLAGS_FMT64 = -f elf64 -DASM_FORMAT_ELF
|
---|
1113 | VBOX_ASFLAGS_DBFINFO64 = -g dwarf2
|
---|
1114 | endif
|
---|
1115 | ifeq ($(VBOX_LDR_FMT64),macho)
|
---|
1116 | VBOX_ASFLAGS_FMT64 = -f macho64 -DASM_FORMAT_MACHO
|
---|
1117 | VBOX_ASFLAGS_DBFINFO64 = -g dwarf2
|
---|
1118 | endif
|
---|
1119 | ifeq ($(VBOX_LDR_FMT64),pe)
|
---|
1120 | VBOX_ASFLAGS_FMT64 = -f win64 -DASM_FORMAT_PE
|
---|
1121 | VBOX_ASFLAGS_DBFINFO64 = -g cv8
|
---|
1122 | endif
|
---|
1123 | ifndef VBOX_ASFLAGS_FMT64
|
---|
1124 | $(error VBOX_ASFLAGS_FMT64 is not defined. VBOX_LDR_FMT64=$(VBOX_LDR_FMT64))
|
---|
1125 | endif
|
---|
1126 |
|
---|
1127 | ifndef DONT_USE_YASM
|
---|
1128 | VBOX_ASTOOL = YASM
|
---|
1129 | VBOX_LDR_FMT_2_YASM_DBGINFO.elf = -g dwarf2
|
---|
1130 | VBOX_LDR_FMT_2_YASM_DBGINFO.lx = -g stabs
|
---|
1131 | VBOX_LDR_FMT_2_YASM_DBGINFO.macho =
|
---|
1132 | VBOX_LDR_FMT_2_YASM_DBGINFO.pe = -g cv8
|
---|
1133 | VBOX_ASFLAGS = $(VBOX_ASFLAGS_FMT) -D__YASM__ -Worphan-labels $(VBOX_LDR_FMT_2_YASM_DBGINFO.$(VBOX_LDR_FMT))
|
---|
1134 | VBOX_ASFLAGS32 = $(VBOX_ASFLAGS_FMT32) -D__YASM__ -Worphan-labels $(VBOX_LDR_FMT_2_YASM_DBGINFO.$(VBOX_LDR_FMT32))
|
---|
1135 | VBOX_ASFLAGS64 = $(VBOX_ASFLAGS_FMT64) -D__YASM__ -Worphan-labels $(VBOX_LDR_FMT_2_YASM_DBGINFO.$(VBOX_LDR_FMT64))
|
---|
1136 | else
|
---|
1137 | VBOX_ASTOOL = NASM
|
---|
1138 | VBOX_ASFLAGS = $(subst elf32,elf,$(VBOX_ASFLAGS_FMT)) -D__NASM__ -w+orphan-labels -g
|
---|
1139 | VBOX_ASFLAGS32 = $(subst elf32,elf,$(VBOX_ASFLAGS_FMT32)) -D__NASM__ -w+orphan-labels -g
|
---|
1140 | VBOX_ASFLAGS64 = $(VBOX_ASFLAGS_FMT64) -D__NASM__ -w+orphan-labels -g
|
---|
1141 | endif
|
---|
1142 |
|
---|
1143 | #
|
---|
1144 | # Windows only has mingw handy. On *nix we have to deal with cross compiling
|
---|
1145 | # 32-bit targets on 64-bit platforms, meaning we'll be using gcc32/g++32.
|
---|
1146 | # In the latter case we'll also have to disable all the all the R0 driver related stuff.
|
---|
1147 | #
|
---|
1148 | ifndef VBOX_GCC_TOOL
|
---|
1149 | ifeq ($(KBUILD_TARGET),win)
|
---|
1150 | VBOX_GCC_TOOL := MINGW32
|
---|
1151 | TOOL_MINGW32_CFLAGS := $(UNDEFINED) # override -g
|
---|
1152 | else ifeq ($(KBUILD_TARGET),os2)
|
---|
1153 | VBOX_GCC_TOOL := GXX3OMF
|
---|
1154 | else ifeq ($(KBUILD_TARGET),darwin)
|
---|
1155 | VBOX_GCC_TOOL := GXX4MACHO
|
---|
1156 | else ifeq ($(KBUILD_TARGET),solaris)
|
---|
1157 | VBOX_GCC_TOOL := GXX3PLAIN
|
---|
1158 | VBOX_GCC32_TOOL := GXX3PLAIN
|
---|
1159 | TOOL_GXX3PLAIN_LD_SYSMOD ?= /usr/ccs/bin/ld
|
---|
1160 | else
|
---|
1161 | VBOX_GCC_TOOL := GXX3
|
---|
1162 | ifeq ($(KBUILD_TARGET_ARCH).$(KBUILD_HOST_ARCH),x86.amd64) ## @todo mixing target/host here!
|
---|
1163 | VBOX_GCC_TOOL := GXX32
|
---|
1164 | VBOX_WITH_VBOXDRV=
|
---|
1165 | else ifeq ($(KBUILD_TARGET_ARCH).$(KBUILD_HOST_ARCH),amd64.x86)
|
---|
1166 | VBOX_GCC_TOOL := GXX64
|
---|
1167 | VBOX_WITH_VBOXDRV=
|
---|
1168 | endif
|
---|
1169 | endif
|
---|
1170 | endif
|
---|
1171 | ifndef VBOX_GCC32_TOOL
|
---|
1172 | ifeq ($(KBUILD_TARGET_ARCH),x86)
|
---|
1173 | VBOX_GCC32_TOOL := $(VBOX_GCC_TOOL)
|
---|
1174 | else ifeq ($(KBUILD_TARGET),win)
|
---|
1175 | VBOX_GCC32_TOOL := MINGW32
|
---|
1176 | else
|
---|
1177 | VBOX_GCC32_TOOL := GXX32
|
---|
1178 | endif
|
---|
1179 | endif
|
---|
1180 |
|
---|
1181 | #
|
---|
1182 | # Decide which Visual C++ compiler version we're using by default.
|
---|
1183 | #
|
---|
1184 | ifndef VBOX_VCC_TOOL
|
---|
1185 | ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),win.amd64)
|
---|
1186 | ifndef VBOX_USE_VCC100
|
---|
1187 | VBOX_USE_VCC80 ?= 1 # the default for win.amd64
|
---|
1188 | endif
|
---|
1189 | endif
|
---|
1190 | ifdef VBOX_USE_VCC100
|
---|
1191 | VBOX_VCC_TOOL_STEM = VCC100
|
---|
1192 | else ifdef VBOX_USE_VCC80
|
---|
1193 | VBOX_VCC_TOOL_STEM = VCC80
|
---|
1194 | else
|
---|
1195 | VBOX_VCC_TOOL := VCC70
|
---|
1196 | VBOX_VCC_TOOL_STEM := VCC70
|
---|
1197 | endif
|
---|
1198 | ifndef VBOX_VCC_TOOL
|
---|
1199 | VBOX_VCC_TOOL := $(VBOX_VCC_TOOL_STEM)$(toupper $(KBUILD_TARGET_ARCH))
|
---|
1200 | endif
|
---|
1201 | else ifndef VBOX_VCC_TOOL_STEM
|
---|
1202 | $(error VBOX_VCC_TOOL_STEM is not defined)
|
---|
1203 | endif
|
---|
1204 | # VCC70 is hopefully the most special case here...
|
---|
1205 | if !defined(VBOX_USE_VCC100) && !defined(VBOX_USE_VCC90) && !defined(VBOX_USE_VCC80) && !defined(VBOX_USE_VCC70)
|
---|
1206 | VBOX_USE_VCC70 := 1
|
---|
1207 | endif
|
---|
1208 |
|
---|
1209 | #
|
---|
1210 | # The kBuild tools and SDKs are using PATH_DEVTOOLS, PATH_DEVTOOLS_BLD
|
---|
1211 | # and PATH_DEVTOOLS_TRG to find things if we give them specific locations.
|
---|
1212 | #
|
---|
1213 | PATH_DEVTOOLS ?= $(PATH_ROOT)/tools
|
---|
1214 | PATH_DEVTOOLS := $(abspath $(PATH_DEVTOOLS))
|
---|
1215 | PATH_DEVTOOLS_BLD ?= $(PATH_DEVTOOLS)/$(KBUILD_HOST).$(KBUILD_HOST_ARCH)
|
---|
1216 | PATH_DEVTOOLS_TRG ?= $(PATH_DEVTOOLS)/$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)
|
---|
1217 |
|
---|
1218 | ## @todo Remove the default tool crap here!
|
---|
1219 | TOOL = $(VBOX_GCC_TOOL)
|
---|
1220 | ifdef VBOX_USE_VCC70
|
---|
1221 | TOOL.win = VCC70
|
---|
1222 | else
|
---|
1223 | TOOL.win.x86 = $(VBOX_VCC_TOOL_STEM)X86
|
---|
1224 | TOOL.win.amd64 = $(VBOX_VCC_TOOL_STEM)AMD64
|
---|
1225 | endif
|
---|
1226 | ASTOOL = $(VBOX_ASTOOL)
|
---|
1227 |
|
---|
1228 | #
|
---|
1229 | # L4-specific settings.
|
---|
1230 | #
|
---|
1231 | ifdef L4_DIR
|
---|
1232 | ifeq ($(KBUILD_TARGET),l4)
|
---|
1233 | L4_API ?= l4v2
|
---|
1234 | L4_ARCH ?= $(KBUILD_TARGET_ARCH)
|
---|
1235 | ifeq ($(L4_ARCH),x86)
|
---|
1236 | L4_CPU ?= 586
|
---|
1237 | L4LINUX26_INCDIR := $(L4LINUX26_DIR)/include \
|
---|
1238 | $(L4LINUX26_DIR)/include/asm-l4/i386-arch
|
---|
1239 | else ifeq ($(L4_ARCH),amd64)
|
---|
1240 | L4_CPU ?= k8
|
---|
1241 | L4LINUX26_INCDIR := $(L4LINUX26_DIR)/include
|
---|
1242 | # no red zone for L4 because of IPC bindings
|
---|
1243 | CFLAGS.l4 = -mno-red-zone
|
---|
1244 | CXXFLAGS.l4 = -mno-red-zone
|
---|
1245 | else
|
---|
1246 | $(error L4_ARCH=$(L4_ARCH))
|
---|
1247 | endif
|
---|
1248 | L4_OBJ := $(L4_DIR)/build-$(L4_ARCH)-$(L4_CPU)-$(L4_API)
|
---|
1249 | # support splitted Linux kernels (make O=<build directory>)
|
---|
1250 | kernelsrc := $(shell $(SED_EXT) -ne 's+^KERNELSRC.*= *\(.*\)+\1+p' $(L4LINUX26_DIR)/Makefile)
|
---|
1251 | ifneq ($(kernelsrc),)
|
---|
1252 | kernelpath := $(realpath $(kernelsrc))
|
---|
1253 | L4LINUX26_INCDIR += $(L4LINUX26_DIR)/include2 $(kernelpath)/include
|
---|
1254 | endif
|
---|
1255 | L4_INCDIR := \
|
---|
1256 | $(L4_OBJ)/include/uclibc++ \
|
---|
1257 | $(L4_OBJ)/include/$(L4_ARCH)/uclibc \
|
---|
1258 | $(L4_OBJ)/include/uclibc \
|
---|
1259 | $(L4LINUX26_INCDIR) \
|
---|
1260 | $(L4_OBJ)/include/$(L4_ARCH)/$(L4_API) \
|
---|
1261 | $(L4_OBJ)/include/$(L4_API) \
|
---|
1262 | $(L4_OBJ)/include/$(L4_ARCH) \
|
---|
1263 | $(L4_OBJ)/include \
|
---|
1264 | $(L4_DIR)/tool/dice/include
|
---|
1265 | L4_LIBDIR := \
|
---|
1266 | $(L4_DIR)/build-$(L4_ARCH)-$(L4_CPU)-$(L4_API)/lib/$(L4_ARCH)_$(L4_CPU)/$(L4_API)
|
---|
1267 | endif # KBUILD_TARGET == l4
|
---|
1268 | endif # L4_DIR
|
---|
1269 |
|
---|
1270 | # Produce debugging information that the Fiasco kernel debugger can read.
|
---|
1271 | ifeq ($(KBUILD_TARGET).$(KBUILD_TYPE),l4.debug)
|
---|
1272 | DEBUG_L4 = -gstabs+
|
---|
1273 | endif
|
---|
1274 |
|
---|
1275 | #
|
---|
1276 | # Setup the global defines and includes.
|
---|
1277 | #
|
---|
1278 | # Note! The __SOMETHING__ #defines are deprecated as they violate the C/C++ specs.
|
---|
1279 | #
|
---|
1280 | INCS += $(PATH_ROOT)/include $(PATH_OUT)
|
---|
1281 | DEFS += VBOX
|
---|
1282 | DEFS.debug := DEBUG DEBUG_$(subst $(subst _, ,_),_,$(USERNAME)) DEBUG_USERNAME=$(subst $(subst _, ,_),_,$(USERNAME))
|
---|
1283 | DEFS.dbgopt = $(DEFS.debug)
|
---|
1284 | DEFS.profile = VBOX_WITH_STATISTICS
|
---|
1285 | DEFS.strict = RT_STRICT VBOX_STRICT
|
---|
1286 | DEFS.x86 = RT_ARCH_X86 __X86__
|
---|
1287 | DEFS.amd64 = RT_ARCH_AMD64 __AMD64__
|
---|
1288 | DEFS.darwin = RT_OS_DARWIN __DARWIN__
|
---|
1289 | DEFS.freebsd = RT_OS_FREEBSD __FREEBSD__
|
---|
1290 | DEFS.l4 = RT_OS_L4 __L4__ __L4ENV__ L4API_l4v2 ARCH_$(KBUILD_TARGET_ARCH) __NO_CTYPE _FILE_OFFSET_BITS=64
|
---|
1291 | DEFS.linux = RT_OS_LINUX _FILE_OFFSET_BITS=64
|
---|
1292 | DEFS.netbsd = RT_OS_NETBSD
|
---|
1293 | DEFS.openbsd = RT_OS_OPENBSD
|
---|
1294 | DEFS.os2 = RT_OS_OS2 __OS2__
|
---|
1295 | DEFS.solaris = RT_OS_SOLARIS _FILE_OFFSET_BITS=64
|
---|
1296 | DEFS.win = RT_OS_WINDOWS __WIN__
|
---|
1297 | DEFS.win.x86 = __WIN32__
|
---|
1298 | DEFS.win.amd64 = __WIN64__
|
---|
1299 | # optional defines (use environment or make commandline)
|
---|
1300 | ifdef VBOX_WITH_DEBUGGER
|
---|
1301 | DEFS += VBOX_WITH_DEBUGGER
|
---|
1302 | endif
|
---|
1303 | ifdef VBOX_WITH_STATISTICS
|
---|
1304 | DEFS += VBOX_WITH_STATISTICS
|
---|
1305 | endif
|
---|
1306 | ifdef VBOX_STRICT
|
---|
1307 | DEFS += VBOX_STRICT
|
---|
1308 | endif
|
---|
1309 | ifdef LOG_ENABLED
|
---|
1310 | DEFS += LOG_ENABLED
|
---|
1311 | endif
|
---|
1312 | ifdef VBOX_OSE
|
---|
1313 | DEFS += VBOX_OSE
|
---|
1314 | endif
|
---|
1315 | ifdef VBOX_WITH_64_BITS_GUESTS
|
---|
1316 | DEFS += VBOX_WITH_64_BITS_GUESTS
|
---|
1317 | endif
|
---|
1318 | ifdef VBOX_WITH_HARDENING
|
---|
1319 | DEFS += VBOX_WITH_HARDENING
|
---|
1320 | endif
|
---|
1321 | ifdef VBOX_PATH_APP_PRIVATE
|
---|
1322 | DEFS += RTPATH_APP_PRIVATE=\"$(VBOX_PATH_APP_PRIVATE)\"
|
---|
1323 | endif
|
---|
1324 | ifdef VBOX_PATH_APP_PRIVATE_ARCH
|
---|
1325 | DEFS += RTPATH_APP_PRIVATE_ARCH=\"$(VBOX_PATH_APP_PRIVATE_ARCH)\"
|
---|
1326 | endif
|
---|
1327 | ifdef VBOX_PATH_APP_PRIVATE_ARCH_TOP
|
---|
1328 | DEFS += RTPATH_APP_PRIVATE_ARCH_TOP=\"$(VBOX_PATH_APP_PRIVATE_ARCH_TOP)\"
|
---|
1329 | endif
|
---|
1330 | ifdef VBOX_PATH_SHARED_LIBS
|
---|
1331 | DEFS += RTPATH_SHARED_LIBS=\"$(VBOX_PATH_SHARED_LIBS)\"
|
---|
1332 | endif
|
---|
1333 | ifdef VBOX_PATH_APP_DOCS
|
---|
1334 | DEFS += RTPATH_APP_DOCS=\"$(VBOX_PATH_APP_DOCS)\"
|
---|
1335 | endif
|
---|
1336 | if defined(VBOX_WITH_STRICT_LOCKS) && ($(KBUILD_TYPE) == "debug" || $(KBUILD_TYPE) == "strict")
|
---|
1337 | DEFS += RT_LOCK_STRICT RT_LOCK_STRICT_ORDER
|
---|
1338 | endif
|
---|
1339 | ifdef VBOX_WITH_EF_WRAPS
|
---|
1340 | DEFS += RTMEM_WRAP_TO_EF_APIS RTMEM_WRAP_SOME_NEW_AND_DELETE_TO_EF
|
---|
1341 | endif
|
---|
1342 |
|
---|
1343 | #
|
---|
1344 | # Compiler optimization flags.
|
---|
1345 | #
|
---|
1346 | VBOX_GCC_WARN ?= -Wall $(VBOX_GCC_Wextra) $(VBOX_GCC_Wno-missing-field-initializers) -Wno-unused -Wno-trigraphs $(VBOX_GCC_fdiagnostics-show-option)
|
---|
1347 | VBOX_GCC_PEDANTIC_CXX ?= -pedantic -Wshadow $(VBOX_GCC_WARN) -Wno-long-long
|
---|
1348 | VBOX_GCC_PEDANTIC_C ?= -pedantic -Wshadow $(VBOX_GCC_WARN) -Wno-long-long -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Werror-implicit-function-declaration
|
---|
1349 | ifeq ($(KBUILD_TYPE),debug)
|
---|
1350 | VBOX_GCC_FP ?= -fno-omit-frame-pointer
|
---|
1351 | VBOX_GCC_OPT ?= -O0
|
---|
1352 | VBOX_VCC_FP ?= -Oy-
|
---|
1353 | VBOX_VCC_OPT ?=
|
---|
1354 | VBOX_GCC_R0_FP ?= -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
---|
1355 | VBOX_GCC_R0_OPT ?= -O2
|
---|
1356 | VBOX_VCC_R0_FP ?= -Oy-
|
---|
1357 | VBOX_VCC_R0_OPT ?=
|
---|
1358 | VBOX_GCC_GC_FP ?= -fno-omit-frame-pointer -fno-optimize-sibling-calls
|
---|
1359 | VBOX_GCC_GC_OPT ?= -O2
|
---|
1360 | VBOX_VCC_GC_FP ?= -Oy-
|
---|
1361 | VBOX_VCC_GC_OPT ?=
|
---|
1362 | else
|
---|
1363 | # We should use -fomit-frame-pointer for GCC / -Oy for VCC.
|
---|
1364 | # -funwind-tables provides support for backtraces in gdb then.
|
---|
1365 | VBOX_GCC_FP ?= -fno-omit-frame-pointer
|
---|
1366 | VBOX_GCC_OPT ?= -O2 $(VBOX_GCC_mtune-generic)
|
---|
1367 | VBOX_VCC_FP ?= -Oy-
|
---|
1368 | ifndef VBOX_USE_VCC70
|
---|
1369 | VBOX_VCC_OPT ?= -O2 -GS-
|
---|
1370 | else
|
---|
1371 | VBOX_VCC_OPT ?= -Ogitb2
|
---|
1372 | endif
|
---|
1373 | VBOX_GCC_R0_FP ?= -fno-omit-frame-pointer
|
---|
1374 | VBOX_GCC_R0_OPT ?= -O2 $(VBOX_GCC_mtune-generic)
|
---|
1375 | VBOX_VCC_R0_FP ?= -Oy-
|
---|
1376 | ifndef VBOX_USE_VCC70
|
---|
1377 | VBOX_VCC_R0_OPT ?= -O2 -GS-
|
---|
1378 | else
|
---|
1379 | VBOX_VCC_R0_OPT ?= -Ogitb2
|
---|
1380 | endif
|
---|
1381 | VBOX_GCC_GC_FP ?= -fno-omit-frame-pointer
|
---|
1382 | VBOX_GCC_GC_OPT ?= -O2 $(VBOX_GCC_mtune-generic)
|
---|
1383 | VBOX_VCC_GC_FP ?= -Oy-
|
---|
1384 | ifndef VBOX_USE_VCC70
|
---|
1385 | VBOX_VCC_GC_OPT ?= -O2
|
---|
1386 | else
|
---|
1387 | VBOX_VCC_GC_OPT ?= -Ogitb2
|
---|
1388 | endif
|
---|
1389 | endif
|
---|
1390 | ifeq ($(KBUILD_TARGET_ARCH),x86)
|
---|
1391 | ifneq ($(KBUILD_TARGET),darwin)
|
---|
1392 | # (The '<=' operator is for prepending (kmk specific).)
|
---|
1393 | VBOX_GCC_OPT <= -march=i586
|
---|
1394 | endif
|
---|
1395 | endif
|
---|
1396 |
|
---|
1397 |
|
---|
1398 | #
|
---|
1399 | # Select the CRT type we're using with Microsoft Visual C++.
|
---|
1400 | #
|
---|
1401 | ifdef VBOX_WITH_DEBUG_VCC_CRT
|
---|
1402 | VBOX_VCC_CRT_TYPE = d
|
---|
1403 | VBOX_VCC_CRT_TYPE_N =
|
---|
1404 | else
|
---|
1405 | VBOX_VCC_CRT_TYPE =
|
---|
1406 | VBOX_VCC_CRT_TYPE_N = d
|
---|
1407 | endif
|
---|
1408 |
|
---|
1409 | #
|
---|
1410 | # Decide which windows DDK to use by default.
|
---|
1411 | #
|
---|
1412 | ifdef VBOX_USE_WINDDK
|
---|
1413 | VBOX_WINDDK ?= WINDDK
|
---|
1414 | else
|
---|
1415 | VBOX_WINDDK ?= W2K3DDK
|
---|
1416 | endif
|
---|
1417 |
|
---|
1418 | #
|
---|
1419 | # ARCH_BITS_DEFS.
|
---|
1420 | #
|
---|
1421 | ifeq ($(KBUILD_TARGET_ARCH),amd64)
|
---|
1422 | ARCH_BITS_DEFS := HC_ARCH_BITS=64
|
---|
1423 | else ifeq ($(KBUILD_TARGET_ARCH),x86)
|
---|
1424 | ARCH_BITS_DEFS := HC_ARCH_BITS=32
|
---|
1425 | else
|
---|
1426 | error KBUILD_TARGET_ARCH=$(KBUILD_TARGET_ARCH)
|
---|
1427 | endif
|
---|
1428 |
|
---|
1429 | ifdef VBOX_WITH_64_BITS_GUESTS
|
---|
1430 | VBOX_GC_ARCH_BITS_DEFS := GC_ARCH_BITS=64
|
---|
1431 | else
|
---|
1432 | VBOX_GC_ARCH_BITS_DEFS := GC_ARCH_BITS=32
|
---|
1433 | endif
|
---|
1434 | ARCH_BITS_DEFS += $(VBOX_GC_ARCH_BITS_DEFS)
|
---|
1435 |
|
---|
1436 | #
|
---|
1437 | # Add the output dir(s) to the dynamic loader search path.
|
---|
1438 | #
|
---|
1439 | if1of ($(KBUILD_HOST), freebsd linux l4 netbsd openbsd solaris)
|
---|
1440 | export LD_LIBRARY_PATH:=$(PATH_BIN):$(PATH_LIB):$(LD_LIBRARY_PATH)
|
---|
1441 | endif
|
---|
1442 | ifeq ($(KBUILD_HOST),os2)
|
---|
1443 | #fixme! export BEGINLIBPATH:=$(PATH_BIN);$(PATH_LIB);$(BEGINLIBPATH)
|
---|
1444 | endif
|
---|
1445 | ifeq ($(KBUILD_HOST),win)
|
---|
1446 | export PATH:=$(PATH_BIN);$(PATH_LIB);$(PATH)
|
---|
1447 | endif
|
---|
1448 |
|
---|
1449 | #
|
---|
1450 | # Common libraries and tools.
|
---|
1451 | #
|
---|
1452 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
1453 | LIB_RUNTIME = $(PATH_BIN)/VBoxRT.dylib
|
---|
1454 | LIB_RUNTIME_EF = #$(PATH_LIB)/RuntimeEFCPP.a
|
---|
1455 | LIB_KPROFILE = $(PATH_BIN)/kPrf2.dylib
|
---|
1456 | LIB_VMM = $(PATH_BIN)/VBoxVMM.dylib
|
---|
1457 | LIB_VMMGC = $(PATH_BIN)/VMMGC.gc
|
---|
1458 | LIB_REM = $(PATH_LIB)/VBoxREM.dylib
|
---|
1459 | LIB_XPCOM = $(PATH_BIN)/VBoxXPCOM.dylib
|
---|
1460 | LIB_DDU = $(PATH_BIN)/VBoxDDU.dylib
|
---|
1461 | endif
|
---|
1462 | ifeq ($(KBUILD_TARGET),l4)
|
---|
1463 | LIB_RUNTIME = $(PATH_BIN)/VBoxRT.s.so
|
---|
1464 | LIB_RUNTIME_EF = #$(PATH_LIB)/RuntimeEFCPP.a
|
---|
1465 | LIB_KPROFILE = $(PATH_BIN)/kPrf2.s.so
|
---|
1466 | LIB_VMM = $(PATH_BIN)/VBoxVMM.s.so
|
---|
1467 | LIB_VMMGC = $(PATH_BIN)/VMMGC.gc
|
---|
1468 | LIB_REM = $(PATH_LIB)/VBoxREM.s.so
|
---|
1469 | LIB_XPCOM = $(PATH_BIN)/VBoxXPCOM.s.so
|
---|
1470 | LIB_DDU = $(PATH_BIN)/VBoxDDU.s.so
|
---|
1471 | endif
|
---|
1472 | if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris)
|
---|
1473 | LIB_RUNTIME = $(PATH_BIN)/VBoxRT.so
|
---|
1474 | LIB_RUNTIME_EF = $(PATH_LIB)/RuntimeEFCPP.a
|
---|
1475 | LIB_KPROFILE = $(PATH_BIN)/kPrf2.so
|
---|
1476 | LIB_VMM = $(PATH_BIN)/VBoxVMM.so
|
---|
1477 | LIB_VMMGC = $(PATH_BIN)/VMMGC.gc
|
---|
1478 | LIB_REM = $(PATH_LIB)/VBoxREM.so
|
---|
1479 | LIB_XPCOM = $(PATH_BIN)/VBoxXPCOM.so
|
---|
1480 | LIB_DDU = $(PATH_BIN)/VBoxDDU.so
|
---|
1481 | endif
|
---|
1482 | ifeq ($(KBUILD_TARGET),os2)
|
---|
1483 | LIB_RUNTIME = $(PATH_BIN)/VBoxRT.dll
|
---|
1484 | LIB_RUNTIME_EF = #$(PATH_LIB)/RuntimeEFCPP.a
|
---|
1485 | LIB_KPROFILE = $(PATH_BIN)/kPrf2.dll
|
---|
1486 | LIB_VMM = $(PATH_BIN)/VBoxVMM.dll
|
---|
1487 | LIB_VMMGC = $(PATH_LIB)/VMMRCImp.lib
|
---|
1488 | LIB_REM = $(PATH_LIB)/VBoxREMImp.lib
|
---|
1489 | LIB_XPCOM = $(PATH_BIN)/VBoxXCOM.dll
|
---|
1490 | LIB_DDU = $(PATH_BIN)/VBoxDDU.dll
|
---|
1491 | VBOX_OBJ_SYS0 = $(PATH_OBJ)/RuntimeR0/os2/sys0.obj
|
---|
1492 | endif
|
---|
1493 | ifeq ($(KBUILD_TARGET),win)
|
---|
1494 | LIB_RUNTIME = $(PATH_LIB)/VBoxRT.lib
|
---|
1495 | LIB_RUNTIME_EF = #$(PATH_LIB)/RuntimeEFCPP.lib
|
---|
1496 | LIB_KPROFILE = $(PATH_LIB)/kPrf2.lib
|
---|
1497 | LIB_VMM = $(PATH_LIB)/VBoxVMM.lib
|
---|
1498 | LIB_VMMGC = $(PATH_OBJ)/VMMRC/VMMGC.lib
|
---|
1499 | LIB_REM = $(PATH_LIB)/VBoxREMImp.lib
|
---|
1500 | LIB_XPCOM = $(PATH_BIN)/VBoxXPCOM.dll
|
---|
1501 | LIB_DDU = $(PATH_LIB)/VBoxDDU.lib
|
---|
1502 | endif
|
---|
1503 | VBOX_LIB_SUPHARDENED = $(PATH_LIB)/SUPR3HardenedStatic$(VBOX_SUFF_LIB)
|
---|
1504 | VBOX_LIB_RUNTIME_STATIC = $(PATH_LIB)/RuntimeR3$(VBOX_SUFF_LIB)
|
---|
1505 |
|
---|
1506 | # Python
|
---|
1507 | ifndef VBOX_BLD_PYTHON
|
---|
1508 | if1of ($(KBUILD_HOST), win)
|
---|
1509 | VBOX_BLD_PYTHON := $(firstword $(rsort $(wildcard $(PATH_DEVTOOLS)/win.x86/python/v*/python$(HOSTSUFF_EXE))) python-not-found.exe)
|
---|
1510 | else
|
---|
1511 | VBOX_BLD_PYTHON := python$(HOSTSUFF_EXE)
|
---|
1512 | endif
|
---|
1513 | endif
|
---|
1514 |
|
---|
1515 | # Define the macro for win path conversion.
|
---|
1516 | ifndef VBOX_ONLY_SDK
|
---|
1517 | VBOX_FN_MAKE_WIN_PATH = $(subst /,\\,$(1))
|
---|
1518 | else
|
---|
1519 | # on Wine Z: is always FS root
|
---|
1520 | VBOX_FN_MAKE_WIN_PATH = $(subst /,\\,$(patsubst /%,Z:/%,$(1)))
|
---|
1521 | endif #!VBOX_ONLY_SDK
|
---|
1522 |
|
---|
1523 | # The kprofile build automagically links with kProfile.
|
---|
1524 | ifeq ($(KBUILD_TYPE),kprofile)
|
---|
1525 | LIB_RUNTIME += $(LIB_KPROFILE)
|
---|
1526 | endif
|
---|
1527 |
|
---|
1528 | # Enable C++ electric fence heap. (Warning: will easily run out of virtual memory / kernel stuff on Linux/Windows.)
|
---|
1529 | ifdef VBOX_WITH_CPP_EF
|
---|
1530 | LIB_RUNTIME <= $(LIB_RUNTIME_EF)
|
---|
1531 | endif
|
---|
1532 |
|
---|
1533 | # Overridable libraries (unix).
|
---|
1534 | LIB_PTHREAD ?= pthread
|
---|
1535 |
|
---|
1536 | # Xcursor (consider an SDK for this).
|
---|
1537 | ifeq ($(VBOX_XCURSOR_LIBS),)
|
---|
1538 | ifeq ($(KBUILD_TARGET),solaris)
|
---|
1539 | VBOX_XCURSOR_LIBS := $(lastword $(wildcard $(PATH_DEVTOOLS_TRG)/libXcursor/*/lib/libXcursor.a))
|
---|
1540 | ifneq ($(VBOX_XCURSOR_LIBS),)
|
---|
1541 | VBOX_XCURSOR_INCS := $(patsubst %/lib/libXcursor.a,%/include, $(VBOX_XCURSOR_LIBS))
|
---|
1542 | VBOX_XCURSOR_LIBS += X11 Xrender Xfixes
|
---|
1543 | endif
|
---|
1544 | endif
|
---|
1545 | ifeq ($(VBOX_XCURSOR_LIBS),)
|
---|
1546 | VBOX_XCURSOR_LIBS := Xcursor
|
---|
1547 | endif
|
---|
1548 | endif
|
---|
1549 |
|
---|
1550 |
|
---|
1551 | # Intel ASL compiler for ACPI
|
---|
1552 | VBOX_IASLCMD ?= $(firstword $(wildcard $(PATH_DEVTOOLS_BLD)/bin/iasl$(HOSTSUFF_EXE)) iasl$(HOSTSUFF_EXE))
|
---|
1553 |
|
---|
1554 | # Bruce's C compile is a C-compiler for BIOS-related 8086 code
|
---|
1555 | ifndef VBOX_BCC
|
---|
1556 | if exists "$(PATH_DEVTOOLS_BLD)/bin/bcc$(HOSTSUFF_EXE)"
|
---|
1557 | VBOX_BCC := $(PATH_DEVTOOLS_BLD)/bin/bcc$(HOSTSUFF_EXE) -B $(PATH_DEVTOOLS_BLD)/bin/
|
---|
1558 | else
|
---|
1559 | VBOX_BCC := bcc$(HOSTSUFF_EXE)
|
---|
1560 | endif
|
---|
1561 | endif
|
---|
1562 |
|
---|
1563 | # Assembler for BIOS-related 8086 code
|
---|
1564 | ifndef VBOX_AS86
|
---|
1565 | if exists "$(PATH_DEVTOOLS_BLD)/bin/as86$(HOSTSUFF_EXE)"
|
---|
1566 | VBOX_AS86 := $(PATH_DEVTOOLS_BLD)/bin/as86$(HOSTSUFF_EXE)
|
---|
1567 | else
|
---|
1568 | VBOX_AS86 := as86$(HOSTSUFF_EXE)
|
---|
1569 | endif
|
---|
1570 | endif
|
---|
1571 |
|
---|
1572 | # libxslt XSLT processor. (see PATH_TOOL_YASM for explanation why it's temporarily located in bin.)
|
---|
1573 | ifeq ($(KBUILD_HOST),win)
|
---|
1574 | # VBOX_XSLTPROC ?= $(PATH_DEVTOOLS)/win.x86/libxslt/10114/xsltproc.exe
|
---|
1575 | VBOX_XSLTPROC ?= $(PATH_DEVTOOLS)/win.x86/bin/xsltproc.exe
|
---|
1576 | else ifeq ($(KBUILD_HOST),os2)
|
---|
1577 | VBOX_XSLTPROC ?= BEGINLIBPATH="$(PATH_DEVTOOLS_BLD)/bin;$$BEGINLIBPATH" $(PATH_DEVTOOLS_BLD)/bin/xsltproc.exe
|
---|
1578 | else
|
---|
1579 | VBOX_XSLTPROC ?= xsltproc$(HOSTSUFF_EXE)
|
---|
1580 | endif
|
---|
1581 |
|
---|
1582 | # bin2c (convert binary files into C arrays)
|
---|
1583 | VBOX_BIN2C ?= $(PATH_OBJ)/bin2c/bin2c$(HOSTSUFF_EXE)
|
---|
1584 |
|
---|
1585 | # biossums (set BIOS checksums)
|
---|
1586 | VBOX_BIOSSUMS ?= $(PATH_OBJ)/biossums/biossums$(HOSTSUFF_EXE)
|
---|
1587 |
|
---|
1588 | # RTManifest (extension pack manifest utility)
|
---|
1589 | VBOX_RTMANIFEST ?= $(PATH_OBJ)/bldRTManifest/bldRTManifest$(HOSTSUFF_EXE)
|
---|
1590 |
|
---|
1591 | # filesplitter (splits java files)
|
---|
1592 | VBOX_FILESPLIT ?= $(PATH_OBJ)/filesplitter/filesplitter$(HOSTSUFF_EXE)
|
---|
1593 |
|
---|
1594 | # mkisofs
|
---|
1595 | ifeq ($(KBUILD_HOST),win)
|
---|
1596 | VBOX_MKISOFS ?= $(PATH_DEVTOOLS_BLD)/bin/mkisofs.exe
|
---|
1597 | else
|
---|
1598 | VBOX_MKISOFS ?= mkisofs
|
---|
1599 | endif
|
---|
1600 |
|
---|
1601 | # Makeself for the linux installers.
|
---|
1602 | VBOX_MAKESELF ?= $(PATH_DEVTOOLS)/common/makeself/v2.1.5/makeself.sh
|
---|
1603 |
|
---|
1604 | # Microsoft HTML Help Workshop.
|
---|
1605 | VBOX_PATH_HTML_HELP_WORKSHOP ?= $(PATH_DEVTOOLS)/win.x86/HTML_Help_Workshop/v1.3/
|
---|
1606 |
|
---|
1607 | # Path to the null soft installer.
|
---|
1608 | VBOX_PATH_NSIS ?= $(PATH_DEVTOOLS)/win.x86/nsis/v2.46-log-nsscm-r1
|
---|
1609 |
|
---|
1610 | # Path to AutoIt3.
|
---|
1611 | VBOX_PATH_AUTOIT3 ?= $(PATH_DEVTOOLS)/win.x86/autoit/v3.2.10.0
|
---|
1612 |
|
---|
1613 | # Windows install tools...
|
---|
1614 | VBOX_PATH_WIX ?= $(PATH_DEVTOOLS)/win.x86/wix/v2.0.5805.0
|
---|
1615 | VBOX_PATH_MSITRAN ?= $(PATH_DEVTOOLS)/win.x86/sdk/200504/Bin/MsiTran.Exe
|
---|
1616 | VBOX_PATH_MSIDB ?= $(PATH_DEVTOOLS)/win.x86/sdk/200504/Bin/MsiDb.Exe
|
---|
1617 | VBOX_PATH_WISUBSTG ?= $(PATH_DEVTOOLS)/win.x86/sdk/200504/Samples/SysMgmt/Msi/Scripts/WiSubStg.vbs
|
---|
1618 | VBOX_PATH_WISUMINFO ?= $(PATH_DEVTOOLS)/win.x86/sdk/200504/Samples/SysMgmt/Msi/Scripts/WiSumInf.vbs
|
---|
1619 | VBOX_PATH_DIFX ?= $(PATH_DEVTOOLS)/win.$(KBUILD_TARGET_ARCH)/DIFx/v2.1-r2
|
---|
1620 | VBOX_PATH_CABSDK ?= $(PATH_DEVTOOLS)/win.x86/cabsdk/r1
|
---|
1621 | VBOX_PATH_MAKECAB ?= $(VBOX_PATH_CABSDK)/BIN/MAKECAB.EXE
|
---|
1622 |
|
---|
1623 | # We need to export YASM for OSE, but since it was converted to .zip we need to
|
---|
1624 | # allow for the location used by the zip to be properly cleaned up first.
|
---|
1625 | if1of ($(KBUILD_HOST).$(KBUILD_HOST_ARCH), linux.x86 solaris.x86 win.x86)
|
---|
1626 | PATH_TOOL_YASM ?= $(PATH_DEVTOOLS_BLD)/bin
|
---|
1627 | endif
|
---|
1628 |
|
---|
1629 | # XPCOM setup for all but win32.
|
---|
1630 | ifneq ($(KBUILD_TARGET),win)
|
---|
1631 | VBOX_WITH_XPCOM = 1
|
---|
1632 | # if updating, also update xpidl_INST var in src/libs/xpcom18a4/Makefile.kmk
|
---|
1633 | VBOX_XPIDL ?= $(PATH_BIN)/xpidl$(HOSTSUFF_EXE)
|
---|
1634 | ifeq ($(KBUILD_TARGET),os2)
|
---|
1635 | VBOX_XPIDL_ENV = BEGINLIBPATH="$(dir $(VBOX_XPIDL));$$BEGINLIBPATH"$(SP)
|
---|
1636 | endif
|
---|
1637 | VBOX_PATH_XPCOM_IDL ?= $(VBOX_PATH_SDK)/bindings/xpcom/idl
|
---|
1638 | VBOX_XPCOM_INCS ?= \
|
---|
1639 | $(VBOX_PATH_SDK)/bindings/xpcom/include \
|
---|
1640 | $(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
|
---|
1641 | $(VBOX_PATH_SDK)/bindings/xpcom/include/string \
|
---|
1642 | $(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
|
---|
1643 | $(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \
|
---|
1644 | $(VBOX_PATH_SDK)/bindings/xpcom/include/ipcd
|
---|
1645 | ifneq ($(KBUILD_TARGET),os2)
|
---|
1646 | # libIDL-config (for xpcom18a4)
|
---|
1647 | ifeq ($(origin VBOX_LIBIDL_CONFIG),undefined)
|
---|
1648 | export VBOX_LIBIDL_CONFIG := $(firstword $(shell which libIDL-config-2 libIDL-config 2> /dev/null))
|
---|
1649 | endif
|
---|
1650 | endif
|
---|
1651 | endif
|
---|
1652 |
|
---|
1653 | # The X11 LIBPATH. (The amd64 hack is for RHEL4.)
|
---|
1654 | ifeq ($(KBUILD_TARGET_ARCH),amd64)
|
---|
1655 | VBOX_LIBPATH_X11 ?= /usr/X11R6/lib64 /usr/X11R6/lib
|
---|
1656 | else
|
---|
1657 | VBOX_LIBPATH_X11 ?= /usr/X11R6/lib
|
---|
1658 | endif
|
---|
1659 |
|
---|
1660 | # 32bit X11 LIBPATH for building 32bit guest additions
|
---|
1661 | VBOX_LIBPATH32_X11 ?= /usr/X11R6/lib32 /usr/X11R6/lib
|
---|
1662 |
|
---|
1663 | #
|
---|
1664 | # Macros dealing with the darwin version we're targeting.
|
---|
1665 | # The DEF in VBOX_DEF_MACOSX_VERSION_MIN mean default. The default min
|
---|
1666 | # version is assumed to be the
|
---|
1667 | #
|
---|
1668 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
1669 | ifeq ($(KBUILD_TARGET_ARCH),x86)
|
---|
1670 | ifdef VBOX_WITH_COCOA_QT
|
---|
1671 | VBOX_DEF_MACOSX_VERSION_MIN ?= 10.5
|
---|
1672 | VBOX_DARWIN_NO_COMPACT_LINKEDIT ?= $(VBOX_LD_no_compact_linkedit)
|
---|
1673 | else
|
---|
1674 | VBOX_DEF_MACOSX_VERSION_MIN ?= 10.4
|
---|
1675 | VBOX_DARWIN_NO_COMPACT_LINKEDIT ?=
|
---|
1676 | endif
|
---|
1677 | VBOX_MACOSX_GCC_INFIX ?= -4.0
|
---|
1678 | else
|
---|
1679 | VBOX_DEF_MACOSX_VERSION_MIN ?= 10.6
|
---|
1680 | VBOX_MACOSX_GCC_INFIX ?= -4.2
|
---|
1681 | VBOX_DARWIN_NO_COMPACT_LINKEDIT ?=
|
---|
1682 | endif
|
---|
1683 | TOOL_GCC4MACHO_CC = gcc$(VBOX_MACOSX_GCC_INFIX)$(HOSTSUFF_EXE)
|
---|
1684 | TOOL_GCC4MACHO_CXX = g++$(VBOX_MACOSX_GCC_INFIX)$(HOSTSUFF_EXE)
|
---|
1685 | TOOL_GCC4MACHO_AS = gcc$(VBOX_MACOSX_GCC_INFIX)$(HOSTSUFF_EXE)
|
---|
1686 | TOOL_GCC4MACHO_LD = gcc$(VBOX_MACOSX_GCC_INFIX)$(HOSTSUFF_EXE)
|
---|
1687 | TOOL_GCC4MACHO_LD_SYSMOD = gcc$(VBOX_MACOSX_GCC_INFIX)$(HOSTSUFF_EXE)
|
---|
1688 | TOOL_GXX4MACHO_CC = gcc$(VBOX_MACOSX_GCC_INFIX)$(HOSTSUFF_EXE)
|
---|
1689 | TOOL_GXX4MACHO_CXX = g++$(VBOX_MACOSX_GCC_INFIX)$(HOSTSUFF_EXE)
|
---|
1690 | TOOL_GXX4MACHO_OBJC= gcc$(VBOX_MACOSX_GCC_INFIX)$(HOSTSUFF_EXE) $(if-expr $(KBUILD_TARGET_ARCH) == "x86",-m32,-m64) -fvisibility=hidden
|
---|
1691 | TOOL_GXX4MACHO_OBJCXX = gcc$(VBOX_MACOSX_GCC_INFIX)$(HOSTSUFF_EXE) $(if-expr $(KBUILD_TARGET_ARCH) == "x86",-m32,-m64) -fvisibility=hidden -fvisibility-inlines-hidden
|
---|
1692 | TOOL_GXX4MACHO_AS = gcc$(VBOX_MACOSX_GCC_INFIX)$(HOSTSUFF_EXE)
|
---|
1693 | TOOL_GXX4MACHO_LD = g++$(VBOX_MACOSX_GCC_INFIX)$(HOSTSUFF_EXE)
|
---|
1694 | TOOL_GXX4MACHO_LD_SYSMOD = g++$(VBOX_MACOSX_GCC_INFIX)$(HOSTSUFF_EXE)
|
---|
1695 | ifeq ($(VBOX_DEF_MACOSX_VERSION_MIN),10.4)
|
---|
1696 | ifeq ($(origin VBOX_DARWIN_CLASSIC_LINKER),undefined)
|
---|
1697 | VBOX_DARWIN_CLASSIC_LINKER := $(shell ld -v 2>&1 )
|
---|
1698 | ifneq ($(filter ld64%, $(subst :, , $(VBOX_DARWIN_CLASSIC_LINKER))),)
|
---|
1699 | export VBOX_DARWIN_CLASSIC_LINKER := -Wl,-classic_linker
|
---|
1700 | else
|
---|
1701 | export VBOX_DARWIN_CLASSIC_LINKER :=
|
---|
1702 | endif
|
---|
1703 | endif
|
---|
1704 | VBOX_PATH_MACOSX_SDK ?= /Developer/SDKs/MacOSX$(VBOX_DEF_MACOSX_VERSION_MIN)u.sdk
|
---|
1705 | else
|
---|
1706 | VBOX_PATH_MACOSX_SDK ?= /Developer/SDKs/MacOSX$(VBOX_DEF_MACOSX_VERSION_MIN).sdk
|
---|
1707 | endif
|
---|
1708 | VBOX_DARWIN_DEF_SDK_DEFS := MAC_OS_X_VERSION_MIN_REQUIRED=$(subst .,,$(VBOX_DEF_MACOSX_VERSION_MIN))0 \
|
---|
1709 | MAC_OS_X_VERSION_MAX_ALLOWED=$(subst .,,$(VBOX_DEF_MACOSX_VERSION_MIN))0
|
---|
1710 | VBOX_DARWIN_DEF_SDK_CFLAGS := -mmacosx-version-min=$(VBOX_DEF_MACOSX_VERSION_MIN) -isysroot $(VBOX_PATH_MACOSX_SDK)
|
---|
1711 | VBOX_DARWIN_DEF_SDK_CXXFLAGS := -mmacosx-version-min=$(VBOX_DEF_MACOSX_VERSION_MIN) -isysroot $(VBOX_PATH_MACOSX_SDK)
|
---|
1712 | VBOX_DARWIN_DEF_SDK_OBJCFLAGS := -mmacosx-version-min=$(VBOX_DEF_MACOSX_VERSION_MIN) -isysroot $(VBOX_PATH_MACOSX_SDK)
|
---|
1713 | VBOX_DARWIN_DEF_SDK_OBJCXXFLAGS := -mmacosx-version-min=$(VBOX_DEF_MACOSX_VERSION_MIN) -isysroot $(VBOX_PATH_MACOSX_SDK)
|
---|
1714 | VBOX_DARWIN_DEF_SDK_LDFLAGS = -mmacosx-version-min=$(VBOX_DEF_MACOSX_VERSION_MIN) -Wl,-syslibroot,$(VBOX_PATH_MACOSX_SDK) \
|
---|
1715 | -Wl,-headerpad_max_install_names $(VBOX_DARWIN_CLASSIC_LINKER) $(VBOX_DARWIN_NO_COMPACT_LINKEDIT)
|
---|
1716 |
|
---|
1717 | # specific versions.
|
---|
1718 | ## @todo s/VBOX_DARWIN_DEF_SDK_10/VBOX_DARWIN_SDK_10/g
|
---|
1719 |
|
---|
1720 | if1of ($(VBOX_DEF_MACOSX_VERSION_MIN), 10.4) # classic linker detection is bust otherwise
|
---|
1721 | VBOX_PATH_MACOSX_SDK_10_4 ?= /Developer/SDKs/MacOSX10.4u.sdk
|
---|
1722 | VBOX_DARWIN_DEF_SDK_10_4_DEFS := MAC_OS_X_VERSION_MIN_REQUIRED=1040 MAC_OS_X_VERSION_MAX_ALLOWED=1040
|
---|
1723 | VBOX_DARWIN_DEF_SDK_10_4_CFLAGS := -mmacosx-version-min=10.4 -isysroot $(VBOX_PATH_MACOSX_SDK_10_4)
|
---|
1724 | VBOX_DARWIN_DEF_SDK_10_4_CXXFLAGS := -mmacosx-version-min=10.4 -isysroot $(VBOX_PATH_MACOSX_SDK_10_4)
|
---|
1725 | VBOX_DARWIN_DEF_SDK_10_4_OBJCFLAGS := -mmacosx-version-min=10.4 -isysroot $(VBOX_PATH_MACOSX_SDK_10_4)
|
---|
1726 | VBOX_DARWIN_DEF_SDK_10_4_OBJCXXFLAGS := -mmacosx-version-min=10.4 -isysroot $(VBOX_PATH_MACOSX_SDK_10_4)
|
---|
1727 | VBOX_DARWIN_DEF_SDK_10_4_LDFLAGS := -mmacosx-version-min=10.4 -Wl,-syslibroot,$(VBOX_PATH_MACOSX_SDK_10_4) \
|
---|
1728 | -Wl,-headerpad_max_install_names $(VBOX_DARWIN_CLASSIC_LINKER)
|
---|
1729 | else
|
---|
1730 | VBOX_DARWIN_DEF_SDK_10_4_CXXFLAGS = $(error Using 10.4 SDK)
|
---|
1731 | VBOX_DARWIN_DEF_SDK_10_4_LDFLAGS = $(error Using 10.4 SDK)
|
---|
1732 | endif
|
---|
1733 |
|
---|
1734 | if1of ($(VBOX_DEF_MACOSX_VERSION_MIN), 10.4 10.5)
|
---|
1735 | VBOX_PATH_MACOSX_SDK_10_5 ?= /Developer/SDKs/MacOSX10.5.sdk
|
---|
1736 | VBOX_DARWIN_DEF_SDK_10_5_DEFS := MAC_OS_X_VERSION_MIN_REQUIRED=1050 MAC_OS_X_VERSION_MAX_ALLOWED=1050
|
---|
1737 | VBOX_DARWIN_DEF_SDK_10_5_CFLAGS := -mmacosx-version-min=10.5 -isysroot $(VBOX_PATH_MACOSX_SDK_10_5)
|
---|
1738 | VBOX_DARWIN_DEF_SDK_10_5_CXXFLAGS := -mmacosx-version-min=10.5 -isysroot $(VBOX_PATH_MACOSX_SDK_10_5)
|
---|
1739 | VBOX_DARWIN_DEF_SDK_10_5_OBJCFLAGS := -mmacosx-version-min=10.5 -isysroot $(VBOX_PATH_MACOSX_SDK_10_5)
|
---|
1740 | VBOX_DARWIN_DEF_SDK_10_5_OBJCXXFLAGS := -mmacosx-version-min=10.5 -isysroot $(VBOX_PATH_MACOSX_SDK_10_5)
|
---|
1741 | VBOX_DARWIN_DEF_SDK_10_5_LDFLAGS := -mmacosx-version-min=10.5 -Wl,-syslibroot,$(VBOX_PATH_MACOSX_SDK_10_5) \
|
---|
1742 | -Wl,-headerpad_max_install_names $(VBOX_DARWIN_NO_COMPACT_LINKEDIT)
|
---|
1743 | else
|
---|
1744 | VBOX_DARWIN_DEF_SDK_10_5_CXXFLAGS = $(error Using 10.5 SDK)
|
---|
1745 | VBOX_DARWIN_DEF_SDK_10_5_LDFLAGS = $(error Using 10.5 SDK)
|
---|
1746 | endif
|
---|
1747 |
|
---|
1748 | if1of ($(VBOX_DEF_MACOSX_VERSION_MIN), 10.4 10.5 10.6)
|
---|
1749 | VBOX_PATH_MACOSX_SDK_10_6 ?= /Developer/SDKs/MacOSX10.6.sdk
|
---|
1750 | VBOX_DARWIN_DEF_SDK_10_6_DEFS := MAC_OS_X_VERSION_MIN_REQUIRED=1060 MAC_OS_X_VERSION_MAX_ALLOWED=1060
|
---|
1751 | VBOX_DARWIN_DEF_SDK_10_6_CFLAGS := -mmacosx-version-min=10.6 -isysroot $(VBOX_PATH_MACOSX_SDK_10_6)
|
---|
1752 | VBOX_DARWIN_DEF_SDK_10_6_CXXFLAGS := -mmacosx-version-min=10.6 -isysroot $(VBOX_PATH_MACOSX_SDK_10_6)
|
---|
1753 | VBOX_DARWIN_DEF_SDK_10_6_OBJCFLAGS := -mmacosx-version-min=10.6 -isysroot $(VBOX_PATH_MACOSX_SDK_10_6)
|
---|
1754 | VBOX_DARWIN_DEF_SDK_10_6_OBJCXXFLAGS := -mmacosx-version-min=10.6 -isysroot $(VBOX_PATH_MACOSX_SDK_10_6)
|
---|
1755 | VBOX_DARWIN_DEF_SDK_10_6_LDFLAGS := -mmacosx-version-min=10.6 -Wl,-syslibroot,$(VBOX_PATH_MACOSX_SDK_10_6) \
|
---|
1756 | -Wl,-headerpad_max_install_names
|
---|
1757 | else
|
---|
1758 | VBOX_DARWIN_DEF_SDK_10_6_CXXFLAGS = $(error Using 10.6 SDK)
|
---|
1759 | VBOX_DARWIN_DEF_SDK_10_6_LDFLAGS = $(error Using 10.6 SDK)
|
---|
1760 | endif
|
---|
1761 |
|
---|
1762 |
|
---|
1763 | endif # target=darwin
|
---|
1764 |
|
---|
1765 | #
|
---|
1766 | # Macro switching between @executable_path, @rpath and /Applications/VirtualBox.app
|
---|
1767 | # depending on whether the build is hardened or not (dylib install_name).
|
---|
1768 | #
|
---|
1769 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
1770 | ifndef VBOX_DYLD_EXECUTABLE_PATH
|
---|
1771 | ifdef VBOX_WITH_HARDENING
|
---|
1772 | VBOX_DYLD_EXECUTABLE_PATH = $(VBOX_PATH_APP_PRIVATE_ARCH)
|
---|
1773 | else if 0
|
---|
1774 | VBOX_DYLD_EXECUTABLE_PATH = @executable_path
|
---|
1775 | else
|
---|
1776 | VBOX_DYLD_EXECUTABLE_PATH = @rpath
|
---|
1777 | VBOX_WITH_RELATIVE_RUNPATH = @loader_path/
|
---|
1778 | endif
|
---|
1779 | endif
|
---|
1780 | endif
|
---|
1781 |
|
---|
1782 | #
|
---|
1783 | # Check for incompatible rpath combinations.
|
---|
1784 | #
|
---|
1785 | if defined(VBOX_WITH_RUNPATH) && defined(VBOX_WITH_ORIGIN)
|
---|
1786 | $(error VBOX_WITH_RUNPATH and VBOX_WITH_ORIGIN are mutually exclusive)
|
---|
1787 | endif
|
---|
1788 | if defined(VBOX_WITH_RELATIVE_RUNPATH) && defined(VBOX_WITH_ORIGIN)
|
---|
1789 | $(error VBOX_WITH_RELATIVE_RUNPATH and VBOX_WITH_ORIGIN are mutually exclusive)
|
---|
1790 | endif
|
---|
1791 | if defined(VBOX_WITH_RUNPATH) && defined(VBOX_WITH_RELATIVE_RUNPATH)
|
---|
1792 | $(error VBOX_WITH_RUNPATH and VBOX_WITH_RELATIVE_RUNPATH are mutually exclusive)
|
---|
1793 | endif
|
---|
1794 | if defined(VBOX_WITH_RELATIVE_RUNPATH) && defined(VBOX_WITH_HARDENING)
|
---|
1795 | $(error VBOX_WITH_RELATIVE_RUNPATH and VBOX_WITH_HARDENING are mutually exclusive)
|
---|
1796 | endif
|
---|
1797 |
|
---|
1798 | #
|
---|
1799 | # VBOX_WITH_ORIGIN translates into VBOX_WITH_RELATIVE_RUNPATH.
|
---|
1800 | #
|
---|
1801 | # We use two helper variables for the VBOX_WITH_ORIGIN stuff:
|
---|
1802 | # VBOX_ORIGIN - Indirect expansion trick.
|
---|
1803 | # VBOX_GCC_RPATH_OPT - Different GCC/LD combinations needs different options.
|
---|
1804 | #
|
---|
1805 | VBOX_ORIGIN = $$ORIGIN
|
---|
1806 | ifeq ($(KBUILD_TARGET),solaris)
|
---|
1807 | VBOX_GCC_RPATH_OPT = -R
|
---|
1808 | else
|
---|
1809 | VBOX_GCC_RPATH_OPT = -Wl,-rpath,
|
---|
1810 | VBOX_GCC_ORIGIN_OPT = -Wl,-z,origin
|
---|
1811 | endif
|
---|
1812 | ifdef VBOX_WITH_ORIGIN
|
---|
1813 | VBOX_WITH_RELATIVE_RUNPATH = $$(VBOX_ORIGIN)
|
---|
1814 | endif
|
---|
1815 |
|
---|
1816 |
|
---|
1817 | #
|
---|
1818 | # The X11 headers.
|
---|
1819 | #
|
---|
1820 | VBOX_PATH_X11_ROOT = $(PATH_ROOT)/src/VBox/Additions/x11/x11include
|
---|
1821 | VBOX_PATH_X11_XFREE_4_3 = $(VBOX_PATH_X11_ROOT)/4.3
|
---|
1822 | VBOX_PATH_X11_XORG_7_0 = $(VBOX_PATH_X11_ROOT)/7.0
|
---|
1823 | VBOX_PATH_X11_XORG_7_1 = $(VBOX_PATH_X11_ROOT)/7.1
|
---|
1824 | VBOX_PATH_X11_XORG_1_3 = $(VBOX_PATH_X11_ROOT)/1.3
|
---|
1825 | VBOX_PATH_X11_XORG_1_4 = $(VBOX_PATH_X11_ROOT)/1.4
|
---|
1826 | VBOX_PATH_X11_XORG_1_5 = $(VBOX_PATH_X11_ROOT)/1.5
|
---|
1827 | VBOX_PATH_X11_XORG_1_6 = $(VBOX_PATH_X11_ROOT)/1.6
|
---|
1828 |
|
---|
1829 |
|
---|
1830 | #
|
---|
1831 | # crOpenGL related paths and variables.
|
---|
1832 | #
|
---|
1833 | ifdef VBOX_WITH_CROGL
|
---|
1834 | ifdef VBOX_WITH_WDDM
|
---|
1835 | VBOX_WITH_CRHGSMI = 1
|
---|
1836 | endif
|
---|
1837 | VBOX_PATH_CROGL_GLAPI = $(PATH_ROOT)/src/VBox/GuestHost/OpenGL/glapi_parser
|
---|
1838 | VBOX_PATH_CROGL_GENFILES = $(PATH_OBJ)/VBoxOGLgen
|
---|
1839 | VBOX_PATH_CROGL_INCLUDE = $(PATH_ROOT)/src/VBox/GuestHost/OpenGL/include
|
---|
1840 | VBOX_CROGL_API_FILES = $(VBOX_PATH_CROGL_GLAPI)/apiutil.py $(VBOX_PATH_CROGL_GLAPI)/APIspec.txt
|
---|
1841 | VBOX_CROGL_PYTHON_ENV = $(REDIRECT) $(if $1,-E 'PYTHONPATH=$1',) $(if $2,-o $2,) $(if $3,-i $3) --
|
---|
1842 |
|
---|
1843 | if1of ($(KBUILD_HOST), os2 win)
|
---|
1844 | VBOX_PATH_CROGL_PYTHON_INCLUDE = $(VBOX_PATH_CROGL_GLAPI);$(PATH_ROOT)/src/VBox/GuestHost/OpenGL/packer;$(PATH_ROOT)/src/VBox/HostServices/SharedOpenGL/crserverlib
|
---|
1845 | else
|
---|
1846 | VBOX_PATH_CROGL_PYTHON_INCLUDE = $(VBOX_PATH_CROGL_GLAPI):$(PATH_ROOT)/src/VBox/GuestHost/OpenGL/packer:$(PATH_ROOT)/src/VBox/HostServices/SharedOpenGL/crserverlib
|
---|
1847 | endif
|
---|
1848 |
|
---|
1849 | ifeq ($(KBUILD_TARGET),win)
|
---|
1850 | VBOX_LIB_OGL_CRUTIL = $(PATH_OBJ)/VBoxOGLcrutil/VBoxOGLcrutil$(VBOX_SUFF_LIB)
|
---|
1851 | VBOX_LIB_OGL_HOSTCRUTIL = $(PATH_OBJ)/VBoxOGLhostcrutil/VBoxOGLhostcrutil$(VBOX_SUFF_LIB)
|
---|
1852 | ifeq ($(KBUILD_TARGET),x86)
|
---|
1853 | VBOX_LIB_OGL_CRUTIL_X86 = $(VBOX_LIB_OGL_CRUTIL)
|
---|
1854 | else
|
---|
1855 | VBOX_LIB_OGL_CRUTIL_X86 = $(PATH_OBJ)/VBoxOGLcrutil-x86/VBoxOGLcrutil-x86$(VBOX_SUFF_LIB)
|
---|
1856 | endif
|
---|
1857 | else
|
---|
1858 | VBOX_LIB_OGL_CRUTIL = $(VBOX_PATH_ADDITIONS)/VBoxOGLcrutil$(VBOX_SUFF_DLL)
|
---|
1859 | VBOX_LIB_OGL_HOSTCRUTIL = $(PATH_BIN)/VBoxOGLhostcrutil$(VBOX_SUFF_DLL)
|
---|
1860 | endif
|
---|
1861 |
|
---|
1862 | if1of ($(KBUILD_TARGET), freebsd linux solaris)
|
---|
1863 | # VBOX_PATH_MESA_SOURCE = $(PATH_ROOT)/src/libs/mesa-7.2
|
---|
1864 | VBOX_PATH_MESA_SOURCE = $(VBOX_PATH_X11_ROOT)/mesa-7.2
|
---|
1865 | VBOX_MESA_INCS = \
|
---|
1866 | $(VBOX_PATH_MESA_SOURCE) \
|
---|
1867 | $(VBOX_PATH_MESA_SOURCE)/include \
|
---|
1868 | $(VBOX_PATH_MESA_SOURCE)/src/mesa/ \
|
---|
1869 | $(VBOX_PATH_MESA_SOURCE)/src/mesa/glapi \
|
---|
1870 | $(VBOX_PATH_MESA_SOURCE)/src/mesa/main \
|
---|
1871 | $(VBOX_PATH_MESA_SOURCE)/src/mesa/drivers/dri/common
|
---|
1872 | endif
|
---|
1873 |
|
---|
1874 | VBOX_DARWIN_OPENGL_INST = obj/VBoxOGL/GL/
|
---|
1875 | VBOX_DARWIN_OPENGL_HEADERS = gl.h glu.h
|
---|
1876 | SDK_DARWIN-OPENGL = Workaround SDK for the darwin OpenGL include directorly layout layout.
|
---|
1877 | SDK_DARWIN-OPENGL_INCS = $(PATH_OUT)/obj/VBoxOGL
|
---|
1878 | SDK_DARWIN-OPENGL_ORDERDEPS = $(addprefix $(PATH_OUT)/obj/VBoxOGL/GL/./,$(VBOX_DARWIN_OPENGL_HEADERS))
|
---|
1879 | ## @todo kBuild: Using INTERMEDIATES doesn't work!
|
---|
1880 | endif
|
---|
1881 |
|
---|
1882 | # The icons to use.
|
---|
1883 | ifdef VBOX_OSE
|
---|
1884 | VBOX_WINDOWS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_win.ico
|
---|
1885 | VBOX_WINDOWS_ADDITIONS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_win.ico
|
---|
1886 | VBOX_NSIS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_win.ico
|
---|
1887 | VBOX_MACOSX_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox.icns
|
---|
1888 | else
|
---|
1889 | ifeq ($(KBUILD_HOST),win)
|
---|
1890 | VBOX_WINDOWS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/VirtualBox-vista.ico
|
---|
1891 | VBOX_WINDOWS_ADDITIONS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/VirtualBoxGA-vista.ico
|
---|
1892 | VBOX_NSIS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/VirtualBoxGA-nsis.ico
|
---|
1893 | TOOL_VCC100X86_RC := $(PATH_DEVTOOLS)/win.x86/ddk/6000/bin/x86/rc.exe
|
---|
1894 | TOOL_VCC100AMD64_RC := $(PATH_DEVTOOLS)/win.x86/ddk/6000/bin/x86/rc.exe
|
---|
1895 | TOOL_VCC80X86_RC := $(PATH_DEVTOOLS)/win.x86/ddk/6000/bin/x86/rc.exe
|
---|
1896 | TOOL_VCC80AMD64_RC := $(PATH_DEVTOOLS)/win.x86/ddk/6000/bin/x86/rc.exe
|
---|
1897 | TOOL_VCC70_RC := $(PATH_DEVTOOLS)/win.x86/ddk/6000/bin/x86/rc.exe
|
---|
1898 | else
|
---|
1899 | VBOX_WINDOWS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/VirtualBox-winxp.ico
|
---|
1900 | VBOX_WINDOWS_ADDITIONS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/VirtualBoxGA-winxp.ico
|
---|
1901 | VBOX_NSIS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/VirtualBox-nsis.ico
|
---|
1902 | endif
|
---|
1903 | VBOX_MACOSX_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/VirtualBox.icns
|
---|
1904 | endif
|
---|
1905 |
|
---|
1906 |
|
---|
1907 | ifndef VBOX_NOINC_GCC_CONFIG_KMK
|
---|
1908 | #
|
---|
1909 | # GCC stuff properties.
|
---|
1910 | # Most of this is resolved on first kmk invocation and cached in PATH_OUT.
|
---|
1911 | #
|
---|
1912 | # Note! That a harmless warning is printed if the file doesn't exist.
|
---|
1913 | # Note! Changes in GCC are not detected automatically (yet).
|
---|
1914 | #
|
---|
1915 | include $(KBUILD_PATH)/tools/$(VBOX_GCC_TOOL).kmk
|
---|
1916 | ifneq ($(VBOX_GCC_TOOL),$(VBOX_GCC32_TOOL))
|
---|
1917 | include $(KBUILD_PATH)/tools/$(VBOX_GCC32_TOOL).kmk
|
---|
1918 | endif
|
---|
1919 |
|
---|
1920 | # These tests never worked on Windows because of /dev/null, so, there
|
---|
1921 | # can be no harm in just dropping them until cygwin is mp safe.
|
---|
1922 | ifeq ($(KBUILD_HOST),win)
|
---|
1923 | VBOX_GCC_CHECK_CC = $(2)
|
---|
1924 | VBOX_GCC_CHECK_CXX = $(2)
|
---|
1925 | VBOX_GCC_CHECK_LD = $(2)
|
---|
1926 | VBOX_GCC32_CHECK_CXX = $(2)
|
---|
1927 | else
|
---|
1928 | VBOX_GCC_CHECK_CC = $(shell \
|
---|
1929 | if $(TOOL_$(VBOX_GCC_TOOL)_CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
|
---|
1930 | then echo "$(1)"; \
|
---|
1931 | else echo "$(2)"; fi; )
|
---|
1932 |
|
---|
1933 | VBOX_GCC_CHECK_CXX = $(shell \
|
---|
1934 | if $(TOOL_$(VBOX_GCC_TOOL)_CXX) $(1) -S -o /dev/null -xc++ /dev/null > /dev/null 2>&1; \
|
---|
1935 | then echo "$(1)"; \
|
---|
1936 | else echo "$(2)"; fi; )
|
---|
1937 |
|
---|
1938 | VBOX_GCC_CHECK_LD = $(shell \
|
---|
1939 | if $(TOOL_$(VBOX_GCC_TOOL)_LD) -Wl,$(1) $(if $(eq $(KBUILD_HOST),darwin),-Wl$(COMMA)-u$(COMMA)start -Wl$(COMMA)-undefined$(COMMA)dynamic_lookup,) -nostdlib -o /dev/null -xc /dev/null > /dev/null 2>&1 ;\
|
---|
1940 | then echo "-Wl,$(1)"; \
|
---|
1941 | else echo "$(2)"; fi; )
|
---|
1942 |
|
---|
1943 | VBOX_GCC32_CHECK_CXX = $(shell \
|
---|
1944 | if $(TOOL_$(VBOX_GCC32_TOOL)_CXX) $(1) -S -o /dev/null -xc++ /dev/null > /dev/null 2>&1; \
|
---|
1945 | then echo "$(1)"; \
|
---|
1946 | else echo "$(2)"; fi; )
|
---|
1947 | endif
|
---|
1948 |
|
---|
1949 | ifeq ($(KBUILD_HOST),win)
|
---|
1950 | # This isn't important (yet) on windows, so cook the result until
|
---|
1951 | # cygwin is feeling better.
|
---|
1952 | VBOX_GCC_VERSION := $(int-add $(int-mul 10000, 3), $(int-mul 100, 3), 3)
|
---|
1953 | else
|
---|
1954 | # This is kind of bad, the returned string needs to be re-evaluated before use.
|
---|
1955 | # The reason for this hack is that the windows kmk_ash cannot deal with $((1+1)).
|
---|
1956 | # Some versions of gcc (e.g. openSUSE11) return only major.minor on `gcc -dumpversion`.
|
---|
1957 | VBOX_GCC_VERSION = $(shell \
|
---|
1958 | $(1) -dumpversion | $(SED_EXT) 's|\([0-9]\)\.\([0-9]\)\.\{0,1\}\([0-9]\{0,1\}\)|$$(int-add $$(int-mul 10000, \1), $$(int-mul 100, \2), $$(firstword \3 0))|' )
|
---|
1959 | endif
|
---|
1960 |
|
---|
1961 | # No $(QUIET) here as it's interesting to see what goes into the file.
|
---|
1962 | $(PATH_OUT)/GCCConfig.kmk: $(PATH_ROOT)/Config.kmk $(LOCALCFG) $(AUTOCFG)
|
---|
1963 | $(call MSG_GENERATE,,$@,)
|
---|
1964 | $(QUIET)$(RM) -f '$@'
|
---|
1965 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
1966 |
|
---|
1967 | # HC compiler switch detection.
|
---|
1968 | $(APPEND) '$@' 'VBOX_GCC_VERSION_CC ?= $(call VBOX_GCC_VERSION,$(TOOL_$(VBOX_GCC_TOOL)_CC))'
|
---|
1969 | $(APPEND) '$@' 'VBOX_GCC_VERSION_CXX ?= $(call VBOX_GCC_VERSION,$(TOOL_$(VBOX_GCC_TOOL)_CXX))'
|
---|
1970 | $(APPEND) '$@' 'VBOX_GCC_LIBGCC ?= $(shell $(TOOL_$(VBOX_GCC_TOOL)_CC) -print-libgcc-file-name)'
|
---|
1971 | $(APPEND) '$@' 'VBOX_GCC_Wno-pointer-sign ?= $(call VBOX_GCC_CHECK_CC,-Wno-pointer-sign,)'
|
---|
1972 | $(APPEND) '$@' 'VBOX_GCC_Wno-array_bounds ?= $$(if $$(int-ge $$(VBOX_GCC_VERSION_CXX),40300),-Wno-array-bounds,)'
|
---|
1973 | # -Wextra produces additional useful warnings but includes -Wno-missing-field-initializers (too noisy)
|
---|
1974 | $(APPEND) '$@' 'VBOX_GCC_Wextra ?= $(call VBOX_GCC_CHECK_CC,-Wextra,)'
|
---|
1975 | $(APPEND) '$@' 'VBOX_GCC_Wlogical-op ?= $(call VBOX_GCC_CHECK_CC,-Wlogical-op,)'
|
---|
1976 | $(APPEND) '$@' 'VBOX_GCC_Wno-missing-field-initializers ?= $(call VBOX_GCC_CHECK_CC,-Wno-missing-field-initializers,)'
|
---|
1977 | $(APPEND) '$@' 'VBOX_GCC_Wno-pointer-to-int-cast ?= $(call VBOX_GCC_CHECK_CC,-Wno-pointer-to-int-cast,)'
|
---|
1978 | $(APPEND) '$@' 'VBOX_GCC_Wno-int-to-pointer-cast ?= $(call VBOX_GCC_CHECK_CC,-Wno-int-to-pointer-cast,)'
|
---|
1979 | $(APPEND) '$@' 'VBOX_GCC_Wno-variadic-macros ?= $(call VBOX_GCC_CHECK_CXX,-Wno-variadic-macros,)'
|
---|
1980 | $(APPEND) '$@' 'VBOX_GCC_Wno-invalid-offsetof ?= $(call VBOX_GCC_CHECK_CXX,-Wno-invalid-offsetof,)'
|
---|
1981 | $(APPEND) '$@' 'VBOX_GCC_fno-stack-protector ?= $(call VBOX_GCC_CHECK_CC,-fno-stack-protector,)'
|
---|
1982 | $(APPEND) '$@' 'VBOX_GCC_fdiagnostics-show-option ?= $(call VBOX_GCC_CHECK_CC,-fdiagnostics-show-option,)'
|
---|
1983 | # Produce code optimized for the most common IA32/AMD64/EM64T processors. Introduced with gcc version 4.2.
|
---|
1984 | $(APPEND) '$@' 'VBOX_GCC_mtune-generic ?= $(call VBOX_GCC_CHECK_CC,-mtune=generic,)'
|
---|
1985 | $(APPEND) '$@' 'VBOX_LD_as_needed ?= $(call VBOX_GCC_CHECK_LD,--as-needed,)'
|
---|
1986 | # gcc version < 3.4 has a bug in handling __attribute__((regparm(3))).
|
---|
1987 | # See http://osdir.com/ml/gcc.prs/2002-08/msg00223.html and probably http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20004
|
---|
1988 | $(APPEND) '$@' 'VBOX_GCC_BUGGY_REGPARM ?= $$(int-lt $$(VBOX_GCC_VERSION_CC),30400)'
|
---|
1989 | ifneq ($(KBUILD_TARGET),l4)
|
---|
1990 | # Set default attribute for ELF and MACH-O symbols to ``hidden'' to reduce the number
|
---|
1991 | # of relocation entries and PLT indirections in shared libraries. Don't allow for gcc version < 4.
|
---|
1992 | $(APPEND) '$@' 'ifneq ($$(VBOX_GCC_VERSION_CC),)'
|
---|
1993 | $(APPEND) '$@' ' ifneq ($$(int-ge $$(VBOX_GCC_VERSION_CC),40000),)'
|
---|
1994 | $(APPEND) '$@' ' VBOX_GCC_fvisibility-hidden ?= $(call VBOX_GCC_CHECK_CC,-fvisibility=hidden -DVBOX_HAVE_VISIBILITY_HIDDEN -DRT_USE_VISIBILITY_DEFAULT,)'
|
---|
1995 | $(APPEND) '$@' ' endif'
|
---|
1996 | $(APPEND) '$@' 'endif'
|
---|
1997 | endif
|
---|
1998 | ifneq ($(KBUILD_TARGET),l4)
|
---|
1999 | # Set default attribute for inline functions to ``hidden'' to reduce the number
|
---|
2000 | # of relocation entries and PLT indirections in shared libraries. Don't allow for gcc version < 4.
|
---|
2001 | $(APPEND) '$@' 'ifneq ($$(VBOX_GCC_VERSION_CXX),)'
|
---|
2002 | $(APPEND) '$@' ' ifneq ($$(int-ge $$(VBOX_GCC_VERSION_CXX),40000),)'
|
---|
2003 | $(APPEND) '$@' ' VBOX_GCC_fvisibility-inlines-hidden ?= $(call VBOX_GCC_CHECK_CXX,-fvisibility-inlines-hidden,)'
|
---|
2004 | $(APPEND) '$@' ' endif'
|
---|
2005 | $(APPEND) '$@' 'endif'
|
---|
2006 | endif
|
---|
2007 | # Find the compiler includes for IPRT no-crt.
|
---|
2008 | # Note that `$(dir $(gcc -print-libgcc-file-name))/include does not work for a 64-bit cross build on a 32-bit build host.
|
---|
2009 | ifeq ($(KBUILD_HOST),win)
|
---|
2010 | # With the cygwin issues and gcc on windows returning a useless path, just skip this on windows.
|
---|
2011 | $(APPEND) '$@' 'VBOX_PATH_GCC_INCS ?= '
|
---|
2012 | else
|
---|
2013 | $(APPEND) '$@' 'VBOX_PATH_GCC_INCS ?= $(shell LC_ALL=C $(TOOL_$(VBOX_GCC_TOOL)_CC) -print-search-dirs|$(SED_EXT) -ne 's+^install: \(.*[^/][^/]*\)/+\1+p')/include'
|
---|
2014 | endif
|
---|
2015 | # 32-bit (GC) compiler switch detection.
|
---|
2016 | $(APPEND) '$@' 'VBOX_GCC32_VERSION_CC ?= $(call VBOX_GCC_VERSION,$(TOOL_$(VBOX_GCC32_TOOL)_CC))'
|
---|
2017 | $(APPEND) '$@' 'VBOX_GCC32_VERSION_CXX ?= $(call VBOX_GCC_VERSION,$(TOOL_$(VBOX_GCC32_TOOL)_CXX))'
|
---|
2018 | $(APPEND) '$@' 'VBOX_GCC32_LIBGCC ?= $(shell $(TOOL_$(VBOX_GCC32_TOOL)_CC) -print-libgcc-file-name)'
|
---|
2019 | $(APPEND) '$@' 'VBOX_GCC32_Wno-variadic-macros ?= $(call VBOX_GCC32_CHECK_CXX,-Wno-variadic-macros,)'
|
---|
2020 | # darwin no_compact_linkedit starting at Xcode 3.2
|
---|
2021 | ifeq ($(KBUILD_HOST),darwin)
|
---|
2022 | $(APPEND) '$@' 'VBOX_LD_no_compact_linkedit ?= $(call VBOX_GCC_CHECK_LD,-no_compact_linkedit,)'
|
---|
2023 | endif
|
---|
2024 |
|
---|
2025 | include $(PATH_OUT)/GCCConfig.kmk
|
---|
2026 | endif # !VBOX_NOINC_GCC_CONFIG_KMK
|
---|
2027 |
|
---|
2028 | #
|
---|
2029 | # Warnings as errors.
|
---|
2030 | #
|
---|
2031 | # GCC: We disable warnings on non-X86 systems because of the variadic
|
---|
2032 | # macro usage in the logger.
|
---|
2033 | #
|
---|
2034 | ifdef VBOX_WITH_WARNINGS_AS_ERRORS
|
---|
2035 | if defined(VBOX_WITH_WARNINGS_AS_ERRORS) \
|
---|
2036 | && $(VBOX_GCC_VERSION_CXX) < 40000 \
|
---|
2037 | && "$(KBUILD_TARGET_ARCH)" != "x86" \
|
---|
2038 | && "$(KBUILD_TARGET)" != "win"
|
---|
2039 | VBOX_WITH_WARNINGS_AS_ERRORS=
|
---|
2040 | else
|
---|
2041 | VBOX_GCC_WERR ?= -Werror
|
---|
2042 | VBOX_VCC_WERR ?= -WX
|
---|
2043 | VBOX_VCC_LD_WERR ?= ## @todo later also: -WX
|
---|
2044 | endif
|
---|
2045 | endif
|
---|
2046 |
|
---|
2047 |
|
---|
2048 | #
|
---|
2049 | # Misc macros.
|
---|
2050 | #
|
---|
2051 |
|
---|
2052 | ##
|
---|
2053 | # Edits VirtualBox version, vendor and package strings in a text file.
|
---|
2054 | #
|
---|
2055 | # The rule using this must list $(VBOX_SVN_REV_KMK) as a prerequisite.
|
---|
2056 | #
|
---|
2057 | # @param 1 The input filename.
|
---|
2058 | # @param 2 The output filename.
|
---|
2059 | #
|
---|
2060 | VBOX_EDIT_VERSION_CMD_FN = $(SED) \
|
---|
2061 | -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
|
---|
2062 | -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
|
---|
2063 | -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
|
---|
2064 | -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
|
---|
2065 | -e 's/@VBOX_SVN_REV@/$(VBOX_SVN_REV)/g' \
|
---|
2066 | -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
|
---|
2067 | -e 's/@VBOX_VENDOR_SHORT@/$(VBOX_VENDOR_SHORT)/g' \
|
---|
2068 | -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
|
---|
2069 | -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
|
---|
2070 | -e 's/@VBOX_PACKAGE_STRING@/$(VBOX_PACKAGE_STRING)/g' \
|
---|
2071 | --output $(2) $(1)
|
---|
2072 |
|
---|
2073 | ##
|
---|
2074 | # Generates a rule for editing a file using VBOX_EDIT_VERSION_CMD_FN.
|
---|
2075 | #
|
---|
2076 | # @param 1 The target name.
|
---|
2077 | # @param 2 The input filename relative to the current sub-makefile.
|
---|
2078 | # @param 3 The output filename relative to the target output dir.
|
---|
2079 | # Optional, defaults to 2.
|
---|
2080 | #
|
---|
2081 | VBOX_EDIT_VERSION_RULE_FN = $(eval $(value VBOX_EDIT_VERSION_RULE_DEF))
|
---|
2082 | define VBOX_EDIT_VERSION_RULE_DEF
|
---|
2083 | $$($(1)_0_OUTDIR)/$(if $(3),$(3),$(2)): $(PATH_SUB_CURRENT)/$(2) $(VBOX_SVN_REV_KMK) | $$(dir $$@)
|
---|
2084 | $(call MSG_GENERATE,$(1),$@,$<)
|
---|
2085 | $(QUIET)$(call VBOX_EDIT_VERSION_CMD_FN,$<,$@)
|
---|
2086 | endef
|
---|
2087 |
|
---|
2088 |
|
---|
2089 | ##
|
---|
2090 | # Fill in am import library target based on a somewhat special windows .def file.
|
---|
2091 | #
|
---|
2092 | # @param 1 The target name of the import library.
|
---|
2093 | # @param 2 The name of the real library.
|
---|
2094 | # @param 3 The .def-file paths relative to the current makefile.
|
---|
2095 | #
|
---|
2096 | VBOX_GENERATE_IMPORT_TARGET_FN = $(eval $(VBOX_GENERATE_IMPORT_TARGET_DEF))
|
---|
2097 | define VBOX_GENERATE_IMPORT_TARGET_DEF
|
---|
2098 | $(1)_TEMPLATE = VBoxR3Dll
|
---|
2099 | $(1)_INST = $(INST_LIB)
|
---|
2100 | if $(KBUILD_TARGET) == "darwin"
|
---|
2101 | $(1)_LDFLAGS = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/$(2)$(SUFF_DLL)
|
---|
2102 | else ifn1of ($(KBUILD_TARGET), os2 win)
|
---|
2103 | $(1)_SONAME = $(2)$(SUFF_DLL)
|
---|
2104 | endif
|
---|
2105 | if1of ($(KBUILD_TARGET), os2 win)
|
---|
2106 | $(1)_SOURCES = $$($(1)_0_OUTDIR)/$(1)Imp.def
|
---|
2107 | $(1)_CLEAN = $$($(1)_0_OUTDIR)/$(1)Imp.def
|
---|
2108 | else
|
---|
2109 | $(1)_SOURCES = $$($(1)_0_OUTDIR)/$(1)Imp.c
|
---|
2110 | $(1)_CLEAN = $$($(1)_0_OUTDIR)/$(1)Imp.c
|
---|
2111 | endif
|
---|
2112 |
|
---|
2113 | $$$$($(1)_SOURCES): $(addprefix $(PATH_SUB_CURRENT)/,$(3)) $(PATH_ROOT)/src/bldprogs/deftoimp.sed | $$$$(dir $$$$@)
|
---|
2114 | $$(call MSG_GENERATE,,$$@)
|
---|
2115 | ifeq ($(KBUILD_TARGET),os2)
|
---|
2116 | $$(SED) \
|
---|
2117 | -e '/not-$(KBUILD_TARGET)/d' \
|
---|
2118 | -e '/not-$(KBUILD_TARGET_ARCH)/d' \
|
---|
2119 | -e 's/^LIBRARY[[:space:]][[:space:]]*\(.*\)\.dll/LIBRARY \1 INITINSTANCE TERMINSTANCE\nDATA MULTIPLE\n/' \
|
---|
2120 | -e 's/^[ \t][ \t]*\([a-zA-Z]\)/ _\1/' \
|
---|
2121 | -e 's/[ \t]DATA[ \t]*/ /' \
|
---|
2122 | --output $$@ $(addprefix $(PATH_SUB_CURRENT)/,$(3))
|
---|
2123 | else ifeq ($(KBUILD_TARGET),win)
|
---|
2124 | $$(SED) \
|
---|
2125 | -e '/not-$(KBUILD_TARGET)/d' \
|
---|
2126 | -e '/not-$(KBUILD_TARGET_ARCH)/d' \
|
---|
2127 | --output $$@ $(addprefix $(PATH_SUB_CURRENT)/,$(3))
|
---|
2128 | else
|
---|
2129 | $$(QUIET)$$(APPEND) -tn $$@ \
|
---|
2130 | '#ifdef VBOX_HAVE_VISIBILITY_HIDDEN' \
|
---|
2131 | '# define EXPORT __attribute__((visibility("default")))' \
|
---|
2132 | '# define EXPORT_DATA __attribute__((visibility("default")))' \
|
---|
2133 | '#else' \
|
---|
2134 | '# define EXPORT' \
|
---|
2135 | '# define EXPORT_DATA' \
|
---|
2136 | '#endif' \
|
---|
2137 | ''
|
---|
2138 | $$(SED) \
|
---|
2139 | -e '/not-$(KBUILD_TARGET)/d' \
|
---|
2140 | -e '/not-$(KBUILD_TARGET_ARCH)/d' \
|
---|
2141 | -f $(PATH_ROOT)/src/bldprogs/deftoimp.sed \
|
---|
2142 | --append $$@ $(addprefix $(PATH_SUB_CURRENT)/,$(3))
|
---|
2143 | endif
|
---|
2144 | endef # VBOX_GENERATE_IMPORT_TARGET_DEF
|
---|
2145 |
|
---|
2146 |
|
---|
2147 | #
|
---|
2148 | # Code Signing.
|
---|
2149 | #
|
---|
2150 | ifdef VBOX_SIGNING_MODE
|
---|
2151 | ifeq ($(KBUILD_HOST),win)
|
---|
2152 | # VBOX_PATH_SELFSIGN points to the Vista WDK bin/SelfSign directory.
|
---|
2153 | ifndef VBOX_PATH_SELFSIGN
|
---|
2154 | VBOX_PATH_SELFSIGN := $(lastword $(sort $(wildcard $(PATH_DEVTOOLS)/win.x86/selfsign/*)))
|
---|
2155 | ifeq ($(VBOX_PATH_SELFSIGN),)
|
---|
2156 | VBOX_PATH_SELFSIGN := $(PATH_DEVTOOLS)/win.x86/selfsign/r1
|
---|
2157 | endif
|
---|
2158 | endif
|
---|
2159 | VBOX_SIGNTOOL ?= $(PATH_DEVTOOLS)/bin/retry.cmd $(VBOX_PATH_SELFSIGN)/SignTool.exe
|
---|
2160 | VBOX_INF2CAT ?= $(VBOX_PATH_SELFSIGN)/Inf2Cat.exe
|
---|
2161 |
|
---|
2162 | # There are three signing modes; 'test', 'development' and 'release'.
|
---|
2163 | ifeq ($(strip $(VBOX_SIGNING_MODE)),test)
|
---|
2164 | VBOX_CERTIFICATE_SUBJECT_NAME ?= MyTestCertificate
|
---|
2165 | VBOX_CERTIFICATE_SUBJECT_NAME_ARGS ?= /n "$(VBOX_CERTIFICATE_SUBJECT_NAME)"
|
---|
2166 | else if1of ($(VBOX_SIGNING_MODE), release development)
|
---|
2167 | VBOX_CERTIFICATE_SUBJECT_NAME ?= Sun Microsystems, Inc.
|
---|
2168 | VBOX_CERTIFICATE_SUBJECT_NAME_ARGS ?= /n "$(VBOX_CERTIFICATE_SUBJECT_NAME)"
|
---|
2169 | VBOX_CROSS_CERTIFICATE_FILE ?= $(VBOX_PATH_SELFSIGN)/MSCV-VSClass3.cer
|
---|
2170 | VBOX_CROSS_CERTIFICATE_FILE_ARGS ?= /ac "$(VBOX_CROSS_CERTIFICATE_FILE)"
|
---|
2171 | VBOX_TSA_URL ?= http://timestamp.verisign.com/scripts/timestamp.dll
|
---|
2172 | VBOX_TSA_URL_ARGS ?= /t "$(VBOX_TSA_URL)"
|
---|
2173 | else
|
---|
2174 | $(error Unknown VBOX_SIGNING_MODE: $(VBOX_SIGNING_MODE))
|
---|
2175 | endif
|
---|
2176 | VBOX_CERTIFICATE_STORE ?= my
|
---|
2177 | VBOX_CERTIFICATE_STORE_ARGS ?= /s "$(VBOX_CERTIFICATE_STORE)"
|
---|
2178 |
|
---|
2179 | ## Commands for signing a driver image after link.
|
---|
2180 | VBOX_SIGN_DRIVER_CMDS ?= $(if $(eq $(tool_do),LINK_LIBRARY),,$(call VBOX_SIGN_FILE_FN,$(out)))
|
---|
2181 | ## Sign a file.
|
---|
2182 | # @param 1 The file to sign.
|
---|
2183 | VBOX_SIGN_FILE_FN ?= $(VBOX_SIGNTOOL) sign \
|
---|
2184 | $(VBOX_CROSS_CERTIFICATE_FILE_ARGS) \
|
---|
2185 | $(VBOX_CERTIFICATE_STORE_ARGS) \
|
---|
2186 | $(VBOX_CERTIFICATE_SUBJECT_NAME_ARGS) \
|
---|
2187 | $(VBOX_TSA_URL_ARGS) \
|
---|
2188 | $(1)
|
---|
2189 | ## Create a security catalog file.
|
---|
2190 | # @param 1 The directory containing the stuff to sign.
|
---|
2191 | # @param 2 The expected .cat name. (Inf2Cat lowercases it)
|
---|
2192 | # @param 3 The list of OSes, separated by ';'.
|
---|
2193 | VBOX_MAKE_CAT_HLP_FN ?= \
|
---|
2194 | $(RM) -f $(2)\
|
---|
2195 | $(NL)$(TAB)$(VBOX_INF2CAT) /driver:$(strip $(1)) /os:$(strip $(subst ;,$(COMMA),$(3))) /verbose \
|
---|
2196 | $(NL)$(TAB)$(MV) $(2) $(2) \
|
---|
2197 | $(NL)$(TAB)$(call VBOX_SIGN_FILE_FN,$(2))
|
---|
2198 | VBOX_MAKE_CAT64_FN ?= $(call VBOX_MAKE_CAT_HLP_FN,$(1),$(2),XP_X64;Server2003_X64;Vista_X64)
|
---|
2199 | VBOX_MAKE_CAT32_FN ?= $(call VBOX_MAKE_CAT_HLP_FN,$(1),$(2),2000;XP_X86;Server2003_X86;Vista_X86)
|
---|
2200 | ifeq ($(KBUILD_TARGET_ARCH),x86)
|
---|
2201 | VBOX_MAKE_CAT_FN ?= $(call VBOX_MAKE_CAT32_FN,$(1),$(2))
|
---|
2202 | else
|
---|
2203 | VBOX_MAKE_CAT_FN ?= $(call VBOX_MAKE_CAT64_FN,$(1),$(2))
|
---|
2204 | endif
|
---|
2205 |
|
---|
2206 | # Go nuts, sign everything.
|
---|
2207 | ifeq ($(strip $(VBOX_SIGNING_MODE)),release)
|
---|
2208 | ## Commands for signing an executable or a dll image after link.
|
---|
2209 | VBOX_SIGN_IMAGE_CMDS ?= $(if $(eq $(tool_do),LINK_LIBRARY),,$(call VBOX_SIGN_FILE_FN,$(out)))
|
---|
2210 | endif
|
---|
2211 | ## Enable signing of the additions.
|
---|
2212 | VBOX_SIGN_ADDITIONS ?= 1
|
---|
2213 | else
|
---|
2214 | # Not windows build platform, ignore.
|
---|
2215 | VBOX_SIGNING_MODE :=
|
---|
2216 | endif
|
---|
2217 | endif
|
---|
2218 |
|
---|
2219 | #
|
---|
2220 | # Windows .inf editing.
|
---|
2221 | #
|
---|
2222 | ifeq ($(KBUILD_TARGET_ARCH),x86)
|
---|
2223 | VBOX_EDIT_INF_FN = $(call VBOX_EDIT_INF32_FN,$(1),$(2))
|
---|
2224 | else
|
---|
2225 | VBOX_EDIT_INF_FN = $(call VBOX_EDIT_INF64_FN,$(1),$(2))
|
---|
2226 | endif
|
---|
2227 | ## Edit an inf file an x86 target.
|
---|
2228 | # @param 1 The inf file to edit.
|
---|
2229 | # @param 2 The output file.
|
---|
2230 | VBOX_EDIT_INF32_FN = $(SED) $(if $(VBOX_SIGNING_MODE),-e 's/^;cat *//', -e '/^;cat /d') \
|
---|
2231 | -e 's/^;x86 *//' \
|
---|
2232 | -e '/^;amd64 /d' \
|
---|
2233 | -e 's/^;edit-DriverVer.*/DriverVer = $(date-utc %m\/%d\/%Y),$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)/' \
|
---|
2234 | --output $(2) \
|
---|
2235 | $(1)
|
---|
2236 | ## Edit an inf file an x86 target.
|
---|
2237 | # @param 1 The inf file to edit.
|
---|
2238 | # @param 2 The output file.
|
---|
2239 | VBOX_EDIT_INF64_FN = $(SED) \
|
---|
2240 | $(if $(VBOX_SIGNING_MODE),-e 's/^;cat *//', -e '/^;cat /d')\
|
---|
2241 | -e 's/^;amd64 *//' \
|
---|
2242 | -e '/^;x86 /d' \
|
---|
2243 | -e 's/^;edit-DriverVer.*/DriverVer = $(date-utc %m\/%d\/%Y),$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)/' \
|
---|
2244 | --output $(2) \
|
---|
2245 | $(1)
|
---|
2246 |
|
---|
2247 | #
|
---|
2248 | # Default prefixes and suffixes.
|
---|
2249 | #
|
---|
2250 | VBOX_PREF_LIB =
|
---|
2251 | if1of ($(KBUILD_TARGET), os2 win)
|
---|
2252 | VBOX_SUFF_LIB = .lib
|
---|
2253 | else
|
---|
2254 | VBOX_SUFF_LIB = .a
|
---|
2255 | endif
|
---|
2256 | VBOX_SUFF_DLL = $(SUFF_DLL)
|
---|
2257 | ifeq ($(KBUILD_TARGET),os2) # GXX3OMF produces out .o at the moment.
|
---|
2258 | VBOX_SUFF_OBJ = .o
|
---|
2259 | else
|
---|
2260 | VBOX_SUFF_OBJ = $(SUFF_OBJ)
|
---|
2261 | endif
|
---|
2262 | VBOXW32GUEST_SUFF_LIB = .lib
|
---|
2263 | VBOXLNX32GUEST_SUFF_LIB = .a
|
---|
2264 |
|
---|
2265 | #
|
---|
2266 | # SDKs for external libraries.
|
---|
2267 | #
|
---|
2268 | SDK_VBOX_LIBXML2 = .
|
---|
2269 | SDK_VBOX_LIBXML2_INCS ?= $(PATH_ROOT)/src/libs/libxml2-2.6.30/include
|
---|
2270 | SDK_VBOX_LIBXML2_DEFS ?= _REENTRANT
|
---|
2271 | SDK_VBOX_LIBXML2_DEFS.win += WIN32 _WINDOWS _MBCS
|
---|
2272 | # note: no linking to LIB here, we do that explicitly in src/VBox/Runtime/Makefile.kmk to link
|
---|
2273 | # libxml against VBoxRT
|
---|
2274 |
|
---|
2275 | SDK_VBOX_LIBXSLT = .
|
---|
2276 | #if1of ($(KBUILD_TARGET), os2 solaris win)
|
---|
2277 | SDK_VBOX_LIBXSLT_INCS ?= $(PATH_ROOT)/src/libs/libxslt-1.1.22
|
---|
2278 | SDK_VBOX_LIBXSLT_LIBS ?= $(PATH_LIB)/VBox-libxslt$(VBOX_SUFF_LIB)
|
---|
2279 | SDK_VBOX_LIBXSLT_DEFS ?=
|
---|
2280 | SDK_VBOX_LIBXSLT_DEFS.win += WIN32 _WINDOWS _MBCS _REENTRANT
|
---|
2281 | #else if1of ($(KBUILD_TARGET), linux)
|
---|
2282 | # SDK_VBOX_LIBXSLT_INCS ?=
|
---|
2283 | # SDK_VBOX_LIBXSLT_LIBS ?=
|
---|
2284 | # SDK_VBOX_LIBXSLT_CFLAGS ?= $(shell pkg-config libxslt-1.0 --cflags)
|
---|
2285 | # SDK_VBOX_LIBXSLT_CXXFLAGS ?= $(SDK_VBOX_LIBXSLT_CFLAGS)
|
---|
2286 | # SDK_VBOX_LIBXSLT_LDFLAGS ?= $(shell pkg-config libxslt-1.0 --libs)
|
---|
2287 | #else
|
---|
2288 | # SDK_VBOX_LIBXSLT_INCS ?=
|
---|
2289 | # SDK_VBOX_LIBXSLT_LIBS ?= xslt
|
---|
2290 | #endif
|
---|
2291 |
|
---|
2292 | SDK_VBOX_LIBPNG = .
|
---|
2293 | SDK_VBOX_LIBPNG_INCS ?= $(PATH_ROOT)/src/libs/libpng-1.2.8
|
---|
2294 | SDK_VBOX_LIBPNG_LIBS ?= $(PATH_LIB)/VBox-libpng$(VBOX_SUFF_LIB)
|
---|
2295 |
|
---|
2296 | SDK_VBOX_ZLIB = .
|
---|
2297 | if1of ($(KBUILD_TARGET), os2 win)
|
---|
2298 | SDK_VBOX_ZLIB_INCS ?= $(PATH_ROOT)/src/libs/zlib-1.2.1
|
---|
2299 | SDK_VBOX_ZLIB_LIBS ?= $(PATH_LIB)/VBox-zlib$(VBOX_SUFF_LIB)
|
---|
2300 | else
|
---|
2301 | SDK_VBOX_ZLIB_INCS ?=
|
---|
2302 | SDK_VBOX_ZLIB_LIBS ?= z
|
---|
2303 | SDK_VBOX_ZLIB_DEFS.linux ?= _LARGEFILE64_SOURCE
|
---|
2304 | endif
|
---|
2305 |
|
---|
2306 | SDK_VBOX_OPENSSL = .
|
---|
2307 | SDK_VBOX_OPENSSL_VBOX_DEFAULT_INCS := $(PATH_OUT)/obj/crypto-headers/include
|
---|
2308 | SDK_VBOX_OPENSSL_INCS ?= $(SDK_VBOX_OPENSSL_VBOX_DEFAULT_INCS)
|
---|
2309 | SDK_VBOX_OPENSSL_ORDERDEPS ?= $(crypto-headers_1_TARGET)
|
---|
2310 | SDK_VBOX_OPENSSL_LIBS ?= $(PATH_LIB)/VBox-libcrypto$(VBOX_SUFF_LIB)
|
---|
2311 | # Build entire openssl library, not just the minimal subset.
|
---|
2312 | if1of ($(KBUILD_TARGET), linux solaris)
|
---|
2313 | VBOX_OPENSSL_ALL = 1
|
---|
2314 | endif
|
---|
2315 |
|
---|
2316 | SDK_VBOX_BLD_OPENSSL = .
|
---|
2317 | SDK_VBOX_BLD_OPENSSL_EXTENDS = VBOX_OPENSSL
|
---|
2318 | SDK_VBOX_BLD_OPENSSL_LIBS ?= $(PATH_LIB)/VBoxBldProg-libcrypto$(VBOX_SUFF_LIB)
|
---|
2319 |
|
---|
2320 | ifdef VBOX_WITH_S3
|
---|
2321 | VBOX_WITH_LIBCURL = 1
|
---|
2322 | SDK_VBOX_LIBCURL = .
|
---|
2323 | SDK_VBOX_LIBCURL_INCS ?= $(PATH_ROOT)/src/libs/curl-7.19.4/include
|
---|
2324 | SDK_VBOX_LIBCURL_LIBS ?= $(PATH_LIB)/VBox-libcurl$(VBOX_SUFF_LIB)
|
---|
2325 | SDK_VBOX_LIBCURL_DEFS ?= BUILDING_LIBCURL
|
---|
2326 | endif
|
---|
2327 |
|
---|
2328 | SDK_VBOX_FFMPEG = .
|
---|
2329 | if1of ($(KBUILD_TARGET), darwin linux os2 solaris win)
|
---|
2330 | SDK_VBOX_FFMPEG_INCS ?= \
|
---|
2331 | $(PATH_ROOT)/src/libs/ffmpeg-20060710/libavutil \
|
---|
2332 | $(PATH_ROOT)/src/libs/ffmpeg-20060710/libavcodec \
|
---|
2333 | $(PATH_ROOT)/src/libs/ffmpeg-20060710/libavformat
|
---|
2334 | ifeq ($(KBUILD_TARGET),win)
|
---|
2335 | ## @todo Michael! Where is $(PATH_LIB)/VBoxFFmpegImp$(VBOX_SUFF_LIB) supposed to come from?
|
---|
2336 | #SDK_VBOX_FFMPEG_LIBS ?= $(PATH_LIB)/VBoxFFmpeg.a
|
---|
2337 | SDK_VBOX_FFMPEG_LIBS ?= $(PATH_LIB)/VBoxFFmpegImp.lib
|
---|
2338 | else
|
---|
2339 | SDK_VBOX_FFMPEG_LIBS ?= $(PATH_BIN)/VBoxFFmpeg$(SUFF_DLL)
|
---|
2340 | endif
|
---|
2341 | else
|
---|
2342 | SDK_VBOX_FFMPEG_INCS ?= /usr/include/ffmpeg /usr/include/libpng
|
---|
2343 | SDK_VBOX_FFMPEG_LIBS ?= avutil avcodec avformat
|
---|
2344 | endif
|
---|
2345 |
|
---|
2346 | SDK_VBOX_BOOST = .
|
---|
2347 | SDK_VBOX_BOOST_DEFS ?= BOOST_DISABLE_ASSERTS
|
---|
2348 | SDK_VBOX_BOOST_INCS ?= $(PATH_ROOT)/src/libs/boost-1.37.0
|
---|
2349 |
|
---|
2350 | #
|
---|
2351 | # Special SDK for the problematic NTDLL.LIB.
|
---|
2352 | #
|
---|
2353 | SDK_VBOX_NTDLL = Mini NTDLL import library, required IPRT.
|
---|
2354 | SDK_VBOX_NTDLL_LIBS.x86 ?= $(PATH_LIB)/RuntimeR3NtDll-x86.lib
|
---|
2355 | SDK_VBOX_NTDLL_LIBS.amd64 ?= $(PATH_LIB)/RuntimeR3NtDll-amd64.lib
|
---|
2356 |
|
---|
2357 | #
|
---|
2358 | # The linux kernel headers(/sources).
|
---|
2359 | #
|
---|
2360 | if1of ($(KBUILD_TARGET), linux)
|
---|
2361 | ifeq ($(origin VBOX_LINUX_SRC),undefined)
|
---|
2362 | ifneq ($(wildcard /lib/modules/$(shell uname -r)/build/include/linux/autoconf.h),)
|
---|
2363 | export VBOX_LINUX_SRC := /lib/modules/$(shell uname -r)/build
|
---|
2364 | else
|
---|
2365 | export VBOX_LINUX_SRC := /usr/src/linux
|
---|
2366 | endif
|
---|
2367 | endif
|
---|
2368 | ifneq ($(VBOX_LINUX_SRC),)
|
---|
2369 | ifeq ($(origin VBOX_LINUX_INCS),undefined)
|
---|
2370 | export VBOX_LINUX_INCS := $(VBOX_LINUX_SRC)/include
|
---|
2371 | # XXX hack alert! support splitted Linux kernels (make O=<build directory>)
|
---|
2372 | # XXX put this crap elsewhere
|
---|
2373 | kernelpath := $(shell $(SED_EXT) -ne 's+^KERNELSRC.*= *\(.*\)+\1+p' $(VBOX_LINUX_SRC)/Makefile)
|
---|
2374 | ifeq ($(kernelpath),)
|
---|
2375 | # Linux >= 2.6.25
|
---|
2376 | kernelpath := $(shell $(SED_EXT) -ne 's+^MAKEARGS *:= *-C *\(\S*\).*+\1+p' $(VBOX_LINUX_SRC)/Makefile)
|
---|
2377 | endif
|
---|
2378 | ifneq ($(kernelpath),)
|
---|
2379 | # absolute path?
|
---|
2380 | ifneq ($(patsubst /%,,$(kernelpath)),)
|
---|
2381 | # no, relative path
|
---|
2382 | kernelpath := $(realpath $(VBOX_LINUX_SRC)/$(kernelpath))
|
---|
2383 | endif
|
---|
2384 | endif
|
---|
2385 | ifneq ($(kernelpath),)
|
---|
2386 | VBOX_LINUX_INCS += $(VBOX_LINUX_SRC)/include2 $(kernelpath)/include
|
---|
2387 | else
|
---|
2388 | kernelpath := $(VBOX_LINUX_SRC)
|
---|
2389 | endif
|
---|
2390 | VBOX_LINUX_INCS += $(kernelpath)/include/asm-i386/mach-default \
|
---|
2391 | $(kernelpath)/include/asm-x86/mach-default \
|
---|
2392 | $(kernelpath)/arch/x86/include \
|
---|
2393 | $(kernelpath)/arch/x86/include/asm/mach-default \
|
---|
2394 | $(kernelpath)/include
|
---|
2395 | endif
|
---|
2396 | endif
|
---|
2397 | # Since Linux 2.6.15, <linux/autoconf.h> is included like this. It cannot hurt to do the
|
---|
2398 | # same for older Linux kernels
|
---|
2399 | ifneq ($(wildcard $(VBOX_LINUX_SRC)/include/generated/autoconf.h),)
|
---|
2400 | # Linux >= 2.6.33
|
---|
2401 | export VBOX_LINUX_INCLUDE := -include $(VBOX_LINUX_SRC)/include/generated/autoconf.h
|
---|
2402 | else ifneq ($(wildcard $(VBOX_LINUX_SRC)/include/linux/autoconf.h),)
|
---|
2403 | # Linux < 2.6.33
|
---|
2404 | export VBOX_LINUX_INCLUDE := -include $(VBOX_LINUX_SRC)/include/linux/autoconf.h
|
---|
2405 | endif
|
---|
2406 | endif
|
---|
2407 |
|
---|
2408 | #
|
---|
2409 | # Determine Solaris version.
|
---|
2410 | #
|
---|
2411 | ifeq ($(KBUILD_TARGET),solaris)
|
---|
2412 | ifeq ($(origin VBOX_SOLARIS_VERSION),undefined)
|
---|
2413 | $(eval export VBOX_SOLARIS_VERSION := $(shell uname -r | $(SED_EXT) 's|\([0-9]*\)\.\([0-9]*\)|$$(int-add $$(int-mul 100, \1), \2)|' ))
|
---|
2414 | endif
|
---|
2415 | ifeq ($(VBOX_SOLARIS_VERSION),510)
|
---|
2416 | DEFS.solaris += RT_OS_SOLARIS_10
|
---|
2417 | # Solaris 10 does not include crossbow.
|
---|
2418 | VBOX_WITH_CROSSBOW =
|
---|
2419 | VBOX_SOLARIS_10 = 1
|
---|
2420 | # We cannot compile additions on Solaris 10, due kernel interface deps
|
---|
2421 | VBOX_WITHOUT_ADDITIONS := 1
|
---|
2422 | VBOX_WITH_ADDITIONS =
|
---|
2423 | else
|
---|
2424 | ## @todo r=bird: Why eval, and why export? Actually, since this isn't used anywhere, why not
|
---|
2425 | # VBOX_WITH_SOLARIS_OSS := $(if-expr $(shell uname -v | cut -f2 -d'_')) >= 115,1,)
|
---|
2426 | $(eval export VBOX_SOLARIS_SNV_VERSION := $(shell uname -v | cut -f2 -d'_'))
|
---|
2427 |
|
---|
2428 | # OSS audio support for Solaris
|
---|
2429 | VBOX_WITH_SOLARIS_OSS := $(if-expr $(VBOX_SOLARIS_SNV_VERSION) >= 115,1,)
|
---|
2430 | endif
|
---|
2431 | endif
|
---|
2432 |
|
---|
2433 | ifdef VBOX_WITH_RAW_MODE
|
---|
2434 | #
|
---|
2435 | # Template for building RC things.
|
---|
2436 | #
|
---|
2437 | TEMPLATE_VBoxRc = VBox Raw-Mode Context
|
---|
2438 | TEMPLATE_VBoxRc_ASTOOL = $(VBOX_ASTOOL)
|
---|
2439 | TEMPLATE_VBoxRc_ASFLAGS = $(VBOX_ASFLAGS32)
|
---|
2440 | TEMPLATE_VBoxRc_DEFS = IN_RC IPRT_NO_CRT RT_WITH_NOCRT_ALIASES $(ARCH_BITS_DEFS)
|
---|
2441 | TEMPLATE_VBoxRc_INCS = $(PATH_ROOT)/include/iprt/nocrt
|
---|
2442 | TEMPLATE_VBoxRc_SYSSUFF = .gc
|
---|
2443 | TEMPLATE_VBoxRc_BLD_TRG_ARCH = x86
|
---|
2444 |
|
---|
2445 | ifeq ($(VBOX_LDR_FMT32),pe)
|
---|
2446 | ifndef VBOX_USE_VCC70
|
---|
2447 | TEMPLATE_VBoxRc_TOOL = $(VBOX_VCC_TOOL_STEM)X86
|
---|
2448 | TEMPLATE_VBoxRc_CXXFLAGS = -Zi -Zl -GR- -EHs- -GF -W3 -wd4244 -GS- -wd4996 -Zc:wchar_t- -Gs8192 $(VBOX_VCC_GC_OPT) $(VBOX_VCC_GC_FP) $(VBOX_VCC_WERR)
|
---|
2449 | else
|
---|
2450 | TEMPLATE_VBoxRc_TOOL = VCC70
|
---|
2451 | TEMPLATE_VBoxRc_CXXFLAGS = -Zi -Zl -GR- -EHs- -GF -W3 -wd4244 $(VBOX_VCC_GC_OPT) $(VBOX_VCC_GC_FP) $(VBOX_VCC_WERR)
|
---|
2452 | endif
|
---|
2453 | TEMPLATE_VBoxRc_CFLAGS = $(TEMPLATE_VBoxRc_CXXFLAGS)
|
---|
2454 | TEMPLATE_VBoxRc_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:64 -MapInfo:Exports -NoD $(VBOX_VCC_LD_WERR) -Debug
|
---|
2455 | ifdef VBOX_USE_WINDDK
|
---|
2456 | ifndef VBOX_NOINC_MISC
|
---|
2457 | include $(KBUILD_PATH)/sdks/$(VBOX_WINDDK).kmk
|
---|
2458 | endif
|
---|
2459 | TEMPLATE_VBoxRc_LIBS = \
|
---|
2460 | $(PATH_SDK_$(VBOX_WINDDK)_LIB.x86)/int64.lib
|
---|
2461 | else
|
---|
2462 | ifndef VBOX_NOINC_MISC
|
---|
2463 | include $(KBUILD_PATH)/sdks/W2K3DDKX86.kmk
|
---|
2464 | endif
|
---|
2465 | TEMPLATE_VBoxRc_LIBS = \
|
---|
2466 | $(PATH_SDK_W2K3DDKX86_LIB)/int64.lib
|
---|
2467 | endif
|
---|
2468 | TEMPLATE_VBoxRc_LIBS += \
|
---|
2469 | $(PATH_LIB)/RuntimeRCStub$(VBOX_SUFF_LIB)
|
---|
2470 | TEMPLATE_VBoxRc_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
|
---|
2471 | endif # pe
|
---|
2472 |
|
---|
2473 | ifeq ($(VBOX_LDR_FMT32),elf)
|
---|
2474 | TEMPLATE_VBoxRc_TOOL = $(VBOX_GCC32_TOOL)
|
---|
2475 | TEMPLATE_VBoxRc_CXXFLAGS = -nostdinc -g -pipe $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden) -fno-rtti
|
---|
2476 | TEMPLATE_VBoxRc_CFLAGS = -nostdinc -g -pipe $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden)
|
---|
2477 | ifeq ($(KBUILD_TARGET),solaris)
|
---|
2478 | TEMPLATE_VBoxRc_LDFLAGS = -r
|
---|
2479 | else
|
---|
2480 | TEMPLATE_VBoxRc_LDFLAGS = -nostdlib -Bsymbolic
|
---|
2481 | # "temporarily", must fix the loader.
|
---|
2482 | TEMPLATE_VBoxRc_LDFLAGS += $(if $(VBOX_DO_STRIP_MODULES),-S,)
|
---|
2483 | TEMPLATE_VBoxRc_LDFLAGS.release = $(if $(VBOX_DO_STRIP_MODULES),-S,)
|
---|
2484 | endif
|
---|
2485 | ifn1of ($(KBUILD_TARGET), solaris freebsd)
|
---|
2486 | TEMPLATE_VBoxRc_LIBS = \
|
---|
2487 | $(VBOX_GCC32_LIBGCC) # instricts
|
---|
2488 | endif
|
---|
2489 | endif
|
---|
2490 |
|
---|
2491 | ifeq ($(VBOX_LDR_FMT32),macho)
|
---|
2492 | TEMPLATE_VBoxRc_TOOL = GXX4MACHO
|
---|
2493 | TEMPLATE_VBoxRc_DEFS += $(VBOX_DARWIN_DEF_SDK_DEFS)
|
---|
2494 | TEMPLATE_VBoxRc_CXXFLAGS = $(VBOX_DARWIN_DEF_SDK_CXXFLAGS) -m32 -nostdinc -g -pipe $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC32_Wno-variadic-macros) -fno-common -msoft-float -static $(VBOX_GCC_fno-stack-protector) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing -fno-rtti
|
---|
2495 | TEMPLATE_VBoxRc_CFLAGS = $(VBOX_DARWIN_DEF_SDK_CFLAGS) -m32 -nostdinc -g -pipe $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC32_Wno-variadic-macros) -fno-common -msoft-float -static $(VBOX_GCC_fno-stack-protector) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing
|
---|
2496 | TEMPLATE_VBoxRc_LDFLAGS = $(VBOX_DARWIN_DEF_SDK_LDFLAGS) -m32 -nostdlib
|
---|
2497 | #TEMPLATE_VBoxRc_LDFLAGS.release = -Wl,-S ???
|
---|
2498 | endif
|
---|
2499 |
|
---|
2500 | ifeq ($(VBOX_LDR_FMT32),lx)
|
---|
2501 | TEMPLATE_VBoxRc_TOOL = GXX3OMF
|
---|
2502 | TEMPLATE_VBoxRc_CXXFLAGS = -nostdinc -g -pipe $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC32_Wno-variadic-macros) $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing -fno-exceptions -fno-rtti
|
---|
2503 | TEMPLATE_VBoxRc_CFLAGS = -nostdinc -g -pipe $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC32_Wno-variadic-macros) $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing -fno-exceptions
|
---|
2504 | TEMPLATE_VBoxRc_LDFLAGS = -Zdll -nostdlib
|
---|
2505 | TEMPLATE_VBoxRc_LIBS = \
|
---|
2506 | $(VBOX_GCC32_LIBGCC) \
|
---|
2507 | $(VBOX_OBJ_SYS0) \
|
---|
2508 | end
|
---|
2509 | endif
|
---|
2510 |
|
---|
2511 |
|
---|
2512 | #
|
---|
2513 | # Template for building a RC ring-3 testcase (tstVMStructGC, tstDevStructGC).
|
---|
2514 | #
|
---|
2515 | TEMPLATE_VBoxRcExe = VBox Raw-Mode as ring-3 testcase
|
---|
2516 | TEMPLATE_VBoxRcExe_EXTENDS = VBoxRc
|
---|
2517 | TEMPLATE_VBoxRcExe_DEFS = $(filter-out IPRT_NO_CRT RT_WITH_NOCRT_ALIASES,$(TEMPLATE_VBoxRc_DEFS))
|
---|
2518 | TEMPLATE_VBoxRcExe_INCS = $(NO_SUCH_VARIABLE)
|
---|
2519 |
|
---|
2520 | ifeq ($(VBOX_LDR_FMT32),pe)
|
---|
2521 | TEMPLATE_VBoxRcExe_LDFLAGS = -Incremental:NO -MapInfo:Exports -NoD -Debug
|
---|
2522 | TEMPLATE_VBoxRcExe_SDKS = WIN32SDK
|
---|
2523 | ifndef VBOX_USE_VCC70
|
---|
2524 | TEMPLATE_VBoxRcExe_LIBS = \
|
---|
2525 | $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)X86_LIB)/libcmt.lib \
|
---|
2526 | $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)X86_LIB)/oldnames.lib
|
---|
2527 | else
|
---|
2528 | TEMPLATE_VBoxRcExe_LIBS = \
|
---|
2529 | $(PATH_TOOL_VCC70_LIB)/libcmt.lib \
|
---|
2530 | $(PATH_TOOL_VCC70_LIB)/oldnames.lib
|
---|
2531 | endif
|
---|
2532 | endif
|
---|
2533 |
|
---|
2534 | ifeq ($(VBOX_LDR_FMT32),elf)
|
---|
2535 | TEMPLATE_VBoxRcExe_CFLAGS = $(filter-out -nostdinc,$(TEMPLATE_VBoxRc_CFLAGS))
|
---|
2536 | TEMPLATE_VBoxRcExe_CXXFLAGS = $(filter-out -nostdinc,$(TEMPLATE_VBoxRc_CXXFLAGS))
|
---|
2537 | TEMPLATE_VBoxRcExe_LDFLAGS = -g
|
---|
2538 | TEMPLATE_VBoxRcExe_LDFLAGS.dbgopt = -g
|
---|
2539 | TEMPLATE_VBoxRcExe_LDFLAGS.strict = -g
|
---|
2540 | TEMPLATE_VBoxRcExe_LDFLAGS.release = -g
|
---|
2541 | if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), freebsd.amd64)
|
---|
2542 | # The FreeBSD port of gcc isn't picking up -m32 where it should. the .o order below isn't
|
---|
2543 | # quite right (target source comes first), if it stops working we'll have to write a linker tool.
|
---|
2544 | TEMPLATE_VBoxRcExe_DEFS.$(KBUILD_TARGET) = $(TEMPLATE_VBoxRc_DEFS.$(KBUILD_TARGET)) IPRT_DONT_USE_SYSTEM_STDINT_H
|
---|
2545 | TEMPLATE_VBoxRcExe_LDFLAGS.$(KBUILD_TARGET) = $(TEMPLATE_VBoxRc_LDFLAGS.$(KBUILD_TARGET)) -nostdlib -v
|
---|
2546 | TEMPLATE_VBoxRcExe_SOURCES.$(KBUILD_TARGET) = /usr/lib32/crtend.o /usr/lib32/crtn.o
|
---|
2547 | TEMPLATE_VBoxRcExe_SOURCES = /usr/lib32/crt1.o /usr/lib32/crti.o /usr/lib32/crtbegin.o
|
---|
2548 | TEMPLATE_VBoxRcExe_LIBPATH.$(KBUILD_TARGET) = /usr/lib32
|
---|
2549 | TEMPLATE_VBoxRcExe_LIBS.$(KBUILD_TARGET) = /usr/lib32/libc.so
|
---|
2550 | endif
|
---|
2551 | endif
|
---|
2552 |
|
---|
2553 | ifeq ($(VBOX_LDR_FMT32),macho)
|
---|
2554 | TEMPLATE_VBoxRcExe_CFLAGS = $(filter-out -static -nostdinc,$(TEMPLATE_VBoxRc_CFLAGS))
|
---|
2555 | TEMPLATE_VBoxRcExe_CXXFLAGS = $(filter-out -static -nostdinc,$(TEMPLATE_VBoxRc_CXXFLAGS))
|
---|
2556 | TEMPLATE_VBoxRcExe_LDFLAGS = -g -m32
|
---|
2557 | endif
|
---|
2558 |
|
---|
2559 | ifeq ($(VBOX_LDR_FMT32),lx)
|
---|
2560 | TEMPLATE_VBoxRcExe_CFLAGS = $(filter-out -nostdinc,$(TEMPLATE_VBoxRc_CFLAGS))
|
---|
2561 | TEMPLATE_VBoxRcExe_CXXFLAGS = $(filter-out -nostdinc,$(TEMPLATE_VBoxRc_CXXFLAGS))
|
---|
2562 | TEMPLATE_VBoxRcExe_LDFLAGS = -g
|
---|
2563 | TEMPLATE_VBoxRcExe_LIBS = $(NO_SUCH_VARIABLE)
|
---|
2564 | endif
|
---|
2565 | endif # VBOX_WITH_RAW_MODE
|
---|
2566 |
|
---|
2567 |
|
---|
2568 | #
|
---|
2569 | # Template for building R0 things.
|
---|
2570 | #
|
---|
2571 | TEMPLATE_VBoxR0 = VBox Ring 0
|
---|
2572 | TEMPLATE_VBoxR0_ASTOOL = $(VBOX_ASTOOL)
|
---|
2573 | TEMPLATE_VBoxR0_ASFLAGS = $(VBOX_ASFLAGS)
|
---|
2574 | TEMPLATE_VBoxR0_DEFS = IN_RING0 IN_RING0_AGNOSTIC IPRT_NO_CRT RT_WITH_NOCRT_ALIASES $(ARCH_BITS_DEFS)
|
---|
2575 | TEMPLATE_VBoxR0_INCS = $(PATH_ROOT)/include/iprt/nocrt
|
---|
2576 | TEMPLATE_VBoxR0_SYSSUFF = .r0
|
---|
2577 |
|
---|
2578 | ifeq ($(VBOX_LDR_FMT),pe)
|
---|
2579 | TEMPLATE_VBoxR0_TOOL = $(VBOX_VCC_TOOL)
|
---|
2580 | ifndef VBOX_USE_VCC70
|
---|
2581 | TEMPLATE_VBoxR0_CXXFLAGS = -Zi -Zl -GR- -EHs- -GF -W3 -wd4244 -GS- -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP) $(VBOX_VCC_WERR)
|
---|
2582 | else
|
---|
2583 | TEMPLATE_VBoxR0_CXXFLAGS = -Zi -Zl -GR- -EHs- -GF -W3 -wd4244 $(VBOX_VCC_OPT) $(VBOX_VCC_FP) $(VBOX_VCC_WERR)
|
---|
2584 | endif
|
---|
2585 | TEMPLATE_VBoxR0_CFLAGS = $(TEMPLATE_VBoxR0_CXXFLAGS)
|
---|
2586 | TEMPLATE_VBoxR0_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:64 -MapInfo:Exports -NoD $(VBOX_VCC_LD_WERR) -Debug
|
---|
2587 | TEMPLATE_VBoxR0_LIBS = \
|
---|
2588 | $(PATH_LIB)/RuntimeR0Stub$(VBOX_SUFF_LIB)
|
---|
2589 | ifdef VBOX_USE_WINDDK
|
---|
2590 | TEMPLATE_VBoxR0_LIBS.x86 = \
|
---|
2591 | $(PATH_SDK_$(VBOX_WINDDK)_LIB.x86)/int64.lib
|
---|
2592 | else
|
---|
2593 | TEMPLATE_VBoxR0_LIBS.x86 = \
|
---|
2594 | $(PATH_SDK_W2K3DDKX86_LIB)/int64.lib
|
---|
2595 | endif
|
---|
2596 | TEMPLATE_VBoxR0_POST_CMDS = $(VBOX_SIGN_DRIVER_CMDS)
|
---|
2597 | endif # pe
|
---|
2598 |
|
---|
2599 | ifeq ($(VBOX_LDR_FMT),elf)
|
---|
2600 | TEMPLATE_VBoxR0_TOOL = $(VBOX_GCC_TOOL)
|
---|
2601 | TEMPLATE_VBoxR0_CFLAGS = -nostdinc -g -pipe $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) -std=gnu99
|
---|
2602 | TEMPLATE_VBoxR0_CXXFLAGS = -nostdinc -g -pipe $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) -fno-rtti
|
---|
2603 | TEMPLATE_VBoxR0_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables -ffreestanding
|
---|
2604 | TEMPLATE_VBoxR0_CXXFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables
|
---|
2605 | ifeq ($(KBUILD_TARGET),solaris)
|
---|
2606 | TEMPLATE_VBoxR0_LDFLAGS = -r
|
---|
2607 | else
|
---|
2608 | TEMPLATE_VBoxR0_LDFLAGS = -nostdlib -Bsymbolic
|
---|
2609 | # temporarily, must fix the loader.
|
---|
2610 | TEMPLATE_VBoxR0_LDFLAGS += $(if $(VBOX_DO_STRIP_MODULES),-S,)
|
---|
2611 | TEMPLATE_VBoxR0_LDFLAGS.release = $(if $(VBOX_DO_STRIP_MODULES),-S,)
|
---|
2612 | endif
|
---|
2613 | ifn1of ($(KBUILD_TARGET),solaris freebsd)
|
---|
2614 | TEMPLATE_VBoxR0_LIBS = \
|
---|
2615 | $(VBOX_GCC_LIBGCC) # instricts
|
---|
2616 | endif
|
---|
2617 | endif
|
---|
2618 |
|
---|
2619 | ifeq ($(VBOX_LDR_FMT),macho)
|
---|
2620 | TEMPLATE_VBoxR0_TOOL = GXX4MACHO
|
---|
2621 | TEMPLATE_VBoxR0_DEFS += $(VBOX_DARWIN_DEF_SDK_DEFS)
|
---|
2622 | TEMPLATE_VBoxR0_CXXFLAGS = $(VBOX_DARWIN_DEF_SDK_CXXFLAGS) -nostdinc -g -pipe $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) \
|
---|
2623 | -fno-common -msoft-float -static -fno-rtti -fno-exceptions $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing \
|
---|
2624 | -mno-sse -mno-mmx -mno-sse2 -mno-3dnow $(VBOX_GCC_fno-stack-protector)
|
---|
2625 | TEMPLATE_VBoxR0_CXXFLAGS.amd64 = -m64 -mno-red-zone -mno-sse3 -mno-sse4 -mno-sse4.1 -mno-sse4.2 -mno-sse4a -fno-unwind-tables
|
---|
2626 | TEMPLATE_VBoxR0_CXXFLAGS.x86 = -m32
|
---|
2627 | TEMPLATE_VBoxR0_CFLAGS = $(VBOX_DARWIN_DEF_SDK_CFLAGS) -nostdinc -g -pipe $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC_Wno-variadic-macros) \
|
---|
2628 | -fno-common -msoft-float -static -fno-exceptions $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing \
|
---|
2629 | -mno-sse -mno-mmx -mno-sse2 -mno-3dnow $(VBOX_GCC_fno-stack-protector)
|
---|
2630 | TEMPLATE_VBoxR0_CFLAGS.amd64 = -m64 -mno-red-zone -mno-sse3 -mno-sse4 -mno-sse4.1 -mno-sse4.2 -mno-sse4a -fno-unwind-tables
|
---|
2631 | TEMPLATE_VBoxR0_CFLAGS.x86 = -m32
|
---|
2632 | TEMPLATE_VBoxR0_LDFLAGS = $(VBOX_DARWIN_DEF_SDK_LDFLAGS) -nostdlib
|
---|
2633 | #TEMPLATE_VBoxR0_LDFLAGS.release = -Wl,-S ???
|
---|
2634 | TEMPLATE_VBoxR0_LDFLAGS.amd64 = -m64 -static
|
---|
2635 | TEMPLATE_VBoxR0_LDFLAGS.x86 = -m32
|
---|
2636 | endif
|
---|
2637 |
|
---|
2638 | ifeq ($(VBOX_LDR_FMT),lx)
|
---|
2639 | TEMPLATE_VBoxR0_TOOL = GXX3OMF
|
---|
2640 | TEMPLATE_VBoxR0_CFLAGS = -nostdinc -g -pipe $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions
|
---|
2641 | TEMPLATE_VBoxR0_CXXFLAGS = -nostdinc -g -pipe $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions -fno-rtti
|
---|
2642 | TEMPLATE_VBoxR0_LDFLAGS = -nostdlib -Zdll
|
---|
2643 | TEMPLATE_VBoxR0_LIBS = \
|
---|
2644 | $(VBOX_GCC_LIBGCC) \
|
---|
2645 | $(VBOX_OBJ_SYS0) \
|
---|
2646 | end
|
---|
2647 | endif
|
---|
2648 |
|
---|
2649 |
|
---|
2650 | #
|
---|
2651 | # Template for building SUPDRV R0 things.
|
---|
2652 | #
|
---|
2653 | TEMPLATE_VBOXR0DRV = VBox SUPDRV Ring 0
|
---|
2654 | TEMPLATE_VBOXR0DRV_ASTOOL = $(VBOX_ASTOOL)
|
---|
2655 | TEMPLATE_VBOXR0DRV_ASFLAGS = $(VBOX_ASFLAGS)
|
---|
2656 | TEMPLATE_VBOXR0DRV_DEFS = IN_RING0 IN_RT_R0 $(ARCH_BITS_DEFS)
|
---|
2657 |
|
---|
2658 | ifeq ($(KBUILD_TARGET),win)
|
---|
2659 | TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_VCC_TOOL)
|
---|
2660 | TEMPLATE_VBOXR0DRV_RCDEFS = \
|
---|
2661 | VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
|
---|
2662 | VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
|
---|
2663 | VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
|
---|
2664 | VBOX_SVN_REV=\"$(VBOX_SVN_REV)\" \
|
---|
2665 | VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
|
---|
2666 | VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
|
---|
2667 | VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD) \
|
---|
2668 | VBOX_SVN_REV_NR=$(VBOX_SVN_REV)
|
---|
2669 | TEMPLATE_VBOXR0DRV_DEFS.x86 = _X86_
|
---|
2670 | TEMPLATE_VBOXR0DRV_DEFS.amd64 = _AMD64_
|
---|
2671 | ifndef VBOX_USE_VCC70
|
---|
2672 | TEMPLATE_VBOXR0DRV_CXXFLAGS = -Zi -Zl -GR- -EHs- -GF -Gz -W3 -GS- -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
2673 | else
|
---|
2674 | TEMPLATE_VBOXR0DRV_CXXFLAGS = -Zi -Zl -GR- -EHs- -GF -Gz -W3 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
2675 | endif
|
---|
2676 | TEMPLATE_VBOXR0DRV_CFLAGS = $(TEMPLATE_VBOXR0DRV_CXXFLAGS)
|
---|
2677 | TEMPLATE_VBOXR0DRV_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:64 -MapInfo:Exports -NoD -Debug
|
---|
2678 | TEMPLATE_VBOXR0DRV_POST_CMDS = $(VBOX_SIGN_DRIVER_CMDS)
|
---|
2679 | ifdef VBOX_USE_VCC100 # HACK ALERT!
|
---|
2680 | TEMPLATE_VBOXR0DRV_CINCS = $(TOOL_$(VBOX_VCC_TOOL)_CINCS)
|
---|
2681 | TEMPLATE_VBOXR0DRV_CXXINCS = $(TOOL_$(VBOX_VCC_TOOL)_CXXINCS)
|
---|
2682 | endif
|
---|
2683 | endif
|
---|
2684 |
|
---|
2685 | ifeq ($(KBUILD_TARGET),linux)
|
---|
2686 | TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_GCC_TOOL)
|
---|
2687 | TEMPLATE_VBOXR0DRV_DEFS = __KERNEL__ MODULE IN_RING0 IN_RT_R0
|
---|
2688 | TEMPLATE_VBOXR0DRV_INCS = $(VBOX_LINUX_INCS)
|
---|
2689 | TEMPLATE_VBOXR0DRV_CFLAGS = -nostdinc -iwithprefix include $(VBOX_LINUX_INCLUDE) \
|
---|
2690 | $(VBOX_GCC_WARN) -Wstrict-prototypes $(VBOX_GCC_Wno-pointer-sign) -Wno-sign-compare \
|
---|
2691 | $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration
|
---|
2692 | TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -mpreferred-stack-boundary=2 -msoft-float
|
---|
2693 | TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow \
|
---|
2694 | -fno-reorder-blocks -ffreestanding -fno-asynchronous-unwind-tables -funit-at-a-time \
|
---|
2695 | -Wno-sign-compare -Wdeclaration-after-statement
|
---|
2696 | TEMPLATE_VBOXR0DRV_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wno-pointer-sign -ffreestanding -Wdeclaration-after-statement -Werror-implicit-function-declaration,$(TEMPLATE_VBOXR0DRV_CFLAGS) $(TEMPLATE_VBOXR0DRV_CFLAGS.$(KBUILD_TARGET_ARCH))) -fno-exceptions -fno-rtti
|
---|
2697 | ifndef VBOX_LINUX_VERSION_2_4
|
---|
2698 | # 2.6
|
---|
2699 | TEMPLATE_VBOXR0DRV_SYSSUFF = .ko
|
---|
2700 | TEMPLATE_VBOXR0DRV_LDFLAGS.x86 = -m elf_i386 -r
|
---|
2701 | TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -m elf_x86_64 -r
|
---|
2702 | else
|
---|
2703 | # 2.4
|
---|
2704 | TEMPLATE_VBOXR0DRV_SYSSUFF = .o
|
---|
2705 | TEMPLATE_VBOXR0DRV_LDFLAGS = -r -s
|
---|
2706 | endif
|
---|
2707 | endif
|
---|
2708 |
|
---|
2709 | ifeq ($(KBUILD_TARGET),os2)
|
---|
2710 | TEMPLATE_VBOXR0DRV_TOOL = GXX3OMF
|
---|
2711 | TEMPLATE_VBOXR0DRV_CXXFLAGS = -g -pipe $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions -fno-rtti
|
---|
2712 | TEMPLATE_VBOXR0DRV_CFLAGS = -g -pipe $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions
|
---|
2713 | TEMPLATE_VBOXR0DRV_LIBS = $(VBOX_GCC_LIBGCC)
|
---|
2714 | # wlink thinks physdevice doesn't need fixups and should have a stack - stupid!
|
---|
2715 | TEMPLATE_VBOXR0DRV_LDFLAGS = -Zlinker Option -Zlinker internalrelocs, -Zlinker togglerelocs
|
---|
2716 | endif
|
---|
2717 |
|
---|
2718 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
2719 | TEMPLATE_VBOXR0DRV_TOOL = GXX4MACHO
|
---|
2720 | TEMPLATE_VBOXR0DRV_DEFS += $(VBOX_DARWIN_DEF_SDK_DEFS) KERNEL KERNEL_PRIVATE DRIVER_PRIVATE APPLE NeXT RT_USE_VISIBILITY_HIDDEN
|
---|
2721 | TEMPLATE_VBOXR0DRV_INCS += $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/Kernel.framework/Headers
|
---|
2722 | ## @todo try use VBOX_GCC_PEDANTIC_CXX
|
---|
2723 | TEMPLATE_VBOXR0DRV_CXXFLAGS = $(VBOX_DARWIN_DEF_SDK_CXXFLAGS) \
|
---|
2724 | -g -pipe $(VBOX_GCC_WARN) -Wno-long-long -fno-common -nostdinc -fno-builtin -finline \
|
---|
2725 | -fno-keep-inline-functions -fno-exceptions -msoft-float \
|
---|
2726 | -fapple-kext -fno-rtti -fcheck-new -force_cpusubtype_ALL \
|
---|
2727 | $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fasm-blocks
|
---|
2728 | TEMPLATE_VBOXR0DRV_CXXFLAGS.amd64 = -m64 -mkernel -mno-red-zone -gdwarf-2
|
---|
2729 | TEMPLATE_VBOXR0DRV_CXXFLAGS.x86 = -m32 -static
|
---|
2730 | TEMPLATE_VBOXR0DRV_CFLAGS = $(VBOX_DARWIN_DEF_SDK_CFLAGS) \
|
---|
2731 | -g -pipe $(VBOX_GCC_WARN) -Wno-long-long -fno-common -nostdinc -fno-builtin -finline \
|
---|
2732 | -fno-keep-inline-functions -fno-exceptions -msoft-float \
|
---|
2733 | -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations \
|
---|
2734 | -Werror-implicit-function-declaration -force_cpusubtype_ALL \
|
---|
2735 | $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fasm-blocks
|
---|
2736 | TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 -mkernel -mno-red-zone -gdwarf-2
|
---|
2737 | TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 -static
|
---|
2738 | TEMPLATE_VBOXR0DRV_LDFLAGS = $(filter-out $(VBOX_DARWIN_NO_COMPACT_LINKEDIT),$(VBOX_DARWIN_DEF_SDK_LDFLAGS)) -static -nostdlib -r -Wl,-Y,1455 -keep_private_extern
|
---|
2739 | TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -m64 -Xlinker -kext
|
---|
2740 | TEMPLATE_VBOXR0DRV_LDFLAGS.x86 = -m32
|
---|
2741 | TEMPLATE_VBOXR0DRV_LIBS = kmodc++ kmod cc_kext cpp_kext $(VBOX_GCC_LIBGCC)
|
---|
2742 | endif
|
---|
2743 |
|
---|
2744 | ifeq ($(KBUILD_TARGET),solaris)
|
---|
2745 | ## The Solaris /usr/platform/i86pc/include and /usr/include directories.
|
---|
2746 | VBOX_SOLARIS_SYS_INCS ?= /usr/platform/i86pc/include /usr/include
|
---|
2747 |
|
---|
2748 | TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_GCC_TOOL)
|
---|
2749 | TEMPLATE_VBOXR0DRV_DEFS = _MACHDEP _KERNEL _STRICT_STDC IN_RING0 IN_RT_R0
|
---|
2750 | TEMPLATE_VBOXR0DRV_INCS = $(VBOX_SOLARIS_SYS_INCS)
|
---|
2751 | TEMPLATE_VBOXR0DRV_LDFLAGS = -r -dy
|
---|
2752 | TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -64
|
---|
2753 | # Exclude -Wall because of solaris headers' pragma ident warnings that gcc refuses to supress.
|
---|
2754 | TEMPLATE_VBOXR0DRV_CFLAGS = -Wpointer-arith -Winline $(VBOX_GCC_Wno-pointer-sign) \
|
---|
2755 | -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs \
|
---|
2756 | -Wshadow -Wuninitialized -Wunused-function -Wunused-label -Wunused-value -Wunused-variable \
|
---|
2757 | -Wformat -Wimplicit-int -Wimplicit-function-declaration -Werror-implicit-function-declaration -Wparentheses \
|
---|
2758 | -O2 -fno-omit-frame-pointer -ffreestanding -nodefaultlibs -fno-strict-aliasing -fno-common -std=c99
|
---|
2759 | TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
|
---|
2760 | TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow $(if $(VBOX_SOLARIS_10),,-msave-args) -mno-red-zone -mcmodel=kernel \
|
---|
2761 | -fno-reorder-blocks -fno-asynchronous-unwind-tables -funit-at-a-time
|
---|
2762 | TEMPLATE_VBOXR0DRV_CXXFLAGS = -Wpointer-arith -Winline $(VBOX_GCC_Wno-pointer-sign) \
|
---|
2763 | -Wshadow -Wuninitialized -Wunused-function -Wunused-label -Wunused-value -Wunused-variable \
|
---|
2764 | -Wformat \
|
---|
2765 | -O2 -nodefaultlibs -fno-omit-frame-pointer -fno-strict-aliasing -fno-common -fno-exceptions -fno-rtti
|
---|
2766 | TEMPLATE_VBOXR0DRV_CXXFLAGS.x86 = $(TEMPLATE_VBOXR0DRV_CFLAGS.x86)
|
---|
2767 | TEMPLATE_VBOXR0DRV_CXXFLAGS.amd64 = $(TEMPLATE_VBOXR0DRV_CFLAGS.amd64)
|
---|
2768 | endif # Solaris
|
---|
2769 |
|
---|
2770 | ifeq ($(KBUILD_TARGET),freebsd)
|
---|
2771 | # x86 FreeBSD (6.2 or something):
|
---|
2772 | # cc -O2 -fno-strict-aliasing -pipe -Werror -D_KERNEL -DKLD_MODULE \
|
---|
2773 | # -nostdinc -I- -I. -I@ -I@/contrib/altq -I@/../include -I/usr/include \
|
---|
2774 | # -finline-limit=8000 -fno-common -mno-align-long-strings -mpreferred-stack-boundary=2 \
|
---|
2775 | # -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -ffreestanding -Wall -Wredundant-decls -Wnested-externs \
|
---|
2776 | # -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -fformat-extensions \
|
---|
2777 | # -std=c99 -c ../my.c
|
---|
2778 | # ld -d -warn-common -r -d -o my.kld my.o
|
---|
2779 | # :> export_syms
|
---|
2780 | # awk -f /usr/src/sys/modules/my/../../conf/kmod_syms.awk my.kld export_syms | xargs -J% objcopy % my.kld
|
---|
2781 | # ld -Bsharable -d warn-commnon -o my.ko my.kld
|
---|
2782 | #
|
---|
2783 | # AMD64 FreeBSD (7.1):
|
---|
2784 | # cc -O2 -fno-strict-aliasing -pipe -D_KERNEL -DKLD_MODULE -std=c99 -nostdinc -I. -I@ -I@/contrib/altq \
|
---|
2785 | # -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-common \
|
---|
2786 | # -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx \
|
---|
2787 | # -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -ffreestanding \
|
---|
2788 | # -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign \
|
---|
2789 | # -fformat-extensions -c /usr/src/sys/modules/my/../../dev/my/if_my.c
|
---|
2790 | # ld -d -warn-common -r -d -o if_my.ko if_my.o
|
---|
2791 | # :> export_syms
|
---|
2792 | # awk -f /usr/src/sys/modules/my/../../conf/kmod_syms.awk if_my.ko export_syms | xargs -J% objcopy % if_my.ko
|
---|
2793 |
|
---|
2794 | # Note: @ -> /usr/src/sys and machine -> /usr/src/sys/i386/include
|
---|
2795 |
|
---|
2796 | ## The location of the FreeBSD kernel source.
|
---|
2797 | VBOX_FREEBSD_SRC ?= /usr/src/sys
|
---|
2798 | ## The FreeBSD /usr/include.
|
---|
2799 | VBOX_FREEBSD_SYS_INCS ?= /usr/include
|
---|
2800 |
|
---|
2801 | TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_GCC_TOOL)
|
---|
2802 | TEMPLATE_VBOXR0DRV_LDTOOL = FREEBSDKMODLD
|
---|
2803 | TEMPLATE_VBOXR0DRV_DEFS = _KERNEL KLD_MODULE IN_RING0 IN_RT_R0
|
---|
2804 | TEMPLATE_VBOXR0DRV_INCS = \
|
---|
2805 | $(VBOX_FREEBSD_SRC) \
|
---|
2806 | $(VBOX_FREEBSD_SRC)/contrib/altq \
|
---|
2807 | $(VBOX_FREEBSD_SRC)/../include \
|
---|
2808 | $(VBOX_FREEBSD_SYS_INCS)
|
---|
2809 | # omitting: -Wcast-qual, -Wredundant-decls
|
---|
2810 | TEMPLATE_VBOXR0DRV_CFLAGS = \
|
---|
2811 | $(VBOX_GCC_WARN) -Wpointer-arith -Winline $(VBOX_GCC_Wno-pointer-sign) \
|
---|
2812 | -Wstrict-prototypes -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs \
|
---|
2813 | -Wimplicit-function-declaration -Werror-implicit-function-declaration \
|
---|
2814 | -O2 -fformat-extensions -ffreestanding -fno-strict-aliasing -fno-common -finline-limit=8000 \
|
---|
2815 | $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \
|
---|
2816 | -nostdinc -std=c99
|
---|
2817 | TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2
|
---|
2818 | TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 --param inline-unit-growth=100 --param large-function-growth=1000 \
|
---|
2819 | -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx \
|
---|
2820 | -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -Wundef
|
---|
2821 | TEMPLATE_VBOXR0DRV_CXXFLAGS = -fno-exceptions -fno-rtti \
|
---|
2822 | $(VBOX_GCC_WARN) -Wpointer-arith -Winline \
|
---|
2823 | -O2 -fno-format-extensions -fno-strict-aliasing -fno-common -finline-limit=8000 \
|
---|
2824 | $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \
|
---|
2825 | -nostdinc
|
---|
2826 | TEMPLATE_VBOXR0DRV_CXXFLAGS.x86 = $(TEMPLATE_VBOXR0DRV_CFLAGS.x86)
|
---|
2827 | TEMPLATE_VBOXR0DRV_CXXFLAGS.amd64 = $(TEMPLATE_VBOXR0DRV_CFLAGS.amd64)
|
---|
2828 | TEMPLATE_VBOXR0DRV_SYSSUFF = .ko
|
---|
2829 | TEMPLATE_VBOXR0DRV_LDFLAGS = -d --warn-common
|
---|
2830 | TEMPLATE_VBOXR0DRV_LDFLAGS.x86 = -m elf_i386_fbsd
|
---|
2831 | TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -m elf_x86_64_fbsd
|
---|
2832 |
|
---|
2833 | TOOL_FREEBSDKMODLD = FreeBSD kernel module linker.
|
---|
2834 | # See kBuild/tools/GCC3.kmk for docs.
|
---|
2835 | TOOL_FREEBSDKMODLD_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map
|
---|
2836 | TOOL_FREEBSDKMODLD_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
|
---|
2837 | TOOL_FREEBSDKMODLD_LINK_SYSMOD_DEPORD =
|
---|
2838 | ifeq ($(KBUILD_TARGET_ARCH),amd64)
|
---|
2839 | TOOL_FREEBSDKMODLD_LINK_SYSMOD_OUTPUT =
|
---|
2840 | define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS
|
---|
2841 | # Link intermediate .kld (a relocatable object).
|
---|
2842 | ld $(flags) -r -o $(out) $(objs) \
|
---|
2843 | $(foreach p,$(libpath), -L$(p))\
|
---|
2844 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
|
---|
2845 | # Strip non-exported symbols private and localize the exported ones.
|
---|
2846 | awk -f $(VBOX_FREEBSD_SRC)/conf/kmod_syms.awk $(out) $(if $(othersrc), $(othersrc),/dev/null) \
|
---|
2847 | | xargs -J% objcopy % $(out)
|
---|
2848 |
|
---|
2849 | ## Strip debug info (comment out if debugging or something).
|
---|
2850 | objcopy --strip-debug $(out)
|
---|
2851 | endef
|
---|
2852 | else # x86
|
---|
2853 | TOOL_FREEBSDKMODLD_LINK_SYSMOD_OUTPUT = $(outbase).kld
|
---|
2854 | define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS
|
---|
2855 | # Link intermediate .kld (a relocatable object).
|
---|
2856 | ld $(flags) -r -o $(outbase).kld $(objs) \
|
---|
2857 | $(foreach p,$(libpath), -L$(p))\
|
---|
2858 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
|
---|
2859 | # Strip non-exported symbols private and localize the exported ones.
|
---|
2860 | awk -f $(VBOX_FREEBSD_SRC)/conf/kmod_syms.awk $(outbase).kld $(if $(othersrc), $(othersrc),/dev/null) \
|
---|
2861 | | xargs -J% objcopy % $(outbase).kld
|
---|
2862 |
|
---|
2863 | # Link the final .ko (a shared object).
|
---|
2864 | ld $(flags) -Bshareable -o $(out) $(outbase).kld
|
---|
2865 | endef
|
---|
2866 | endif # x86
|
---|
2867 |
|
---|
2868 | endif # FreeBSD
|
---|
2869 |
|
---|
2870 | ifdef VBOX_WITH_VBOXDRV
|
---|
2871 | ifndef TEMPLATE_VBOXR0DRV_TOOL
|
---|
2872 | $(warning Warning: VBox Build: Target $(KBUILD_HOST) is not officially supported!)
|
---|
2873 | endif
|
---|
2874 | endif
|
---|
2875 |
|
---|
2876 |
|
---|
2877 |
|
---|
2878 | #
|
---|
2879 | # Template for building R3 executables and static libraries which are linked into executables.
|
---|
2880 | # Note! This is the base template for a whole lot of other ones, so be careful when changing it.
|
---|
2881 | #
|
---|
2882 | TEMPLATE_VBOXR3EXE = VBox Ring 3 Exe
|
---|
2883 | TEMPLATE_VBOXR3EXE_ASTOOL = $(VBOX_ASTOOL)
|
---|
2884 | TEMPLATE_VBOXR3EXE_ASFLAGS.x86 = $(VBOX_ASFLAGS32)
|
---|
2885 | TEMPLATE_VBOXR3EXE_ASFLAGS.amd64 = $(VBOX_ASFLAGS64)
|
---|
2886 | TEMPLATE_VBOXR3EXE_DEFS = IN_RING3 $(ARCH_BITS_DEFS)
|
---|
2887 | TEMPLATE_VBOXR3EXE_LIBS.kprofile = $(LIB_KPROFILE)
|
---|
2888 | ifeq ($(KBUILD_TARGET),win)
|
---|
2889 | # TEMPLATE_VBOXR3EXE_TOOL = $(VBOX_VCC_TOOL)
|
---|
2890 | ifdef VBOX_USE_VCC70
|
---|
2891 | TEMPLATE_VBOXR3EXE_TOOL.win.x86 = $(VBOX_VCC_TOOL)
|
---|
2892 | TEMPLATE_VBOXR3EXE_TOOL.win.amd64 = VCC80AMD64
|
---|
2893 | else
|
---|
2894 | TEMPLATE_VBOXR3EXE_TOOL.win.x86 = $(VBOX_VCC_TOOL_STEM)X86
|
---|
2895 | TEMPLATE_VBOXR3EXE_TOOL.win.amd64 = $(VBOX_VCC_TOOL_STEM)AMD64
|
---|
2896 | endif
|
---|
2897 | TEMPLATE_VBOXR3EXE_RCDEFS = \
|
---|
2898 | VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
|
---|
2899 | VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
|
---|
2900 | VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
|
---|
2901 | VBOX_SVN_REV=\"$(VBOX_SVN_REV)\" \
|
---|
2902 | VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
|
---|
2903 | VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
|
---|
2904 | VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD) \
|
---|
2905 | VBOX_SVN_REV_NR=$(VBOX_SVN_REV)
|
---|
2906 | TEMPLATE_VBOXR3EXE_SDKS = WINPSDK
|
---|
2907 | ifndef VBOX_USE_VCC70
|
---|
2908 | TEMPLATE_VBOXR3EXE_CXXFLAGS = -Zi -Zl -GR- -EHsc -GF -MD$(VBOX_VCC_CRT_TYPE) -W3 -wd4065 -wd4244 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
2909 | TEMPLATE_VBOXR3EXE_CXXFLAGS.debug = -RTCsu
|
---|
2910 | else
|
---|
2911 | TEMPLATE_VBOXR3EXE_CXXFLAGS = -Zi -Zl -GR- -EHsc -GF -MD$(VBOX_VCC_CRT_TYPE) -W3 -wd4065 -wd4244 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
2912 | TEMPLATE_VBOXR3EXE_CXXFLAGS.debug = -GZ
|
---|
2913 | endif
|
---|
2914 | TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = -Gh -GH
|
---|
2915 | TEMPLATE_VBOXR3EXE_CFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS)
|
---|
2916 | TEMPLATE_VBOXR3EXE_CFLAGS.debug = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.debug)
|
---|
2917 | TEMPLATE_VBOXR3EXE_CFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile)
|
---|
2918 | TEMPLATE_VBOXR3EXE_LDFLAGS = \
|
---|
2919 | /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE /DEBUG \
|
---|
2920 | /DISALLOWLIB:libc.lib \
|
---|
2921 | /DISALLOWLIB:libcd.lib \
|
---|
2922 | /DISALLOWLIB:libcmt.lib \
|
---|
2923 | /DISALLOWLIB:libcmtd.lib \
|
---|
2924 | /DISALLOWLIB:msvcrt$(VBOX_VCC_CRT_TYPE_N).lib \
|
---|
2925 | /DISALLOWLIB:msvcprt$(VBOX_VCC_CRT_TYPE_N).lib
|
---|
2926 |
|
---|
2927 | TEMPLATE_VBOXR3EXE_LIBS.x86 = \
|
---|
2928 | $(PATH_TOOL_$(TEMPLATE_VBOXR3EXE_TOOL.win.x86)_LIB)/msvcrt$(VBOX_VCC_CRT_TYPE).lib \
|
---|
2929 | $(PATH_TOOL_$(TEMPLATE_VBOXR3EXE_TOOL.win.x86)_LIB)/msvcprt$(VBOX_VCC_CRT_TYPE).lib \
|
---|
2930 | $(PATH_TOOL_$(TEMPLATE_VBOXR3EXE_TOOL.win.x86)_LIB)/oldnames.lib
|
---|
2931 | TEMPLATE_VBOXR3EXE_LIBS.amd64 = \
|
---|
2932 | $(PATH_TOOL_$(TEMPLATE_VBOXR3EXE_TOOL.win.amd64)_LIB)/msvcrt$(VBOX_VCC_CRT_TYPE).lib \
|
---|
2933 | $(PATH_TOOL_$(TEMPLATE_VBOXR3EXE_TOOL.win.amd64)_LIB)/msvcprt$(VBOX_VCC_CRT_TYPE).lib \
|
---|
2934 | $(PATH_TOOL_$(TEMPLATE_VBOXR3EXE_TOOL.win.amd64)_LIB)/oldnames.lib
|
---|
2935 | TEMPLATE_VBOXR3EXE_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
|
---|
2936 | ifdef VBOX_USE_VCC100 # HACK ALERT!
|
---|
2937 | TEMPLATE_VBOXR3EXE_CINCS.win = $(TOOL_$(VBOX_VCC_TOOL)_CINCS)
|
---|
2938 | TEMPLATE_VBOXR3EXE_CXXINCS.win = $(TOOL_$(VBOX_VCC_TOOL)_CXXINCS)
|
---|
2939 | endif
|
---|
2940 |
|
---|
2941 | else # the gcc guys
|
---|
2942 | TEMPLATE_VBOXR3EXE_TOOL = $(VBOX_GCC_TOOL)
|
---|
2943 | TEMPLATE_VBOXR3EXE_CXXFLAGS = -g -pipe $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden)
|
---|
2944 | TEMPLATE_VBOXR3EXE_CXXFLAGS.x86 = -m32
|
---|
2945 | TEMPLATE_VBOXR3EXE_CXXFLAGS.amd64 = -m64
|
---|
2946 | TEMPLATE_VBOXR3EXE_CXXFLAGS.sparc32 = -m32
|
---|
2947 | TEMPLATE_VBOXR3EXE_CXXFLAGS.sparc64 = -m64
|
---|
2948 | # L4 currently can't handle exception handling.
|
---|
2949 | TEMPLATE_VBOXR3EXE_CXXFLAGS.l4 = -fno-exceptions -nostdinc \
|
---|
2950 | $(addprefix -I,$(VBOX_PATH_GCC_INCS) $(L4_INCDIR) $(FILE_TOOL_GPP3_INCDIR)) \
|
---|
2951 | $(DEBUG_L4)
|
---|
2952 | TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = -finstrument-functions
|
---|
2953 | TEMPLATE_VBOXR3EXE_CFLAGS = -g -pipe $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing $(VBOX_GCC_fvisibility-hidden)
|
---|
2954 | TEMPLATE_VBOXR3EXE_CFLAGS.x86 = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.x86)
|
---|
2955 | TEMPLATE_VBOXR3EXE_CFLAGS.amd64 = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.amd64)
|
---|
2956 | TEMPLATE_VBOXR3EXE_CFLAGS.sparc32 = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.sparc32)
|
---|
2957 | TEMPLATE_VBOXR3EXE_CFLAGS.sparc64 = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.sparc64)
|
---|
2958 | TEMPLATE_VBOXR3EXE_CFLAGS.debug = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.debug)
|
---|
2959 | TEMPLATE_VBOXR3EXE_CFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile)
|
---|
2960 | TEMPLATE_VBOXR3EXE_CFLAGS.l4 = -nostdinc \
|
---|
2961 | $(addprefix -I,$(VBOX_PATH_GCC_INCS) $(L4_INCDIR)) $(DEBUG_L4)
|
---|
2962 | TEMPLATE_VBOXR3EXE_OBJCFLAGS = $(TEMPLATE_VBOXR3EXE_CFLAGS)
|
---|
2963 | TEMPLATE_VBOXR3EXE_OBJCFLAGS.x86 = $(TEMPLATE_VBOXR3EXE_CFLAGS.x86)
|
---|
2964 | TEMPLATE_VBOXR3EXE_OBJCFLAGS.amd64 = $(TEMPLATE_VBOXR3EXE_CFLAGS.amd64)
|
---|
2965 | TEMPLATE_VBOXR3EXE_OBJCFLAGS.debug = $(TEMPLATE_VBOXR3EXE_CFLAGS.debug)
|
---|
2966 | TEMPLATE_VBOXR3EXE_OBJCFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CFLAGS.kprofile)
|
---|
2967 | TEMPLATE_VBOXR3EXE_OBJCXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS)
|
---|
2968 | TEMPLATE_VBOXR3EXE_OBJCXXFLAGS.x86 = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.x86)
|
---|
2969 | TEMPLATE_VBOXR3EXE_OBJCXXFLAGS.amd64 = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.amd64)
|
---|
2970 | TEMPLATE_VBOXR3EXE_OBJCXXFLAGS.debug = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.debug)
|
---|
2971 | TEMPLATE_VBOXR3EXE_OBJCXXFLAGS.kprofile= $(TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile)
|
---|
2972 | TEMPLATE_VBOXR3EXE_DEFS.l4 = L4_THREAD_SAFE
|
---|
2973 | TEMPLATE_VBOXR3EXE_LDFLAGS.x86 = -m32
|
---|
2974 | TEMPLATE_VBOXR3EXE_LDFLAGS.amd64 = -m64
|
---|
2975 | TEMPLATE_VBOXR3EXE_LDFLAGS.sparc32 = -m32
|
---|
2976 | TEMPLATE_VBOXR3EXE_LDFLAGS.sparc64 = -m64
|
---|
2977 | TEMPLATE_VBOXR3EXE_LDFLAGS.l4 = \
|
---|
2978 | $(L4_LIBDIR)/../crt0.o \
|
---|
2979 | -T$(L4_LIBDIR)/../main_dyn.ld -nostdlib \
|
---|
2980 | -Wl,--export-dynamic,--dynamic-linker=libld-l4.s.so \
|
---|
2981 | -Wl,--rpath-link,$(L4_LIBDIR)
|
---|
2982 | TEMPLATE_VBOXR3EXE_LDFLAGS.linux = -Wl,-z,noexecstack $(VBOX_LD_as_needed)
|
---|
2983 | ifeq ($(KBUILD_TARGET),linux)
|
---|
2984 | TEMPLATE_VBOXR3EXE_LIBS = pthread m rt dl
|
---|
2985 | else ifeq ($(KBUILD_TARGET),l4)
|
---|
2986 | TEMPLATE_VBOXR3EXE_LIBS = \
|
---|
2987 | $(L4_LIBDIR)/libvboxserver.s.so \
|
---|
2988 | $(L4_LIBDIR)/libuc++.0.s.so \
|
---|
2989 | supc++ gcc_eh gcc \
|
---|
2990 | $(L4_LIBDIR)/libdl.s.so \
|
---|
2991 | $(L4_LIBDIR)/libuc.0.s.so
|
---|
2992 | else ifeq ($(KBUILD_TARGET),os2)
|
---|
2993 | TEMPLATE_VBOXR3EXE_TOOL = GXX3OMF
|
---|
2994 | TEMPLATE_VBOXR3EXE_LIBS = socket iconv
|
---|
2995 | else ifeq ($(KBUILD_TARGET),darwin)
|
---|
2996 | TEMPLATE_VBOXR3EXE_TOOL = GXX4MACHO
|
---|
2997 | TEMPLATE_VBOXR3EXE_LIBS =
|
---|
2998 | TEMPLATE_VBOXR3EXE_DEFS.darwin = $(VBOX_DARWIN_DEF_SDK_DEFS)
|
---|
2999 | TEMPLATE_VBOXR3EXE_CFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_CFLAGS) -fno-common
|
---|
3000 | TEMPLATE_VBOXR3EXE_CXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_CXXFLAGS)
|
---|
3001 | TEMPLATE_VBOXR3EXE_OBJCFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_OBJCFLAGS)
|
---|
3002 | TEMPLATE_VBOXR3EXE_OBJCXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_OBJCXXFLAGS)
|
---|
3003 | TEMPLATE_VBOXR3EXE_LDFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_LDFLAGS)
|
---|
3004 | TEMPLATE_VBOXR3EXE_LDFLAGS.darwin.x86 = -read_only_relocs suppress
|
---|
3005 | else if1of ($(KBUILD_TARGET), freebsd netbsd openbsd)
|
---|
3006 | TEMPLATE_VBOXR3EXE_TOOL = GXX3
|
---|
3007 | TEMPLATE_VBOXR3EXE_LIBS = pthread
|
---|
3008 | TEMPLATE_VBOXR3EXE_INCS += \
|
---|
3009 | /usr/include \
|
---|
3010 | /usr/X11R6/include \
|
---|
3011 | /usr/local/include
|
---|
3012 | TEMPLATE_VBOXR3EXE_LIBPATH += \
|
---|
3013 | /usr/lib \
|
---|
3014 | /usr/X11R6/lib \
|
---|
3015 | /usr/local/lib
|
---|
3016 | else ifeq ($(KBUILD_TARGET),solaris)
|
---|
3017 | TEMPLATE_VBOXR3EXE_TOOL = GXX3PLAIN
|
---|
3018 | TEMPLATE_VBOXR3EXE_DEFS += LIBICONV_PLUG _REENTRANT # Avoid the GNU libiconv, for now at least.
|
---|
3019 | TEMPLATE_VBOXR3EXE_LIBS = rt socket
|
---|
3020 | else
|
---|
3021 | $(warning Warning: VBOX Build: Target $(KBUILD_TARGET) is not officially supported!)
|
---|
3022 | TEMPLATE_VBOXR3EXE_CXXFLAGS.profile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.release)
|
---|
3023 | TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.krelease)
|
---|
3024 | endif
|
---|
3025 | ifdef VBOX_WITH_RUNPATH
|
---|
3026 | TEMPLATE_VBOXR3EXE_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)'
|
---|
3027 | else ifdef VBOX_WITH_RELATIVE_RUNPATH
|
---|
3028 | TEMPLATE_VBOXR3EXE_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)'
|
---|
3029 | endif
|
---|
3030 | ifdef VBOX_WITH_ORIGIN
|
---|
3031 | TEMPLATE_VBOXR3EXE_LDFLAGS.linux += $(VBOX_GCC_ORIGIN_OPT)
|
---|
3032 | endif
|
---|
3033 | endif
|
---|
3034 |
|
---|
3035 | #
|
---|
3036 | # Template for building R3 shared objects / DLLs.
|
---|
3037 | # This is mostly identical to the VBOXR3EXE template. (Avoid PIC if possible!)
|
---|
3038 | # -
|
---|
3039 | TEMPLATE_VBOXR3 = VBox Ring 3 SO/DLLs
|
---|
3040 | TEMPLATE_VBOXR3_EXTENDS = VBOXR3EXE
|
---|
3041 | TEMPLATE_VBOXR3_LDFLAGS.l4 = $(L4_LIBDIR)/../crt0.s.o -T$(L4_LIBDIR)/../main_rel.ld -nostdlib
|
---|
3042 | TEMPLATE_VBOXR3_DEFS.l4 = $(TEMPLATE_VBOXR3EXE_DEFS.l4) __PIC__
|
---|
3043 | TEMPLATE_VBOXR3_DEFS.darwin = $(TEMPLATE_VBOXR3EXE_DEFS.darwin) PIC
|
---|
3044 | TEMPLATE_VBOXR3_LDFLAGS.darwin = $(TEMPLATE_VBOXR3EXE_LDFLAGS.darwin) \
|
---|
3045 | -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
|
---|
3046 | -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
|
---|
3047 | ifn1of ($(KBUILD_TARGET), darwin win os2)
|
---|
3048 | TEMPLATE_VBOXR3_DEFS = $(TEMPLATE_VBOXR3EXE_DEFS) PIC
|
---|
3049 | TEMPLATE_VBOXR3_CFLAGS = $(TEMPLATE_VBOXR3EXE_CFLAGS) -fPIC
|
---|
3050 | TEMPLATE_VBOXR3_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) -fPIC
|
---|
3051 | TEMPLATE_VBOXR3_LDFLAGS = $(TEMPLATE_VBOXR3EXE_LDFLAGS) -fPIC
|
---|
3052 | endif
|
---|
3053 |
|
---|
3054 | #
|
---|
3055 | # Temporary: Renaming the template and warnings will be errors (soon).
|
---|
3056 | #
|
---|
3057 | TEMPLATE_VBoxR3Dll += VBox ring-3 SO/DLLs, no warnings
|
---|
3058 | TEMPLATE_VBoxR3Dll_EXTENDS += VBOXR3
|
---|
3059 | TEMPLATE_VBoxR3Dll_EXTENDS_BY += appending
|
---|
3060 | ifeq ($(KBUILD_TARGET),win)
|
---|
3061 | TEMPLATE_VBoxR3Dll_CFLAGS += $(VBOX_VCC_WERR)
|
---|
3062 | TEMPLATE_VBoxR3Dll_CXXFLAGS += $(VBOX_VCC_WERR)
|
---|
3063 | TEMPLATE_VBoxR3Dll_LDFLAGS += $(VBOX_VCC_LD_WERR)
|
---|
3064 | else
|
---|
3065 | TEMPLATE_VBoxR3Dll_CFLAGS += $(VBOX_GCC_WERR)
|
---|
3066 | TEMPLATE_VBoxR3Dll_CXXFLAGS += $(VBOX_GCC_WERR)
|
---|
3067 | endif
|
---|
3068 |
|
---|
3069 | #
|
---|
3070 | # Template for building performance critical stuff with warnings-as-errors.
|
---|
3071 | # -
|
---|
3072 | TEMPLATE_VBoxR3DllNoPic = VBox ring-3 SO/DLLs without PIC, without warnings.
|
---|
3073 | TEMPLATE_VBoxR3DllNoPic_EXTENDS = VBOXR3
|
---|
3074 | if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), linux.x86 freebsd.x86)
|
---|
3075 | TEMPLATE_VBoxR3DllNoPic_DEFS = $(TEMPLATE_VBOXR3EXE_DEFS)
|
---|
3076 | TEMPLATE_VBoxR3DllNoPic_CFLAGS = $(TEMPLATE_VBOXR3EXE_CFLAGS) $(VBOX_GCC_WERR)
|
---|
3077 | TEMPLATE_VBoxR3DllNoPic_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) $(VBOX_GCC_WERR)
|
---|
3078 | TEMPLATE_VBoxR3DllNoPic_LDFLAGS = $(TEMPLATE_VBOXR3EXE_LDFLAGS)
|
---|
3079 | else ifeq ($(KBUILD_TARGET),win)
|
---|
3080 | TEMPLATE_VBoxR3DllNoPic_CFLAGS = $(TEMPLATE_VBOXR3_CFLAGS) $(VBOX_VCC_WERR)
|
---|
3081 | TEMPLATE_VBoxR3DllNoPic_CXXFLAGS = $(TEMPLATE_VBOXR3_CXXFLAGS) $(VBOX_VCC_WERR)
|
---|
3082 | TEMPLATE_VBoxR3DllNoPic_LDFLAGS = $(TEMPLATE_VBOXR3_LDFLAGS) $(VBOX_VCC_LD_WERR)
|
---|
3083 | else
|
---|
3084 | TEMPLATE_VBoxR3DllNoPic_CFLAGS = $(TEMPLATE_VBOXR3_CFLAGS) $(VBOX_GCC_WERR)
|
---|
3085 | TEMPLATE_VBoxR3DllNoPic_CXXFLAGS = $(TEMPLATE_VBOXR3_CXXFLAGS) $(VBOX_GCC_WERR)
|
---|
3086 | endif
|
---|
3087 |
|
---|
3088 | #
|
---|
3089 | # Template for building performance critical stuff without warnings-as-errors.
|
---|
3090 | # -
|
---|
3091 | TEMPLATE_VBoxR3DllWarnNoPic = VBox ring-3 SO/DLLs without PIC, with warnings.
|
---|
3092 | TEMPLATE_VBoxR3DllWarnNoPic_EXTENDS = VBOXR3
|
---|
3093 | if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), linux.x86 freebsd.x86)
|
---|
3094 | TEMPLATE_VBoxR3DllWarnNoPic_DEFS = $(TEMPLATE_VBOXR3EXE_DEFS)
|
---|
3095 | TEMPLATE_VBoxR3DllWarnNoPic_CFLAGS = $(TEMPLATE_VBOXR3EXE_CFLAGS)
|
---|
3096 | TEMPLATE_VBoxR3DllWarnNoPic_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS)
|
---|
3097 | TEMPLATE_VBoxR3DllWarnNoPic_LDFLAGS = $(TEMPLATE_VBOXR3EXE_LDFLAGS)
|
---|
3098 | endif
|
---|
3099 |
|
---|
3100 | #
|
---|
3101 | # Template for building static R3 executables and any static
|
---|
3102 | # libraries they link with.
|
---|
3103 | #
|
---|
3104 | TEMPLATE_VBOXR3STATIC = VBox Static Ring 3 EXE
|
---|
3105 | TEMPLATE_VBOXR3STATIC_EXTENDS = VBOXR3EXE
|
---|
3106 | ifeq ($(KBUILD_TARGET),win)
|
---|
3107 | TEMPLATE_VBOXR3STATIC_CFLAGS = $(filter-out -MD$(VBOX_VCC_CRT_TYPE), $(TEMPLATE_VBOXR3EXE_CFLAGS)) -MT$(VBOX_VCC_CRT_TYPE)
|
---|
3108 | TEMPLATE_VBOXR3STATIC_CXXFLAGS = $(filter-out -MD$(VBOX_VCC_CRT_TYPE), $(TEMPLATE_VBOXR3EXE_CFLAGS)) -MT$(VBOX_VCC_CRT_TYPE)
|
---|
3109 | TEMPLATE_VBOXR3STATIC_LDFLAGS = $(filter-out /DISALLOWLIB:libcmt$(VBOX_VCC_CRT_TYPE).lib /DISALLOWLIB:libcpmt$(VBOX_VCC_CRT_TYPE).lib, $(TEMPLATE_VBOXR3EXE_LDFLAGS)) \
|
---|
3110 | /DISALLOWLIB:msvcrt.lib \
|
---|
3111 | /DISALLOWLIB:msvcrtd.lib \
|
---|
3112 | /DISALLOWLIB:msvcprt.lib \
|
---|
3113 | /DISALLOWLIB:msvcprtd.lib
|
---|
3114 | TEMPLATE_VBOXR3STATIC_LIBS.x86 = \
|
---|
3115 | $(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.x86)_LIB)/oldnames.lib \
|
---|
3116 | $(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.x86)_LIB)/libcmt$(VBOX_VCC_CRT_TYPE).lib \
|
---|
3117 | $(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.x86)_LIB)/libcpmt$(VBOX_VCC_CRT_TYPE).lib
|
---|
3118 | TEMPLATE_VBOXR3STATIC_LIBS.amd64 = \
|
---|
3119 | $(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.amd64)_LIB)/libcmt$(VBOX_VCC_CRT_TYPE).lib \
|
---|
3120 | $(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.amd64)_LIB)/libcpmt$(VBOX_VCC_CRT_TYPE).lib \
|
---|
3121 | $(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.amd64)_LIB)/oldnames.lib
|
---|
3122 | else ifn1of ($(KBUILD_TARGET), darwin solaris)
|
---|
3123 | # The gcc guys sans darwin.
|
---|
3124 | TEMPLATE_VBOXR3STATIC_CFLAGS = $(TEMPLATE_VBOXR3EXE_CFLAGS) -static
|
---|
3125 | TEMPLATE_VBOXR3STATIC_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) -static
|
---|
3126 | TEMPLATE_VBOXR3STATIC_OBJCFLAGS = $(TEMPLATE_VBOXR3EXE_OBJCFLAGS) -static
|
---|
3127 | TEMPLATE_VBOXR3STATIC_OBJCXXFLAGS = $(TEMPLATE_VBOXR3EXE_OBJCXXFLAGS) -static
|
---|
3128 | TEMPLATE_VBOXR3STATIC_LDFLAGS = $(TEMPLATE_VBOXR3EXE_LDFLAGS) -static
|
---|
3129 | endif
|
---|
3130 |
|
---|
3131 | #
|
---|
3132 | # Temporary: Renaming the template and warnings will be errors (soon).
|
---|
3133 | #
|
---|
3134 | TEMPLATE_VBoxR3Static = New name for VBOXR3STATIC
|
---|
3135 | TEMPLATE_VBoxR3Static_EXTENDS = VBOXR3STATIC
|
---|
3136 | TEMPLATE_VBoxR3Static_EXTENDS_BY = appending
|
---|
3137 | ifeq ($(KBUILD_TARGET),win)
|
---|
3138 | TEMPLATE_VBoxR3Static_CFLAGS += $(VBOX_VCC_WERR)
|
---|
3139 | TEMPLATE_VBoxR3Static_CXXFLAGS += $(VBOX_VCC_WERR)
|
---|
3140 | TEMPLATE_VBoxR3Static_LDFLAGS += $(VBOX_VCC_LD_WERR)
|
---|
3141 | else
|
---|
3142 | TEMPLATE_VBoxR3Static_CFLAGS += $(VBOX_GCC_WERR)
|
---|
3143 | TEMPLATE_VBoxR3Static_CXXFLAGS += $(VBOX_GCC_WERR)
|
---|
3144 | endif
|
---|
3145 |
|
---|
3146 | #
|
---|
3147 | # Same as VBOXR3EXE but without C++ exceptions.
|
---|
3148 | #
|
---|
3149 | # VBOXR3EXE does C++ exceptions and may assumes that extern "C" functions
|
---|
3150 | # doesn't throw them. Use this template (and VBOXR3DLLNOXCPT) with care
|
---|
3151 | # and only where the C++ overhead is really unwanted.
|
---|
3152 | #
|
---|
3153 | TEMPLATE_VBOXR3EXENOXCPT = VBox Ring 3 Exe without C++ exception
|
---|
3154 | TEMPLATE_VBOXR3EXENOXCPT_EXTENDS = VBOXR3EXE
|
---|
3155 | ifeq ($(KBUILD_TARGET),win)
|
---|
3156 | TEMPLATE_VBOXR3EXENOXCPT_CFLAGS = $(filter-out -EH%,$(TEMPLATE_VBOXR3EXE_CFLAGS) ) -EHs-
|
---|
3157 | TEMPLATE_VBOXR3EXENOXCPT_CXXFLAGS = $(filter-out -EH%,$(TEMPLATE_VBOXR3EXE_CXXFLAGS)) -EHs-
|
---|
3158 | else
|
---|
3159 | TEMPLATE_VBOXR3EXENOXCPT_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) -fno-exceptions
|
---|
3160 | endif
|
---|
3161 |
|
---|
3162 | #
|
---|
3163 | # Same as VBOXR3 but without C++ exceptions.
|
---|
3164 | #
|
---|
3165 | TEMPLATE_VBOXR3DLLNOXCPT = VBox Ring 3 SO/DLLs without C++ exception
|
---|
3166 | TEMPLATE_VBOXR3DLLNOXCPT_EXTENDS = VBOXR3
|
---|
3167 | ifeq ($(KBUILD_TARGET),win)
|
---|
3168 | TEMPLATE_VBOXR3DLLNOXCPT_CFLAGS = $(filter-out -EH%,$(TEMPLATE_VBOXR3_CFLAGS) ) -EHs-
|
---|
3169 | TEMPLATE_VBOXR3DLLNOXCPT_CXXFLAGS = $(filter-out -EH%,$(TEMPLATE_VBOXR3_CXXFLAGS)) -EHs-
|
---|
3170 | else
|
---|
3171 | TEMPLATE_VBOXR3DLLNOXCPT_CXXFLAGS = $(TEMPLATE_VBOXR3_CXXFLAGS) -fno-exceptions
|
---|
3172 | endif
|
---|
3173 |
|
---|
3174 | #
|
---|
3175 | # Template for building hardened Ring-3 executables.
|
---|
3176 | # These shall have no extra runpaths, esp. not origin ones.
|
---|
3177 | #
|
---|
3178 | TEMPLATE_VBOXR3HARDENEDEXE = Hardened VBox Ring-3 EXE
|
---|
3179 | TEMPLATE_VBOXR3HARDENEDEXE_EXTENDS = VBOXR3EXE
|
---|
3180 | TEMPLATE_VBOXR3HARDENEDEXE_LIBS = $(VBOX_LIB_SUPHARDENED) $(TEMPLATE_VBOXR3EXE_LIBS)
|
---|
3181 | TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.darwin = $(TEMPLATE_VBOXR3EXE_LDFLAGS.darwin) -framework IOKit
|
---|
3182 | ifeq ($(KBUILD_TARGET),linux)
|
---|
3183 | # not necessary except USE_LIB_PCAP is defined in SUPR3HardenedMain.cpp
|
---|
3184 | # TEMPLATE_VBOXR3HARDENEDEXE_LIBS += cap
|
---|
3185 | endif
|
---|
3186 | ifn1of ($(KBUILD_TARGET), win os2)
|
---|
3187 | TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBOXR3EXE_LDFLAGS))
|
---|
3188 | TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.linux))
|
---|
3189 | endif
|
---|
3190 |
|
---|
3191 | #
|
---|
3192 | # Template for building hardened Ring-3 libraries.
|
---|
3193 | #
|
---|
3194 | TEMPLATE_VBOXR3HARDENEDLIB = Hardened VBox Ring-3 LIB
|
---|
3195 | TEMPLATE_VBOXR3HARDENEDLIB_EXTENDS = VBOXR3HARDENEDEXE
|
---|
3196 | TEMPLATE_VBOXR3HARDENEDLIB_LIBS = $(NO_SUCH_VARIABLE)
|
---|
3197 |
|
---|
3198 |
|
---|
3199 | #
|
---|
3200 | # Template for building set-uid-to-root helper programs.
|
---|
3201 | # In hardened builds, these may only contain absolute runpaths!
|
---|
3202 | #
|
---|
3203 | TEMPLATE_VBoxR3SetUidToRoot = Set-uid-to-root helper program.
|
---|
3204 | TEMPLATE_VBoxR3SetUidToRoot_EXTENDS = VBOXR3HARDENEDEXE
|
---|
3205 | TEMPLATE_VBoxR3SetUidToRoot_LIBS = $(NO_SUCH_VARIABLE)
|
---|
3206 | ifdef VBOX_WITH_RUNPATH
|
---|
3207 | TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)'
|
---|
3208 | endif
|
---|
3209 | ifndef VBOX_WITH_HARDENING
|
---|
3210 | ifdef VBOX_WITH_RELATIVE_RUNPATH
|
---|
3211 | TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)'
|
---|
3212 | endif
|
---|
3213 | ifdef VBOX_WITH_ORIGIN
|
---|
3214 | TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS.linux += $(VBOX_GCC_ORIGIN_OPT)
|
---|
3215 | endif
|
---|
3216 | endif
|
---|
3217 |
|
---|
3218 |
|
---|
3219 | #
|
---|
3220 | # Template for building R3 shared objects / DLLs with the 10.5 Mac OS X SDK.
|
---|
3221 | # Identical to VBOXR3EXE, except for the DYLIB, the classic_linker and SDK bits.
|
---|
3222 | #
|
---|
3223 | TEMPLATE_VBOXR3OSX105 = VBox Ring 3 SO/DLLs for OS X 10.5
|
---|
3224 | TEMPLATE_VBOXR3OSX105_EXTENDS = VBOXR3EXE
|
---|
3225 | TEMPLATE_VBOXR3OSX105_DEFS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_DEFS) PIC
|
---|
3226 | TEMPLATE_VBOXR3OSX105_CFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_CFLAGS) -fno-common
|
---|
3227 | TEMPLATE_VBOXR3OSX105_CXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_CXXFLAGS)
|
---|
3228 | TEMPLATE_VBOXR3OSX105_OBJCFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_OBJCFLAGS)
|
---|
3229 | TEMPLATE_VBOXR3OSX105_OBJCXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_OBJCFLAGS)
|
---|
3230 | TEMPLATE_VBOXR3OSX105_LDFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_LDFLAGS) \
|
---|
3231 | -read_only_relocs suppress \
|
---|
3232 | -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
|
---|
3233 | -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
|
---|
3234 |
|
---|
3235 |
|
---|
3236 | #
|
---|
3237 | # Ring-3 testcase, running automatically during the build.
|
---|
3238 | # This is the VBOXR3EXE template only with a different install dir.
|
---|
3239 | #
|
---|
3240 | TEMPLATE_VBOXR3AUTOTST = VBox Ring 3 Testcase Exe
|
---|
3241 | TEMPLATE_VBOXR3AUTOTST_EXTENDS = VBOXR3EXE
|
---|
3242 | TEMPLATE_VBOXR3AUTOTST_INST = $(INST_TESTCASE)
|
---|
3243 | TEMPLATE_VBOXR3AUTOTST_LIBS = $(TEMPLATE_VBOXR3EXE_LIBS)
|
---|
3244 | TEMPLATE_VBOXR3AUTOTST_LIBS.l4 = $(LIB_RUNTIME) $(TEMPLATE_VBOXR3EXE_LIBS.l4)
|
---|
3245 | ifeq ($(KBUILD_TARGET),win)
|
---|
3246 | ifdef VBOX_SIGNING_MODE
|
---|
3247 | TEMPLATE_VBOXR3AUTOTST_POST_CMDS =
|
---|
3248 | endif
|
---|
3249 | endif
|
---|
3250 |
|
---|
3251 | #
|
---|
3252 | # Ring-3 testcase.
|
---|
3253 | # This is the VBOXR3EXE template only with a different install dir.
|
---|
3254 | #
|
---|
3255 | TEMPLATE_VBOXR3TSTEXE = VBox Ring 3 Testcase Exe
|
---|
3256 | TEMPLATE_VBOXR3TSTEXE_EXTENDS = VBOXR3EXE
|
---|
3257 | TEMPLATE_VBOXR3TSTEXE_INST = $(INST_TESTCASE)
|
---|
3258 | TEMPLATE_VBOXR3TSTEXE_LIBS = $(LIB_RUNTIME) $(TEMPLATE_VBOXR3EXE_LIBS)
|
---|
3259 | ifdef VBOX_WITH_RUNPATH
|
---|
3260 | TEMPLATE_VBOXR3TSTEXE_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' $(TEMPLATE_VBOXR3EXE_LDFLAGS)
|
---|
3261 | else ifdef VBOX_WITH_RELATIVE_RUNPATH
|
---|
3262 | TEMPLATE_VBOXR3TSTEXE_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/..' $(TEMPLATE_VBOXR3EXE_LDFLAGS)
|
---|
3263 | endif
|
---|
3264 | ifeq ($(KBUILD_TARGET),win)
|
---|
3265 | ifdef VBOX_SIGNING_MODE
|
---|
3266 | TEMPLATE_VBOXR3TSTEXE_POST_CMDS =
|
---|
3267 | endif
|
---|
3268 | endif
|
---|
3269 |
|
---|
3270 | #
|
---|
3271 | # Ring-3 testcase (no -pedantic)
|
---|
3272 | #
|
---|
3273 | TEMPLATE_VBOXR3TSTNPEXE = VBox Ring 3 Testcase Exe Non-pedantic
|
---|
3274 | TEMPLATE_VBOXR3TSTNPEXE_EXTENDS = VBOXR3TSTEXE
|
---|
3275 | ifneq ($(KBUILD_TARGET),win) # (only gcc)
|
---|
3276 | TEMPLATE_VBOXR3TSTNPEXE_TOOL = $(VBOX_GCC_TOOL)
|
---|
3277 | TEMPLATE_VBOXR3TSTNPEXE_CXXFLAGS = $(filter-out -pedantic -Wshadow,$(TEMPLATE_VBOXR3TSTEXE_CXXFLAGS)) -Wno-sign-compare
|
---|
3278 | TEMPLATE_VBOXR3TSTNPEXE_CFLAGS = $(filter-out -pedantic -Wshadow -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations,$(TEMPLATE_VBOXR3TSTEXE_CFLAGS)) -Wno-sign-compare
|
---|
3279 | endif
|
---|
3280 |
|
---|
3281 |
|
---|
3282 | #
|
---|
3283 | # Template for the CppUnit kind of testcases.
|
---|
3284 | #
|
---|
3285 | TEMPLATE_VBOXCPPUNITEXE = VBox CppUnit Testcase Exe
|
---|
3286 | TEMPLATE_VBOXCPPUNITEXE_EXTENDS = VBOXR3TSTEXE
|
---|
3287 | ## @todo make a CPPUNIT SDK and add cppunit tools packages for windows, mac, solaris and OS/2.
|
---|
3288 | #TEMPLATE_VBOXCPPUNITEXE_SDKS = CPPUNIT -
|
---|
3289 | TEMPLATE_VBOXCPPUNITEXE_LIBS = \
|
---|
3290 | $(TEMPLATE_VBOXR3TSTEXE_LIBS) \
|
---|
3291 | cppunit
|
---|
3292 |
|
---|
3293 | #
|
---|
3294 | # Template for building bad C/C++ style R3 executables (no -pedantic).
|
---|
3295 | #
|
---|
3296 | TEMPLATE_VBOXR3NPEXE = VBox Ring 3 Non-pedantic
|
---|
3297 | TEMPLATE_VBOXR3NPEXE_EXTENDS = VBOXR3EXE
|
---|
3298 | ifneq ($(KBUILD_TARGET),win) # (only gcc)
|
---|
3299 | TEMPLATE_VBOXR3NPEXE_TOOL = $(VBOX_GCC_TOOL)
|
---|
3300 | TEMPLATE_VBOXR3NPEXE_CXXFLAGS = $(filter-out -pedantic -Wshadow,$(TEMPLATE_VBOXR3EXE_CXXFLAGS)) -Wno-sign-compare
|
---|
3301 | TEMPLATE_VBOXR3NPEXE_CFLAGS = $(filter-out -pedantic -Wshadow -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations,$(TEMPLATE_VBOXR3EXE_CFLAGS)) \
|
---|
3302 | -Wno-sign-compare -Werror-implicit-function-declaration
|
---|
3303 | endif
|
---|
3304 |
|
---|
3305 |
|
---|
3306 | #
|
---|
3307 | # Template for building bad C/C++ style R3 shared libraries / Dlls (no -pedantic).
|
---|
3308 | # (Same transformation as for VBOXR3NPEXE.)
|
---|
3309 | #
|
---|
3310 | TEMPLATE_VBOXR3NP= VBox Ring 3 Non-pedantic
|
---|
3311 | TEMPLATE_VBOXR3NP_EXTENDS = VBOXR3
|
---|
3312 | ifneq ($(KBUILD_TARGET),win) # (only gcc)
|
---|
3313 | TEMPLATE_VBOXR3NP_TOOL = $(VBOX_GCC_TOOL)
|
---|
3314 | TEMPLATE_VBOXR3NP_CXXFLAGS = $(filter-out -pedantic -Wshadow,$(TEMPLATE_VBOXR3_CXXFLAGS)) -Wno-sign-compare
|
---|
3315 | TEMPLATE_VBOXR3NP_CFLAGS = $(filter-out -pedantic -Wshadow -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations,$(TEMPLATE_VBOXR3_CFLAGS)) \
|
---|
3316 | -Wno-sign-compare -Werror-implicit-function-declaration
|
---|
3317 | endif
|
---|
3318 |
|
---|
3319 |
|
---|
3320 | #
|
---|
3321 | # Template for building libraries, shared libraries / modules
|
---|
3322 | # which only depends on IPRT for crt.
|
---|
3323 | #
|
---|
3324 | TEMPLATE_VBOXNOCRTGCC = VBox no-crt GCC libraries and modules, yasm/nasm.
|
---|
3325 | TEMPLATE_VBOXNOCRTGCC_DEFS = IN_RING3 IPRT_NO_CRT $(ARCH_BITS_DEFS)
|
---|
3326 | TEMPLATE_VBOXNOCRTGCC_ASDEFS = ASM_CALL64_GCC
|
---|
3327 | TEMPLATE_VBOXNOCRTGCC_CFLAGS = -nostdinc -fno-strict-aliasing -fno-math-errno $(VBOX_GCC_WARN) -Werror-implicit-function-declaration
|
---|
3328 | TEMPLATE_VBOXNOCRTGCC_CFLAGS.x86 = -m32
|
---|
3329 | TEMPLATE_VBOXNOCRTGCC_CFLAGS.amd64 = -m64 -mcmodel=medium -fno-common
|
---|
3330 | TEMPLATE_VBOXNOCRTGCC_CFLAGS.sparc32 = -m32
|
---|
3331 | TEMPLATE_VBOXNOCRTGCC_CFLAGS.sparc64 = -m64
|
---|
3332 | TEMPLATE_VBOXNOCRTGCC_CFLAGS.release = -O2 -fno-strict-aliasing
|
---|
3333 | TEMPLATE_VBOXNOCRTGCC_CFLAGS.profile = $(TEMPLATE_VBOXNOCRTGCC_CFLAGS.release)
|
---|
3334 | TEMPLATE_VBOXNOCRTGCC_CFLAGS.kprofile = $(TEMPLATE_VBOXNOCRTGCC_CFLAGS.release)
|
---|
3335 | TEMPLATE_VBOXNOCRTGCC_CFLAGS.darwin = -static
|
---|
3336 | TEMPLATE_VBOXNOCRTGCC_CXXFLAGS = $(TEMPLATE_VBOXNOCRTGCC_CFLAGS)
|
---|
3337 | TEMPLATE_VBOXNOCRTGCC_CXXFLAGS.$(KBUILD_TARGET) = $(TEMPLATE_VBOXNOCRTGCC_CFLAGS.$(KBUILD_TARGET))
|
---|
3338 | TEMPLATE_VBOXNOCRTGCC_CXXFLAGS.$(KBUILD_TARGET_ARCH) = $(TEMPLATE_VBOXNOCRTGCC_CFLAGS.$(KBUILD_TARGET_ARCH))
|
---|
3339 | TEMPLATE_VBOXNOCRTGCC_INCS = $(PATH_ROOT)/include/iprt/nocrt
|
---|
3340 |
|
---|
3341 | ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),win.amd64)
|
---|
3342 | # cross compile to 64-bit ELF (linux).
|
---|
3343 | TEMPLATE_VBOXNOCRTGCC_TOOL = XGCCAMD64LINUX
|
---|
3344 | TEMPLATE_VBOXNOCRTGCC_ASTOOL = YASM
|
---|
3345 | TEMPLATE_VBOXNOCRTGCC_ASFLAGS = -f elf64 -DASM_FORMAT_ELF -D__YASM__ -w+orphan-labels -g dwarf2
|
---|
3346 | TEMPLATE_VBOXNOCRTGCC_LIBS = $(PATH_DEVTOOLS)/win.x86/x86_64-unknown-linux-gnu/20060701-r2/lib/gcc/x86_64-unknown-linux-gnu/3.4.6/libgcc.a
|
---|
3347 | TEMPLATE_VBOXNOCRTGCC_LDFLAGS = -nostdlib
|
---|
3348 |
|
---|
3349 | else ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),win.x86)
|
---|
3350 | # Use the default GCC (MinGW) with the Microsoft linker.
|
---|
3351 | # (Drop all '-g' options as we're unable to strip the debug info.)
|
---|
3352 | TEMPLATE_VBOXNOCRTGCC_TOOL = $(VBOX_GCC_TOOL)
|
---|
3353 | TEMPLATE_VBOXNOCRTGCC_ASTOOL = $(VBOX_ASTOOL)
|
---|
3354 | TEMPLATE_VBOXNOCRTGCC_ASFLAGS = $(VBOX_ASFLAGS)
|
---|
3355 | TEMPLATE_VBOXNOCRTGCC_LDTOOL = $(VBOX_VCC_TOOL)
|
---|
3356 | TEMPLATE_VBOXNOCRTGCC_LDFLAGS = -Incremental:NO -MapInfo:Exports -NoD
|
---|
3357 | TEMPLATE_VBOXNOCRTGCC_LIBS = $(VBOX_GCC_LIBGCC)
|
---|
3358 | TEMPLATE_VBOXNOCRTGCC_CFLAGS := $(filter-out -g,$(TEMPLATE_VBOXNOCRTGCC_CFLAGS)) -s
|
---|
3359 |
|
---|
3360 | else
|
---|
3361 | # Use the default GCC.
|
---|
3362 | # The use of --exclude-libs ALL is to avoid confusing the linux ld.so.
|
---|
3363 | TEMPLATE_VBOXNOCRTGCC_TOOL = $(VBOX_GCC_TOOL)
|
---|
3364 | TEMPLATE_VBOXNOCRTGCC_ASTOOL = $(VBOX_ASTOOL)
|
---|
3365 | TEMPLATE_VBOXNOCRTGCC_ASFLAGS = $(VBOX_ASFLAGS)
|
---|
3366 | TEMPLATE_VBOXNOCRTGCC_CFLAGS += $(VBOX_GCC_fno-stack-protector)
|
---|
3367 | TEMPLATE_VBOXNOCRTGCC_CXXFLAGS += $(VBOX_GCC_fno-stack-protector)
|
---|
3368 | ifeq ($(KBUILD_TARGET_ARCH),amd64)
|
---|
3369 | # in 64-bit mode we'll build a sys-module (VBoxREM2).
|
---|
3370 | if1of ($(KBUILD_TARGET), darwin solaris)
|
---|
3371 | TEMPLATE_VBOXNOCRTGCC_LDFLAGS.solaris= -64 -r
|
---|
3372 | else
|
---|
3373 | TEMPLATE_VBOXNOCRTGCC_LDFLAGS = -nostdlib
|
---|
3374 | endif
|
---|
3375 | else # x86:
|
---|
3376 | TEMPLATE_VBOXNOCRTGCC_LDFLAGS = -nostdlib
|
---|
3377 | ifn1of ($(KBUILD_TARGET), os2 darwin solaris)
|
---|
3378 | TEMPLATE_VBOXNOCRTGCC_LDFLAGS += -Wl,--no-undefined
|
---|
3379 | endif
|
---|
3380 | endif # x86
|
---|
3381 | TEMPLATE_VBOXNOCRTGCC_LDFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_LDFLAGS)
|
---|
3382 | TEMPLATE_VBOXNOCRTGCC_LIBS = # FIXME - has unwind mess.
|
---|
3383 | endif
|
---|
3384 |
|
---|
3385 |
|
---|
3386 | #
|
---|
3387 | # Same as VBOXNOCRTGCC only it uses GAS as the assembler instead of yasm/nasm.
|
---|
3388 | #
|
---|
3389 | TEMPLATE_VBOXNOCRTGAS = VBox no-crt GCC libraries and modules, gas.
|
---|
3390 | TEMPLATE_VBOXNOCRTGAS_EXTENDS = VBOXNOCRTGCC
|
---|
3391 | TEMPLATE_VBOXNOCRTGAS_ASTOOL = $(TEMPLATE_VBOXNOCRTGCC_TOOL)
|
---|
3392 | ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),win.x86)
|
---|
3393 | TEMPLATE_VBOXNOCRTGAS_ASFLAGS = -s
|
---|
3394 | else
|
---|
3395 | TEMPLATE_VBOXNOCRTGAS_ASFLAGS = -g
|
---|
3396 | endif
|
---|
3397 | TEMPLATE_VBOXNOCRTGAS_ASFLAGS.x86 = -m32
|
---|
3398 | TEMPLATE_VBOXNOCRTGAS_ASFLAGS.amd64 = -m64
|
---|
3399 |
|
---|
3400 |
|
---|
3401 | #
|
---|
3402 | # Template for building executables that are part of the VBox Main component
|
---|
3403 | # (COM/XPCOM interface to VirtualBox).
|
---|
3404 | #
|
---|
3405 | TEMPLATE_VBOXMAINEXE = VBox Main Executable
|
---|
3406 | TEMPLATE_VBOXMAINEXE_ASTOOL = $(VBOX_ASTOOL)
|
---|
3407 | TEMPLATE_VBOXMAINEXE_ASFLAGS = $(VBOX_ASFLAGS)
|
---|
3408 | TEMPLATE_VBOXMAINEXE_DEFS = IN_RING3 UNICODE NDEBUG=1
|
---|
3409 | TEMPLATE_VBOXMAINEXE_DEFS.win = _UNICODE
|
---|
3410 | TEMPLATE_VBOXMAINEXE_RCDEFS = $(TEMPLATE_VBOXR3EXE_RCDEFS)
|
---|
3411 | TEMPLATE_VBOXMAINEXE_LIBS.kprofile = $(LIB_KPROFILE)
|
---|
3412 |
|
---|
3413 | ifeq ($(KBUILD_TARGET),win)
|
---|
3414 | TEMPLATE_VBOXMAINEXE_SDKS = WINPSDK $(VBOX_WINDDK)
|
---|
3415 | # Note: C4250 is the dominance warning, see r32789.
|
---|
3416 | # C4065 is about default only switches.
|
---|
3417 | # C4996 is about deprected function (CRT only?).
|
---|
3418 | ifndef VBOX_USE_VCC70
|
---|
3419 | TEMPLATE_VBOXMAINEXE_TOOL = $(VBOX_VCC_TOOL)
|
---|
3420 | TEMPLATE_VBOXMAINEXE_CXXFLAGS = -Zi -Zl -GR -EHsc -GF -MD$(VBOX_VCC_CRT_TYPE) -W3 -wd4065 -wd4996 -wd4250 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
3421 | TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug = -RTCsu
|
---|
3422 | else
|
---|
3423 | TEMPLATE_VBOXMAINEXE_TOOL = VCC70
|
---|
3424 | TEMPLATE_VBOXMAINEXE_CXXFLAGS = -Zi -Zl -GR -EHsc -GF -MD$(VBOX_VCC_CRT_TYPE) -W3 -wd4065 -wd4250 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
3425 | TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug = -GZ
|
---|
3426 | endif
|
---|
3427 | TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile = -Gh -GH
|
---|
3428 | TEMPLATE_VBOXMAINEXE_CFLAGS = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS)
|
---|
3429 | TEMPLATE_VBOXMAINEXE_CFLAGS.debug = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug)
|
---|
3430 | TEMPLATE_VBOXMAINEXE_CFLAGS.kprofile = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile)
|
---|
3431 | TEMPLATE_VBOXMAINEXE_INCS += \
|
---|
3432 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC)
|
---|
3433 | TEMPLATE_VBOXMAINEXE_LDFLAGS = \
|
---|
3434 | /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE /DEBUG\
|
---|
3435 | /DISALLOWLIB:libc.lib \
|
---|
3436 | /DISALLOWLIB:libcd.lib \
|
---|
3437 | /DISALLOWLIB:libcmt.lib \
|
---|
3438 | /DISALLOWLIB:libcmtd.lib \
|
---|
3439 | /DISALLOWLIB:msvcrt$(VBOX_VCC_CRT_TYPE_N).lib \
|
---|
3440 | /DISALLOWLIB:msvcprt$(VBOX_VCC_CRT_TYPE_N).lib
|
---|
3441 | TEMPLATE_VBOXMAINEXE_LIBS = \
|
---|
3442 | $(LIB_RUNTIME) \
|
---|
3443 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt$(VBOX_VCC_CRT_TYPE).lib \
|
---|
3444 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt$(VBOX_VCC_CRT_TYPE).lib \
|
---|
3445 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \
|
---|
3446 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls$(VBOX_VCC_CRT_TYPE).lib
|
---|
3447 | TEMPLATE_VBOXMAINEXE_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
|
---|
3448 | ifdef VBOX_USE_VCC100 # HACK ALERT!
|
---|
3449 | TEMPLATE_VBOXMAINEXE_CINCS = $(TOOL_$(VBOX_VCC_TOOL)_CINCS)
|
---|
3450 | TEMPLATE_VBOXMAINEXE_CXXINCS = $(TOOL_$(VBOX_VCC_TOOL)_CXXINCS)
|
---|
3451 | endif
|
---|
3452 |
|
---|
3453 | else # the GCC guys:
|
---|
3454 |
|
---|
3455 | TEMPLATE_VBOXMAINEXE_TOOL = $(VBOX_GCC_TOOL)
|
---|
3456 | TEMPLATE_VBOXMAINEXE_CXXFLAGS = -g -pipe \
|
---|
3457 | $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) -Wno-long-long -Wno-non-virtual-dtor -Wshadow \
|
---|
3458 | -fshort-wchar -fpermissive -fexceptions -frtti $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing \
|
---|
3459 | $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden)
|
---|
3460 | TEMPLATE_VBOXMAINEXE_CXXFLAGS.x86 = -m32
|
---|
3461 | TEMPLATE_VBOXMAINEXE_CXXFLAGS.amd64 = -m64
|
---|
3462 | TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile = -finstrument-functions
|
---|
3463 | TEMPLATE_VBOXMAINEXE_CFLAGS = -g -pipe $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC_Wno-variadic-macros) \
|
---|
3464 | $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing $(VBOX_GCC_fvisibility-hidden)
|
---|
3465 | TEMPLATE_VBOXMAINEXE_CFLAGS.x86 = -m32
|
---|
3466 | TEMPLATE_VBOXMAINEXE_CFLAGS.amd64 = -m64
|
---|
3467 | TEMPLATE_VBOXMAINEXE_CFLAGS.kprofile = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile)
|
---|
3468 | TEMPLATE_VBOXMAINEXE_OBJCFLAGS = $(TEMPLATE_VBOXMAINEXE_CFLAGS)
|
---|
3469 | TEMPLATE_VBOXMAINEXE_OBJCFLAGS.x86 = $(TEMPLATE_VBOXMAINEXE_CFLAGS.x86)
|
---|
3470 | TEMPLATE_VBOXMAINEXE_OBJCFLAGS.amd64 = $(TEMPLATE_VBOXMAINEXE_CFLAGS.amd64)
|
---|
3471 | TEMPLATE_VBOXMAINEXE_OBJCFLAGS.kprofile = $(TEMPLATE_VBOXMAINEXE_CFLAGS.kprofile)
|
---|
3472 | TEMPLATE_VBOXMAINEXE_OBJCXXFLAGS = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS)
|
---|
3473 | TEMPLATE_VBOXMAINEXE_OBJCXXFLAGS.x86 = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.x86)
|
---|
3474 | TEMPLATE_VBOXMAINEXE_OBJCXXFLAGS.amd64 = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.amd64)
|
---|
3475 | TEMPLATE_VBOXMAINEXE_OBJCXXFLAGS.kprofile= $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile)
|
---|
3476 | TEMPLATE_VBOXMAINEXE_LDFLAGS.x86 = -m32
|
---|
3477 | TEMPLATE_VBOXMAINEXE_LDFLAGS.amd64 = -m64
|
---|
3478 | ifeq ($(KBUILD_TARGET),linux)
|
---|
3479 | TEMPLATE_VBOXMAINEXE_LIBS = pthread m rt $(LIB_RUNTIME) dl
|
---|
3480 | TEMPLATE_VBOXMAINEXE_LDFLAGS.linux = $(VBOX_LD_as_needed)
|
---|
3481 | else ifeq ($(KBUILD_TARGET),l4)
|
---|
3482 | TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME)
|
---|
3483 | # no libs as yet in l4 target - must be added later
|
---|
3484 | else ifeq ($(KBUILD_TARGET),os2)
|
---|
3485 | TEMPLATE_VBOXMAINEXE_TOOL = GXX3OMF
|
---|
3486 | TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME)
|
---|
3487 | else ifeq ($(KBUILD_TARGET),darwin)
|
---|
3488 | TEMPLATE_VBOXMAINEXE_TOOL = GXX4MACHO
|
---|
3489 | TEMPLATE_VBOXMAINEXE_DEFS += $(VBOX_DARWIN_DEF_SDK_DEFS)
|
---|
3490 | TEMPLATE_VBOXMAINEXE_CFLAGS += $(VBOX_DARWIN_DEF_SDK_CFLAGS)
|
---|
3491 | TEMPLATE_VBOXMAINEXE_CXXFLAGS += $(VBOX_DARWIN_DEF_SDK_CXXFLAGS)
|
---|
3492 | TEMPLATE_VBOXMAINEXE_OBJCFLAGS += $(VBOX_DARWIN_DEF_SDK_OBJCFLAGS)
|
---|
3493 | TEMPLATE_VBOXMAINEXE_OBJCXXFLAGS += $(VBOX_DARWIN_DEF_SDK_OBJCXXFLAGS)
|
---|
3494 | TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin += -bind_at_load
|
---|
3495 | TEMPLATE_VBOXMAINEXE_LDFLAGS += $(VBOX_DARWIN_DEF_SDK_LDFLAGS) -framework Carbon
|
---|
3496 | TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME)
|
---|
3497 | else if1of ($(KBUILD_TARGET), freebsd netbsd openbsd)
|
---|
3498 | TEMPLATE_VBOXMAINEXE_TOOL = GXX3
|
---|
3499 | TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME)
|
---|
3500 | TEMPLATE_VBOXMAINEXE_INCS += \
|
---|
3501 | /usr/include \
|
---|
3502 | /usr/X11R6/include \
|
---|
3503 | /usr/local/include
|
---|
3504 | TEMPLATE_VBOXMAINEXE_LIBPATH += \
|
---|
3505 | /usr/lib \
|
---|
3506 | /usr/X11R6/lib \
|
---|
3507 | /usr/local/lib
|
---|
3508 | else ifeq ($(KBUILD_TARGET),solaris)
|
---|
3509 | TEMPLATE_VBOXMAINEXE_TOOL = GXX3PLAIN
|
---|
3510 | TEMPLATE_VBOXMAINEXE_DEFS += _REENTRANT
|
---|
3511 | TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) rt thread
|
---|
3512 | else
|
---|
3513 | $(warning Warning: VBOX Build: Target $(KBUILD_TARGET) is not officially supported!)
|
---|
3514 | TEMPLATE_VBOXMAINEXE_LIBS =
|
---|
3515 | endif
|
---|
3516 | ifdef VBOX_WITH_RUNPATH
|
---|
3517 | TEMPLATE_VBOXMAINEXE_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)'
|
---|
3518 | else ifdef VBOX_WITH_RELATIVE_RUNPATH
|
---|
3519 | TEMPLATE_VBOXMAINEXE_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)'
|
---|
3520 | endif
|
---|
3521 | ifdef VBOX_WITH_ORIGIN
|
---|
3522 | TEMPLATE_VBOXMAINEXE_LDFLAGS.linux += $(VBOX_GCC_ORIGIN_OPT)
|
---|
3523 | endif
|
---|
3524 |
|
---|
3525 | endif # !win
|
---|
3526 |
|
---|
3527 | # Add COM/XPCOM stuff
|
---|
3528 | TEMPLATE_VBOXMAINEXE_LIBS += \
|
---|
3529 | $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB)
|
---|
3530 | ifdef VBOX_WITH_XPCOM
|
---|
3531 | ## @todo may be worth creating the VBOX_XPCOM SDK def
|
---|
3532 | TEMPLATE_VBOXMAINEXE_DEFS += VBOX_WITH_XPCOM
|
---|
3533 | ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
|
---|
3534 | TEMPLATE_VBOXMAINEXE_DEFS += VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
|
---|
3535 | endif
|
---|
3536 | TEMPLATE_VBOXMAINEXE_INCS += \
|
---|
3537 | $(VBOX_XPCOM_INCS)
|
---|
3538 | TEMPLATE_VBOXMAINEXE_LIBS += \
|
---|
3539 | $(LIB_XPCOM)
|
---|
3540 | TEMPLATE_VBOXMAINEXE_INTERMEDIATES += \
|
---|
3541 | $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
|
---|
3542 |
|
---|
3543 | else # COM
|
---|
3544 | TEMPLATE_VBOXMAINEXE_INCS += \
|
---|
3545 | $(VBOX_PATH_SDK)/bindings/mscom/include
|
---|
3546 | TEMPLATE_VBOXMAINEXE_INTERMEDIATES += \
|
---|
3547 | $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h
|
---|
3548 | endif # COM
|
---|
3549 |
|
---|
3550 | #
|
---|
3551 | # Template for building the Main DLL modules (such as in-process COM/XPCOM
|
---|
3552 | # components for Main).
|
---|
3553 | #
|
---|
3554 | # This differs from VBOXMAINEXE only in PIC handling and similar DLL stuff.
|
---|
3555 | #
|
---|
3556 | TEMPLATE_VBOXMAINDLL = VBox Main Component (shared library)
|
---|
3557 | TEMPLATE_VBOXMAINDLL_EXTENDS = VBOXMAINEXE
|
---|
3558 | ifn1of ($(KBUILD_TARGET), darwin os2 win)
|
---|
3559 | TEMPLATE_VBOXMAINDLL_DEFS = PIC $(TEMPLATE_VBOXMAINEXE_DEFS)
|
---|
3560 | TEMPLATE_VBOXMAINDLL_CFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_CFLAGS)
|
---|
3561 | TEMPLATE_VBOXMAINDLL_CXXFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_CXXFLAGS)
|
---|
3562 | TEMPLATE_VBOXMAINDLL_LDFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_LDFLAGS)
|
---|
3563 | endif
|
---|
3564 | TEMPLATE_VBOXMAINDLL_LDFLAGS.darwin = $(filter-out -bind_at_load,$(TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin)) \
|
---|
3565 | -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
|
---|
3566 | -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
|
---|
3567 |
|
---|
3568 | #
|
---|
3569 | # Template identical to VBOXMAINDLL except for where the stuff is
|
---|
3570 | # installed when using XPCOM (components/).
|
---|
3571 | #
|
---|
3572 | # Note! In the hardened build this gets a bit ugly since $ORIGIN/..
|
---|
3573 | # doesn't work. So, we keep the $ORIGIN from VBOXMAINEXE and let
|
---|
3574 | # the installers do the necessary .so symlinking.
|
---|
3575 | #
|
---|
3576 | # (No difference when building against COM on Windows.)
|
---|
3577 | #
|
---|
3578 | TEMPLATE_VBOXMAINCOMP = VBox Main COM/XPCOM Component (shared library)
|
---|
3579 | TEMPLATE_VBOXMAINCOMP_EXTENDS = VBOXMAINEXE
|
---|
3580 | ifn1of ($(KBUILD_TARGET), win)
|
---|
3581 | TEMPLATE_VBOXMAINCOMP_INST = $(INST_BIN)components/
|
---|
3582 | endif
|
---|
3583 | ifneq ($(KBUILD_TARGET),win)
|
---|
3584 | ifeq ($(filter-out solaris.x86 %.amd64 %.sparc32 %.sparc64,$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)),) ## TODO: cleanup!
|
---|
3585 | TEMPLATE_VBOXMAINCOMP_DEFS = PIC $(TEMPLATE_VBOXMAINEXE_DEFS)
|
---|
3586 | TEMPLATE_VBOXMAINCOMP_CFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_CFLAGS)
|
---|
3587 | TEMPLATE_VBOXMAINCOMP_CXXFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_CXXFLAGS)
|
---|
3588 | if defined(VBOX_WITH_RELATIVE_RUNPATH) && !defined(VBOX_WITH_HARDENING)
|
---|
3589 | TEMPLATE_VBOXMAINCOMP_LDFLAGS = -fPIC $(filter-out '$(VBOX_GCC_RPATH_OPT)%',$(TEMPLATE_VBOXMAINEXE_LDFLAGS)) '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/..'
|
---|
3590 | else
|
---|
3591 | TEMPLATE_VBOXMAINCOMP_LDFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_LDFLAGS)
|
---|
3592 | endif
|
---|
3593 | else ifndef VBOX_WITH_HARDENING
|
---|
3594 | ifdef VBOX_WITH_RELATIVE_RUNPATH
|
---|
3595 | TEMPLATE_VBOXMAINCOMP_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%',$(TEMPLATE_VBOXMAINEXE_LDFLAGS)) '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/..'
|
---|
3596 | endif
|
---|
3597 | endif
|
---|
3598 | endif
|
---|
3599 | TEMPLATE_VBOXMAINCOMP_LDFLAGS.darwin = $(filter-out -bind_at_load,$(TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin)) \
|
---|
3600 | -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
|
---|
3601 | -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
|
---|
3602 |
|
---|
3603 | #
|
---|
3604 | # Template for building the Main static libraries.
|
---|
3605 | #
|
---|
3606 | # This differs from VBOXMAINDLL only that it zeroes out the _LIBS definition.
|
---|
3607 | #
|
---|
3608 | TEMPLATE_VBOXMAINLIB = VBox Main Component (static library)
|
---|
3609 | TEMPLATE_VBOXMAINLIB_EXTENDS = VBOXMAINDLL
|
---|
3610 | TEMPLATE_VBOXMAINLIB_LIBS =
|
---|
3611 |
|
---|
3612 | #
|
---|
3613 | # Template for building executables that use the VBox Main component.
|
---|
3614 | #
|
---|
3615 | TEMPLATE_VBOXMAINCLIENTEXE = VBox Main Client (executable)
|
---|
3616 | TEMPLATE_VBOXMAINCLIENTEXE_EXTENDS = VBOXMAINEXE
|
---|
3617 | ifeq ($(KBUILD_TARGET),win)
|
---|
3618 | TEMPLATE_VBOXMAINCLIENTEXE_LIBS.win = $(TEMPLATE_VBOXMAINEXE_LIBS.win) \
|
---|
3619 | $(PATH_SDK_WINPSDK_LIB)/User32.Lib \
|
---|
3620 | $(PATH_SDK_WINPSDK_LIB)/Shell32.Lib \
|
---|
3621 | $(PATH_SDK_WINPSDK_LIB)/ShLwApi.Lib \
|
---|
3622 | $(PATH_SDK_WINPSDK_LIB)/Ole32.Lib \
|
---|
3623 | $(PATH_SDK_WINPSDK_LIB)/OleAut32.Lib \
|
---|
3624 | $(PATH_SDK_WINPSDK_LIB)/Uuid.Lib
|
---|
3625 | else
|
---|
3626 | TEMPLATE_VBOXMAINCLIENTEXE_DEFS = $(TEMPLATE_VBOXMAINEXE_DEFS) \
|
---|
3627 | NDEBUG TRIMMED
|
---|
3628 | TEMPLATE_VBOXMAINCLIENTEXE_CXXFLAGS.linux = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.linux) \
|
---|
3629 | -pthread
|
---|
3630 | endif
|
---|
3631 |
|
---|
3632 | #
|
---|
3633 | # Template for building shared libraries / DLLs that use the VBox Main component.
|
---|
3634 | #
|
---|
3635 | # This differs from VBOXMAINCLIENTEXE only in PIC handling and similar DLL stuff.
|
---|
3636 | #
|
---|
3637 | TEMPLATE_VBOXMAINCLIENTDLL = VBox MAIN Client (shared library)
|
---|
3638 | TEMPLATE_VBOXMAINCLIENTDLL_EXTENDS = VBOXMAINCLIENTEXE
|
---|
3639 | ifn1of ($(KBUILD_TARGET), darwin os2 win)
|
---|
3640 | TEMPLATE_VBOXMAINCLIENTDLL_DEFS = PIC $(TEMPLATE_VBOXMAINCLIENTEXE_DEFS)
|
---|
3641 | TEMPLATE_VBOXMAINCLIENTDLL_CFLAGS = -fPIC $(TEMPLATE_VBOXMAINCLIENTEXE_CFLAGS)
|
---|
3642 | TEMPLATE_VBOXMAINCLIENTDLL_CXXFLAGS = -fPIC $(TEMPLATE_VBOXMAINCLIENTEXE_CXXFLAGS)
|
---|
3643 | TEMPLATE_VBOXMAINCLIENTDLL_LDFLAGS = -fPIC $(TEMPLATE_VBOXMAINCLIENTEXE_LDFLAGS)
|
---|
3644 | endif
|
---|
3645 | TEMPLATE_VBOXMAINCLIENTDLL_LDFLAGS.darwin = $(filter-out -bind_at_load,$(TEMPLATE_VBOXMAINCLIENTEXE_LDFLAGS.darwin))
|
---|
3646 |
|
---|
3647 |
|
---|
3648 |
|
---|
3649 | #
|
---|
3650 | # Templates used for building the extension packs.
|
---|
3651 | #
|
---|
3652 | ifdef VBOX_WITH_EXTPACK
|
---|
3653 | # Base templates (native or portable).
|
---|
3654 | TEMPLATE_VBoxR3ExtPack = For the ring-3 context extension pack modules.
|
---|
3655 | if 1 # Native for now.
|
---|
3656 | TEMPLATE_VBoxR3ExtPack_EXTENDS = VBOXR3DLLNOXCPT
|
---|
3657 | TEMPLATE_VBoxR3ExtPack_DEFS = $(TEMPLATE_VBOXR3DLLNOXCPT_DEFS) VBOX_IN_EXTPACK VBOX_IN_EXTPACK_R3
|
---|
3658 | else
|
---|
3659 | TEMPLATE_VBoxR3ExtPack_EXTENDS = VBOXNOCRTGCC
|
---|
3660 | TEMPLATE_VBoxR3ExtPack_DEFS = $(TEMPLATE_VBOXNOCRTGCC_DEFS) VBOX_IN_EXTPACK VBOX_IN_EXTPACK_R3 IPRT_NO_CRT IN_RING3
|
---|
3661 | TEMPLATE_VBoxR3ExtPack_INCS = $(PATH_ROOT)/include/iprt/nocrt $(TEMPLATE_VBOXR3DLLNOXCPT_INCS)
|
---|
3662 | endif
|
---|
3663 | ifneq ($(KBUILD_TARGET),win)
|
---|
3664 | TEMPLATE_VBoxR3ExtPack_CXXFLAGS = $(TEMPLATE_VBOXR3DLLNOXCPT_CXXFLAGS) -fno-rtti
|
---|
3665 | endif
|
---|
3666 | TEMPLATE_VBoxR3ExtPack_INST = $(INST_EXTPACK)YouShallOverrideThis/
|
---|
3667 | ifeq ($(KBUILD_TARGET),linux)
|
---|
3668 | TEMPLATE_VBoxR3ExtPack_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)', $(TEMPLATE_VBOXR3DLLNOXCPT_LDFLAGS))
|
---|
3669 | else
|
---|
3670 | if !defined(VBOX_WITH_RUNPATH) && defined(VBOX_WITH_RELATIVE_RUNPATH)
|
---|
3671 | TEMPLATE_VBoxR3ExtPack_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/../../..' $(filter-out '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)', $(TEMPLATE_VBOXR3DLLNOXCPT_LDFLAGS))
|
---|
3672 | endif
|
---|
3673 | endif
|
---|
3674 | ifdef VBOX_ONLY_EXTPACKS_USE_IMPLIBS
|
---|
3675 | if1of ($(KBUILD_TARGET), win os2)
|
---|
3676 | TEMPLATE_VBoxR3ExtPack_LIBS = \
|
---|
3677 | $(TEMPLATE_LIBS_VBOXR3) \
|
---|
3678 | $(PATH_LIB)/VMMR3Imp$(VBOX_SUFF_LIB) \
|
---|
3679 | $(PATH_LIB)/VBoxRTImp$(VBOX_SUFF_LIB)
|
---|
3680 | else
|
---|
3681 | TEMPLATE_VBoxR3ExtPack_LIBS = \
|
---|
3682 | $(TEMPLATE_LIBS_VBOXR3) \
|
---|
3683 | $(PATH_LIB)/VMMR3Imp$(VBOX_SUFF_DLL) \
|
---|
3684 | $(PATH_LIB)/VBoxRTImp$(VBOX_SUFF_DLL)
|
---|
3685 | endif
|
---|
3686 | else
|
---|
3687 | TEMPLATE_VBoxR3ExtPack_LIBS = \
|
---|
3688 | $(TEMPLATE_LIBS_VBOXR3) \
|
---|
3689 | $(LIB_RUNTIME) \
|
---|
3690 | $(LIB_VMM)
|
---|
3691 | endif
|
---|
3692 |
|
---|
3693 | TEMPLATE_VBoxR0ExtPack = For the ring-0 context extension pack modules.
|
---|
3694 | TEMPLATE_VBoxR0ExtPack_EXTENDS = VBoxR0
|
---|
3695 | TEMPLATE_VBoxR0ExtPack_EXTENDS_BY = appending
|
---|
3696 | TEMPLATE_VBoxR0ExtPack_INST = $(INST_EXTPACK)YouShallOverrideThis/
|
---|
3697 | TEMPLATE_VBoxR0ExtPack_DEFS = VBOX_IN_EXTPACK VBOX_IN_EXTPACK_R0
|
---|
3698 | if1of ($(VBOX_LDR_FMT), pe lx)
|
---|
3699 | TEMPLATE_VBoxR0ExtPack_LIBS = \
|
---|
3700 | $(PATH_LIB)/VMMR0Imp$(VBOX_SUFF_LIB) \
|
---|
3701 | $(PATH_LIB)/SUPR0$(VBOX_SUFF_LIB)
|
---|
3702 | endif
|
---|
3703 |
|
---|
3704 | TEMPLATE_VBoxRcExtPack = For the raw-mode context extension pack modules.
|
---|
3705 | TEMPLATE_VBoxRcExtPack_EXTENDS = VBoxRc
|
---|
3706 | TEMPLATE_VBoxRcExtPack_EXTENDS_BY = appending
|
---|
3707 | TEMPLATE_VBoxRcExtPack_SYSSUFF = .rc
|
---|
3708 | TEMPLATE_VBoxRcExtPack_INST = $(INST_EXTPACK)YouShallOverrideThis/
|
---|
3709 | TEMPLATE_VBoxRcExtPack_DEFS = VBOX_IN_EXTPACK VBOX_IN_EXTPACK_RC
|
---|
3710 | if1of ($(VBOX_LDR_FMT32), pe lx)
|
---|
3711 | TEMPLATE_VBoxRcExtPack_LIBS = \
|
---|
3712 | $(PATH_LIB)/VMMRCBuiltin$(VBOX_SUFF_LIB) \
|
---|
3713 | $(PATH_LIB)/VMMRCImp$(VBOX_SUFF_LIB)
|
---|
3714 | endif
|
---|
3715 |
|
---|
3716 | TEMPLATE_VBoxInsExtPack = For the install targets of an extension pack.
|
---|
3717 | TEMPLATE_VBoxInsExtPack_MODE = 0644
|
---|
3718 | TEMPLATE_VBoxInsExtPack_INST = $(INST_EXTPACK)YouShallOverrideThis/
|
---|
3719 |
|
---|
3720 | # For each individual extension pack
|
---|
3721 | ifdef VBOX_WITH_EXTPACK_PUEL
|
---|
3722 | TEMPLATE_VBoxR3ExtPackPuel = For the ring-3 context modules in the PUEL extension pack.
|
---|
3723 | TEMPLATE_VBoxR3ExtPackPuel_EXTENDS = VBoxR3ExtPack
|
---|
3724 | TEMPLATE_VBoxR3ExtPackPuel_INST = $(INST_EXTPACK_PUEL)$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/
|
---|
3725 |
|
---|
3726 | TEMPLATE_VBoxR0ExtPackPuel = For the ring-0 context modules in the PUEL extension pack.
|
---|
3727 | TEMPLATE_VBoxR0ExtPackPuel_EXTENDS = VBoxR0ExtPack
|
---|
3728 | TEMPLATE_VBoxR0ExtPackPuel_INST = $(INST_EXTPACK_PUEL)$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/
|
---|
3729 |
|
---|
3730 | TEMPLATE_VBoxRcExtPackPuel = For the raw-mode context modules in the PUEL extension pack.
|
---|
3731 | TEMPLATE_VBoxRcExtPackPuel_EXTENDS = VBoxRcExtPack
|
---|
3732 | TEMPLATE_VBoxRcExtPackPuel_INST = $(INST_EXTPACK_PUEL)$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/
|
---|
3733 |
|
---|
3734 | TEMPLATE_VBoxInsExtPackPuel = For the install targets of an extension pack.
|
---|
3735 | TEMPLATE_VBoxInsExtPackPuel_EXTENDS = VBoxR0ExtPack
|
---|
3736 | TEMPLATE_VBoxInsExtPackPuel_INST = $(INST_EXTPACK_PUEL)
|
---|
3737 | endif
|
---|
3738 | endif # VBOX_WITH_EXTPACK
|
---|
3739 |
|
---|
3740 |
|
---|
3741 | #
|
---|
3742 | # Qt 4
|
---|
3743 | # Qt 4
|
---|
3744 | # Qt 4
|
---|
3745 | #
|
---|
3746 | ifdef VBOX_WITH_QTGUI
|
---|
3747 |
|
---|
3748 | # Guess VBOX_WITH_QT4_SUN
|
---|
3749 | ifndef VBOX_WITH_QT4_SUN
|
---|
3750 | ifndef VBOX_OSE
|
---|
3751 | if1of ($(KBUILD_TARGET), darwin solaris win)
|
---|
3752 | VBOX_WITH_QT4_SUN := 1
|
---|
3753 | endif
|
---|
3754 | endif
|
---|
3755 | endif
|
---|
3756 |
|
---|
3757 | ifdef VBOX_WITH_QT4_SUN
|
---|
3758 | VBOX_QT4_INFIX=VBox
|
---|
3759 | endif
|
---|
3760 |
|
---|
3761 | VBOX_QT4_MOD = QtCore QtGui QtNetwork $(if $(VBOX_GUI_USE_QGL),QtOpenGL,)
|
---|
3762 | VBOX_QT4_MOD_NAMES = $(foreach qtmod,$(VBOX_QT4_MOD),$(qtmod)$(VBOX_QT4_INFIX))
|
---|
3763 |
|
---|
3764 | #
|
---|
3765 | # Handmade configuration of qt4 - very annoying, this needs to
|
---|
3766 | # be cleaned up properly later some time (not important now).
|
---|
3767 | #
|
---|
3768 | ifeq ($(VBOX_PATH_QT4),)
|
---|
3769 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
3770 | VBOX_PATH_QT4 := $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*)))
|
---|
3771 | ifeq ($(VBOX_PATH_QT4),)
|
---|
3772 | ifneq ($(wildcard /Library/Frameworks/QtCore.framework),)
|
---|
3773 | # Using the global installation (for OSE).
|
---|
3774 | VBOX_PATH_QT4 ?= /usr
|
---|
3775 | VBOX_PATH_QT4_FRAMEWORKS ?= /Library/Frameworks
|
---|
3776 | endif
|
---|
3777 | endif
|
---|
3778 | else if1of ($(KBUILD_TARGET), win)
|
---|
3779 | VBOX_PATH_QT4 ?= $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*)))
|
---|
3780 | else if1of ($(KBUILD_TARGET), solaris)
|
---|
3781 | VBOX_PATH_QT4 ?= $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*)))
|
---|
3782 | ifneq ($(VBOX_PATH_QT4),)
|
---|
3783 | VBOX_WITH_QT4_SUN = 1
|
---|
3784 | endif
|
---|
3785 | endif
|
---|
3786 | endif
|
---|
3787 | ifeq ($(VBOX_PATH_QT4),)
|
---|
3788 | if1of ($(USERNAME), bird)
|
---|
3789 | # gentoo (64-bit)
|
---|
3790 | VBOX_PATH_QT4 ?= /usr
|
---|
3791 | VBOX_PATH_QT4_LIB ?= /usr/lib/qt4
|
---|
3792 | endif
|
---|
3793 | endif
|
---|
3794 | VBOX_PATH_QT4 ?= /usr
|
---|
3795 | VBOX_PATH_QT4_LIB ?= $(VBOX_PATH_QT4)/lib
|
---|
3796 |
|
---|
3797 | # Hack LD_LIBRARY_PATH for stuff in tools.
|
---|
3798 | ifdef VBOX_WITH_QT4_SUN
|
---|
3799 | if1of ($(KBUILD_TARGET), linux)
|
---|
3800 | export LD_LIBRARY_PATH := $(VBOX_PATH_QT4_LIB):$(LD_LIBRARY_PATH)
|
---|
3801 | endif
|
---|
3802 | endif
|
---|
3803 |
|
---|
3804 |
|
---|
3805 | #
|
---|
3806 | # Template for building Qt GUI executables.
|
---|
3807 | #
|
---|
3808 | TEMPLATE_VBOXQT4GUIEXE = VBox Qt GUI Executable
|
---|
3809 | TEMPLATE_VBOXQT4GUIEXE_USES = qt4
|
---|
3810 | TEMPLATE_VBOXQT4GUIEXE_QTTOOL = QT4
|
---|
3811 | TEMPLATE_VBOXQT4GUIEXE_MOCTOOL = QT4
|
---|
3812 | TEMPLATE_VBOXQT4GUIEXE_UICTOOL = QT4
|
---|
3813 | TEMPLATE_VBOXQT4GUIEXE_RCCTOOL = QT4
|
---|
3814 | TEMPLATE_VBOXQT4GUIEXE_LRCTOOL = QT4
|
---|
3815 | TEMPLATE_VBOXQT4GUIEXE_SDKS = QT4
|
---|
3816 | TEMPLATE_VBOXQT4GUIEXE_QT_INFIX = $(VBOX_QT4_INFIX)
|
---|
3817 | TEMPLATE_VBOXQT4GUIEXE_DEFS = IN_RING3 QT_NO_DEBUG QT_THREAD_SUPPORT QT_SHARED HAVE_CONFIG_H $(ARCH_BITS_DEFS)
|
---|
3818 | TEMPLATE_VBOXQT4GUIEXE_RCDEFS = $(TEMPLATE_VBOXR3EXE_RCDEFS)
|
---|
3819 |
|
---|
3820 | ifeq ($(KBUILD_TARGET),win)
|
---|
3821 | # Note! No use of VBOX_VCC_CRT_TYPE here yet as it requires a /MDd build of Qt as well.
|
---|
3822 | TEMPLATE_VBOXQT4GUIEXE_TOOL = $(VBOX_VCC_TOOL)
|
---|
3823 | TEMPLATE_VBOXQT4GUIEXE_DEFS += \
|
---|
3824 | _WIN32_WINNT=0x0500 UNICODE _UNICODE \
|
---|
3825 | QT_DLL _CRT_SECURE_NO_DEPRECATE \
|
---|
3826 | $(QMAKE_PRL_DEFINES)
|
---|
3827 | ## @todo VCC70 flags?
|
---|
3828 | ifndef VBOX_USE_VCC70
|
---|
3829 | TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
|
---|
3830 | -nologo -Zm200 -W3 -MD -Zi -EHsc -Zc:wchar_t-
|
---|
3831 | TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.debug = -RTCsu
|
---|
3832 | else
|
---|
3833 | TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
|
---|
3834 | -nologo -Zm200 -W3 -MD -Zi -GX
|
---|
3835 | TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.debug = -GZ
|
---|
3836 | endif
|
---|
3837 | TEMPLATE_VBOXQT4GUIEXE_INCS += \
|
---|
3838 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC)
|
---|
3839 | TEMPLATE_VBOXQT4GUIEXE_LDFLAGS = \
|
---|
3840 | /NOD /NOLOGO /INCREMENTAL:NO /MAPINFO:EXPORTS /DEBUG \
|
---|
3841 | /DELAYLOAD:oleaut32.dll
|
---|
3842 | TEMPLATE_VBOXQT4GUIEXE_SDKS += WINPSDK
|
---|
3843 | TEMPLATE_VBOXQT4GUIEXE_LIBS = \
|
---|
3844 | $(VBOX_LIBS_QT4) \
|
---|
3845 | $(LIB_RUNTIME) \
|
---|
3846 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
|
---|
3847 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
|
---|
3848 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \
|
---|
3849 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib \
|
---|
3850 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib
|
---|
3851 | ifdef VBOX_WITH_DEBUG_VCC_CRT # VBoxCOM (static) is causing trouble of course.
|
---|
3852 | TEMPLATE_VBOXQT4GUIEXE_LIBS += \
|
---|
3853 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt$(VBOX_VCC_CRT_TYPE).lib \
|
---|
3854 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt$(VBOX_VCC_CRT_TYPE).lib
|
---|
3855 | endif
|
---|
3856 | TEMPLATE_VBOXQT4GUIEXE_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
|
---|
3857 | TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.win.x86 += /LARGEADDRESSAWARE
|
---|
3858 |
|
---|
3859 | ifdef VBOX_USE_VCC100 # HACK ALERT!
|
---|
3860 | TEMPLATE_VBOXQT4GUIEXE_CINCS = $(TOOL_$(VBOX_VCC_TOOL)_CINCS)
|
---|
3861 | TEMPLATE_VBOXQT4GUIEXE_CXXINCS = $(TOOL_$(VBOX_VCC_TOOL)_CXXINCS)
|
---|
3862 | endif
|
---|
3863 |
|
---|
3864 | else # the gcc guys:
|
---|
3865 | TEMPLATE_VBOXQT4GUIEXE_TOOL = $(VBOX_GCC_TOOL)
|
---|
3866 | TEMPLATE_VBOXQT4GUIEXE_DEFS.linux = _REENTRANT
|
---|
3867 |
|
---|
3868 | TEMPLATE_VBOXQT4GUIEXE_DEFS.solaris = _REENTRANT
|
---|
3869 |
|
---|
3870 | TEMPLATE_VBOXQT4GUIEXE_INCS += \
|
---|
3871 | $(LIB_SDL_INC)
|
---|
3872 | ## @todo Use VBOX_GCC_PEDANTIC_CXX?
|
---|
3873 | TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS = \
|
---|
3874 | -g -pipe $(filter-out -Wno-unused,$(VBOX_GCC_WARN)) -frtti -fno-exceptions -Wno-non-virtual-dtor \
|
---|
3875 | -Wno-long-long -fshort-wchar -fno-strict-aliasing \
|
---|
3876 | $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden)
|
---|
3877 | TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.x86 = -m32
|
---|
3878 | TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.amd64 = -m64
|
---|
3879 | TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.linux = -pthread
|
---|
3880 | TEMPLATE_VBOXQT4GUIEXE_OBJCFLAGS = -g -pipe $(VBOX_GCC_PEDANTIC_C) -Wno-long-long -fno-exceptions
|
---|
3881 | TEMPLATE_VBOXQT4GUIEXE_OBJCFLAGS.x86 = $(TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.x86)
|
---|
3882 | TEMPLATE_VBOXQT4GUIEXE_OBJCFLAGS.amd64 = $(TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.amd64)
|
---|
3883 | TEMPLATE_VBOXQT4GUIEXE_OBJCXXFLAGS = \
|
---|
3884 | -g -pipe $(VBOX_GCC_PEDANTIC_CXX) -Wno-non-virtual-dtor -Wno-long-long \
|
---|
3885 | -frtti -fno-exceptions $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden)
|
---|
3886 | TEMPLATE_VBOXQT4GUIEXE_OBJCXXFLAGS.x86 = $(TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.x86)
|
---|
3887 | TEMPLATE_VBOXQT4GUIEXE_OBJCXXFLAGS.amd64 = $(TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.amd64)
|
---|
3888 | TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.x86 = -m32
|
---|
3889 | TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.amd64 = -m64
|
---|
3890 | TEMPLATE_VBOXQT4GUIEXE_LIBS = \
|
---|
3891 | $(VBOX_LIBS_QT4) \
|
---|
3892 | $(LIB_SDL) \
|
---|
3893 | $(LIB_RUNTIME) \
|
---|
3894 | $(LIB_REM) \
|
---|
3895 | $(LIB_VMM)
|
---|
3896 |
|
---|
3897 | ifeq ($(KBUILD_TARGET),linux)
|
---|
3898 | TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += $(VBOX_LD_as_needed)
|
---|
3899 | TEMPLATE_VBOXQT4GUIEXE_LIBS += \
|
---|
3900 | $(VBOX_XCURSOR_LIBS) \
|
---|
3901 | Xext \
|
---|
3902 | X11
|
---|
3903 | TEMPLATE_VBOXQT4GUIEXE_LIBPATH += \
|
---|
3904 | $(VBOX_LIBPATH_X11)
|
---|
3905 | else ifeq ($(KBUILD_TARGET),darwin)
|
---|
3906 | TEMPLATE_VBOXQT4GUIEXE_DEFS.darwin += $(VBOX_DARWIN_DEF_SDK_DEFS)
|
---|
3907 | TEMPLATE_VBOXQT4GUIEXE_CFLAGS.darwin += $(VBOX_DARWIN_DEF_SDK_CFLAGS)
|
---|
3908 | TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.darwin += $(VBOX_DARWIN_DEF_SDK_CXXFLAGS)
|
---|
3909 | TEMPLATE_VBOXQT4GUIEXE_OBJCFLAGS.darwin += $(VBOX_DARWIN_DEF_SDK_OBJCFLAGS)
|
---|
3910 | TEMPLATE_VBOXQT4GUIEXE_OBJCXXFLAGS.darwin += $(VBOX_DARWIN_DEF_SDK_OBJCXXFLAGS)
|
---|
3911 | TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.darwin += $(VBOX_DARWIN_DEF_SDK_LDFLAGS) -bind_at_load
|
---|
3912 | TEMPLATE_VBOXQT4GUIEXE_LIBS +=
|
---|
3913 | TEMPLATE_VBOXQT4GUIEXE_LIBPATH +=
|
---|
3914 | else
|
---|
3915 | TEMPLATE_VBOXQT4GUIEXE_INCS += \
|
---|
3916 | $(VBOX_XCURSOR_INCS)
|
---|
3917 | TEMPLATE_VBOXQT4GUIEXE_LIBS += \
|
---|
3918 | $(VBOX_XCURSOR_LIBS) \
|
---|
3919 | Xext \
|
---|
3920 | X11 \
|
---|
3921 | m \
|
---|
3922 | $(LIB_PTHREAD)
|
---|
3923 | TEMPLATE_VBOXQT4GUIEXE_LIBPATH += \
|
---|
3924 | $(VBOX_LIBPATH_X11)
|
---|
3925 | ifeq ($(KBUILD_TARGET),freebsd)
|
---|
3926 | TEMPLATE_VBOXQT4GUIEXE_INCS += \
|
---|
3927 | /usr/include \
|
---|
3928 | /usr/X11R6/include \
|
---|
3929 | /usr/local/include
|
---|
3930 | TEMPLATE_VBOXQT4GUIEXE_LIBPATH += \
|
---|
3931 | /usr/lib \
|
---|
3932 | /usr/X11R6/lib \
|
---|
3933 | /usr/local/lib
|
---|
3934 | endif
|
---|
3935 | ifeq ($(KBUILD_TARGET),solaris)
|
---|
3936 | TEMPLATE_VBOXQT4GUIEXE_LIBS += \
|
---|
3937 | rt socket nsl
|
---|
3938 | endif
|
---|
3939 | endif
|
---|
3940 | # Assume the Qt shared objects are in the same directory as the executable, on Solaris too.
|
---|
3941 | ifdef VBOX_WITH_RUNPATH
|
---|
3942 | TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)'
|
---|
3943 | else ifdef VBOX_WITH_RELATIVE_RUNPATH
|
---|
3944 | TEMPLATE_VBOXQT4GUIEXE_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)'
|
---|
3945 | endif
|
---|
3946 |
|
---|
3947 | endif
|
---|
3948 |
|
---|
3949 | # Add COM/XPCOM stuff
|
---|
3950 | TEMPLATE_VBOXQT4GUIEXE_LIBS += \
|
---|
3951 | $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB)
|
---|
3952 | ifdef VBOX_WITH_XPCOM
|
---|
3953 | ## @todo may be worth creating the VBOX_XPCOM SDK def, or just a SDK_VBOXXPCOM.
|
---|
3954 | TEMPLATE_VBOXQT4GUIEXE_DEFS += VBOX_WITH_XPCOM
|
---|
3955 | ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
|
---|
3956 | TEMPLATE_VBOXQT4GUIEXE_DEFS += VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
|
---|
3957 | endif
|
---|
3958 | TEMPLATE_VBOXQT4GUIEXE_INCS += \
|
---|
3959 | $(VBOX_XPCOM_INCS)
|
---|
3960 | TEMPLATE_VBOXQT4GUIEXE_LIBS += \
|
---|
3961 | $(LIB_XPCOM)
|
---|
3962 | TEMPLATE_VBOXQT4GUIEXE_INTERMEDIATES += \
|
---|
3963 | $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
|
---|
3964 | else # COM
|
---|
3965 | TEMPLATE_VBOXQT4GUIEXE_INCS += \
|
---|
3966 | $(VBOX_PATH_SDK)/bindings/mscom/include
|
---|
3967 | TEMPLATE_VBOXQT4GUIEXE_INTERMEDIATES += \
|
---|
3968 | $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h
|
---|
3969 | endif # COM
|
---|
3970 |
|
---|
3971 |
|
---|
3972 | #
|
---|
3973 | # Template for building Qt GUI components.
|
---|
3974 | #
|
---|
3975 | TEMPLATE_VBOXQT4GUI = VBox Qt GUI Components
|
---|
3976 | TEMPLATE_VBOXQT4GUI_EXTENDS = VBOXQT4GUIEXE
|
---|
3977 | TEMPLATE_VBOXQT4GUI_LIBS = $(filter-out $(QTMAIN),$(TEMPLATE_VBOXQT4GUIEXE_LIBS))
|
---|
3978 | ifeq ($(KBUILD_TARGET),darwin)
|
---|
3979 | TEMPLATE_VBOXQT4GUI_LDFLAGS.darwin += $(filter-out -bind_at_load,$(TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.darwin)) \
|
---|
3980 | -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
|
---|
3981 | -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
|
---|
3982 | endif
|
---|
3983 | ifn1of ($(KBUILD_TARGET), darwin os2 win)
|
---|
3984 | TEMPLATE_VBOXQT4GUI_DEFS = PIC $(TEMPLATE_VBOXQT4GUIEXE_DEFS)
|
---|
3985 | TEMPLATE_VBOXQT4GUI_CFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_CFLAGS)
|
---|
3986 | TEMPLATE_VBOXQT4GUI_CXXFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS)
|
---|
3987 | TEMPLATE_VBOXQT4GUI_LDFLAGS = -fPIC $(TEMPLATE_VBOXQT4GUIEXE_LDFLAGS)
|
---|
3988 | endif
|
---|
3989 |
|
---|
3990 | endif # VBOX_WITH_QTGUI
|
---|
3991 |
|
---|
3992 |
|
---|
3993 | #
|
---|
3994 | # Template for building build bldprogs.
|
---|
3995 | #
|
---|
3996 | # HACK ALERT! The BLD_TRG_* is a hack to allow building libraries as well.
|
---|
3997 | #
|
---|
3998 | TEMPLATE_VBOXBLDPROG = VBox Build Program
|
---|
3999 | TEMPLATE_VBOXBLDPROG_BLD_TRG := $(KBUILD_HOST)
|
---|
4000 | TEMPLATE_VBOXBLDPROG_BLD_TRG_ARCH := $(KBUILD_HOST_ARCH)
|
---|
4001 | TEMPLATE_VBOXBLDPROG_BLD_TRG_CPU := $(KBUILD_HOST_CPU)
|
---|
4002 | TEMPLATE_VBOXBLDPROG_DEFS := IN_RING3 LOG_DISABLED
|
---|
4003 | TEMPLATE_VBOXBLDPROG_DEFS.win := _CRT_SECURE_NO_DEPRECATE
|
---|
4004 | TEMPLATE_VBOXBLDPROG_ASTOOL := YASM
|
---|
4005 | TEMPLATE_VBOXBLDPROG_ASFLAGS.x86 := $(VBOX_ASFLAGS32)
|
---|
4006 | TEMPLATE_VBOXBLDPROG_ASFLAGS.amd64 := $(VBOX_ASFLAGS64)
|
---|
4007 | ifeq ($(KBUILD_HOST),win)
|
---|
4008 | ifndef VBOX_USE_VCC70
|
---|
4009 | TEMPLATE_VBOXBLDPROG_TOOL := $(VBOX_VCC_TOOL_STEM)$(toupper $(KBUILD_HOST_ARCH))
|
---|
4010 | TEMPLATE_VBOXBLDPROG_SDKS := $(if-expr "$(KBUILD_HOST_ARCH)" == "x86",WIN32SDK,WIN64SDK)
|
---|
4011 | else if1of ($(KBUILD_HOST_ARCH), x86)
|
---|
4012 | TEMPLATE_VBOXBLDPROG_TOOL := VCC70
|
---|
4013 | TEMPLATE_VBOXBLDPROG_SDKS := WIN32SDK
|
---|
4014 | else if1of ($(KBUILD_HOST_ARCH), amd64)
|
---|
4015 | TEMPLATE_VBOXBLDPROG_TOOL := VCC80AMD64
|
---|
4016 | TEMPLATE_VBOXBLDPROG_SDKS := WIN64SDK
|
---|
4017 | else
|
---|
4018 | $(error KBUILD_HOST_ARCH=$(KBUILD_HOST_ARCH))
|
---|
4019 | endif
|
---|
4020 | ifneq ($(TEMPLATE_VBOXBLDPROG_TOOL),VCC70)
|
---|
4021 | TEMPLATE_VBOXBLDPROG_CXXFLAGS = -Zi -Zl -GR- -EHs- -GF -MT$(VBOX_VCC_CRT_TYPE) -W3 -wd4996 -Zc:wchar_t-
|
---|
4022 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug = -RTCsu
|
---|
4023 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.release = -O2 -Oy- -GS-
|
---|
4024 | else
|
---|
4025 | TEMPLATE_VBOXBLDPROG_CXXFLAGS = -Zi -Zl -GR- -EHs- -GF -MT$(VBOX_VCC_CRT_TYPE) -W3
|
---|
4026 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug = -GZ
|
---|
4027 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.release = -Ogitb2 -Oy-
|
---|
4028 | endif
|
---|
4029 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
|
---|
4030 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
|
---|
4031 | TEMPLATE_VBOXBLDPROG_CFLAGS = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS)
|
---|
4032 | TEMPLATE_VBOXBLDPROG_CFLAGS.debug = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug)
|
---|
4033 | TEMPLATE_VBOXBLDPROG_CFLAGS.release = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
|
---|
4034 | TEMPLATE_VBOXBLDPROG_CFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile)
|
---|
4035 | TEMPLATE_VBOXBLDPROG_CFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile)
|
---|
4036 | TEMPLATE_VBOXBLDPROG_LDFLAGS = \
|
---|
4037 | /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE /DEBUG \
|
---|
4038 | /DISALLOWLIB:libc$(VBOX_VCC_CRT_TYPE_N).lib \
|
---|
4039 | /DISALLOWLIB:libcmt$(VBOX_VCC_CRT_TYPE_N).lib \
|
---|
4040 | /DISALLOWLIB:msvcrt.lib \
|
---|
4041 | /DISALLOWLIB:msvcrtd.lib \
|
---|
4042 | /DISALLOWLIB:msvcprt.lib \
|
---|
4043 | /DISALLOWLIB:msvcprtd.lib
|
---|
4044 | TEMPLATE_VBOXBLDPROG_LIBS = \
|
---|
4045 | $(PATH_TOOL_$(TEMPLATE_VBOXBLDPROG_TOOL)_LIB)/oldnames.lib \
|
---|
4046 | $(PATH_TOOL_$(TEMPLATE_VBOXBLDPROG_TOOL)_LIB)/libcmt$(VBOX_VCC_CRT_TYPE).lib \
|
---|
4047 | $(PATH_TOOL_$(TEMPLATE_VBOXBLDPROG_TOOL)_LIB)/libcpmt$(VBOX_VCC_CRT_TYPE).lib
|
---|
4048 |
|
---|
4049 | else
|
---|
4050 | # (gcc of some kind )
|
---|
4051 | TEMPLATE_VBOXBLDPROG_TOOL = GXX3
|
---|
4052 | TEMPLATE_VBOXBLDPROG_CFLAGS = -g -pipe $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC_Wno-variadic-macros)
|
---|
4053 | TEMPLATE_VBOXBLDPROG_CFLAGS.x86 = -m32
|
---|
4054 | TEMPLATE_VBOXBLDPROG_CFLAGS.sparc32 = -m32
|
---|
4055 | TEMPLATE_VBOXBLDPROG_CFLAGS.amd64 = -m64
|
---|
4056 | TEMPLATE_VBOXBLDPROG_CFLAGS.sparc64 = -m64
|
---|
4057 | TEMPLATE_VBOXBLDPROG_CFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing
|
---|
4058 | TEMPLATE_VBOXBLDPROG_CFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile)
|
---|
4059 | TEMPLATE_VBOXBLDPROG_CFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile)
|
---|
4060 | TEMPLATE_VBOXBLDPROG_CXXFLAGS = -g -pipe $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros)
|
---|
4061 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.x86 = -m32
|
---|
4062 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.sparc32 = -m32
|
---|
4063 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.amd64 = -m64
|
---|
4064 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.sparc64 = -m64
|
---|
4065 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing
|
---|
4066 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
|
---|
4067 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
|
---|
4068 | TEMPLATE_VBOXBLDPROG_OBJCFLAGS = $(TEMPLATE_VBOXBLDPROG_CFLAGS)
|
---|
4069 | TEMPLATE_VBOXBLDPROG_OBJCFLAGS.x86 = $(TEMPLATE_VBOXBLDPROG_CFLAGS.x86)
|
---|
4070 | TEMPLATE_VBOXBLDPROG_OBJCFLAGS.amd64 = $(TEMPLATE_VBOXBLDPROG_CFLAGS.amd64)
|
---|
4071 | TEMPLATE_VBOXBLDPROG_OBJCFLAGS.release = $(TEMPLATE_VBOXBLDPROG_CFLAGS.release)
|
---|
4072 | TEMPLATE_VBOXBLDPROG_OBJCFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CFLAGS.profile)
|
---|
4073 | TEMPLATE_VBOXBLDPROG_OBJCFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CFLAGS.kprofile)
|
---|
4074 | TEMPLATE_VBOXBLDPROG_OBJCXXFLAGS = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS)
|
---|
4075 | TEMPLATE_VBOXBLDPROG_OBJCXXFLAGS.x86 = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.x86)
|
---|
4076 | TEMPLATE_VBOXBLDPROG_OBJCXXFLAGS.amd64 = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.amd64)
|
---|
4077 | TEMPLATE_VBOXBLDPROG_OBJCXXFLAGS.release = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
|
---|
4078 | TEMPLATE_VBOXBLDPROG_OBJCXXFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile)
|
---|
4079 | TEMPLATE_VBOXBLDPROG_OBJCXXFLAGS.kprofile= $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile)
|
---|
4080 | TEMPLATE_VBOXBLDPROG_LDFLAGS.x86 = -m32
|
---|
4081 | TEMPLATE_VBOXBLDPROG_LDFLAGS.sparc32 = -m32
|
---|
4082 | TEMPLATE_VBOXBLDPROG_LDFLAGS.amd64 = -m64
|
---|
4083 | TEMPLATE_VBOXBLDPROG_LDFLAGS.sparc64 = -m64
|
---|
4084 | ifeq ($(KBUILD_HOST),linux)
|
---|
4085 | TEMPLATE_VBOXBLDPROG_LIBS = pthread m rt dl
|
---|
4086 | else ifeq ($(KBUILD_HOST),os2)
|
---|
4087 | TEMPLATE_VBOXBLDPROG_TOOL = GXX3OMF
|
---|
4088 | TEMPLATE_VBOXBLDPROG_LIBS = socket iconv
|
---|
4089 | else ifeq ($(KBUILD_HOST),darwin)
|
---|
4090 | TEMPLATE_VBOXBLDPROG_TOOL = GXX4MACHO
|
---|
4091 | ifeq ($(KBUILD_HOST_ARCH).$(KBUILD_TARGET_ARCH),amd64.x86) # MESS ALERT!
|
---|
4092 | TEMPLATE_VBOXBLDPROG_DEFS.darwin = $(VBOX_DARWIN_DEF_SDK_10_6_DEFS)
|
---|
4093 | TEMPLATE_VBOXBLDPROG_CFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_6_CFLAGS) -fno-common
|
---|
4094 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_6_CXXFLAGS)
|
---|
4095 | TEMPLATE_VBOXBLDPROG_OBJCFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_6_OBJCFLAGS) $(VBOX_GCC_PEDANTIC_C)
|
---|
4096 | TEMPLATE_VBOXBLDPROG_OBJCXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_6_OBJCXXFLAGS) $(VBOX_GCC_PEDANTIC_CXX)
|
---|
4097 | TEMPLATE_VBOXBLDPROG_LDFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_6_LDFLAGS)
|
---|
4098 | else ifdef VBOX_MACOS_10_5_WORKAROUND # enable this if you have problems linking xpidl and is running 10.5 or later.
|
---|
4099 | TEMPLATE_VBOXBLDPROG_DEFS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_DEFS)
|
---|
4100 | TEMPLATE_VBOXBLDPROG_CFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_CFLAGS) -fno-common
|
---|
4101 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_CXXFLAGS)
|
---|
4102 | TEMPLATE_VBOXBLDPROG_OBJCFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_OBJCFLAGS) $(VBOX_GCC_PEDANTIC_C)
|
---|
4103 | TEMPLATE_VBOXBLDPROG_OBJCXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_OBJCXXFLAGS) $(VBOX_GCC_PEDANTIC_CXX)
|
---|
4104 | TEMPLATE_VBOXBLDPROG_LDFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_LDFLAGS)
|
---|
4105 | else
|
---|
4106 | TEMPLATE_VBOXBLDPROG_DEFS.darwin = $(VBOX_DARWIN_DEF_SDK_DEFS)
|
---|
4107 | TEMPLATE_VBOXBLDPROG_CFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_CFLAGS) -fno-common
|
---|
4108 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_CXXFLAGS)
|
---|
4109 | TEMPLATE_VBOXBLDPROG_OBJCFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_OBJCFLAGS) $(VBOX_GCC_PEDANTIC_C)
|
---|
4110 | TEMPLATE_VBOXBLDPROG_OBJCXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_OBJCXXFLAGS) $(VBOX_GCC_PEDANTIC_CXX)
|
---|
4111 | TEMPLATE_VBOXBLDPROG_LDFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_LDFLAGS)
|
---|
4112 | endif
|
---|
4113 | TEMPLATE_VBOXBLDPROG_LIBS =
|
---|
4114 | else if1of ($(KBUILD_HOST), freebsd netbsd openbsd)
|
---|
4115 | TEMPLATE_VBOXBLDPROG_TOOL = GXX3
|
---|
4116 | TEMPLATE_VBOXBLDPROG_LIBS = pthread
|
---|
4117 | TEMPLATE_VBOXBLDPROG_INCS += \
|
---|
4118 | /usr/include \
|
---|
4119 | /usr/X11R6/include \
|
---|
4120 | /usr/local/include
|
---|
4121 | TEMPLATE_VBOXBLDPROG_LIBPATH += \
|
---|
4122 | /usr/lib \
|
---|
4123 | /usr/X11R6/lib \
|
---|
4124 | /usr/local/lib
|
---|
4125 | else ifeq ($(KBUILD_HOST),solaris)
|
---|
4126 | TEMPLATE_VBOXBLDPROG_TOOL = GXX3PLAIN
|
---|
4127 | TEMPLATE_VBOXBLDPROG_LIBS = rt
|
---|
4128 | else
|
---|
4129 | $(warning Warning: VBOX Build: Target $(KBUILD_HOST) is not officially supported!)
|
---|
4130 | endif
|
---|
4131 |
|
---|
4132 | endif # !win
|
---|
4133 |
|
---|
4134 |
|
---|
4135 | #
|
---|
4136 | # Advanced build programs using IPRT, openssl and worse stuff.
|
---|
4137 | #
|
---|
4138 | TEMPLATE_VBoxAdvBldProg = Advanced VBox Build Program
|
---|
4139 | TEMPLATE_VBoxAdvBldProg_EXTENDS = VBOXBLDPROG
|
---|
4140 | TEMPLATE_VBoxAdvBldProg_SDKS = $(TEMPLATE_VBOXBLDPROG_SDKS) VBOX_BLD_OPENSSL
|
---|
4141 | TEMPLATE_VBoxAdvBldProg_SDKS.win= $(TEMPLATE_VBOXBLDPROG_SDKS.win) VBOX_NTDLL
|
---|
4142 | TEMPLATE_VBoxAdvBldProg_DEFS = $(TEMPLATE_VBOXBLDPROG_DEFS) IN_RT_R3
|
---|
4143 | TEMPLATE_VBoxAdvBldProg_LIBS = \
|
---|
4144 | $(PATH_LIB)/RuntimeBldProg$(VBOX_SUFF_LIB) \
|
---|
4145 | $(TEMPLATE_VBOXBLDPROG_LIBS)
|
---|
4146 | TEMPLATE_VBoxAdvBldProg_LIBS.darwin = \
|
---|
4147 | $(TEMPLATE_VBOXBLDPROG_LIBS) \
|
---|
4148 | iconv \
|
---|
4149 | $(TEMPLATE_VBOXBLDPROG_LIBS.darwin)
|
---|
4150 | TEMPLATE_VBoxAdvBldProg_LIBS.freebsd = \
|
---|
4151 | $(TEMPLATE_VBOXBLDPROG_LIBS) \
|
---|
4152 | iconv \
|
---|
4153 | rt \
|
---|
4154 | $(TEMPLATE_VBOXBLDPROG_LIBS.freebsd)
|
---|
4155 | TEMPLATE_VBoxAdvBldProg_LIBS.linux = \
|
---|
4156 | $(TEMPLATE_VBOXBLDPROG_LIBS) \
|
---|
4157 | crypt \
|
---|
4158 | $(TEMPLATE_VBOXBLDPROG_LIBS.linux)
|
---|
4159 | TEMPLATE_VBoxAdvBldProg_LIBS.solaris = \
|
---|
4160 | $(TEMPLATE_VBOXBLDPROG_LIBS) \
|
---|
4161 | contract \
|
---|
4162 | kstat \
|
---|
4163 | rt \
|
---|
4164 | socket \
|
---|
4165 | nsl \
|
---|
4166 | $(TEMPLATE_VBOXBLDPROG_LIBS.solaris)
|
---|
4167 |
|
---|
4168 |
|
---|
4169 | #
|
---|
4170 | # Windows rc workaround for crosscompiling.
|
---|
4171 | # (Some (old) Wine versions fails loading msvcrt.dll from the VCC bin directory.)
|
---|
4172 | #
|
---|
4173 | ifneq ($(KBUILD_HOST),win)
|
---|
4174 | TOOL_VCC100X86_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
|
---|
4175 | TOOL_VCC100AMD64_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
|
---|
4176 | TOOL_VCC80X86_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
|
---|
4177 | TOOL_VCC80AMD64_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
|
---|
4178 | TOOL_VCC70_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
|
---|
4179 | WIN32_MC = $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/mc.exe
|
---|
4180 | else
|
---|
4181 | WIN32_MC = $(EXEC_X86_WIN32) $(firstword $(wildcard \
|
---|
4182 | $(PATH_SDK_WINPSDK_BIN)/MC.Exe\
|
---|
4183 | $(PATH_SDK_WINPSDK)/Bin/MC.Exe\
|
---|
4184 | $(PATH_SDK_WIN32SDK_BIN)/MC.Exe\
|
---|
4185 | $(PATH_SDK_WIN64SDK_BIN)/MC.Exe\
|
---|
4186 | $(PATH_DEVTOOLS)/win.x86/bin/mc.exe\
|
---|
4187 | ) Sorry_Cannot_find_mc_in_the_PSDK)
|
---|
4188 | endif
|
---|
4189 |
|
---|
4190 |
|
---|
4191 | #
|
---|
4192 | # Template for building Linux host tools (only for KBUILD_TARGET=l4).
|
---|
4193 | #
|
---|
4194 | TEMPLATE_VBOXLNXHOSTR3EXE = Template for building linux host programs when targeting L4.
|
---|
4195 | TEMPLATE_VBOXLNXHOSTR3EXE_INST = $(INST_BIN)
|
---|
4196 | TEMPLATE_VBOXLNXHOSTR3EXE_BLD_TRG = linux
|
---|
4197 | TEMPLATE_VBOXLNXHOSTR3EXE_TOOL = $(VBOX_GCC_TOOL)
|
---|
4198 | TEMPLATE_VBOXLNXHOSTR3EXE_ASTOOL = YASM
|
---|
4199 | TEMPLATE_VBOXLNXHOSTR3EXE_ASFLAGS = $(VBOX_ASFLAGS)
|
---|
4200 | TEMPLATE_VBOXLNXHOSTR3EXE_DLLSUFF = .so
|
---|
4201 | TEMPLATE_VBOXLNXHOSTR3EXE_DEFS = IN_RING3 $(ARCH_BITS_DEFS)
|
---|
4202 | TEMPLATE_VBOXLNXHOSTR3EXE_CXXFLAGS = -g -pipe $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_fno-stack-protector)
|
---|
4203 | TEMPLATE_VBOXLNXHOSTR3EXE_CXXFLAGS.debug = -fno-inline
|
---|
4204 | TEMPLATE_VBOXLNXHOSTR3EXE_CXXFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing
|
---|
4205 | TEMPLATE_VBOXLNXHOSTR3EXE_CXXFLAGS.profile = $(TEMPLATE_VBOXLNXHOSTR3EXE_CXXFLAGS.release)
|
---|
4206 | TEMPLATE_VBOXLNXHOSTR3EXE_CXXFLAGS.kprofile = $(TEMPLATE_VBOXLNXHOSTR3EXE_CXXFLAGS.release)
|
---|
4207 | TEMPLATE_VBOXLNXHOSTR3EXE_CFLAGS.release = $(TEMPLATE_VBOXLNXHOSTR3EXE_CXXFLAGS.release)
|
---|
4208 | TEMPLATE_VBOXLNXHOSTR3EXE_CFLAGS.debug = $(TEMPLATE_VBOXLNXHOSTR3EXE_CXXFLAGS.debug)
|
---|
4209 | TEMPLATE_VBOXLNXHOSTR3EXE_CFLAGS.profile = $(TEMPLATE_VBOXLNXHOSTR3EXE_CXXFLAGS.profile)
|
---|
4210 | TEMPLATE_VBOXLNXHOSTR3EXE_CFLAGS.kprofile = $(TEMPLATE_VBOXLNXHOSTR3EXE_CXXFLAGS.kprofile)
|
---|
4211 | TEMPLATE_VBOXLNXHOSTR3EXE_CFLAGS = -g -pipe $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC_fno-stack-protector)
|
---|
4212 | TEMPLATE_VBOXLNXHOSTR3EXE_LIBS = pthread m rt dl
|
---|
4213 |
|
---|
4214 | TEMPLATE_VBOXLNXHOSTR3LIB = Template for linux host libraries.
|
---|
4215 | TEMPLATE_VBOXLNXHOSTR3LIB_EXTENDS = VBOXLNXHOSTR3EXE
|
---|
4216 | TEMPLATE_VBOXLNXHOSTR3LIB_INST = $(INST_LIB)
|
---|
4217 |
|
---|
4218 |
|
---|
4219 | #
|
---|
4220 | # Template for building R3 programs for the guest additions.
|
---|
4221 | # Note: Make sure you don't break VBOXGUESTR3CPPEXE when changing this.
|
---|
4222 | #
|
---|
4223 | TEMPLATE_VBOXGUESTR3EXE = VBox Guest Program
|
---|
4224 | ifeq ($(KBUILD_TARGET),win)
|
---|
4225 | TEMPLATE_VBOXGUESTR3EXE_EXTENDS = VBOXR3EXE
|
---|
4226 | TEMPLATE_VBOXGUESTR3EXE_SDKS = $(TEMPLATE_VBOXR3EXE_SDKS) VBOX_NTDLL
|
---|
4227 | TEMPLATE_VBOXGUESTR3EXE_CFLAGS = $(filter-out -MD$(VBOX_VCC_CRT_TYPE), $(TEMPLATE_VBOXR3EXE_CFLAGS)) -MT$(VBOX_VCC_CRT_TYPE)
|
---|
4228 | TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS = $(filter-out -MD$(VBOX_VCC_CRT_TYPE), $(TEMPLATE_VBOXR3EXE_CFLAGS)) -MT$(VBOX_VCC_CRT_TYPE)
|
---|
4229 | TEMPLATE_VBOXGUESTR3EXE_LDFLAGS = $(filter-out /DISALLOWLIB:libcmt$(VBOX_VCC_CRT_TYPE).lib /DISALLOWLIB:libcpmt$(VBOX_VCC_CRT_TYPE).lib, $(TEMPLATE_VBOXR3EXE_LDFLAGS)) \
|
---|
4230 | /DISALLOWLIB:msvcrt$(VBOX_VCC_CRT_TYPE).lib \
|
---|
4231 | /DISALLOWLIB:msvcprt$(VBOX_VCC_CRT_TYPE).lib
|
---|
4232 | TEMPLATE_VBOXGUESTR3EXE_LIBS.x86 = \
|
---|
4233 | $(PATH_TOOL_$(TEMPLATE_VBOXGUESTR3EXE_TOOL.win.x86)_LIB)/oldnames.lib \
|
---|
4234 | $(PATH_TOOL_$(TEMPLATE_VBOXGUESTR3EXE_TOOL.win.x86)_LIB)/libcmt$(VBOX_VCC_CRT_TYPE).lib \
|
---|
4235 | $(PATH_TOOL_$(TEMPLATE_VBOXGUESTR3EXE_TOOL.win.x86)_LIB)/libcpmt$(VBOX_VCC_CRT_TYPE).lib
|
---|
4236 | TEMPLATE_VBOXGUESTR3EXE_LIBS.amd64 = \
|
---|
4237 | $(PATH_TOOL_$(TEMPLATE_VBOXGUESTR3EXE_TOOL.win.amd64)_LIB)/oldnames.lib \
|
---|
4238 | $(PATH_TOOL_$(TEMPLATE_VBOXGUESTR3EXE_TOOL.win.amd64)_LIB)/libcmt$(VBOX_VCC_CRT_TYPE).lib \
|
---|
4239 | $(PATH_TOOL_$(TEMPLATE_VBOXGUESTR3EXE_TOOL.win.amd64)_LIB)/libcpmt$(VBOX_VCC_CRT_TYPE).lib
|
---|
4240 | else # the gcc guys
|
---|
4241 | TEMPLATE_VBOXGUESTR3EXE_EXTENDS = VBOXR3EXE
|
---|
4242 | TEMPLATE_VBOXGUESTR3EXE_TOOL := $(subst GXX,GCC,$(TEMPLATE_VBOXR3EXE_TOOL))
|
---|
4243 | TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) -fno-exceptions
|
---|
4244 | TEMPLATE_VBOXGUESTR3EXE_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBOXR3EXE_LDFLAGS))
|
---|
4245 | TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.linux))
|
---|
4246 | endif
|
---|
4247 | TEMPLATE_VBOXGUESTR3EXE_INST = $(INST_ADDITIONS)
|
---|
4248 | TEMPLATE_VBOXGUESTR3EXE_DEFS := $(filter-out $(ARCH_BITS_DEFS), $(TEMPLATE_VBOXR3EXE_DEFS)) IN_GUEST IN_GUEST_R3 IN_RT_R3 $(VBOX_GC_ARCH_BITS_DEFS)
|
---|
4249 | TEMPLATE_VBOXGUESTR3EXE_DEFS.linux := $(TEMPLATE_VBOXR3EXE_DEFS.linux) LOG_USE_C99 RT_WITHOUT_EXEC_ALLOC
|
---|
4250 | ifeq ($(KBUILD_TARGET),linux) # As few libs as possible on linux.
|
---|
4251 | TEMPLATE_VBOXGUESTR3EXE_LIBS = pthread rt m
|
---|
4252 | endif
|
---|
4253 | if1of ($(KBUILD_TARGET), freebsd netbsd openbsd)
|
---|
4254 | TEMPLATE_VBOXGUESTR3EXE_LIBS = $(TEMPLATE_VBOXR3EXE_LIBS) iconv
|
---|
4255 | endif
|
---|
4256 |
|
---|
4257 |
|
---|
4258 | #
|
---|
4259 | # Template for building R3 (dynamic) libraries for the guest additions.
|
---|
4260 | #
|
---|
4261 | TEMPLATE_VBOXGUESTR3DLL = VBox Guest User Dynamic Libraries
|
---|
4262 | TEMPLATE_VBOXGUESTR3DLL_EXTENDS = VBOXGUESTR3EXE
|
---|
4263 | ## @todo add a INSTFUN that separates dlls and libs.
|
---|
4264 | ifn1of ($(KBUILD_TARGET), darwin os2 win)
|
---|
4265 | TEMPLATE_VBOXGUESTR3DLL_DEFS = $(TEMPLATE_VBOXGUESTR3EXE_DEFS) PIC
|
---|
4266 | TEMPLATE_VBOXGUESTR3DLL_CFLAGS = $(TEMPLATE_VBOXGUESTR3EXE_CFLAGS) -fPIC
|
---|
4267 | TEMPLATE_VBOXGUESTR3DLL_CXXFLAGS = $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS) -fPIC -fno-exceptions
|
---|
4268 | TEMPLATE_VBOXGUESTR3DLL_LDFLAGS = $(TEMPLATE_VBOXGUESTR3EXE_LDFLAGS) -fPIC
|
---|
4269 | endif
|
---|
4270 |
|
---|
4271 | #
|
---|
4272 | # Template for building R3 (static) libraries for the guest additions.
|
---|
4273 | #
|
---|
4274 | TEMPLATE_VBOXGUESTR3LIB = VBox Guest User Libraries
|
---|
4275 | TEMPLATE_VBOXGUESTR3LIB_EXTENDS = VBOXGUESTR3EXE
|
---|
4276 | TEMPLATE_VBOXGUESTR3LIB_INST = $(INST_ADDITIONS_LIB)
|
---|
4277 | if1of ($(KBUILD_TARGET), solaris) ## @todo r=bird: Fix the *R3Mini template to VBOXGUESTR3DLL and remove this hack.
|
---|
4278 | TEMPLATE_VBOXGUESTR3LIB_DEFS = $(TEMPLATE_VBOXGUESTR3EXE_DEFS) PIC
|
---|
4279 | TEMPLATE_VBOXGUESTR3LIB_CFLAGS = $(TEMPLATE_VBOXGUESTR3EXE_CFLAGS) -fPIC
|
---|
4280 | TEMPLATE_VBOXGUESTR3LIB_CXXFLAGS = $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS) -fPIC -fno-exceptions
|
---|
4281 | endif
|
---|
4282 |
|
---|
4283 | #
|
---|
4284 | # Template for building R3 programs for the guest additions (no -pedantic)
|
---|
4285 | #
|
---|
4286 | TEMPLATE_VBOXGUESTR3NPEXE = VBox Guest Program Non-pedantic
|
---|
4287 | TEMPLATE_VBOXGUESTR3NPEXE_EXTENDS = VBOXGUESTR3EXE
|
---|
4288 | ifneq ($(KBUILD_TARGET),win) # gcc only
|
---|
4289 | TEMPLATE_VBOXGUESTR3NPEXE_CXXFLAGS = $(filter-out -pedantic -Wshadow,$(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS)) -Wno-sign-compare
|
---|
4290 | TEMPLATE_VBOXGUESTR3NPEXE_CFLAGS = $(filter-out -pedantic -Wshadow -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations,$(TEMPLATE_VBOXGUESTR3EXE_CFLAGS)) -Wno-sign-compare
|
---|
4291 | endif
|
---|
4292 |
|
---|
4293 | #
|
---|
4294 | # Template for building R3 (dynamic) libraries for the guest additions (no -pedantic)
|
---|
4295 | #
|
---|
4296 | TEMPLATE_VBOXGUESTR3NPDLL = VBox Guest User Dynamic Libraries Non-pedantic
|
---|
4297 | TEMPLATE_VBOXGUESTR3NPDLL_EXTENDS = VBOXGUESTR3NPEXE
|
---|
4298 | ## @todo add a INSTFUN that separates dlls and libs.
|
---|
4299 | ifn1of ($(KBUILD_TARGET), darwin os2 win)
|
---|
4300 | TEMPLATE_VBOXGUESTR3NPDLL_DEFS = $(TEMPLATE_VBOXGUESTR3NPEXE_DEFS) PIC
|
---|
4301 | TEMPLATE_VBOXGUESTR3NPDLL_CFLAGS = $(TEMPLATE_VBOXGUESTR3NPEXE_CFLAGS) -fPIC
|
---|
4302 | TEMPLATE_VBOXGUESTR3NPDLL_CXXFLAGS = $(TEMPLATE_VBOXGUESTR3NPEXE_CXXFLAGS) -fPIC -fno-exceptions
|
---|
4303 | TEMPLATE_VBOXGUESTR3NPDLL_LDFLAGS = $(TEMPLATE_VBOXGUESTR3NPEXE_LDFLAGS) -fPIC
|
---|
4304 | endif
|
---|
4305 |
|
---|
4306 | #
|
---|
4307 | # Template for building R3 (static) libraries for the guest additions (no -pedantic)
|
---|
4308 | #
|
---|
4309 | TEMPLATE_VBOXGUESTR3NPLIB = VBox Guest User Libraries Non-pedantic
|
---|
4310 | TEMPLATE_VBOXGUESTR3NPLIB_EXTENDS = VBOXGUESTR3NPEXE
|
---|
4311 | TEMPLATE_VBOXGUESTR3NPLIB_INST = $(INST_ADDITIONS_LIB)
|
---|
4312 | ## @todo r=bird: Fix the *R3Mini template to VBOXGUESTR3DLL and remove this hack.
|
---|
4313 | ifeq ($(filter-out solaris.x86 %.amd64 %.sparc32 %.sparc64,$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)),) ## TODO: Remove these checks!
|
---|
4314 | ifn1of ($(KBUILD_TARGET), darwin os2 win)
|
---|
4315 | TEMPLATE_VBOXGUESTR3NPLIB_DEFS = $(TEMPLATE_VBOXGUESTR3NPEXE_DEFS) PIC
|
---|
4316 | TEMPLATE_VBOXGUESTR3NPLIB_CFLAGS = $(TEMPLATE_VBOXGUESTR3NPEXE_CFLAGS) -fPIC
|
---|
4317 | TEMPLATE_VBOXGUESTR3NPLIB_CXXFLAGS = $(TEMPLATE_VBOXGUESTR3NPEXE_CXXFLAGS) -fPIC -fno-exceptions
|
---|
4318 | endif
|
---|
4319 | endif
|
---|
4320 |
|
---|
4321 |
|
---|
4322 | #
|
---|
4323 | # Template for XFree86 guest modules (relocatable module, i.e. sysmod).
|
---|
4324 | # This mostly about zapping the VBOXR3EXE linker flags and libraries.
|
---|
4325 | #
|
---|
4326 | TEMPLATE_VBOXGUESTR3XF86MOD = VBox XFree86 Guest Module
|
---|
4327 | TEMPLATE_VBOXGUESTR3XF86MOD_EXTENDS = VBOXGUESTR3EXE
|
---|
4328 | TEMPLATE_VBOXGUESTR3XF86MOD_LIBS.$(KBUILD_TYPE) = $(NO_SUCH_VARIABLE)
|
---|
4329 | TEMPLATE_VBOXGUESTR3XF86MOD_LIBS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE)
|
---|
4330 | TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE)
|
---|
4331 | TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.$(KBUILD_TYPE) = $(NO_SUCH_VARIABLE)
|
---|
4332 | TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS = -r
|
---|
4333 | if1of ($(KBUILD_TARGET), dragonfly freebsd linux netbsd openbsd) # the gnu ld guys.
|
---|
4334 | TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.release = -S
|
---|
4335 | TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.x86 = -m elf_i386
|
---|
4336 | TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.amd64 = -m elf_x86_64
|
---|
4337 | endif
|
---|
4338 | TEMPLATE_VBOXGUESTR3XF86MOD_CFLAGS = $(TEMPLATE_VBOXGUESTR3EXE_CFLAGS) -fno-merge-constants -std=c99 $(VBOX_GCC_fno-stack-protector) -ffreestanding
|
---|
4339 | TEMPLATE_VBOXGUESTR3XF86MOD_CXXFLAGS= $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS) -fno-merge-constants $(VBOX_GCC_fno-stack-protector) -ffreestanding
|
---|
4340 | TEMPLATE_VBOXGUESTR3XF86MOD_SYSSUFF = .o
|
---|
4341 | TEMPLATE_VBOXGUESTR3XF86MOD_LIBS = \
|
---|
4342 | $(VBOX_LIB_VBGL_R3_XFREE86)
|
---|
4343 | TEMPLATE_VBOXGUESTR3XF86MOD_DEFS = $(TEMPLATE_VBOXGUESTR3DLL_DEFS) VBOX_GUESTR3XF86MOD RTMEM_NO_WRAP_TO_EF_APIS
|
---|
4344 |
|
---|
4345 |
|
---|
4346 | #
|
---|
4347 | # Template for XFree86 guest libraries.
|
---|
4348 | #
|
---|
4349 | TEMPLATE_VBOXGUESTR3XF86LIB = VBox XFree86 Guest Library
|
---|
4350 | TEMPLATE_VBOXGUESTR3XF86LIB_EXTENDS = VBOXGUESTR3XF86MOD
|
---|
4351 | TEMPLATE_VBOXGUESTR3XF86LIB_INST = $(INST_ADDITIONS_LIB)
|
---|
4352 |
|
---|
4353 |
|
---|
4354 | #
|
---|
4355 | # Template for X.org guest modules (shared libs).
|
---|
4356 | # This mostly about zapping unnecessary LIBS from VBOXGUESTR3DLL and adding some flags.
|
---|
4357 | #
|
---|
4358 | TEMPLATE_VBOXGUESTR3XORGMOD = VBox X.org Guest Module
|
---|
4359 | TEMPLATE_VBOXGUESTR3XORGMOD_EXTENDS = VBOXGUESTR3DLL
|
---|
4360 | TEMPLATE_VBOXGUESTR3XORGMOD_LIBS.$(KBUILD_TYPE) = $(NO_SUCH_VARIABLE)
|
---|
4361 | TEMPLATE_VBOXGUESTR3XORGMOD_LIBS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE)
|
---|
4362 | TEMPLATE_VBOXGUESTR3XORGMOD_CFLAGS = $(TEMPLATE_VBOXGUESTR3DLL_CFLAGS) -std=c99
|
---|
4363 | TEMPLATE_VBOXGUESTR3XORGMOD_DEFS = $(TEMPLATE_VBOXGUESTR3DLL_DEFS) LOG_TO_BACKDOOR VBOX_GUESTR3XORGMOD RTMEM_NO_WRAP_TO_EF_APIS
|
---|
4364 | ifeq ($(KBUILD_TARGET_ARCH),amd64)
|
---|
4365 | TEMPLATE_VBOXGUESTR3XORGMOD_DEFS += _XSERVER64
|
---|
4366 | endif
|
---|
4367 | if1of ($(KBUILD_TARGET), linux)
|
---|
4368 | TEMPLATE_VBOXGUESTR3XORGMOD_LDFLAGS = $(TEMPLATE_VBOXGUESTR3DLL_LDFLAGS)
|
---|
4369 | endif
|
---|
4370 | TEMPLATE_VBOXGUESTR3XORGMOD_LIBS = \
|
---|
4371 | $(VBOX_LIB_VBGL_R3_SHARED) \
|
---|
4372 | $(VBOX_LIB_IPRT_GUEST_R3_MINI) \
|
---|
4373 | $(VBOX_LIB_VBGL_R3_SHARED) \
|
---|
4374 | $(VBOX_LIB_IPRT_GUEST_R3_MINI)
|
---|
4375 | TEMPLATE_VBOXGUESTR3XORGMOD_LIBS.freebsd += \
|
---|
4376 | iconv
|
---|
4377 |
|
---|
4378 | #
|
---|
4379 | # Template for guest stuff that makes use of the C++ library and features.
|
---|
4380 | # (This is mostly about undoing what was done to C++ for VBOXGUESTR3EXE.)
|
---|
4381 | #
|
---|
4382 | TEMPLATE_VBOXGUESTR3CPPEXE = VBox Guest Program with C++ library dependencies
|
---|
4383 | TEMPLATE_VBOXGUESTR3CPPEXE_EXTENDS = VBOXGUESTR3EXE
|
---|
4384 | ifeq ($(KBUILD_TARGET),win)
|
---|
4385 | # later if necessary
|
---|
4386 | else
|
---|
4387 | TEMPLATE_VBOXGUESTR3CPPEXE_TOOL = $(TEMPLATE_VBOXR3EXE_TOOL)
|
---|
4388 | TEMPLATE_VBOXGUESTR3CPPEXE_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS)
|
---|
4389 | endif
|
---|
4390 |
|
---|
4391 |
|
---|
4392 | #
|
---|
4393 | # Template for building R0 drivers for the guest additions.
|
---|
4394 | #
|
---|
4395 | TEMPLATE_VBOXGUESTR0 = VBox Guest Driver
|
---|
4396 | TEMPLATE_VBOXGUESTR0_EXTENDS = VBOXR0DRV
|
---|
4397 | TEMPLATE_VBOXGUESTR0_INST = $(INST_ADDITIONS)
|
---|
4398 | TEMPLATE_VBOXGUESTR0_SDKS.win.x86 = WIN32SDK $(VBOX_WINDDK)
|
---|
4399 | TEMPLATE_VBOXGUESTR0_SDKS.win.amd64 = $(VBOX_WINDDK) WINPSDKINCS
|
---|
4400 | TEMPLATE_VBOXGUESTR0_LIBS.win.x86 = \
|
---|
4401 | $(PATH_SDK_$(VBOX_WINDDK)_LIB)/int64.lib
|
---|
4402 | TEMPLATE_VBOXGUESTR0_DEFS = $(TEMPLATE_VBOXR0DRV_DEFS) IN_GUEST IN_GUEST_R0
|
---|
4403 | ifeq ($(KBUILD_TARGET),solaris) # No VBI for the guest additions yet.
|
---|
4404 | TEMPLATE_VBOXGUESTR0_LDFLAGS = -r -dy
|
---|
4405 | endif
|
---|
4406 |
|
---|
4407 | #
|
---|
4408 | # Template for building R0 libraries for the guest additions.
|
---|
4409 | #
|
---|
4410 | TEMPLATE_VBOXGUESTR0LIB = VBox Guest Driver Libraries
|
---|
4411 | TEMPLATE_VBOXGUESTR0LIB_EXTENDS = VBOXGUESTR0
|
---|
4412 | TEMPLATE_VBOXGUESTR0LIB_INST = $(INST_ADDITIONS_LIB)
|
---|
4413 |
|
---|
4414 | #
|
---|
4415 | # Template for building OpenGL host dlls.
|
---|
4416 | #
|
---|
4417 | TEMPLATE_VBOXCROGLR3HOSTDLL = VBox OpenGL Host DLLs
|
---|
4418 | TEMPLATE_VBOXCROGLR3HOSTDLL_EXTENDS = VBOXR3NP
|
---|
4419 | TEMPLATE_VBOXCROGLR3HOSTDLL_EXTENDS_BY = prepending
|
---|
4420 | TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS = CHROMIUM_THREADSAFE VBOX_WITH_HGCM UNPACKS
|
---|
4421 | TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS.win = _WIN32_WINNT=0x0500 WINDOWS=1
|
---|
4422 | TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS.linux = Linux=1 _GNU_SOURCE
|
---|
4423 | TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS.solaris = SunOS=1 _GNU_SOURCE #GLEXT_64_TYPES_DEFINED
|
---|
4424 | TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS.darwin = DARWIN=1 GL_GLEXT_LEGACY _GNU_SOURCE
|
---|
4425 | ifdef VBOX_WITH_COCOA_QT
|
---|
4426 | TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS.darwin += VBOX_WITH_COCOA_QT
|
---|
4427 | TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.darwin = -framework AppKit
|
---|
4428 | else
|
---|
4429 | TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.darwin = -framework Carbon
|
---|
4430 | endif
|
---|
4431 | TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS.freebsd = FreeBSD=1 _GNU_SOURCE
|
---|
4432 | TEMPLATE_VBOXCROGLR3HOSTDLL_INCS = $(VBOX_PATH_CROGL_INCLUDE) $(VBOX_PATH_CROGL_GENFILES)
|
---|
4433 | TEMPLATE_VBOXCROGLR3HOSTDLL_SDKS.darwin = DARWIN-OPENGL
|
---|
4434 | TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.darwin += \
|
---|
4435 | -framework OpenGL \
|
---|
4436 | -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
|
---|
4437 | -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
|
---|
4438 | TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.linux = -Wl,--no-as-needed
|
---|
4439 | TEMPLATE_VBOXCROGLR3HOSTDLL_BLDDIRS = $(VBOX_PATH_CROGL_GENFILES)/
|
---|
4440 |
|
---|
4441 | #
|
---|
4442 | # Template for building OpenGL host libraries.
|
---|
4443 | #
|
---|
4444 | TEMPLATE_VBOXCROGLR3HOSTLIB = VBox OpenGL Host Libraries
|
---|
4445 | TEMPLATE_VBOXCROGLR3HOSTLIB_EXTENDS = VBOXCROGLR3HOSTDLL
|
---|
4446 | TEMPLATE_VBOXCROGLR3HOSTLIB_INST = $(INST_LIB)
|
---|
4447 |
|
---|
4448 | #
|
---|
4449 | # Template for building OpenGL guest dlls.
|
---|
4450 | #
|
---|
4451 | TEMPLATE_VBOXCROGLR3GUESTDLL = VBox OpenGL Guest DLLs
|
---|
4452 | TEMPLATE_VBOXCROGLR3GUESTDLL_EXTENDS = VBOXGUESTR3NPDLL
|
---|
4453 | TEMPLATE_VBOXCROGLR3GUESTDLL_EXTENDS_BY = prepending
|
---|
4454 | TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS = CHROMIUM_THREADSAFE VBOX_WITH_HGCM
|
---|
4455 | TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS.win = WINDOWS=1
|
---|
4456 | TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS.linux = Linux=1 _GNU_SOURCE
|
---|
4457 | TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS.solaris = SunOS=1 _GNU_SOURCE #GLEXT_64_TYPES_DEFINED
|
---|
4458 | TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS.darwin = DARWIN=1 GL_GLEXT_LEGACY _GNU_SOURCE
|
---|
4459 | ifdef VBOX_WITH_COCOA_QT
|
---|
4460 | TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS.darwin += VBOX_WITH_COCOA_QT
|
---|
4461 | TEMPLATE_VBOXCROGLR3GUESTDLL_LDFLAGS.darwin = -framework AppKit
|
---|
4462 | else
|
---|
4463 | TEMPLATE_VBOXCROGLR3GUESTDLL_LDFLAGS.darwin = -framework Carbon
|
---|
4464 | endif
|
---|
4465 | TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS.freebsd = FreeBSD=1 _GNU_SOURCE
|
---|
4466 | TEMPLATE_VBOXCROGLR3GUESTDLL_INCS = $(VBOX_PATH_CROGL_INCLUDE) $(VBOX_PATH_CROGL_GENFILES)
|
---|
4467 | TEMPLATE_VBOXCROGLR3GUESTDLL_SDKS.darwin = DARWIN-OPENGL
|
---|
4468 | TEMPLATE_VBOXCROGLR3GUESTDLL_LDFLAGS.darwin += \
|
---|
4469 | -framework OpenGL \
|
---|
4470 | -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
|
---|
4471 | -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
|
---|
4472 | TEMPLATE_VBOXCROGLR3GUESTDLL_BLDDIRS = $(VBOX_PATH_CROGL_GENFILES)/
|
---|
4473 |
|
---|
4474 | #
|
---|
4475 | # Template for building OpenGL guest libraries.
|
---|
4476 | #
|
---|
4477 | TEMPLATE_VBOXCROGLR3GUESTLIB = VBox OpenGL Guest Libraries
|
---|
4478 | TEMPLATE_VBOXCROGLR3GUESTLIB_EXTENDS = VBOXCROGLR3GUESTDLL
|
---|
4479 | TEMPLATE_VBOXCROGLR3GUESTLIB_INST = $(INST_ADDITIONS_LIB)
|
---|
4480 |
|
---|
4481 |
|
---|
4482 | #
|
---|
4483 | # Template for building Mesa guest library, Linux-only so far.
|
---|
4484 | #
|
---|
4485 | TEMPLATE_VBOXMESAR3GUESTLIB = VBox Mesa Guest Library
|
---|
4486 | TEMPLATE_VBOXMESAR3GUESTLIB_EXTENDS = VBOXCROGLR3GUESTDLL
|
---|
4487 | TEMPLATE_VBOXMESAR3GUESTLIB_INST = $(INST_ADDITIONS_LIB)
|
---|
4488 | TEMPLATE_VBOXMESAR3GUESTLIB_DEFS.linux = Linux=1
|
---|
4489 | TEMPLATE_VBOXMESAR3GUESTLIB_DEFS.solaris = SunOS=1
|
---|
4490 | TEMPLATE_VBOXMESAR3GUESTLIB_DEFS.darwin = DARWIN=1 GL_GLEXT_LEGACY
|
---|
4491 | ifeq ($(KBUILD_TARGET),linux)
|
---|
4492 | TEMPLATE_VBOXMESAR3GUESTLIB_ASTOOL = $(TEMPLATE_VBOXCROGLR3GUESTDLL_TOOL)
|
---|
4493 | TEMPLATE_VBOXMESAR3GUESTLIB_ASFLAGS = $(NO_SUCH_VARIABLE)
|
---|
4494 | TEMPLATE_VBOXMESAR3GUESTLIB_ASFLAGS.x86 = -m32
|
---|
4495 | TEMPLATE_VBOXMESAR3GUESTLIB_ASFLAGS.amd64 = -m64
|
---|
4496 | TEMPLATE_VBOXMESAR3GUESTLIB_ASDEFS = $(NO_SUCH_VARIABLE)
|
---|
4497 | endif
|
---|
4498 |
|
---|
4499 |
|
---|
4500 | #
|
---|
4501 | # Guest additions libraries (all static).
|
---|
4502 | # The _MINI and _SHARED are both compiled as PIC and intended for linking into a .so/.dll/.dylib.
|
---|
4503 | #
|
---|
4504 | VBOX_LIB_IPRT_GUEST_R3 = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR3$(VBOX_SUFF_LIB)
|
---|
4505 | VBOX_LIB_IPRT_GUEST_R3_MINI = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR3Mini$(VBOX_SUFF_LIB)
|
---|
4506 | VBOX_LIB_IPRT_GUEST_R3_SHARED = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR3Shared$(VBOX_SUFF_LIB)
|
---|
4507 | VBOX_LIB_IPRT_GUEST_R0 = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR0$(VBOX_SUFF_LIB)
|
---|
4508 | ifeq ($(KBUILD_TARGET_ARCH),x86)
|
---|
4509 | VBOX_LIB_IPRT_GUEST_R0_NT4 = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR0NT4$(VBOX_SUFF_LIB)
|
---|
4510 | else
|
---|
4511 | VBOX_LIB_IPRT_GUEST_R0_NT4 = $(VBOX_LIB_IPRT_GUEST_R0)
|
---|
4512 | endif
|
---|
4513 | VBOX_LIB_VBGL_R3 = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR3Lib$(VBOX_SUFF_LIB)
|
---|
4514 | VBOX_LIB_VBGL_R3_XFREE86 = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR3LibXFree86$(VBOX_SUFF_LIB)
|
---|
4515 | VBOX_LIB_VBGL_R3_SHARED = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR3LibShared$(VBOX_SUFF_LIB)
|
---|
4516 | VBOX_LIB_VBGL_R0BASE = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR0LibBase$(VBOX_SUFF_LIB)
|
---|
4517 | VBOX_LIB_VBGL_R0 = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR0Lib$(VBOX_SUFF_LIB)
|
---|
4518 | ifeq ($(KBUILD_TARGET),x86)
|
---|
4519 | VBOX_LIB_IPRT_GUEST_R3_X86 = $(VBOX_LIB_IPRT_GUEST_R3)
|
---|
4520 | VBOX_LIB_IPRT_GUEST_R3_SHARED_X86 = $(VBOX_LIB_IPRT_GUEST_R3_SHARED)
|
---|
4521 | VBOX_LIB_VBGL_R3_X86 = $(VBOX_LIB_VBGL_R3)
|
---|
4522 | VBOX_LIB_VBGL_R3_SHARED_X86 = $(VBOX_LIB_VBGL_R3_SHARED)
|
---|
4523 | else
|
---|
4524 | VBOX_LIB_IPRT_GUEST_R3_X86 = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR3-x86$(VBOX_SUFF_LIB)
|
---|
4525 | VBOX_LIB_IPRT_GUEST_R3_SHARED_X86 = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR3Shared-x86$(VBOX_SUFF_LIB)
|
---|
4526 | VBOX_LIB_VBGL_R3_X86 = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR3Lib-x86$(VBOX_SUFF_LIB)
|
---|
4527 | VBOX_LIB_VBGL_R3_SHARED_X86 = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR3LibShared-x86$(VBOX_SUFF_LIB)
|
---|
4528 | endif
|
---|
4529 |
|
---|
4530 |
|
---|
4531 |
|
---|
4532 | #
|
---|
4533 | # Two targets to coordinate version number changes properly. Note that the
|
---|
4534 | # only way to get a really consistent build is to run 'kmk' in the top-level
|
---|
4535 | # directory. If you don't run it there, you get a consistent sub-tree only.
|
---|
4536 | #
|
---|
4537 | VBOX_BAD_CHAR_SET = ,;:/\$(SP)$(TAB)$(HASH)=![]@%&''()*""<>?^{}|~
|
---|
4538 | VBOX_VERSION_STAMP = $(PATH_OUT)/version-stamp-$(translate $(VBOX_VERSION_STRING)-$(VBOX_C_YEAR)-$(VBOX_VENDOR)-$(VBOX_PRODUCT),$(VBOX_BAD_CHAR_SET),,_)
|
---|
4539 | VBOX_VERSION_HEADER = $(PATH_OUT)/version-generated.h
|
---|
4540 | VBOX_VERSION_MK = $(PATH_OUT)/version-generated.mk
|
---|
4541 |
|
---|
4542 | $(VBOX_VERSION_STAMP): | $(PATH_ROOT)/Config.kmk
|
---|
4543 | $(call MSG_GENERATE,,$@)
|
---|
4544 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
4545 | $(QUIET)$(RM) -f $(wildcard $(PATH_OUT)/version-stamp-*)
|
---|
4546 | $(QUIET)$(APPEND) $@ $(VBOX_VERSION_STRING)
|
---|
4547 |
|
---|
4548 | $(VBOX_VERSION_HEADER): $(VBOX_VERSION_STAMP)
|
---|
4549 | $(call MSG_GENERATE,,$@)
|
---|
4550 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
4551 | $(QUIET)$(RM) -f $@ [email protected]
|
---|
4552 | $(QUIET)$(APPEND) [email protected] '#ifndef ___version_generated_h___'
|
---|
4553 | $(QUIET)$(APPEND) [email protected] '#define ___version_generated_h___'
|
---|
4554 | $(QUIET)$(APPEND) [email protected] ''
|
---|
4555 | $(QUIET)$(APPEND) [email protected] '#define VBOX_VERSION_MAJOR $(VBOX_VERSION_MAJOR)'
|
---|
4556 | $(QUIET)$(APPEND) [email protected] '#define VBOX_VERSION_MINOR $(VBOX_VERSION_MINOR)'
|
---|
4557 | $(QUIET)$(APPEND) [email protected] '#define VBOX_VERSION_BUILD $(VBOX_VERSION_BUILD)'
|
---|
4558 | $(QUIET)$(APPEND) [email protected] '#define VBOX_VERSION_STRING "$(VBOX_VERSION_STRING)"'
|
---|
4559 | $(QUIET)$(APPEND) [email protected] ''
|
---|
4560 | $(QUIET)$(APPEND) [email protected] '#endif'
|
---|
4561 | $(QUIET)$(MV) -f [email protected] $@
|
---|
4562 |
|
---|
4563 |
|
---|
4564 | VBOX_PACKAGE_HEADER = $(PATH_OUT)/package-generated.h
|
---|
4565 |
|
---|
4566 | $(VBOX_PACKAGE_HEADER):
|
---|
4567 | $(call MSG_GENERATE,,$@)
|
---|
4568 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
4569 | $(QUIET)$(RM) -f $@ [email protected]
|
---|
4570 | $(QUIET)$(APPEND) [email protected] '#ifndef ___package_generated_h___'
|
---|
4571 | $(QUIET)$(APPEND) [email protected] '#define ___package_generated_h___'
|
---|
4572 | $(QUIET)$(APPEND) [email protected] ''
|
---|
4573 | $(QUIET)$(APPEND) [email protected] '#define VBOX_PACKAGE_STRING "$(VBOX_PACKAGE_STRING)"'
|
---|
4574 | $(QUIET)$(APPEND) [email protected] ''
|
---|
4575 | $(QUIET)$(APPEND) [email protected] '#endif'
|
---|
4576 | $(QUIET)$(MV) -f [email protected] $@
|
---|
4577 |
|
---|
4578 | VBOX_PRODUCT_HEADER = $(PATH_OUT)/product-generated.h
|
---|
4579 |
|
---|
4580 | $(VBOX_PRODUCT_HEADER): $(VBOX_VERSION_STAMP)
|
---|
4581 | $(call MSG_GENERATE,,$@)
|
---|
4582 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
4583 | $(QUIET)$(RM) -f $@ [email protected]
|
---|
4584 | $(QUIET)$(APPEND) [email protected] '#ifndef ___product_generated_h___'
|
---|
4585 | $(QUIET)$(APPEND) [email protected] '#define ___product_generated_h___'
|
---|
4586 | $(QUIET)$(APPEND) [email protected] ''
|
---|
4587 | $(QUIET)$(APPEND) [email protected] '#define VBOX_VENDOR "$(VBOX_VENDOR)"'
|
---|
4588 | $(QUIET)$(APPEND) [email protected] '#define VBOX_VENDOR_SHORT "$(VBOX_VENDOR_SHORT)"'
|
---|
4589 | $(QUIET)$(APPEND) [email protected] '#define VBOX_PRODUCT "$(VBOX_PRODUCT)"'
|
---|
4590 | $(QUIET)$(APPEND) [email protected] '#define VBOX_C_YEAR "$(VBOX_C_YEAR)"'
|
---|
4591 | $(QUIET)$(APPEND) [email protected] ''
|
---|
4592 | $(QUIET)$(APPEND) [email protected] '#endif'
|
---|
4593 | $(QUIET)$(MV) -f [email protected] $@
|
---|
4594 |
|
---|
4595 | #
|
---|
4596 | # Used for external makefiles which cannot include Config.kmk
|
---|
4597 | #
|
---|
4598 | $(VBOX_VERSION_MK): $(VBOX_VERSION_STAMP)
|
---|
4599 | $(call MSG_GENERATE,,$@)
|
---|
4600 | $(QUIET)$(RM) -f $@ [email protected]
|
---|
4601 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
4602 | $(QUIET)$(APPEND) [email protected] 'VBOX_VERSION_MAJOR = $(VBOX_VERSION_MAJOR)'
|
---|
4603 | $(QUIET)$(APPEND) [email protected] 'VBOX_VERSION_MINOR = $(VBOX_VERSION_MINOR)'
|
---|
4604 | $(QUIET)$(APPEND) [email protected] 'VBOX_VERSION_BUILD = $(VBOX_VERSION_BUILD)'
|
---|
4605 | $(QUIET)$(APPEND) [email protected] 'VBOX_VERSION_STRING = $(VBOX_VERSION_STRING)'
|
---|
4606 | $(QUIET)$(APPEND) [email protected] 'VBOX_VENDOR = $(VBOX_VENDOR)'
|
---|
4607 | $(QUIET)$(APPEND) [email protected] 'VBOX_VENDOR_SHORT = $(VBOX_VENDOR_SHORT)'
|
---|
4608 | $(QUIET)$(APPEND) [email protected] 'VBOX_PRODUCT = $(VBOX_PRODUCT)'
|
---|
4609 | $(QUIET)$(APPEND) [email protected] 'VBOX_C_YEAR = $(VBOX_C_YEAR)'
|
---|
4610 | $(QUIET)$(MV) -f [email protected] $@
|
---|
4611 |
|
---|
4612 | if !defined(VBOX_OSE) && !defined(VBOX_NOINC_LICENSE_VER_KMK)
|
---|
4613 | if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris)
|
---|
4614 | # VBOX_LICENSE_VER is used in several Makefiles
|
---|
4615 | VBOX_LICENSE_VER_KMK = $(PATH_OUT)/license-version.kmk
|
---|
4616 | $(VBOX_LICENSE_VER_KMK): $(VBOX_BRAND_LICENSE_HTML)
|
---|
4617 | $(call MSG_GENERATE,,$(VBOX_LICENSE_VER_KMK))
|
---|
4618 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
4619 | ifdef VBOX_BRAND_LICENSE_VER
|
---|
4620 | $(QUIET)$(RM) -f '$@'
|
---|
4621 | $(APPEND) '$@' 'VBOX_LICENSE_VER=$(VBOX_BRAND_LICENSE_VER)'
|
---|
4622 | else
|
---|
4623 | $(QUIET)$(SED) -e "s/.*License version \([0-9.]*\) *[,&].*/VBOX_LICENSE_VER=\1/;t;d" --output $@ $(VBOX_BRAND_LICENSE_HTML)
|
---|
4624 | endif
|
---|
4625 | -include $(VBOX_LICENSE_VER_KMK)
|
---|
4626 | ifdef VBOX_LICENSE_VER
|
---|
4627 | VBOX_LICENSE_FILES = \
|
---|
4628 | License-$(VBOX_LICENSE_VER).html \
|
---|
4629 | $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES),License-$(VBOX_LICENSE_VER)-$(f).html)
|
---|
4630 | VBOX_LICENSE_BINS = $(addprefix $(PATH_BIN)/,$(VBOX_LICENSE_FILES))
|
---|
4631 | endif
|
---|
4632 | endif
|
---|
4633 | endif
|
---|
4634 |
|
---|
4635 |
|
---|
4636 | ifndef VBOX_NOINC_MISC
|
---|
4637 | # Force building of the version header file as the first thing anywhere in
|
---|
4638 | # the tree. This eliminates the need for manual dependencies on it.
|
---|
4639 | ## @todo there gotta be a better way of doing this.
|
---|
4640 | Makefile.kmk: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK) $(VBOX_PRODUCT_HEADER) $(VBOX_PACKAGE_HEADER)
|
---|
4641 | endif
|
---|
4642 |
|
---|
4643 |
|
---|
4644 | #
|
---|
4645 | # Subversion tree revision.
|
---|
4646 | #
|
---|
4647 | # The VBOX_SVN_REV contains our best guess. Use svn info on the root of the
|
---|
4648 | # tree to determin this it if .svn/entries is found, otherwise fall back on
|
---|
4649 | # the Config.kmk revision.
|
---|
4650 | #
|
---|
4651 | # Makefile rules using this information shall list $(VBOX_SVN_REV_KMK) as a
|
---|
4652 | # prerequisite.
|
---|
4653 | #
|
---|
4654 | SVN ?= svn$(HOSTSUFF_EXE)
|
---|
4655 | VBOX_SVN_REV_KMK = $(PATH_OUT)/revision.kmk
|
---|
4656 | ifndef VBOX_SVN_REV
|
---|
4657 | VBOX_SVN_REV_FALLBACK := $(patsubst %:,, $Rev: 35623 $ )
|
---|
4658 | VBOX_SVN_DEP := $(wildcard $(PATH_ROOT)/.svn/entries)
|
---|
4659 | ifeq ($(which $(SVN)),)
|
---|
4660 | VBOX_SVN_DEP :=
|
---|
4661 | endif
|
---|
4662 |
|
---|
4663 | # Rule for generating a timestamp and updating the real thing on change.
|
---|
4664 | $(VBOX_SVN_REV_KMK).ts +| $(VBOX_SVN_REV_KMK): $(if $(VBOX_SVN_DEP), $(VBOX_SVN_DEP), $(PATH_ROOT)/Config.kmk)
|
---|
4665 | $(call MSG_GENERATE,,$(VBOX_SVN_REV_KMK))
|
---|
4666 | $(QUIET)$(RM) -f $@ [email protected]
|
---|
4667 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
4668 | ifneq ($(VBOX_SVN_DEP),)
|
---|
4669 | $(REDIRECT) -E 'LC_ALL=C' -wo [email protected] -- $(SVN) info $(PATH_ROOT)
|
---|
4670 | ifeq ($(int-mod $(VBOX_VERSION_BUILD), 2),0)
|
---|
4671 | $(SED) -e '/^Last Changed Rev/!d' -e 's/Last Changed Rev\: */export VBOX_SVN_REV=/' --output $@ [email protected]
|
---|
4672 | else
|
---|
4673 | $(SED) -e '/^Revision/!d' -e 's/Revision\: */export VBOX_SVN_REV=/' --output $@ [email protected]
|
---|
4674 | endif
|
---|
4675 | $(QUIET)$(RM) -f [email protected]
|
---|
4676 | else
|
---|
4677 | $(QUIET)$(APPEND) $@ 'export VBOX_SVN_REV=$(VBOX_SVN_REV_FALLBACK)'
|
---|
4678 | endif
|
---|
4679 | $(QUIET)$(CP) --changed -fv $@ $(VBOX_SVN_REV_KMK)
|
---|
4680 |
|
---|
4681 | ifndef VBOX_NOINC_SVN_REV_KMK
|
---|
4682 | include $(VBOX_SVN_REV_KMK)
|
---|
4683 | endif
|
---|
4684 | else
|
---|
4685 | # allow to overwrite VBOX_SVN_REV externally (mainly for building .debs/.rpms)
|
---|
4686 | $(VBOX_SVN_REV_KMK):
|
---|
4687 | $(call MSG_GENERATE,,$(VBOX_SVN_REV_KMK))
|
---|
4688 | $(QUIET)$(RM) -f $@
|
---|
4689 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
4690 | $(QUIET)$(APPEND) $@ 'export VBOX_SVN_REV=$(VBOX_SVN_REV)'
|
---|
4691 | $(QUIET)echo '* $(VBOX_SVN_REV_KMK) was externally overwritten:'
|
---|
4692 | $(QUIET)$(CAT) $(VBOX_SVN_REV_KMK)
|
---|
4693 | endif
|
---|
4694 |
|
---|
4695 | # only needed for VBoxGuest for Linux/FreeBSD guests
|
---|
4696 | VBOX_SVN_REV_HEADER = $(PATH_OUT)/revision-generated.h
|
---|
4697 | $(VBOX_SVN_REV_HEADER): $(VBOX_SVN_REV_KMK)
|
---|
4698 | $(call MSG_GENERATE,,$@)
|
---|
4699 | $(QUIET)$(RM) -f $@ [email protected]
|
---|
4700 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
4701 | $(QUIET)$(APPEND) [email protected] '#define VBOX_SVN_REV $(VBOX_SVN_REV)'
|
---|
4702 | $(QUIET)$(MV) -f [email protected] $@
|
---|
4703 |
|
---|
4704 | #
|
---|
4705 | # Shared definitions of the XIDL file to use as a source for
|
---|
4706 | # generating various other files (VBoxSVC, webservice, docs, front-ends, ...)
|
---|
4707 | #
|
---|
4708 |
|
---|
4709 | # Real XIDL source file; from this we strip the <desc> elements to generate
|
---|
4710 | # a second XIDL file, from which the COM/XPCOM IDL files are then generated:
|
---|
4711 | VBOX_XIDL_FILE_SRC = $(PATH_ROOT)/src/VBox/Main/idl/VirtualBox.xidl
|
---|
4712 | # second XIDL file to use as source for COM/XPCOM IDL (with stripped docs):
|
---|
4713 | VBOX_XIDL_FILE = $(PATH_OUT)/obj/VirtualBox_stripped.xidl
|
---|
4714 |
|
---|
4715 | # Java stuff.
|
---|
4716 | ifeq ($(KBUILD_TARGET), darwin)
|
---|
4717 | VBOX_JAVA_COMMANDS = $(firstword $(wildcard \
|
---|
4718 | /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Commands \
|
---|
4719 | ) /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands)
|
---|
4720 | VBOX_JAVAC = $(VBOX_JAVA_COMMANDS)/javac
|
---|
4721 | VBOX_JAVAH = $(VBOX_JAVA_COMMANDS)/javah
|
---|
4722 | VBOX_JAR = $(VBOX_JAVA_COMMANDS)/jar
|
---|
4723 | VBOX_WSIMPORT = $(VBOX_JAVA_COMMANDS)/wsimport
|
---|
4724 | VBOX_JAVA_INC = $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Headers
|
---|
4725 |
|
---|
4726 | else
|
---|
4727 |
|
---|
4728 | ifeq ($(KBUILD_TARGET),linux)
|
---|
4729 | ifeq ($(origin VBOX_JAVA_HOME),undefined)
|
---|
4730 | # Add correct detection for you distro after the /usr/../java-6-sun line.
|
---|
4731 | VBOX_JAVA_HOME := $(firstword $(wildcard \
|
---|
4732 | $(PATH_DEVTOOLS)/linux.x86/jdk1.6.0_21 \
|
---|
4733 | /usr/lib/jvm/java-6-sun \
|
---|
4734 | /usr/lib/jvm/java-6-openjdk \
|
---|
4735 | \
|
---|
4736 | /usr/lib/jvm/sun-jdk-1.6 \
|
---|
4737 | ) /usr/lib/jvm/java-6-sun)
|
---|
4738 | endif
|
---|
4739 | endif
|
---|
4740 |
|
---|
4741 | ifeq ($(KBUILD_TARGET),solaris)
|
---|
4742 | # VBOX_JAVA_HOME ?= /usr/jdk/jdk1.6.0
|
---|
4743 | VBOX_JAVA_HOME ?= /usr/java
|
---|
4744 | endif
|
---|
4745 |
|
---|
4746 | ifeq ($(KBUILD_TARGET),win)
|
---|
4747 | VBOX_JAVA_HOME ?= c:/jdk
|
---|
4748 | endif
|
---|
4749 |
|
---|
4750 | VBOX_JAVAC = $(VBOX_JAVA_HOME)/bin/javac
|
---|
4751 | VBOX_JAVAH = $(VBOX_JAVA_HOME)/bin/javah
|
---|
4752 | VBOX_JAR = $(VBOX_JAVA_HOME)/bin/jar
|
---|
4753 | VBOX_WSIMPORT = $(VBOX_JAVA_HOME)/bin/wsimport
|
---|
4754 | # correct for targets we care about
|
---|
4755 | VBOX_MD_OS = $(KBUILD_TARGET)
|
---|
4756 | VBOX_JAVA_INC = \
|
---|
4757 | $(VBOX_JAVA_HOME)/include \
|
---|
4758 | $(VBOX_JAVA_HOME)/include/$(VBOX_MD_OS)
|
---|
4759 | endif
|
---|
4760 |
|
---|
4761 | ifeq ($(KBUILD_TARGET), win)
|
---|
4762 | VBOX_SEP=\;
|
---|
4763 | else
|
---|
4764 | VBOX_SEP=:
|
---|
4765 | endif
|
---|
4766 | VBOX_JAVAC_OPTS = -source 1.5 -target 1.5 -Xlint:unchecked
|
---|
4767 |
|
---|
4768 | #
|
---|
4769 | # Legacy.
|
---|
4770 | #
|
---|
4771 | ## @todo try remove this.
|
---|
4772 | ifneq ($(LOCALCFG),)
|
---|
4773 | include $(LOCALCFG)
|
---|
4774 | endif
|
---|
4775 |
|
---|
4776 |
|
---|
4777 | #
|
---|
4778 | # Some extra goals.
|
---|
4779 | #
|
---|
4780 | .PHONY: up update st stat status
|
---|
4781 | up update::
|
---|
4782 | $(SVN) up
|
---|
4783 |
|
---|
4784 | up2 update2::
|
---|
4785 | $(SVN) up --ignore-externals
|
---|
4786 |
|
---|
4787 | st stat status:
|
---|
4788 | $(SVN) status
|
---|
4789 |
|
---|
4790 | quick:
|
---|
4791 | $(MAKE) VBOX_QUICK=1
|
---|