VirtualBox

source: vbox/trunk/Config.kmk@ 26956

Last change on this file since 26956 was 26951, checked in by vboxsync, 15 years ago

introduced VBOX_WITH_VUSB

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