VirtualBox

source: vbox/trunk/Config.kmk@ 26735

Last change on this file since 26735 was 26725, checked in by vboxsync, 15 years ago

make VBox build on Ubuntu Karmic

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