VirtualBox

source: vbox/trunk/Config.kmk@ 34867

Last change on this file since 34867 was 34801, checked in by vboxsync, 14 years ago

Cross building 32-bit additions binaries while building the win.amd64 additions.

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