Config.kmk revision ad668002ef2563fe2b6e2bd892eb38c9a9239501
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# The global build configuration file for VBox.
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# This file gets included by all makefiles through the
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# include $(KBUILD_PATH)/header.kmk statement.
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# Copyright (C) 2006-2013 Oracle Corporation
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# This file is part of VirtualBox Open Source Edition (OSE), as
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# available from http://www.virtualbox.org. This file is free software;
e6c3a72a023407f5d1fface64356e1cc81f1af31Phill Cunnington# you can redistribute it and/or modify it under the terms of the GNU
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# General Public License (GPL) as published by the Free Software
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# Foundation, in version 2 as it comes in the "COPYING" file of the
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
f36d7fc719bcbc9aba272b40a4723a24a81d6e0cAndrew ForrestVBOX_ROOT_CONFIG_KMK_INCLUDED = 1
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# kBuild stuff
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# Build with umask 022 (requires kBuild r2556 to work, harmless on earlier).
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest$(set-umask 022)
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# Modify the build types.
5fe0c687369d88782edc616837346adcd42e4bf1sean oneillKBUILD_BLD_TYPES = release profile debug kprofile
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest## 'strict' builds
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# Same as release builds, except that RT_STRICT and VBOX_STRICT are defined,
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# meaning all assertions are in action. (Appending means '.strict' props take
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# precedence in argument lists.)
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew ForrestKBUILD_BLD_TYPES += strict
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew ForrestBLD_TYPE_strict_EXTENDS = release
5fe0c687369d88782edc616837346adcd42e4bf1sean oneillBLD_TYPE_strict_EXTENDS_BY = appending
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest## 'dbgopt' builds
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# Same as debug builds, except that compiler optimizations are enabled. This
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# intended for cases where all the debug facitities (logging, assertions, ++)
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# is wanted but actual source level debugging as important as execution speed.
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew ForrestKBUILD_BLD_TYPES += dbgopt
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew ForrestBLD_TYPE_dbgopt_EXTENDS = debug
6b2668dc101d6c62adc8c13810988a006e2ba666Andrew ForrestBLD_TYPE_dbgopt_EXTENDS_BY = overriding
6b2668dc101d6c62adc8c13810988a006e2ba666Andrew Forrest# Temporary hack for kBuild ticket #83.
6b2668dc101d6c62adc8c13810988a006e2ba666Andrew Forrest## @todo kBuild: remove after closing ticket #83.
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew ForrestPROPS_ACCUMULATE_L_LNK += INTERMEDIATES
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew ForrestPROPS_PROGRAMS_ACCUMULATE_L += INTERMEDIATES
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew ForrestPROPS_LIBRARIES_ACCUMULATE_L += INTERMEDIATES
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew ForrestPROPS_DLLS_ACCUMULATE_L += INTERMEDIATES
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew ForrestPROPS_SYSMODS_ACCUMULATE_L += INTERMEDIATES
5fe0c687369d88782edc616837346adcd42e4bf1sean oneillPROPS_MISCBINS_ACCUMULATE_L += INTERMEDIATES
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# Misc names used bye the install paths below.
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew ForrestVBOX_PUEL_MANGLED_NAME := Oracle_VM_VirtualBox_Extension_Pack
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# Install paths
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest## @todo This will change after 4.1 is branched off!
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# What is now 'bin' and 'lib' will be moved down under 'staged/', except on
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# darwin where it's currently called 'dist' which will be renamed to 'staged'.
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# When running 'kmk install' files will be copied to 'dist/', on unix systems
5fe0c687369d88782edc616837346adcd42e4bf1sean oneill# this will be done in FHS fashion assuming /usr/local or /usr as 'prefix'.
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest# Changes related to this are marked VBOX_WITH_NEW_LAYOUT.
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrestifndef VBOX_WITH_NEW_LAYOUT
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest PATH_INS = $(PATH_OUT)/dist
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest PATH_STAGE = $(PATH_OUT)
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrestifeq ($(KBUILD_TARGET),darwin)
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest ifndef VBOX_WITH_NEW_LAYOUT
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest INST_DIST = dist/
3ef7943a413e2f65a83b81e84a371d240298eb03Julian Kigwana INST_SDK = $(INST_DIST)sdk/
3ef7943a413e2f65a83b81e84a371d240298eb03Julian Kigwana # the bundles
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest INST_VIRTUALBOX = $(INST_DIST)VirtualBox.app/
ea65b6bac936db133a660beef9d75f044dd7ce84Andrew Forrest INST_VBOXDRV = $(INST_DIST)VBoxDrv.kext/
f36d7fc719bcbc9aba272b40a4723a24a81d6e0cAndrew Forrest INST_VBOXNETFLT = $(INST_DIST)VBoxNetFlt.kext/
INST_VBOXNETADP = $(INST_DIST)VBoxNetAdp.kext/
INST_VBOXUSB = $(INST_DIST)VBoxUSB.kext/
INST_BIN = $(INST_VIRTUALBOX)Contents/MacOS/
VBOX_INST_DTRACE_LIB = $(INST_BIN)dtrace/lib/
VBOX_INST_DTRACE_TST = $(INST_BIN)dtrace/testcase/
VBOX_INST_DTRACE_LIB = $(INST_BIN)dtrace/lib/
VBOX_INST_DTRACE_TST = $(INST_BIN)dtrace/testcase/
$(error You must update kBuild! Requires kBuild revision 2577 or later, found $(KMK_REVISION) ($(KBUILD_VERSION)))
# The raw version string. This *must not* contain any other information/fields than
# major, minor and build revision (as it is now) -- also will be used for host/guest version
# This can be overridden in LocalConfig.kmk or elsewhere.
# For the convension, see checks near the end of Config.kmk.
# Full version string (may include more than just x.y.z, but no spaces or other problematic chars).
# Force the additions.sh script to get an exact additions build when we're doing the release.
# src/VBox/Installer/linux/{debian,rpm}
# distribution, mostly for Linux/Solaris where we support different distributions
# (Except when cross-building on linux since we're using /usr/src/...)
ifn1of ($(KBUILD_TARGET).$(KBUILD_HOST_ARCH).$(KBUILD_TARGET_ARCH), linux.x86.amd64 linux.amd64.x86)
# This is not used by makefiles, only Config.kmk, see below.
# Include CHM when building docs (unset in LocalConfig.kmk to suppress CHM)
# This is not used by makefiles, only Config.kmk, see below.
# Enable the virtual SATA/AHCI controller
# Enable the hal/sysfs USB code on Linux.
# The kernel driver/module and related runtime libraries.
ifeq ($(filter win.amd64,$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)),) # too much work with freetype and all that.
# Enable the host/guest information service (aka guest properties).
if1of ($(KBUILD_TARGET), darwin freebsd linux solaris) ## @todo this should be set and used on windows too.
# Enables VMMR0.r0 (++) loading using the native loader on solaris.
if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.x86 darwin.amd64 linux.x86 linux.amd64 win.x86 win.amd64)
# Most developers will want to disable this in their LocalConfig.kmk.
#VBOX_PATH_APP_PRIVATE = /usr/lib/virtualbox
VBOX_PATH_APP_PRIVATE = /opt/VirtualBox
VBOX_PATH_APP_PRIVATE = /Applications/VirtualBox.app/Contents/MacOS
VBOX_PATH_APP_PRIVATE = /usr/local/lib/virtualbox
VBOX_PATH_APP_PRIVATE = /boot/apps/VirtualBox
#VBOX_PATH_APP_PRIVATE_ARCH = /usr/lib/virtualbox
VBOX_PATH_APP_PRIVATE_ARCH = $(VBOX_PATH_APP_PRIVATE_ARCH_TOP)/$(if-expr $(KBUILD_TARGET_ARCH) == "amd64",amd64,i386)
#VBOX_PATH_SHARED_LIBS = /usr/lib
VBOX_PATH_SHARED_LIBS = $(VBOX_PATH_APP_PRIVATE)/$(if-expr $(KBUILD_TARGET_ARCH) == "amd64",amd64,i386)
#VBOX_PATH_APP_DOCS = /usr/share/doc/virtualbox
# The DT_RPATH/DT_RUNPATH to embed into the binaries (ELF).
#VBOX_WITH_RUNPATH = /usr/lib/virtualbox
# Enable use of the $ORIGIN DT_RPATH/DT_RUNPATH feature (ELF).
# Enable the system wide support service/daemon.
# the debug packages containing symbols for gdb located in /usr/lib/debug.
# Strip R0/GC modules (current requirement for our loader)
# when working VT-x/AMD-V in VMMR0.
# to/from the guest in raw mode. Modern Linux kernels use the performance counter
VBOX_BRAND_BIOS_LOGO := $(PATH_ROOT)/src/VBox/Devices/Graphics/BIOS/puel_logo.bmp
VBOX_BRAND_LICENSE_HTML := $(PATH_ROOT)/doc/License-gpl-2.0.html
VBOX_BRAND_LICENSE_RTF := $(PATH_ROOT)/doc/License-gpl-2.0.rtf
VBOX_BRAND_LICENSE_TXT := $(PATH_ROOT)/doc/License-gpl-2.0.txt
VBOX_BRAND_GUI_ABOUT_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/NonOSE/about.png
VBOX_BRAND_GUI_ABOUT_16PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/NonOSE/about_16px.png
VBOX_BRAND_GUI_VBOX_16PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/NonOSE/VirtualBox_16px.png
VBOX_BRAND_GUI_VBOX_20PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/NonOSE/VirtualBox_20px.png
VBOX_BRAND_GUI_VBOX_32PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/NonOSE/VirtualBox_32px.png
VBOX_BRAND_GUI_VBOX_40PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/NonOSE/VirtualBox_40px.png
VBOX_BRAND_GUI_VBOX_48PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/NonOSE/VirtualBox_48px.png
VBOX_BRAND_GUI_VBOX_64PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/NonOSE/VirtualBox_64px.png
VBOX_BRAND_WIN_INST_DLGJPG := $(PATH_ROOT)/src/VBox/Installer/win/Binary/Dialog.jpg
VBOX_BRAND_WIN_ADD_INST_DLGBMP := $(PATH_ROOT)/src/VBox/Additions/WINNT/Installer/welcome.bmp
VBOX_BRAND_DARWIN_DISKIMAGE_DS_STORE := $(PATH_ROOT)/src/VBox/Installer/darwin/DiskImage/DS_Store
VBOX_BRAND_DARWIN_DISKIMAGE_BG := $(PATH_ROOT)/src/VBox/Installer/darwin/DiskImage/vbox_folder.tiff
VBOX_BRAND_DARWIN_INSTALLER_BG := $(PATH_ROOT)/src/VBox/Installer/darwin/VirtualBox_mpkg/background.tif
# We'll use the native html/help viewer.
# We'll use the native html/help viewer.
AUTOCFG := $(wildcard $(PATH_ROOT)/AutoConfig.kmk)
LOCALCFG := $(wildcard $(PATH_ROOT)/LocalConfig.kmk)
$(warning VBOX_WITHOUT_LINUX_COMPILER_H was renamed to VBOX_WITH_LINUX_COMPILER_H, the meaning is inverted.)
VBOX_BRAND_LICENSE_HTML := $(PATH_ROOT)/doc/License-gpl-2.0.html
VBOX_BRAND_LICENSE_RTF := $(PATH_ROOT)/doc/License-gpl-2.0.rtf
VBOX_BRAND_LICENSE_TXT := $(PATH_ROOT)/doc/License-gpl-2.0.txt
VBOX_BRAND_BIOS_LOGO := $(PATH_ROOT)/src/VBox/Devices/Graphics/BIOS/ose_logo.bmp
VBOX_BRAND_GUI_ABOUT_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/about.png
VBOX_BRAND_GUI_ABOUT_16PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/about_16px.png
VBOX_BRAND_GUI_VBOX_16PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_16px.png
VBOX_BRAND_GUI_VBOX_20PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_20px.png
VBOX_BRAND_GUI_VBOX_32PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_32px.png
VBOX_BRAND_GUI_VBOX_40PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_40px.png
VBOX_BRAND_GUI_VBOX_48PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_48px.png
VBOX_BRAND_GUI_VBOX_64PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_64px.png
VBOX_BRAND_GUI_CUBE_42PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_cube_42px.png
# VBOX_WITHOUT_HARDENING is for developers (put in LocalConfig.kmk).
VBOX_JAVA_PACKAGE = org.virtualbox$(VBOX_API_SUFFIX)
# (yasm/nasm) and possibly two different formats (32-bit/64-bit).
VBOX_LDR_FMT_2_YASM_DBGINFO.elf = -g dwarf2
VBOX_LDR_FMT_2_YASM_DBGINFO.lx = -g stabs
VBOX_LDR_FMT_2_YASM_DBGINFO.pe = -g cv8
VBOX_ASFLAGS = $(VBOX_ASFLAGS_FMT) -D__YASM__ -Worphan-labels $(VBOX_LDR_FMT_2_YASM_DBGINFO.$(VBOX_LDR_FMT))
VBOX_ASFLAGS32 = $(VBOX_ASFLAGS_FMT32) -D__YASM__ -Worphan-labels $(VBOX_LDR_FMT_2_YASM_DBGINFO.$(VBOX_LDR_FMT32))
VBOX_ASFLAGS64 = $(VBOX_ASFLAGS_FMT64) -D__YASM__ -Worphan-labels $(VBOX_LDR_FMT_2_YASM_DBGINFO.$(VBOX_LDR_FMT64))
TOOL_GXX3PLAIN_LD_SYSMOD ?= /usr/ccs/bin/ld
else ifeq ($(KBUILD_TARGET_ARCH).$(KBUILD_HOST_ARCH),amd64.x86)
$(error VBox: VBOX_VCC_TOOL_STEM='$(VBOX_VCC_TOOL_STEM)' is not supported, only VCC100 and VCC110 is)
TOOL.win.x86 = $(VBOX_VCC_TOOL_STEM)X86
TOOL.win.amd64 = $(VBOX_VCC_TOOL_STEM)AMD64
$(L4LINUX26_DIR)/include/asm-l4/i386-arch
CFLAGS.l4 = -mno-red-zone
CXXFLAGS.l4 = -mno-red-zone
$(L4_OBJ)/include/uclibc++ \
$(L4_OBJ)/include/uclibc \
$(L4_DIR)/tool/dice/include
ifeq ($(KBUILD_TARGET).$(KBUILD_TYPE),l4.debug)
DEFS.debug := DEBUG DEBUG_$(subst $(subst _, ,_),_,$(USERNAME)) DEBUG_USERNAME=$(subst $(subst _, ,_),_,$(USERNAME))
DEFS.profile = VBOX_WITH_STATISTICS
DEFS.strict = RT_STRICT VBOX_STRICT
DEFS.x86 = RT_ARCH_X86 __X86__
DEFS.amd64 = RT_ARCH_AMD64 __AMD64__
DEFS.darwin = RT_OS_DARWIN __DARWIN__
DEFS.freebsd = RT_OS_FREEBSD __FREEBSD__
DEFS.haiku = RT_OS_HAIKU
DEFS.l4 = RT_OS_L4 __L4__ __L4ENV__ L4API_l4v2 ARCH_$(KBUILD_TARGET_ARCH) __NO_CTYPE _FILE_OFFSET_BITS=64
DEFS.linux = RT_OS_LINUX _FILE_OFFSET_BITS=64
DEFS.netbsd = RT_OS_NETBSD
DEFS.openbsd = RT_OS_OPENBSD
DEFS.os2 = RT_OS_OS2 __OS2__
DEFS.solaris = RT_OS_SOLARIS _FILE_OFFSET_BITS=64
DEFS.win = RT_OS_WINDOWS __WIN__
DEFS.win.x86 = __WIN32__
DEFS.win.amd64 = __WIN64__
VBOX_GCC_WARN ?= -Wall $(VBOX_GCC_Wextra) $(VBOX_GCC_Wno-missing-field-initializers) -Wno-unused -Wno-trigraphs $(VBOX_GCC_fdiagnostics-show-option)
VBOX_GCC_PEDANTIC_CXX ?= -pedantic -Wshadow $(VBOX_GCC_WARN_PEDANTIC) -Wno-long-long $(VBOX_GCC_Wno-delete-non-virtual-dtor)
VBOX_GCC_PEDANTIC_C ?= -pedantic -Wshadow $(VBOX_GCC_WARN_PEDANTIC) -Wno-long-long -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Werror-implicit-function-declaration
LIB_RUNTIME = $(PATH_STAGE_BIN)/VBoxRT.dylib
LIB_RUNTIME_EF = #$(PATH_STAGE_LIB)/RuntimeEFCPP.a
LIB_KPROFILE = $(PATH_STAGE_BIN)/kPrf2.dylib
LIB_VMM = $(PATH_STAGE_BIN)/VBoxVMM.dylib
LIB_VMMGC = $(PATH_STAGE_BIN)/VMMGC.gc
LIB_REM = $(PATH_STAGE_LIB)/VBoxREM.dylib
LIB_XPCOM = $(PATH_STAGE_BIN)/VBoxXPCOM.dylib
LIB_DDU = $(PATH_STAGE_BIN)/VBoxDDU.dylib
LIB_RUNTIME = $(PATH_STAGE_BIN)/VBoxRT.s.so
LIB_RUNTIME_EF = #$(PATH_STAGE_LIB)/RuntimeEFCPP.a
LIB_KPROFILE = $(PATH_STAGE_BIN)/kPrf2.s.so
LIB_VMM = $(PATH_STAGE_BIN)/VBoxVMM.s.so
LIB_VMMGC = $(PATH_STAGE_BIN)/VMMGC.gc
LIB_REM = $(PATH_STAGE_LIB)/VBoxREM.s.so
LIB_XPCOM = $(PATH_STAGE_BIN)/VBoxXPCOM.s.so
LIB_DDU = $(PATH_STAGE_BIN)/VBoxDDU.s.so
LIB_RUNTIME = $(PATH_STAGE_BIN)/VBoxRT.so
LIB_RUNTIME_EF = $(PATH_STAGE_LIB)/RuntimeEFCPP.a
LIB_KPROFILE = $(PATH_STAGE_BIN)/kPrf2.so
LIB_VMM = $(PATH_STAGE_BIN)/VBoxVMM.so
LIB_VMMGC = $(PATH_STAGE_BIN)/VMMGC.gc
LIB_REM = $(PATH_STAGE_LIB)/VBoxREM.so
LIB_XPCOM = $(PATH_STAGE_BIN)/VBoxXPCOM.so
LIB_DDU = $(PATH_STAGE_BIN)/VBoxDDU.so
LIB_RUNTIME = $(PATH_STAGE_BIN)/VBoxRT.dll
LIB_RUNTIME_EF = #$(PATH_STAGE_LIB)/RuntimeEFCPP.a
LIB_KPROFILE = $(PATH_STAGE_BIN)/kPrf2.dll
LIB_VMM = $(PATH_STAGE_BIN)/VBoxVMM.dll
LIB_VMMGC = $(PATH_STAGE_LIB)/VMMRCImp.lib
LIB_REM = $(PATH_STAGE_LIB)/VBoxREMImp.lib
LIB_XPCOM = $(PATH_STAGE_BIN)/VBoxXCOM.dll
LIB_DDU = $(PATH_STAGE_BIN)/VBoxDDU.dll
VBOX_OBJ_SYS0 = $(PATH_OBJ)/RuntimeR0/os2/sys0.obj
LIB_RUNTIME = $(PATH_STAGE_LIB)/VBoxRT.lib
LIB_RUNTIME_EF = #$(PATH_STAGE_LIB)/RuntimeEFCPP.lib
LIB_KPROFILE = $(PATH_STAGE_LIB)/kPrf2.lib
LIB_VMM = $(PATH_STAGE_LIB)/VBoxVMM.lib
LIB_VMMGC = $(PATH_OBJ)/VMMRC/VMMGC.lib
LIB_REM = $(PATH_STAGE_LIB)/VBoxREMImp.lib
LIB_XPCOM = $(PATH_STAGE_BIN)/VBoxXPCOM.dll
LIB_DDU = $(PATH_STAGE_LIB)/VBoxDDU.lib
VBOX_BLD_PYTHON := $(firstword $(rsort $(wildcard $(PATH_DEVTOOLS)/win.x86/python/v*/python$(HOSTSUFF_EXE))) python-not-found.exe)
# Enable C++ electric fence heap. (Warning: will easily run out of virtual memory / kernel stuff on Linux/Windows.)
VBOX_XCURSOR_LIBS := $(lastword $(wildcard $(PATH_DEVTOOLS_TRG)/libXcursor/*/lib/libXcursor.a))
VBOX_XCURSOR_INCS := $(patsubst %/lib/libXcursor.a,%/include, $(VBOX_XCURSOR_LIBS))
VBOX_IASLCMD ?= $(firstword $(wildcard $(PATH_DEVTOOLS_BLD)/bin/iasl$(HOSTSUFF_EXE)) iasl$(HOSTSUFF_EXE))
VBOX_XSLTPROC ?= $(PATH_DEVTOOLS)/win.x86/bin/xsltproc.exe
VBOX_XSLTPROC ?= BEGINLIBPATH="$(PATH_DEVTOOLS_BLD)/bin;$$BEGINLIBPATH" $(PATH_DEVTOOLS_BLD)/bin/xsltproc.exe
VBOX_XSLTPROC ?= $(PATH_DEVTOOLS)/haiku.x86/bin/xsltproc
VBOX_BIN2C ?= $(PATH_OBJ)/bin2c/bin2c$(HOSTSUFF_EXE)
VBOX_RTMANIFEST ?= $(PATH_OBJ)/bldRTManifest/bldRTManifest$(HOSTSUFF_EXE)
# VBoxCmp (simple /bin/cmp with more sensible output)
VBOX_VBOXCMP ?= $(PATH_OBJ)/VBoxCmp/VBoxCmp$(HOSTSUFF_EXE)
VBOX_VBOXCPP ?= $(PATH_OBJ)/VBoxCPP/VBoxCPP$(HOSTSUFF_EXE)
VBOX_VBOXTPG ?= $(PATH_OBJ)/VBoxTpG/VBoxTpG$(HOSTSUFF_EXE)
VBOX_PE_SET_VERSION ?= $(PATH_OBJ)/VBoxPeSetVersion/VBoxPeSetVersion$(HOSTSUFF_EXE)
VBOX_FILESPLIT ?= $(PATH_OBJ)/filesplitter/filesplitter$(HOSTSUFF_EXE)
VBOX_BIOSSUMS ?= $(PATH_OBJ)/biossums/biossums$(HOSTSUFF_EXE)
VBOX_MAKE_ALTERNATIVE_SOURCE ?= $(PATH_OBJ)/MakeAlternativeSource/MakeAlternativeSource$(HOSTSUFF_EXE)
VBOX_MKISOFS ?= $(PATH_DEVTOOLS_BLD)/bin/mkisofs.exe
VBOX_MAKESELF ?= $(PATH_DEVTOOLS)/common/makeself/v2.1.5/makeself.sh
VBOX_PATH_HTML_HELP_WORKSHOP ?= $(PATH_DEVTOOLS)/win.x86/HTML_Help_Workshop/v1.3/
VBOX_PATH_NSIS ?= $(PATH_DEVTOOLS)/win.x86/nsis/v2.46-log-nsscm-r1
VBOX_PATH_AUTOIT3 ?= $(PATH_DEVTOOLS)/win.x86/autoit/v3.2.10.0
VBOX_PATH_WIX ?= $(PATH_DEVTOOLS)/win.x86/wix/v3.5.2519.0
VBOX_PATH_MSITRAN ?= $(PATH_DEVTOOLS)/win.x86/sdk/v7.1/Bin/MsiTran.Exe
VBOX_PATH_MSIDB ?= $(PATH_DEVTOOLS)/win.x86/sdk/v7.1/Bin/MsiDb.Exe
VBOX_PATH_WISUBSTG ?= $(PATH_DEVTOOLS)/win.x86/sdk/v7.1/Samples/sysmgmt/msi/scripts/WiSubStg.vbs
VBOX_PATH_WISUMINFO ?= $(PATH_DEVTOOLS)/win.x86/sdk/v7.1/Samples/sysmgmt/msi/scripts/WiSumInf.vbs
VBOX_PATH_DIFX ?= $(PATH_DEVTOOLS)/win.$(KBUILD_TARGET_ARCH)/DIFx/v2.1-r3
VBOX_PATH_CABSDK ?= $(PATH_DEVTOOLS)/win.x86/cabsdk/r1
VBOX_PATH_MAKECAB ?= $(VBOX_PATH_CABSDK)/BIN/MAKECAB.EXE
$(PATH_DEVTOOLS)/win.x86/bin/[Mm][Ii][Dd][Ll].[Ee][Xx][Ee]\
# if updating, also update xpidl_INST var in src/libs/xpcom18a4/Makefile.kmk
VBOX_PATH_XPCOM_IDL ?= $(VBOX_PATH_SDK)/bindings/xpcom/idl
$(VBOX_PATH_SDK)/bindings/xpcom/include \
$(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
$(VBOX_PATH_SDK)/bindings/xpcom/include/string \
$(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
$(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \
$(VBOX_PATH_SDK)/bindings/xpcom/include/ipcd
export VBOX_LIBIDL_CONFIG := $(firstword $(shell which libIDL-config-2 libIDL-config 2> /dev/null))
VBOX_LIBPATH_X11 ?= /usr/X11R6/lib
VBOX_PATH_MACOSX_SDK ?= $(VBOX_PATH_MACOSX_SDK_ROOT)/MacOSX$(VBOX_DEF_MACOSX_VERSION_MIN)u.sdk
VBOX_XCODE_VERSION := $(word 2, $(shell $(VBOX_PATH_MACOSX_DEVEL_ROOT)/usr/bin/xcodebuild -version))
TOOL_GCC4MACHO_PREFIX := $(VBOX_PATH_MACOSX_DEVEL_ROOT)/usr/bin/$(TOOL_GCC4MACHO_PREFIX)
TOOL_GXX4MACHO_PREFIX := $(VBOX_PATH_MACOSX_DEVEL_ROOT)/usr/bin/$(TOOL_GXX4MACHO_PREFIX)
export PATH:=$(VBOX_PATH_MACOSX_DEVEL_ROOT)/usr/bin/:$(PATH)
## @todo WTF do we do the -m32/64 stuff here for these compilers? Also the visibility should be elsewhere...
TOOL_GXX4MACHO_OBJC = $(TOOL_GCC4MACHO_PREFIX)gcc$(TOOL_GCC4MACHO_SUFFIX) $(if-expr $(KBUILD_TARGET_ARCH) == "x86",-m32,-m64) -fvisibility=hidden
TOOL_GXX4MACHO_OBJCXX = $(TOOL_GCC4MACHO_PREFIX)gcc$(TOOL_GCC4MACHO_SUFFIX) $(if-expr $(KBUILD_TARGET_ARCH) == "x86",-m32,-m64) -fvisibility=hidden -fvisibility-inlines-hidden
VBOX_DARWIN_DEF_SDK_DEFS := MAC_OS_X_VERSION_MIN_REQUIRED=$(subst .,,$(VBOX_DEF_MACOSX_VERSION_MIN))0 \
VBOX_DARWIN_DEF_SDK_CFLAGS := -mmacosx-version-min=$(VBOX_DEF_MACOSX_VERSION_MIN) -isysroot $(VBOX_PATH_MACOSX_SDK)
VBOX_DARWIN_DEF_SDK_CXXFLAGS := -mmacosx-version-min=$(VBOX_DEF_MACOSX_VERSION_MIN) -isysroot $(VBOX_PATH_MACOSX_SDK)
VBOX_DARWIN_DEF_SDK_OBJCFLAGS := -mmacosx-version-min=$(VBOX_DEF_MACOSX_VERSION_MIN) -isysroot $(VBOX_PATH_MACOSX_SDK)
VBOX_DARWIN_DEF_SDK_OBJCXXFLAGS := -mmacosx-version-min=$(VBOX_DEF_MACOSX_VERSION_MIN) -isysroot $(VBOX_PATH_MACOSX_SDK)
VBOX_DARWIN_DEF_SDK_LDFLAGS = -mmacosx-version-min=$(VBOX_DEF_MACOSX_VERSION_MIN) -Wl,-syslibroot,$(VBOX_PATH_MACOSX_SDK) \
## @todo s/VBOX_DARWIN_DEF_SDK_10/VBOX_DARWIN_SDK_10/g
VBOX_PATH_MACOSX_SDK_10_4 ?= $(VBOX_PATH_MACOSX_SDK_ROOT)/MacOSX10.4u.sdk
VBOX_DARWIN_DEF_SDK_10_4_DEFS := MAC_OS_X_VERSION_MIN_REQUIRED=1040 MAC_OS_X_VERSION_MAX_ALLOWED=1040
VBOX_DARWIN_DEF_SDK_10_4_CXXFLAGS := -mmacosx-version-min=10.4 -isysroot $(VBOX_PATH_MACOSX_SDK_10_4)
VBOX_DARWIN_DEF_SDK_10_4_OBJCFLAGS := -mmacosx-version-min=10.4 -isysroot $(VBOX_PATH_MACOSX_SDK_10_4)
VBOX_DARWIN_DEF_SDK_10_4_OBJCXXFLAGS := -mmacosx-version-min=10.4 -isysroot $(VBOX_PATH_MACOSX_SDK_10_4)
VBOX_DARWIN_DEF_SDK_10_4_LDFLAGS := -mmacosx-version-min=10.4 -Wl,-syslibroot,$(VBOX_PATH_MACOSX_SDK_10_4) \
VBOX_PATH_MACOSX_SDK_10_5 ?= $(VBOX_PATH_MACOSX_SDK_ROOT)/MacOSX10.5.sdk
VBOX_DARWIN_DEF_SDK_10_5_DEFS := MAC_OS_X_VERSION_MIN_REQUIRED=1050 MAC_OS_X_VERSION_MAX_ALLOWED=1050
VBOX_DARWIN_DEF_SDK_10_5_CXXFLAGS := -mmacosx-version-min=10.5 -isysroot $(VBOX_PATH_MACOSX_SDK_10_5)
VBOX_DARWIN_DEF_SDK_10_5_OBJCFLAGS := -mmacosx-version-min=10.5 -isysroot $(VBOX_PATH_MACOSX_SDK_10_5)
VBOX_DARWIN_DEF_SDK_10_5_OBJCXXFLAGS := -mmacosx-version-min=10.5 -isysroot $(VBOX_PATH_MACOSX_SDK_10_5)
VBOX_DARWIN_DEF_SDK_10_5_LDFLAGS := -mmacosx-version-min=10.5 -Wl,-syslibroot,$(VBOX_PATH_MACOSX_SDK_10_5) \
VBOX_PATH_MACOSX_SDK_10_6 ?= $(VBOX_PATH_MACOSX_SDK_ROOT)/MacOSX10.6.sdk
VBOX_DARWIN_DEF_SDK_10_6_DEFS := MAC_OS_X_VERSION_MIN_REQUIRED=1060 MAC_OS_X_VERSION_MAX_ALLOWED=1060
VBOX_DARWIN_DEF_SDK_10_6_CXXFLAGS := -mmacosx-version-min=10.6 -isysroot $(VBOX_PATH_MACOSX_SDK_10_6)
VBOX_DARWIN_DEF_SDK_10_6_OBJCFLAGS := -mmacosx-version-min=10.6 -isysroot $(VBOX_PATH_MACOSX_SDK_10_6)
VBOX_DARWIN_DEF_SDK_10_6_OBJCXXFLAGS := -mmacosx-version-min=10.6 -isysroot $(VBOX_PATH_MACOSX_SDK_10_6)
VBOX_DARWIN_DEF_SDK_10_6_LDFLAGS := -mmacosx-version-min=10.6 -Wl,-syslibroot,$(VBOX_PATH_MACOSX_SDK_10_6) \
ifneq ($(wildcard $(VBOX_PATH_MACOSX_SDK_ROOT)/MacOSX10.7.sdk),)
VBOX_PATH_MACOSX_SDK_10_7 = $(VBOX_PATH_MACOSX_SDK_ROOT)/MacOSX10.7.sdk
VBOX_PATH_MACOSX_SDK_10_7 = $(PATH_DEVTOOLS)/darwin.x86/SDKs/MacOSX10.7.sdk
VBOX_DARWIN_DEF_SDK_10_7_DEFS := MAC_OS_X_VERSION_MIN_REQUIRED=1070 MAC_OS_X_VERSION_MAX_ALLOWED=1070
VBOX_DARWIN_DEF_SDK_10_7_CXXFLAGS := -mmacosx-version-min=10.7 -isysroot $(VBOX_PATH_MACOSX_SDK_10_7)
VBOX_DARWIN_DEF_SDK_10_7_OBJCFLAGS := -mmacosx-version-min=10.7 -isysroot $(VBOX_PATH_MACOSX_SDK_10_7)
VBOX_DARWIN_DEF_SDK_10_7_OBJCXXFLAGS := -mmacosx-version-min=10.7 -isysroot $(VBOX_PATH_MACOSX_SDK_10_7)
VBOX_DARWIN_DEF_SDK_10_7_LDFLAGS := -mmacosx-version-min=10.7 -Wl,-syslibroot,$(VBOX_PATH_MACOSX_SDK_10_7) \
# Macro switching between @executable_path, @rpath and /Applications/VirtualBox.app
# VBOX_GCC_RPATH_OPT - Different GCC/LD combinations needs different options.
VBOX_PATH_X11_ROOT = $(PATH_ROOT)/src/VBox/Additions/x11/x11include
VBOX_PATH_CROGL_GLAPI = $(PATH_ROOT)/src/VBox/GuestHost/OpenGL/glapi_parser
VBOX_PATH_CROGL_INCLUDE = $(PATH_ROOT)/src/VBox/GuestHost/OpenGL/include
VBOX_PATH_CROGL_PYTHON_INCLUDE = $(VBOX_PATH_CROGL_GLAPI);$(PATH_ROOT)/src/VBox/GuestHost/OpenGL/packer;$(PATH_ROOT)/src/VBox/HostServices/SharedOpenGL/crserverlib
VBOX_PATH_CROGL_PYTHON_INCLUDE = $(VBOX_PATH_CROGL_GLAPI):$(PATH_ROOT)/src/VBox/GuestHost/OpenGL/packer:$(PATH_ROOT)/src/VBox/HostServices/SharedOpenGL/crserverlib
VBOX_LIB_OGL_CRUTIL = $(PATH_OBJ)/VBoxOGLcrutil/VBoxOGLcrutil$(VBOX_SUFF_LIB)
VBOX_LIB_OGL_HOSTCRUTIL = $(PATH_OBJ)/VBoxOGLhostcrutil/VBoxOGLhostcrutil$(VBOX_SUFF_LIB)
VBOX_LIB_OGL_CRUTIL_X86 = $(PATH_OBJ)/VBoxOGLcrutil-x86/VBoxOGLcrutil-x86$(VBOX_SUFF_LIB)
# VBOX_PATH_MESA_SOURCE = $(PATH_ROOT)/src/libs/mesa-7.2
$(VBOX_PATH_MESA_SOURCE)/src/mesa/ \
$(VBOX_PATH_MESA_SOURCE)/src/mesa/glapi \
$(VBOX_PATH_MESA_SOURCE)/src/mesa/main \
$(VBOX_PATH_MESA_SOURCE)/src/mesa/drivers/dri/common
VBOX_DARWIN_OPENGL_INST = obj/VBoxOGL/GL/
SDK_DARWIN-OPENGL_INCS = $(PATH_OUT)/obj/VBoxOGL
SDK_DARWIN-OPENGL_ORDERDEPS = $(addprefix $(PATH_OUT)/obj/VBoxOGL/GL/,$(VBOX_DARWIN_OPENGL_HEADERS))
VBOX_WINDOWS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_win.ico
VBOX_WINDOWS_ADDITIONS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_win.ico
VBOX_NSIS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox_win.ico
VBOX_MACOSX_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/VirtualBox.icns
VBOX_WINDOWS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/VirtualBox-vista.ico
VBOX_WINDOWS_ADDITIONS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/VirtualBoxGA-vista.ico
VBOX_NSIS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/VirtualBoxGA-nsis.ico
VBOX_WINDOWS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/VirtualBox-winxp.ico
VBOX_WINDOWS_ADDITIONS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/VirtualBoxGA-winxp.ico
VBOX_NSIS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/VirtualBox-nsis.ico
VBOX_MACOSX_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/VirtualBox.icns
# These tests never worked on Windows because of /dev/null, so, there
if $(TOOL_$(VBOX_GCC_TOOL)_CC) $(subst -Wno-,-W,$(1)) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
if $(TOOL_$(VBOX_GCC_TOOL)_CXX) $(subst -Wno-,-W,$(1)) -S -o /dev/null -xc++ /dev/null > /dev/null 2>&1; \
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 ;\
$(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))|' )
$(PATH_OUT)/GCCConfig.kmk: \
$(PATH_ROOT)/Config.kmk \
$(QUIET)$(APPEND) '$@' 'VBOX_GCC_VERSION_CC ?= $(call VBOX_GCC_VERSION,$(TOOL_$(VBOX_GCC_TOOL)_CC))'
$(QUIET)$(APPEND) '$@' 'VBOX_GCC_VERSION_CXX ?= $(call VBOX_GCC_VERSION,$(TOOL_$(VBOX_GCC_TOOL)_CXX))'
$(QUIET)$(APPEND) '$@' 'VBOX_GCC_LIBGCC ?= $(shell $(TOOL_$(VBOX_GCC_TOOL)_CC) -print-libgcc-file-name)'
# -Wextra produces additional useful warnings but includes -Wno-missing-field-initializers (too noisy)
$(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-delete-non-virtual-dtor ?= $(call VBOX_GCC_CHECK_CXX,-Wno-delete-non-virtual-dtor,)'
$(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-int-to-pointer-cast ?= $(call VBOX_GCC_CHECK_CC,-Wno-int-to-pointer-cast,)'
$(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-invalid-offsetof ?= $(call VBOX_GCC_CHECK_CXX,-Wno-invalid-offsetof,)'
$(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-missing-field-initializers ?= $(call VBOX_GCC_CHECK_CC,-Wno-missing-field-initializers,)'
$(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-pointer-to-int-cast ?= $(call VBOX_GCC_CHECK_CC,-Wno-pointer-to-int-cast,)'
$(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-variadic-macros ?= $(call VBOX_GCC_CHECK_CXX,-Wno-variadic-macros,)'
$(QUIET)$(APPEND) '$@' 'VBOX_GCC_fno-stack-protector ?= $(call VBOX_GCC_CHECK_CC,-fno-stack-protector,)'
$(QUIET)$(APPEND) '$@' 'VBOX_GCC_fno-dwarf2-cfi-asm ?= $(call VBOX_GCC_CHECK_CC,-fno-dwarf2-cfi-asm,)'
$(QUIET)$(APPEND) '$@' 'VBOX_GCC_fdiagnostics-show-option ?= $(call VBOX_GCC_CHECK_CC,-fdiagnostics-show-option,)'
# Produce code optimized for the most common IA32/AMD64/EM64T processors. Introduced with gcc version 4.2.
# See http://osdir.com/ml/gcc.prs/2002-08/msg00223.html and probably http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20004
$(QUIET)$(APPEND) '$@' ' VBOX_GCC_fvisibility-hidden ?= $(call VBOX_GCC_CHECK_CC,-fvisibility=hidden -DVBOX_HAVE_VISIBILITY_HIDDEN -DRT_USE_VISIBILITY_DEFAULT,)'
$(QUIET)$(APPEND) '$@' ' VBOX_GCC_fvisibility-inlines-hidden ?= $(call VBOX_GCC_CHECK_CXX,-fvisibility-inlines-hidden,)'
# Detect the solaris assembler. It is used by the the 4.x gcc compilers,
$(QUIET)$(APPEND) '$@' 'VBOX_AS_VERSION ?= $(shell `gcc -print-prog-name=as` -V -o /dev/null < /dev/null 2>&1 | kmk_sed -e '1!d' -e 's/^as: *//' )'
# Note that `$(dir $(gcc -print-libgcc-file-name))/include does not work for a 64-bit cross build on a 32-bit build host.
$(QUIET)$(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'
$(QUIET)$(APPEND) '$@' 'VBOX_GCC32_VERSION_CC ?= $(call VBOX_GCC_VERSION,$(TOOL_$(VBOX_GCC32_TOOL)_CC))'
$(QUIET)$(APPEND) '$@' 'VBOX_GCC32_VERSION_CXX ?= $(call VBOX_GCC_VERSION,$(TOOL_$(VBOX_GCC32_TOOL)_CXX))'
$(QUIET)$(APPEND) '$@' 'VBOX_GCC32_LIBGCC ?= $(shell $(TOOL_$(VBOX_GCC32_TOOL)_CC) -print-libgcc-file-name)'
$(QUIET)$(APPEND) '$@' 'VBOX_GCC32_Wno-variadic-macros ?= $(call VBOX_GCC32_CHECK_CXX,-Wno-variadic-macros,)'
$(QUIET)$(APPEND) '$@' 'VBOX_LD_no_compact_linkedit ?= $(call VBOX_GCC_CHECK_LD,-no_compact_linkedit,)'
include $(PATH_OUT)/GCCConfig.kmk
$(1)_SOURCES = $$($(1)_0_OUTDIR)/$(1)Imp.def
$(1)_CLEAN = $$($(1)_0_OUTDIR)/$(1)Imp.def
$(1)_SOURCES = $$($(1)_0_OUTDIR)/$(1)Imp.c
$(1)_CLEAN = $$($(1)_0_OUTDIR)/$(1)Imp.c
$$$$($(1)_SOURCES): $(addprefix $(PATH_SUB_CURRENT)/,$(3)) $(PATH_ROOT)/src/bldprogs/deftoimp.sed | $$$$(dir $$$$@)
-e 's/^LIBRARY[[:space:]][[:space:]]*\(.*\)\.dll/LIBRARY \1 INITINSTANCE TERMINSTANCE\nDATA MULTIPLE\n/' \
-f $(PATH_ROOT)/src/bldprogs/deftoimp.sed \
# VBOX_PATH_SELFSIGN points to the Vista WDK bin/SelfSign directory.
VBOX_PATH_SELFSIGN := $(lastword $(sort $(wildcard $(PATH_DEVTOOLS)/win.x86/selfsign/*)))
VBOX_PATH_SELFSIGN := $(PATH_DEVTOOLS)/win.x86/selfsign/r1
VBOX_INF2CAT ?= $(VBOX_PATH_SELFSIGN)/Inf2Cat.exe
VBOX_CROSS_CERTIFICATE_FILE ?= $(VBOX_PATH_SELFSIGN)/MSCV-VSClass3.cer
VBOX_TSA_URL ?= http://timestamp.verisign.com/scripts/timestamp.dll
VBOX_CERTIFICATE_SUBJECT_NAME ?= $(error You, need to set VBOX_CERTIFICATE_SUBJECT_NAME in LocalConfig.kmk.)
-e 's/^;edit-DriverVer.*/DriverVer = $(date-utc %m\/%d\/%Y),$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)/' \
-e 's/^;edit-DriverVer.*/DriverVer = $(date-utc %m\/%d\/%Y),$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)/' \
-long "$(VBOX_PRODUCT) $(VBOX_VERSION_STRING) $(shell /bin/echo -e '\xC2\xA9')2009-$(VBOX_C_YEAR) $(VBOX_VENDOR)"
VBOX_HAIKU_XRES_SETVER_CMDS ?= $(if $(eq $(tool_do),LINK_PROGRAM),$(call VBOX_HAIKU_XRES_SETVER_FN,$(out),$($(target)_RSRCS),$(target)),)
SDK_VBOX_LIBXML2_INCS ?= $(PATH_ROOT)/src/libs/libxml2-2.6.31/include
SDK_VBOX_LIBXML2_DEFS.win += WIN32 _WINDOWS _MBCS
# note: no linking to LIB here, we do that explicitly in src/VBox/Runtime/Makefile.kmk to link
SDK_VBOX_LIBPNG_INCS ?= $(PATH_ROOT)/src/libs/libpng-1.2.8
SDK_VBOX_ZLIB_INCS ?= $(PATH_ROOT)/src/libs/zlib-1.2.6
SDK_VBOX_ZLIB_DEFS.linux ?= _LARGEFILE64_SOURCE
SDK_VBOX_OPENSSL = Only for VBoxRT and/or statically linked programs.
SDK_VBOX_OPENSSL_VBOX_DEFAULT_INCS := $(PATH_OUT)/obj/crypto-headers/include
SDK_VBOX_LIBCURL_INCS ?= $(PATH_ROOT)/src/libs/curl-7.27.0/include
$(PATH_ROOT)/src/libs/ffmpeg-20060710/libavutil \
$(PATH_ROOT)/src/libs/ffmpeg-20060710/libavcodec \
$(PATH_ROOT)/src/libs/ffmpeg-20060710/libavformat
#SDK_VBOX_FFMPEG_LIBS ?= $(PATH_STAGE_LIB)/VBoxFFmpeg.a
SDK_VBOX_FFMPEG_LIBS ?= $(PATH_STAGE_LIB)/VBoxFFmpegImp.lib
$(PATH_ROOT)/src/libs/libvpx/vpx \
$(PATH_ROOT)/src/libs/libvpx/vp8 \
$(PATH_ROOT)/src/libs/libvpx/vpx_mem
SDK_VBOX_VPX_LIBS ?= $(PATH_STAGE_BIN)/VBox-libvpx.so
SDK_VBOX_BOOST_INCS ?= $(PATH_ROOT)/src/libs/boost-1.37.0
# Special SDK for the problematic NTDLL.LIB.
ifneq ($(wildcard /lib/modules/$(shell uname -r)/build/include/linux/autoconf.h /lib/modules/$(shell uname -r)/build/include/generated/autoconf.h),)
export VBOX_LINUX_SRC := /lib/modules/$(shell uname -r)/build
export VBOX_LINUX_SRC := /usr/src/linux
kernelpath := $(shell $(SED_EXT) -ne 's+^MAKEARGS *:= *-C *\(\S*\).*+\1+p' $(VBOX_LINUX_SRC)/Makefile)
VBOX_LINUX_INCS += $(kernelpath)/include/asm-i386/mach-default \
$(kernelpath)/include/asm-x86/mach-default \
$(kernelpath)/arch/x86/include \
$(kernelpath)/arch/x86/include/asm/mach-default \
$(kernelpath)/arch/x86/include/uapi \
$(VBOX_LINUX_SRC)/arch/x86/include/generated \
$(VBOX_LINUX_SRC)/arch/x86/include/generated/uapi \
$(kernelpath)/include/uapi \
$(VBOX_LINUX_SRC)/include/generated/uapi \
# Since Linux 2.6.15, <linux/autoconf.h> is included like this. It cannot hurt to do the
ifneq ($(wildcard $(kernelpath)/include/linux/kconfig.h),)
export VBOX_LINUX_INCLUDE := -include $(kernelpath)/include/linux/kconfig.h
else ifneq ($(wildcard $(VBOX_LINUX_SRC)/include/generated/autoconf.h),)
export VBOX_LINUX_INCLUDE := -include $(VBOX_LINUX_SRC)/include/generated/autoconf.h
else ifneq ($(wildcard $(VBOX_LINUX_SRC)/include/linux/autoconf.h),)
export VBOX_LINUX_INCLUDE := -include $(VBOX_LINUX_SRC)/include/linux/autoconf.h
$(eval export VBOX_SOLARIS_VERSION := $(shell uname -r | $(SED_EXT) 's|\([0-9]*\)\.\([0-9]*\)|$$(int-add $$(int-mul 100, \1), \2)|' ))
DEFS.solaris += RT_OS_SOLARIS_10
# uname -v can report "snv_XYZ" or "11.X"
VBOX_SOLARIS_11_VERSION = $(shell uname -v | sed 's/snv_//' | cut -f1 -d'.')
VBOX_SOLARIS_11_FULLVERSION = $(shell pkg contents -H -t set -o pkg.fmri entire | $(SED_EXT) -e '1!d' -e 's/^.*\@//;s/\:.*//;s/.*,//')
# FULLVERSION format e.g. "5.11-0.175.1.0.0.16.0", we're interested in 175 (VERSION), 1 (UPDATE), 16 (BUILD).
VBOX_SOLARIS_11_VERSION = $(word 2, $(subst ., ,$(word 2,$(subst -, ,$(VBOX_SOLARIS_11_FULLVERSION)))))
VBOX_SOLARIS_11_UPDATE_VERSION = $(word 3, $(subst ., ,$(word 2,$(subst -, ,$(VBOX_SOLARIS_11_FULLVERSION)))))
VBOX_SOLARIS_11_BUILD_VERSION = $(word 6, $(subst ., ,$(word 2,$(subst -, ,$(VBOX_SOLARIS_11_FULLVERSION)))))
TOOL_DTraceAndVBoxTpG = DTrace and the VirtualBox Tracepoint Generator working together on static ring-3 probes.
$(QUIET)$(VBOX_VBOXTPG) --generate-wrapper-header --host-$(VBOX_HC_ARCH_BITS)-bit --ring-3-context \
TEMPLATE_VBoxRc_INCS = $(PATH_ROOT)/include/iprt/nocrt
TEMPLATE_VBoxRc_CXXFLAGS = -Zi -Zl -GR- -EHs- -GF -GS- -Zc:wchar_t- -Gs8192 $(VBOX_VCC_GC_OPT) $(VBOX_VCC_GC_FP) -W4 -wd4244 -wd4996 -wd4127 -wd4100 -wd4214 -wd4706 $(VBOX_VCC_WERR)
TEMPLATE_VBoxRc_CXXFLAGS = -Zi -Zl -GR- -EHs- -GF -GS- -Zc:wchar_t- -Gs8192 $(VBOX_VCC_GC_OPT) $(VBOX_VCC_GC_FP) -W3 -wd4244 -wd4996 $(VBOX_VCC_WERR)
TEMPLATE_VBoxRc_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:64 -MapInfo:Exports -NoD $(VBOX_VCC_LD_WERR) -Debug
TEMPLATE_VBoxRc_CXXFLAGS = -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden) -fno-rtti
TEMPLATE_VBoxRc_CFLAGS = -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden)
TEMPLATE_VBoxRc_LDFLAGS.release = $(if $(VBOX_DO_STRIP_MODULES),-S,)
TEMPLATE_VBoxRc_CXXFLAGS = $(VBOX_DARWIN_DEF_SDK_CXXFLAGS) -m32 -nostdinc -g $(VBOX_GCC_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
TEMPLATE_VBoxRc_CFLAGS = $(VBOX_DARWIN_DEF_SDK_CFLAGS) -m32 -nostdinc -g $(VBOX_GCC_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
#TEMPLATE_VBoxRc_LDFLAGS.release = -Wl,-S ???
TEMPLATE_VBoxRc_CXXFLAGS = -nostdinc -g $(VBOX_GCC_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
TEMPLATE_VBoxRc_CFLAGS = -nostdinc -g $(VBOX_GCC_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
$(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)X86_LIB)/libcmt.lib \
$(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)X86_LIB)/oldnames.lib
if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), freebsd.amd64)
TEMPLATE_VBoxRcExe_DEFS.$(KBUILD_TARGET) = $(TEMPLATE_VBoxRc_DEFS.$(KBUILD_TARGET)) IPRT_DONT_USE_SYSTEM_STDINT_H
TEMPLATE_VBoxRcExe_LDFLAGS.$(KBUILD_TARGET) = /usr/lib32/crt1.o /usr/lib32/crti.o /usr/lib32/crtbegin.o $(TEMPLATE_VBoxRc_LDFLAGS.$(KBUILD_TARGET)) -nostdlib -v
TEMPLATE_VBoxRcExe_LIBPATH.$(KBUILD_TARGET) = /usr/lib32
TEMPLATE_VBoxR0_DEFS = IN_RING0 IN_RING0_AGNOSTIC IPRT_NO_CRT RT_WITH_NOCRT_ALIASES $(ARCH_BITS_DEFS)
TEMPLATE_VBoxR0_INCS = $(PATH_ROOT)/include/iprt/nocrt
TEMPLATE_VBoxR0_CXXFLAGS = -Zi -Zl -GR- -EHs- -GF -GS- -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP) -W4 -wd4244 -wd4127 -wd4100 -wd4214 -wd4706 -wd4996 $(VBOX_VCC_WERR)
TEMPLATE_VBoxR0_CXXFLAGS = -Zi -Zl -GR- -EHs- -GF -GS- -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP) -W3 -wd4244 -wd4996 $(VBOX_VCC_WERR)
TEMPLATE_VBoxR0_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:4096 -MapInfo:Exports -NoD $(VBOX_VCC_LD_WERR) -Debug
TEMPLATE_VBoxR0_LDFLAGS += -Merge:VTGPrLc.Data=VTGPrLc.Begin -Merge:VTGPrLc.End=VTGPrLc.Begin -Merge:VTGPrLc.Begin=VTGObj
TEMPLATE_VBoxR0_CFLAGS = -nostdinc -g $(VBOX_GCC_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) -fno-common $(VBOX_GCC_fvisibility-hidden) -std=gnu99
TEMPLATE_VBoxR0_CXXFLAGS = -nostdinc -g $(VBOX_GCC_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) -fno-common $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) -fno-rtti
TEMPLATE_VBoxR0_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables -ffreestanding
TEMPLATE_VBoxR0_CXXFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables
TEMPLATE_VBoxR0_LDFLAGS.solaris = -u _init -u _info
TEMPLATE_VBoxR0_CFLAGS.amd64 += -Wa,-xmodel=kernel
TEMPLATE_VBoxR0_CXXFLAGS.amd64 += -Wa,-xmodel=kernel
TEMPLATE_VBoxR0_LDFLAGS.release = $(if $(VBOX_DO_STRIP_MODULES),-S,)
TEMPLATE_VBoxR0_CXXFLAGS = $(VBOX_DARWIN_DEF_SDK_CXXFLAGS) -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) \
-fno-common -msoft-float -static -fno-rtti -fno-exceptions $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing \
TEMPLATE_VBoxR0_CXXFLAGS.amd64 = -m64 -mno-red-zone -mno-sse3 -mno-sse4 -mno-sse4.1 -mno-sse4.2 -mno-sse4a -fno-unwind-tables
TEMPLATE_VBoxR0_CXXFLAGS.x86 = -m32
TEMPLATE_VBoxR0_CFLAGS = $(VBOX_DARWIN_DEF_SDK_CFLAGS) -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC_Wno-variadic-macros) \
-fno-common -msoft-float -static -fno-exceptions $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing \
TEMPLATE_VBoxR0_CFLAGS.amd64 = -m64 -mno-red-zone -mno-sse3 -mno-sse4 -mno-sse4.1 -mno-sse4.2 -mno-sse4a -fno-unwind-tables
TEMPLATE_VBoxR0_CFLAGS.x86 = -m32
#TEMPLATE_VBoxR0_LDFLAGS.release = -Wl,-S ???
TEMPLATE_VBoxR0_LDFLAGS.amd64 = -m64 -static
TEMPLATE_VBoxR0_LDFLAGS.x86 = -m32
TEMPLATE_VBoxR0_CFLAGS = -nostdinc -g $(VBOX_GCC_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 -fno-common
TEMPLATE_VBoxR0_CXXFLAGS = -nostdinc -g $(VBOX_GCC_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-common -fno-rtti
TEMPLATE_VBOXR0DRV_DEFS.x86 = _X86_
TEMPLATE_VBOXR0DRV_DEFS.x86 += WIN9X_COMPAT_SPINLOCK # Avoid multiply defined _KeInitializeSpinLock@4
TEMPLATE_VBOXR0DRV_DEFS.amd64 = _AMD64_
TEMPLATE_VBOXR0DRV_CXXFLAGS = -Zi -Zl -GR- -EHs- -GF -Gz -W3 -GS- -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
TEMPLATE_VBOXR0DRV_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:4096 -MapInfo:Exports -NoD -Debug
TEMPLATE_VBOXR0DRV_LDFLAGS += -Merge:VTGPrLc.Data=VTGPrLc.Begin -Merge:VTGPrLc.End=VTGPrLc.Begin -Merge:VTGPrLc.Begin=VTGObj
$(VBOX_GCC_WARN) -Wstrict-prototypes $(VBOX_GCC_Wno-pointer-sign) -Wno-sign-compare $(VBOX_GCC_fdiagnostics-show-option) \
TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -mpreferred-stack-boundary=2 -msoft-float
TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow \
TEMPLATE_VBOXR0DRV_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wno-pointer-sign -ffreestanding -Wdeclaration-after-statement -Werror-implicit-function-declaration,$(TEMPLATE_VBOXR0DRV_CFLAGS) $(TEMPLATE_VBOXR0DRV_CFLAGS.$(KBUILD_TARGET_ARCH))) -fno-exceptions -fno-rtti
TEMPLATE_VBOXR0DRV_LDFLAGS.x86 = -m elf_i386 -r
TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -m elf_x86_64 -r
TEMPLATE_VBOXR0DRV_CXXFLAGS = -g $(VBOX_GCC_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
TEMPLATE_VBOXR0DRV_CFLAGS = -g $(VBOX_GCC_pipe) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions
TEMPLATE_VBOXR0DRV_DEFS += $(VBOX_DARWIN_DEF_SDK_DEFS) KERNEL KERNEL_PRIVATE DRIVER_PRIVATE APPLE NeXT
TEMPLATE_VBOXR0DRV_INCS += $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/Kernel.framework/Headers
TEMPLATE_VBOXR0DRV_CXXFLAGS.amd64 = -m64 -mkernel -mno-red-zone -gdwarf-2
TEMPLATE_VBOXR0DRV_CXXFLAGS.x86 = -m32 -static
TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 -mkernel -mno-red-zone -gdwarf-2
TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 -static
TEMPLATE_VBOXR0DRV_LDFLAGS = $(filter-out $(VBOX_DARWIN_NO_COMPACT_LINKEDIT),$(VBOX_DARWIN_DEF_SDK_LDFLAGS)) \
TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = $(if $(eq $(KBUILD_HOST),solaris),-64,-m elf_x86_64)
-Wformat -Wimplicit-int -Wimplicit-function-declaration -Werror-implicit-function-declaration -Wparentheses \
TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow $(VBOX_GCC_msave-args) \
-mno-red-zone -mcmodel=kernel $(if-expr defined(VBOX_GCC_USING_SOLARIS_AS),-Wa$(COMMA)-xmodel=kernel,) \
-O2 -nodefaultlibs -fno-omit-frame-pointer -fno-strict-aliasing -fno-common -fno-exceptions -fno-rtti
# -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -fformat-extensions \
# -std=c99 -c ../my.c
# awk -f /usr/src/sys/modules/my/../../conf/kmod_syms.awk my.kld export_syms | xargs -J% objcopy % my.kld
# cc -O2 -fno-strict-aliasing -pipe -D_KERNEL -DKLD_MODULE -std=c99 -nostdinc -I. -I@ -I@/contrib/altq \
# -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-common \
# -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign \
# awk -f /usr/src/sys/modules/my/../../conf/kmod_syms.awk if_my.ko export_syms | xargs -J% objcopy % if_my.ko
VBOX_FREEBSD_SRC ?= /usr/src/sys
## The FreeBSD /usr/include.
VBOX_FREEBSD_SYS_INCS ?= /usr/include
$(VBOX_FREEBSD_SRC)/contrib/altq \
$(VBOX_GCC_WARN) -Wpointer-arith -Winline $(VBOX_GCC_Wno-pointer-sign) $(VBOX_GCC_fdiagnostics-show-option) \
TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2
TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 --param inline-unit-growth=100 --param large-function-growth=1000 \
TEMPLATE_VBOXR0DRV_LDFLAGS.x86 = -m elf_i386_fbsd
TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -m elf_x86_64_fbsd
# See kBuild/tools/GCC3.kmk for docs.
TOOL_FREEBSDKMODLD_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
awk -f $(VBOX_FREEBSD_SRC)/conf/kmod_syms.awk $(outbase).kld $(if $(othersrc), $(othersrc),/dev/null) \
TEMPLATE_VBOXR0DRV_LDFLAGS = -shared -no-undefined -dc -dy -nostdlib -rpath-link /boot/develop/lib/x86 --no-add-needed /boot/develop/lib/x86/_KERNEL_ --no-add-needed /boot/develop/lib/x86/haiku_version_glue.o
$(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration
TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow \
-O2 -nodefaultlibs -fno-omit-frame-pointer -fno-strict-aliasing -fno-common -fno-exceptions -fno-rtti
# This doesn't work if supdrv is natively loading VMMR0.r0 et al, but
TEMPLATE_VBOXR0DRV_CFLAGS += -include $(PATH_ROOT)/include/VBox/SUPDrvMangling.h
TEMPLATE_VBOXR0DRV_CXXFLAGS += -include $(PATH_ROOT)/include/VBox/SUPDrvMangling.h
TEMPLATE_VBOXR3EXE_ASFLAGS.x86 = $(VBOX_ASFLAGS32)
TEMPLATE_VBOXR3EXE_ASFLAGS.amd64 = $(VBOX_ASFLAGS64)
TEMPLATE_VBOXR3EXE_DEFS.win = _CRT_SECURE_NO_DEPRECATE
TEMPLATE_VBOXR3EXE_DTRACE_OBJ_FLAGS = --ring-3-context --pic --probe-fn-imported --probe-fn-name "SUPTracerFireProbe"
TEMPLATE_VBOXR3EXE_LIBS.kprofile = $(LIB_KPROFILE)
TEMPLATE_VBOXR3EXE_TOOL.win.x86 = $(VBOX_VCC_TOOL_STEM)X86
TEMPLATE_VBOXR3EXE_TOOL.win.amd64 = $(VBOX_VCC_TOOL_STEM)AMD64
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)
TEMPLATE_VBOXR3EXE_CXXFLAGS.debug = -RTCsu
TEMPLATE_VBOXR3EXE_CXXFLAGS.dbgopt = $(NO_SUCH_VARIABLE)
TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = -Gh -GH
/DISALLOWLIB:libc.lib \
/DISALLOWLIB:libcd.lib \
/DISALLOWLIB:libcmt.lib \
/DISALLOWLIB:libcmtd.lib \
TEMPLATE_VBOXR3EXE_LDFLAGS += -Merge:VTGPrLc.Data=VTGPrLc.Begin -Merge:VTGPrLc.End=VTGPrLc.Begin -Merge:VTGPrLc.Begin=VTGObj
$(PATH_TOOL_$(TEMPLATE_VBOXR3EXE_TOOL.win.x86)_LIB)/msvcrt$(VBOX_VCC_CRT_TYPE).lib \
$(PATH_TOOL_$(TEMPLATE_VBOXR3EXE_TOOL.win.x86)_LIB)/msvcprt$(VBOX_VCC_CRT_TYPE).lib \
$(PATH_TOOL_$(TEMPLATE_VBOXR3EXE_TOOL.win.amd64)_LIB)/msvcrt$(VBOX_VCC_CRT_TYPE).lib \
$(PATH_TOOL_$(TEMPLATE_VBOXR3EXE_TOOL.win.amd64)_LIB)/msvcprt$(VBOX_VCC_CRT_TYPE).lib \
TEMPLATE_VBOXR3EXE_CXXFLAGS = -g $(VBOX_GCC_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)
TEMPLATE_VBOXR3EXE_CXXFLAGS.l4 = -fno-exceptions -nostdinc \
TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = -finstrument-functions
TEMPLATE_VBOXR3EXE_CFLAGS = -g $(VBOX_GCC_pipe) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing $(VBOX_GCC_fvisibility-hidden)
TEMPLATE_VBOXR3EXE_CFLAGS.l4 = -nostdinc \
TEMPLATE_VBOXR3EXE_DEFS.l4 = L4_THREAD_SAFE
$(L4_LIBDIR)/../crt0.o \
-T$(L4_LIBDIR)/../main_dyn.ld -nostdlib \
-Wl,--export-dynamic,--dynamic-linker=libld-l4.s.so \
TEMPLATE_VBOXR3EXE_LDFLAGS.linux = -Wl,-z,noexecstack $(VBOX_LD_as_needed)
TEMPLATE_VBOXR3EXE_LDFLAGS.solaris = -Wl,-z,ignore # same as VBOX_LD_as_needed
$(L4_LIBDIR)/libvboxserver.s.so \
$(L4_LIBDIR)/libuc++.0.s.so \
$(L4_LIBDIR)/libdl.s.so \
$(L4_LIBDIR)/libuc.0.s.so
TEMPLATE_VBOXR3EXE_DEFS.darwin = $(VBOX_DARWIN_DEF_SDK_DEFS)
TEMPLATE_VBOXR3EXE_CFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_CFLAGS) -fno-common
TEMPLATE_VBOXR3EXE_CXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_CXXFLAGS)
TEMPLATE_VBOXR3EXE_OBJCFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_OBJCFLAGS)
TEMPLATE_VBOXR3EXE_OBJCXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_OBJCXXFLAGS)
TEMPLATE_VBOXR3EXE_LDFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_LDFLAGS)
TEMPLATE_VBOXR3EXE_LDFLAGS.darwin.x86 = -read_only_relocs suppress
TEMPLATE_VBOXR3EXE_CXXFLAGS := $(filter-out -pedantic,$(TEMPLATE_VBOXR3EXE_CXXFLAGS)) -fdollars-in-identifiers # annoying gcc option precedence.
/usr/lib \
TEMPLATE_VBOXR3EXE_LDFLAGS.linux += $(VBOX_GCC_ORIGIN_OPT)
TEMPLATE_VBOXR3 = VBox Ring 3 SO/DLLs
TEMPLATE_VBoxR3Dll += VBox ring-3 SO/DLLs, no warnings
TEMPLATE_VBoxR3DllNoPic = VBox ring-3 SO/DLLs without PIC, without warnings.
TEMPLATE_VBoxR3DllNoPic_CXXFLAGS.debug = $(filter-out -RTC%,$(TEMPLATE_VBOXR3_CXXFLAGS.debug)) # RTCsu Prevents IEM opt.
TEMPLATE_VBoxR3DllWarnNoPic = VBox ring-3 SO/DLLs without PIC, with warnings.
TEMPLATE_VBOXR3STATIC_CFLAGS = $(filter-out -MD$(VBOX_VCC_CRT_TYPE), $(TEMPLATE_VBOXR3EXE_CFLAGS)) -MT$(VBOX_VCC_CRT_TYPE)
TEMPLATE_VBOXR3STATIC_CXXFLAGS = $(filter-out -MD$(VBOX_VCC_CRT_TYPE), $(TEMPLATE_VBOXR3EXE_CFLAGS)) -MT$(VBOX_VCC_CRT_TYPE)
TEMPLATE_VBOXR3STATIC_LDFLAGS = $(filter-out /DISALLOWLIB:libcmt$(VBOX_VCC_CRT_TYPE).lib /DISALLOWLIB:libcpmt$(VBOX_VCC_CRT_TYPE).lib, $(TEMPLATE_VBOXR3EXE_LDFLAGS)) \
/DISALLOWLIB:msvcrt.lib \
/DISALLOWLIB:msvcrtd.lib \
/DISALLOWLIB:msvcprt.lib \
/DISALLOWLIB:msvcprtd.lib
$(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.x86)_LIB)/libcmt$(VBOX_VCC_CRT_TYPE).lib \
$(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.x86)_LIB)/libcpmt$(VBOX_VCC_CRT_TYPE).lib
$(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.amd64)_LIB)/libcmt$(VBOX_VCC_CRT_TYPE).lib \
$(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.amd64)_LIB)/libcpmt$(VBOX_VCC_CRT_TYPE).lib \
TEMPLATE_VBOXR3DLLNOXCPT = VBox Ring 3 SO/DLLs without C++ exception
# not necessary except USE_LIB_PCAP is defined in SUPR3HardenedMain.cpp
TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBOXR3EXE_LDFLAGS))
TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.linux))
TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS.linux += $(VBOX_GCC_ORIGIN_OPT)
TEMPLATE_VBOXR3OSX105 = VBox Ring 3 SO/DLLs for OS X 10.5
TEMPLATE_VBOXR3OSX105_DEFS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_DEFS) PIC
TEMPLATE_VBOXR3OSX105_CFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_CFLAGS) -fno-common
TEMPLATE_VBOXR3OSX105_CXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_CXXFLAGS)
TEMPLATE_VBOXR3OSX105_OBJCFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_OBJCFLAGS)
TEMPLATE_VBOXR3OSX105_OBJCXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_OBJCFLAGS)
TEMPLATE_VBOXR3OSX105_LDFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_LDFLAGS) \
TEMPLATE_VBOXR3AUTOTST_LIBS.l4 = $(LIB_RUNTIME) $(TEMPLATE_$(TEMPLATE_VBOXR3AUTOTST_EXTENDS)_LIBS.l4)
TEMPLATE_VBOXR3TSTEXE_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' $(TEMPLATE_VBOXR3EXE_LDFLAGS)
TEMPLATE_VBOXR3TSTEXE_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/..' $(TEMPLATE_VBOXR3EXE_LDFLAGS)
TEMPLATE_VBOXR3TSTNPEXE_CXXFLAGS = $(filter-out -pedantic -Wshadow,$(TEMPLATE_VBOXR3TSTEXE_CXXFLAGS)) -Wno-sign-compare
TEMPLATE_VBOXR3TSTNPEXE_CFLAGS = $(filter-out -pedantic -Wshadow -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations,$(TEMPLATE_VBOXR3TSTEXE_CFLAGS)) -Wno-sign-compare
TEMPLATE_VBOXR3NPEXE_CXXFLAGS = $(filter-out -pedantic -Wshadow,$(TEMPLATE_VBOXR3EXE_CXXFLAGS)) -Wno-sign-compare
TEMPLATE_VBOXR3NPEXE_CFLAGS = $(filter-out -pedantic -Wshadow -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations,$(TEMPLATE_VBOXR3EXE_CFLAGS)) \
TEMPLATE_VBOXR3NP_CXXFLAGS = $(filter-out -pedantic -Wshadow,$(TEMPLATE_VBOXR3_CXXFLAGS)) -Wno-sign-compare
TEMPLATE_VBOXR3NP_CFLAGS = $(filter-out -pedantic -Wshadow -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations,$(TEMPLATE_VBOXR3_CFLAGS)) \
TEMPLATE_VBOXNOCRTGCC = VBox no-crt GCC libraries and modules, yasm/nasm.
TEMPLATE_VBOXNOCRTGCC_CFLAGS = -nostdinc -fno-strict-aliasing -fno-math-errno $(VBOX_GCC_WARN) -Werror-implicit-function-declaration
TEMPLATE_VBOXNOCRTGCC_CFLAGS.amd64 = -m64 -mcmodel=medium -fno-common
TEMPLATE_VBOXNOCRTGCC_CFLAGS.release = -O2 -fno-strict-aliasing
TEMPLATE_VBOXNOCRTGCC_CFLAGS.darwin = -static
TEMPLATE_VBOXNOCRTGCC_CXXFLAGS.$(KBUILD_TARGET_ARCH) = $(TEMPLATE_VBOXNOCRTGCC_CFLAGS.$(KBUILD_TARGET_ARCH))
TEMPLATE_VBOXNOCRTGCC_INCS = $(PATH_ROOT)/include/iprt/nocrt
ifeq (disabled-by-mingw-w64 $(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),win.amd64)
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
# The use of --exclude-libs ALL is to avoid confusing the linux ld.so.
TEMPLATE_VBOXNOCRTGCC_LDFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_LDFLAGS)
# Same as VBOXNOCRTGCC only it uses GAS as the assembler instead of yasm/nasm.
ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),win.x86)
# (COM/XPCOM interface to VirtualBox).
TEMPLATE_VBOXMAINEXE_DEFS.win = _UNICODE
TEMPLATE_VBOXMAINEXE_LIBS.kprofile = $(LIB_KPROFILE)
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)
TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug = -RTCsu
TEMPLATE_VBOXMAINEXE_CXXFLAGS.dbgopt = $(NO_SUCH_VARIABLE)
TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile = -Gh -GH
/DISALLOWLIB:libc.lib \
/DISALLOWLIB:libcd.lib \
/DISALLOWLIB:libcmt.lib \
/DISALLOWLIB:libcmtd.lib \
$(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \
$(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) -Wno-long-long -Wno-non-virtual-dtor -Wshadow \
-fshort-wchar -fpermissive -fexceptions -frtti $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing \
TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile = -finstrument-functions
TEMPLATE_VBOXMAINEXE_CFLAGS = -g $(VBOX_GCC_pipe) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC_Wno-variadic-macros) \
TEMPLATE_VBOXMAINEXE_LDFLAGS.linux = $(VBOX_LD_as_needed)
TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin += -bind_at_load
/usr/lib \
TEMPLATE_VBOXMAINEXE_LDFLAGS.solaris = -Wl,-z,ignore # Same as VBOX_LD_as_needed.
TEMPLATE_VBOXMAINEXE_LDFLAGS.linux += $(VBOX_GCC_ORIGIN_OPT)
# Add COM/XPCOM stuff
$(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
$(VBOX_PATH_SDK)/bindings/mscom/include
$(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h
# Template for building the Main DLL modules (such as in-process COM/XPCOM
TEMPLATE_VBOXMAINDLL_LDFLAGS.darwin = $(filter-out -bind_at_load,$(TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin)) \
TEMPLATE_VBOXMAINCOMP = VBox Main COM/XPCOM Component (shared library)
ifeq ($(filter-out solaris.x86 %.amd64 %.sparc32 %.sparc64,$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)),) ## TODO: cleanup!
TEMPLATE_VBOXMAINCOMP_LDFLAGS = -fPIC $(filter-out '$(VBOX_GCC_RPATH_OPT)%',$(TEMPLATE_VBOXMAINEXE_LDFLAGS)) '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/..'
TEMPLATE_VBOXMAINCOMP_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%',$(TEMPLATE_VBOXMAINEXE_LDFLAGS)) '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/..'
TEMPLATE_VBOXMAINCOMP_LDFLAGS.darwin = $(filter-out -bind_at_load,$(TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin)) \
$(PATH_SDK_$(VBOX_WINPSDK)_LIB)/User32.Lib \
$(PATH_SDK_$(VBOX_WINPSDK)_LIB)/Shell32.Lib \
$(PATH_SDK_$(VBOX_WINPSDK)_LIB)/ShLwApi.Lib \
$(PATH_SDK_$(VBOX_WINPSDK)_LIB)/Ole32.Lib \
$(PATH_SDK_$(VBOX_WINPSDK)_LIB)/OleAut32.Lib \
$(PATH_SDK_$(VBOX_WINPSDK)_LIB)/Uuid.Lib
TEMPLATE_VBOXMAINCLIENTDLL_LDFLAGS.darwin = $(filter-out -bind_at_load,$(TEMPLATE_VBOXMAINCLIENTEXE_LDFLAGS.darwin))
TEMPLATE_VBoxR3ExtPack_DEFS = $(TEMPLATE_VBOXNOCRTGCC_DEFS) VBOX_IN_EXTPACK VBOX_IN_EXTPACK_R3 IPRT_NO_CRT IN_RING3
TEMPLATE_VBoxR3ExtPack_INCS = $(PATH_ROOT)/include/iprt/nocrt $(TEMPLATE_VBOXR3DLLNOXCPT_INCS)
TEMPLATE_VBoxR3ExtPack_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)', $(TEMPLATE_VBOXR3DLLNOXCPT_LDFLAGS))
TEMPLATE_VBoxR3ExtPack_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/../../..' $(filter-out '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)', $(TEMPLATE_VBOXR3DLLNOXCPT_LDFLAGS))
VBOX_PATH_QT4 := $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*)))
ifneq ($(wildcard /Library/Frameworks/QtCore.framework),)
VBOX_PATH_QT4_FRAMEWORKS ?= /Library/Frameworks
VBOX_PATH_QT4 ?= $(lastword $(filter %-$(tolower $(VBOX_VCC_TOOL_STEM)),$(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*))))
VBOX_PATH_QT4 ?= $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v4*)))
VBOX_PATH_QT4_LIB ?= /usr/lib/qt4
TEMPLATE_VBOXQT4GUIEXE_DEFS = IN_RING3 QT_NO_DEBUG QT_THREAD_SUPPORT QT_SHARED HAVE_CONFIG_H $(ARCH_BITS_DEFS)
TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.dbgopt = $(NO_SUCH_VARIABLE)
/DELAYLOAD:oleaut32.dll
$(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
$(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
$(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \
$(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib \
$(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib
TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.win.x86 += /LARGEADDRESSAWARE
TEMPLATE_VBOXQT4GUIEXE_DEFS.linux = _REENTRANT
TEMPLATE_VBOXQT4GUIEXE_DEFS.solaris = _REENTRANT
-g $(VBOX_GCC_pipe) $(filter-out -Wno-unused,$(VBOX_GCC_WARN)) -frtti -fno-exceptions -Wno-non-virtual-dtor \
TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.linux = -pthread
TEMPLATE_VBOXQT4GUIEXE_OBJCFLAGS = -g $(VBOX_GCC_pipe) $(VBOX_GCC_PEDANTIC_C) -Wno-long-long -fno-exceptions
TEMPLATE_VBOXQT4GUIEXE_DEFS.darwin += $(VBOX_DARWIN_DEF_SDK_DEFS)
TEMPLATE_VBOXQT4GUIEXE_CFLAGS.darwin += $(VBOX_DARWIN_DEF_SDK_CFLAGS)
TEMPLATE_VBOXQT4GUIEXE_CXXFLAGS.darwin += $(VBOX_DARWIN_DEF_SDK_CXXFLAGS)
TEMPLATE_VBOXQT4GUIEXE_OBJCFLAGS.darwin += $(VBOX_DARWIN_DEF_SDK_OBJCFLAGS)
TEMPLATE_VBOXQT4GUIEXE_OBJCXXFLAGS.darwin += $(VBOX_DARWIN_DEF_SDK_OBJCXXFLAGS)
TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.darwin += $(VBOX_DARWIN_DEF_SDK_LDFLAGS) -bind_at_load
/usr/lib \
TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.solaris = -Wl,-z,ignore # Same as VBOX_LD_as_needed.
# Add COM/XPCOM stuff
$(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
$(VBOX_PATH_SDK)/bindings/mscom/include
$(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h
TEMPLATE_VBOXQT4GUI_LDFLAGS.darwin += $(filter-out -bind_at_load,$(TEMPLATE_VBOXQT4GUIEXE_LDFLAGS.darwin)) \
TEMPLATE_VBOXBLDPROG_DEFS.win := _CRT_SECURE_NO_DEPRECATE
TEMPLATE_VBOXBLDPROG_ASFLAGS.x86 := $(VBOX_ASFLAGS32)
TEMPLATE_VBOXBLDPROG_ASFLAGS.amd64 := $(VBOX_ASFLAGS64)
TEMPLATE_VBOXBLDPROG_CXXFLAGS := -Zi -Zl -GR- -EHsc -GF -W3 -wd4065 -wd4244 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP) -MT$(VBOX_VCC_CRT_TYPE)
TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug := -RTCsu
TEMPLATE_VBOXBLDPROG_CXXFLAGS.dbgopt = $(NO_SUCH_VARIABLE)
/DISALLOWLIB:msvcrt.lib \
/DISALLOWLIB:msvcrtd.lib \
/DISALLOWLIB:msvcprt.lib \
/DISALLOWLIB:msvcprtd.lib
$(PATH_TOOL_$(TEMPLATE_VBOXBLDPROG_TOOL)_LIB)/oldnames.lib \
TEMPLATE_VBOXBLDPROG_CFLAGS = -g $(VBOX_GCC_pipe) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC_Wno-variadic-macros)
TEMPLATE_VBOXBLDPROG_CFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing
TEMPLATE_VBOXBLDPROG_CXXFLAGS = -g $(VBOX_GCC_pipe) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros)
TEMPLATE_VBOXBLDPROG_CXXFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing
TEMPLATE_VBOXBLDPROG_DEFS.darwin = $(VBOX_DARWIN_DEF_SDK_10_7_DEFS)
TEMPLATE_VBOXBLDPROG_CFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_7_CFLAGS) -fno-common
TEMPLATE_VBOXBLDPROG_CXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_7_CXXFLAGS)
TEMPLATE_VBOXBLDPROG_OBJCFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_7_OBJCFLAGS) $(VBOX_GCC_PEDANTIC_C)
TEMPLATE_VBOXBLDPROG_OBJCXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_7_OBJCXXFLAGS) $(VBOX_GCC_PEDANTIC_CXX)
TEMPLATE_VBOXBLDPROG_LDFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_7_LDFLAGS)
TEMPLATE_VBOXBLDPROG_DEFS.darwin = $(VBOX_DARWIN_DEF_SDK_10_6_DEFS)
TEMPLATE_VBOXBLDPROG_CFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_6_CFLAGS) -fno-common
TEMPLATE_VBOXBLDPROG_CXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_6_CXXFLAGS)
TEMPLATE_VBOXBLDPROG_OBJCFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_6_OBJCFLAGS) $(VBOX_GCC_PEDANTIC_C)
TEMPLATE_VBOXBLDPROG_OBJCXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_6_OBJCXXFLAGS) $(VBOX_GCC_PEDANTIC_CXX)
TEMPLATE_VBOXBLDPROG_LDFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_6_LDFLAGS)
else if "$(VBOX_DEF_MACOSX_VERSION_MIN)" == "10.5" || "$(VBOX_DARWIN_HOST_VERSION_MAJOR)" == "5" || defined(VBOX_MACOS_10_5_WORKAROUND)
TEMPLATE_VBOXBLDPROG_DEFS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_DEFS)
TEMPLATE_VBOXBLDPROG_CFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_CFLAGS) -fno-common
TEMPLATE_VBOXBLDPROG_CXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_CXXFLAGS)
TEMPLATE_VBOXBLDPROG_OBJCFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_OBJCFLAGS) $(VBOX_GCC_PEDANTIC_C)
TEMPLATE_VBOXBLDPROG_OBJCXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_OBJCXXFLAGS) $(VBOX_GCC_PEDANTIC_CXX)
TEMPLATE_VBOXBLDPROG_LDFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_5_LDFLAGS)
TEMPLATE_VBOXBLDPROG_DEFS.darwin = $(VBOX_DARWIN_DEF_SDK_DEFS)
TEMPLATE_VBOXBLDPROG_CFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_CFLAGS) -fno-common
TEMPLATE_VBOXBLDPROG_CXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_CXXFLAGS)
TEMPLATE_VBOXBLDPROG_OBJCFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_OBJCFLAGS) $(VBOX_GCC_PEDANTIC_C)
TEMPLATE_VBOXBLDPROG_OBJCXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_OBJCXXFLAGS) $(VBOX_GCC_PEDANTIC_CXX)
TEMPLATE_VBOXBLDPROG_LDFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_LDFLAGS)
/usr/lib \
# (Some (old) Wine versions fails loading msvcrt.dll from the VCC bin directory.)
TOOL_VCC80X86_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
TOOL_VCC80AMD64_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
TOOL_VCC70_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
WIN32_MC = $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/mc.exe
$(PATH_SDK_$(VBOX_WINPSDK)_BIN)/MC.Exe\
$(PATH_SDK_WINPSDK_BIN)/MC.Exe\
$(PATH_SDK_WINPSDK)/Bin/MC.Exe\
$(PATH_SDK_WIN32SDK_BIN)/MC.Exe\
$(PATH_SDK_WIN64SDK_BIN)/MC.Exe\
$(PATH_DEVTOOLS)/win.x86/bin/mc.exe\
TEMPLATE_VBOXLNXHOSTR3EXE_CXXFLAGS = -g $(VBOX_GCC_pipe) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_fno-stack-protector)
TEMPLATE_VBOXLNXHOSTR3EXE_CXXFLAGS.debug = -fno-inline
TEMPLATE_VBOXLNXHOSTR3EXE_CXXFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing
TEMPLATE_VBOXLNXHOSTR3EXE_CFLAGS = -g $(VBOX_GCC_pipe) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC_fno-stack-protector)
TEMPLATE_VBOXGUESTR3EXE_CFLAGS = $(filter-out -MD$(VBOX_VCC_CRT_TYPE), $(TEMPLATE_VBOXR3EXE_CFLAGS)) -MT$(VBOX_VCC_CRT_TYPE)
TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS = $(filter-out -MD$(VBOX_VCC_CRT_TYPE), $(TEMPLATE_VBOXR3EXE_CFLAGS)) -MT$(VBOX_VCC_CRT_TYPE)
TEMPLATE_VBOXGUESTR3EXE_LDFLAGS = $(filter-out /DISALLOWLIB:libcmt$(VBOX_VCC_CRT_TYPE).lib /DISALLOWLIB:libcpmt$(VBOX_VCC_CRT_TYPE).lib, $(TEMPLATE_VBOXR3EXE_LDFLAGS)) \
$(PATH_TOOL_$(TEMPLATE_VBOXGUESTR3EXE_TOOL.win.x86)_LIB)/libcmt$(VBOX_VCC_CRT_TYPE).lib \
$(PATH_TOOL_$(TEMPLATE_VBOXGUESTR3EXE_TOOL.win.x86)_LIB)/libcpmt$(VBOX_VCC_CRT_TYPE).lib
$(PATH_TOOL_$(TEMPLATE_VBOXGUESTR3EXE_TOOL.win.amd64)_LIB)/libcmt$(VBOX_VCC_CRT_TYPE).lib \
$(PATH_TOOL_$(TEMPLATE_VBOXGUESTR3EXE_TOOL.win.amd64)_LIB)/libcpmt$(VBOX_VCC_CRT_TYPE).lib
TEMPLATE_VBOXGUESTR3EXE_POST_CMDS.win.x86 = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION) $(out)$$(NLTAB)$(TEMPLATE_VBOXR3EXE_POST_CMDS))
TEMPLATE_VBOXGUESTR3EXE_LNK_DEPS.win.x86 = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION))
TEMPLATE_VBOXGUESTR3EXE_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBOXR3EXE_LDFLAGS))
TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.linux))
TEMPLATE_VBOXGUESTR3EXE_DEFS := $(filter-out $(ARCH_BITS_DEFS), $(TEMPLATE_VBOXR3EXE_DEFS)) IN_GUEST IN_GUEST_R3 IN_RT_R3 $(VBOX_GC_ARCH_BITS_DEFS)
TEMPLATE_VBOXGUESTR3EXE_DEFS.linux := $(TEMPLATE_VBOXR3EXE_DEFS.linux) LOG_USE_C99 RT_WITHOUT_EXEC_ALLOC
if1of ($(KBUILD_TARGET), solaris) ## @todo r=bird: Fix the *R3Mini template to VBOXGUESTR3DLL and remove this hack.
TEMPLATE_VBOXGUESTR3NPEXE_CXXFLAGS = $(filter-out -pedantic -Wshadow,$(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS)) -Wno-sign-compare
TEMPLATE_VBOXGUESTR3NPEXE_CFLAGS = $(filter-out -pedantic -Wshadow -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations,$(TEMPLATE_VBOXGUESTR3EXE_CFLAGS)) -Wno-sign-compare
ifeq ($(filter-out solaris.x86 %.amd64 %.sparc32 %.sparc64,$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)),) ## TODO: Remove these checks!
# Template for XFree86 guest modules (relocatable module, i.e. sysmod).
TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.x86 = -m elf_i386
TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.amd64 = -m elf_x86_64
TEMPLATE_VBOXGUESTR3XF86MOD_CFLAGS = $(TEMPLATE_VBOXGUESTR3EXE_CFLAGS) -fno-merge-constants -std=c99 $(VBOX_GCC_fno-stack-protector) -ffreestanding
TEMPLATE_VBOXGUESTR3XF86MOD_CXXFLAGS= $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS) -fno-merge-constants $(VBOX_GCC_fno-stack-protector) -ffreestanding
TEMPLATE_VBOXGUESTR3XF86MOD_DEFS = $(TEMPLATE_VBOXGUESTR3DLL_DEFS) VBOX_GUESTR3XF86MOD RTMEM_NO_WRAP_TO_EF_APIS
# Template for X.org guest modules (shared libs).
TEMPLATE_VBOXGUESTR3XORGMOD = VBox X.org Guest Module
TEMPLATE_VBOXGUESTR3XORGMOD_DEFS = $(TEMPLATE_VBOXGUESTR3DLL_DEFS) LOG_TO_BACKDOOR VBOX_GUESTR3XORGMOD RTMEM_NO_WRAP_TO_EF_APIS
TEMPLATE_VBOXGUESTR0_SDKS.win.x86 = ReorderCompilerIncs $(VBOX_WINDDK_GST) $(VBOX_WINPSDK_GST)INCS
TEMPLATE_VBOXGUESTR0_SDKS.win.amd64 = ReorderCompilerIncs $(VBOX_WINDDK_GST) $(VBOX_WINPSDK_GST)INCS
$(PATH_SDK_$(VBOX_WINDDK)_LIB)/int64.lib
TEMPLATE_VBOXGUESTR0_CFLAGS = $(patsubst %/VBox/SUPDrvMangling.h,%/VBox/VBoxGuestMangling.h,$(TEMPLATE_VBOXR0DRV_CFLAGS))
TEMPLATE_VBOXGUESTR0_CXXFLAGS = $(patsubst %/VBox/SUPDrvMangling.h,%/VBox/VBoxGuestMangling.h,$(TEMPLATE_VBOXR0DRV_CXXFLAGS))
TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS.win = _WIN32_WINNT=0x0500 WINDOWS=1
TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS.linux = Linux=1 _GNU_SOURCE
TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS.solaris = SunOS=1 _GNU_SOURCE #GLEXT_64_TYPES_DEFINED
TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS.darwin = DARWIN=1 GL_GLEXT_LEGACY _GNU_SOURCE VBOX_WITH_COCOA_QT
TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.darwin = -framework AppKit
TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS.freebsd = FreeBSD=1 _GNU_SOURCE
TEMPLATE_VBOXCROGLR3HOSTDLL_SDKS.darwin = DARWIN-OPENGL
TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.linux = -Wl,--no-as-needed
TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS.win = WINDOWS=1
TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS.linux = Linux=1 _GNU_SOURCE
TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS.solaris = SunOS=1 _GNU_SOURCE #GLEXT_64_TYPES_DEFINED
TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS.darwin = DARWIN=1 GL_GLEXT_LEGACY _GNU_SOURCE VBOX_WITH_COCOA_QT
TEMPLATE_VBOXCROGLR3GUESTDLL_LDFLAGS.darwin = -framework AppKit
TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS.freebsd = FreeBSD=1 _GNU_SOURCE
TEMPLATE_VBOXCROGLR3GUESTDLL_SDKS.darwin = DARWIN-OPENGL
TEMPLATE_VBOXMESAR3GUESTLIB_DEFS.linux = Linux=1
TEMPLATE_VBOXMESAR3GUESTLIB_DEFS.solaris = SunOS=1
TEMPLATE_VBOXMESAR3GUESTLIB_DEFS.darwin = DARWIN=1 GL_GLEXT_LEGACY
VBOX_LIB_IPRT_GUEST_R3_SHARED_X86 = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR3Shared-x86$(VBOX_SUFF_LIB)
VBOX_VERSION_COMP_VALID_CHAR_SET = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz()[]{}+-.,
$(error VBox: VBOX_BUILD_PUBLISHER='$(VBOX_BUILD_PUBLISHER)' contains bad characters! Valid set is:$(NLTAB)$(VBOX_VERSION_COMP_VALID_CHAR_SET))
$(error VBox: VBOX_VERSION_STRING='$(VBOX_VERSION_STRING)' contains too many parts (underscores), max 3!)
$(error VBox: The x.y.z part of VBOX_VERSION_STRING='$(VBOX_VERSION_STRING)' is malformed: '$(word 1,$(VBOX_VER_TMP1))')
$(error VBox: VBOX_VERSION_STRING='$(VBOX_VERSION_STRING)' does not start with VBOX_VERSION_STRING_RAW='$(VBOX_VERSION_STRING_RAW)')
if $(words $(VBOX_VER_TMP1)) == 3 || ($(words $(VBOX_VER_TMP1)) == 2 && "$(VBOX_BUILD_PUBLISHER)" == "")
$(error VBox: VBOX_VERSION_STRING='$(VBOX_VERSION_STRING)' uses an unknown build type: '$(word 2,$(VBOX_VER_TMP1))')
$(error VBox: VBOX_VERSION_STRING='$(VBOX_VERSION_STRING)' uses an unknown build type: '$(word 2,$(VBOX_VER_TMP1))')
VBOX_VERSION_STAMP = $(PATH_OUT)/version-stamp-raw-api-$(translate $(VBOX_VERSION_STRING)-$(VBOX_C_YEAR)-$(VBOX_VENDOR)-$(VBOX_PRODUCT)-$(VBOX_API_VERSION)-$(VBOX_BUILD_PUBLISHER),$(VBOX_BAD_CHAR_SET),,_)
VBOX_VERSION_HEADER = $(PATH_OUT)/version-generated.h
VBOX_VERSION_MK = $(PATH_OUT)/version-generated.mk
$(VBOX_VERSION_STAMP): | $(PATH_ROOT)/Config.kmk
VBOX_PACKAGE_HEADER = $(PATH_OUT)/package-generated.h
VBOX_PRODUCT_HEADER = $(PATH_OUT)/product-generated.h
# Used for external makefiles which cannot include Config.kmk
VBOX_LICENSE_VER_KMK = $(PATH_OUT)/license-version.kmk
$(QUIET)$(SED) -e "s/.*License version \([0-9.]*\) *[,&].*/VBOX_LICENSE_VER=\1/;t;d" --output $@ $(VBOX_BRAND_LICENSE_HTML)
Makefile.kmk: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK) $(VBOX_PRODUCT_HEADER) $(VBOX_PACKAGE_HEADER)
# the Config.kmk revision.
VBOX_SVN_REV_KMK = $(PATH_OUT)/revision.kmk
$(VBOX_SVN_REV_KMK).ts +| $(VBOX_SVN_REV_KMK): $(if $(VBOX_SVN_DEP), $(VBOX_SVN_DEP), $(PATH_ROOT)/Config.kmk)
$(SED) -e '/^Last Changed Rev/!d' -e 's/Last Changed Rev\: */export VBOX_SVN_REV=/' --output $@ $@.tmp
$(SED) -e '/^Revision/!d' -e 's/Revision\: */export VBOX_SVN_REV=/' --output $@ $@.tmp
# only needed for VBoxGuest for Linux/FreeBSD guests
VBOX_SVN_REV_HEADER = $(PATH_OUT)/revision-generated.h
# a second XIDL file, from which the COM/XPCOM IDL files are then generated:
VBOX_XIDL_FILE_SRC = $(PATH_ROOT)/src/VBox/Main/idl/VirtualBox.xidl
# second XIDL file to use as source for COM/XPCOM IDL (with stripped docs):
VBOX_XIDL_FILE = $(PATH_OUT)/obj/VirtualBox_stripped.xidl
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands \
$(if-expr $(VBOX_XCODE_VERSION_MAJOR) >= 4,/System/Library/Frameworks/JavaVM.framework/Versions/A/Commands,) \
) /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands)
if $(VBOX_XCODE_VERSION_MAJOR) >= 4 # Lion (4.1-preview 5) has a broken CurrentJDK link. Blindly applying it to 4.0.
VBOX_JAVA_INC = $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers
VBOX_JAVA_INC = $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Headers
$(PATH_DEVTOOLS)/linux.x86/jdk1.6.0_27 \
# VBOX_JAVA_HOME ?= /usr/jdk/jdk1.6.0
VBOX_JAVA_HOME ?= /usr/java
VBOX_JAVAC = $(VBOX_JAVA_HOME)/bin/javac
VBOX_JAVAH = $(VBOX_JAVA_HOME)/bin/javah
VBOX_JAR = $(VBOX_JAVA_HOME)/bin/jar
VBOX_JAVADOC = $(VBOX_JAVA_HOME)/bin/javadoc
VBOX_WSIMPORT = $(VBOX_JAVA_HOME)/bin/wsimport