VirtualBox

source: vbox/trunk/Config.kmk@ 33010

Last change on this file since 33010 was 32975, checked in by vboxsync, 14 years ago

Config.kmk: enable VRDP memory consumption limit.

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette