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