# $Id: Config.kmk 64544 2016-11-03 20:09:31Z vboxsync $ ## @file # The global build configuration file for VBox. # # This file gets included by all makefiles through the # include $(KBUILD_PATH)/header.kmk statement. # # # Copyright (C) 2006-2016 Oracle Corporation # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; # you can redistribute it and/or modify it under the terms of the GNU # General Public License (GPL) as published by the Free Software # Foundation, in version 2 as it comes in the "COPYING" file of the # VirtualBox OSE distribution. VirtualBox OSE is distributed in the # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. # # Marker. VBOX_ROOT_CONFIG_KMK_INCLUDED = 1 # # kBuild stuff # # Build with umask 022 (requires kBuild r2556 to work, harmless on earlier). $(set-umask 022) # Add our own directories to the search paths. KBUILD_TOOL_PATHS = $(KBUILD_DEVTOOLS)/kBuildTools/ # Modify the build types. KBUILD_BLD_TYPES = release profile debug kprofile ## 'strict' builds # Same as release builds, except that RT_STRICT and VBOX_STRICT are defined, # meaning all assertions are in action. (Appending means '.strict' props take # precedence in argument lists.) KBUILD_BLD_TYPES += strict BLD_TYPE_strict_EXTENDS = release BLD_TYPE_strict_EXTENDS_BY = appending ## 'dbgopt' builds # Same as debug builds, except that compiler optimizations are enabled. This # intended for cases where all the debug facitities (logging, assertions, ++) # is wanted but actual source level debugging as important as execution speed. KBUILD_BLD_TYPES += dbgopt BLD_TYPE_dbgopt_EXTENDS = debug BLD_TYPE_dbgopt_EXTENDS_BY = overriding # Temporary hack for kBuild ticket #83. ## @todo kBuild: remove after closing ticket #83. PROPS_ACCUMULATE_L_LNK += INTERMEDIATES PROPS_PROGRAMS_ACCUMULATE_L += INTERMEDIATES PROPS_LIBRARIES_ACCUMULATE_L += INTERMEDIATES PROPS_DLLS_ACCUMULATE_L += INTERMEDIATES PROPS_SYSMODS_ACCUMULATE_L += INTERMEDIATES PROPS_MISCBINS_ACCUMULATE_L += INTERMEDIATES # Misc names used by the install paths below. VBOX_PUEL_MANGLED_NAME := Oracle_VM_VirtualBox_Extension_Pack # Install paths ## @todo This will change after 4.1 is branched off! # What is now 'bin' and 'lib' will be moved down under 'staged/', except on # darwin where it's currently called 'dist' which will be renamed to 'staged'. # When running 'kmk install' files will be copied to 'dist/', on unix systems # this will be done in FHS fashion assuming /usr/local or /usr as 'prefix'. # # Changes related to this are marked VBOX_WITH_NEW_LAYOUT. ifndef VBOX_WITH_NEW_LAYOUT PATH_INS = $(PATH_OUT)/dist PATH_STAGE = $(PATH_OUT) INST_DEBUG := stage/debug/ endif ifeq ($(KBUILD_TARGET),darwin) ifndef VBOX_WITH_NEW_LAYOUT INST_DIST = dist/ else INST_DIST := endif INST_SDK = $(INST_DIST)sdk/ # the bundles INST_VIRTUALBOX = $(INST_DIST)VirtualBox.app/ INST_VBOXDRV = $(INST_DIST)VBoxDrv.kext/ INST_VBOXNETFLT = $(INST_DIST)VBoxNetFlt.kext/ INST_VBOXNETADP = $(INST_DIST)VBoxNetAdp.kext/ INST_VBOXUSB = $(INST_DIST)VBoxUSB.kext/ # put everything in the VirtualBox app bundle. INST_BIN = $(INST_VIRTUALBOX)Contents/MacOS/ INST_DLL = $(INST_BIN) INST_SYS = $(INST_BIN) INST_TESTCASE = $(INST_BIN)testcase/ INST_ADDITIONS = $(INST_DIST)additions/ INST_ADDITIONS_ISO = $(INST_BIN) INST_VBOXDBG_SYMS = $(INST_VIRTUALBOX)Contents/Resources/VBoxDbgSyms/ # other paths INST_LIB = lib/ INST_ADDITIONS_LIB = $(INST_LIB)additions/ VBOX_INST_DTRACE_LIB = $(INST_BIN)dtrace/lib/ VBOX_INST_DTRACE_TST = $(INST_BIN)dtrace/testcase/ VBOX_INST_TOOLS = $(INST_BIN)tools/ else INST_BIN = bin/ INST_DIST = $(INST_BIN) INST_SDK = $(INST_BIN)sdk/ INST_VIRTUALBOX = $(INST_BIN) INST_VBOXDRV = $(INST_BIN) INST_VBOXNETFLT = $(INST_BIN) INST_VBOXNETADP = $(INST_BIN) INST_VBOXUSB = $(INST_BIN) INST_DLL = $(INST_BIN) INST_SYS = $(INST_BIN) INST_TESTCASE = $(INST_BIN)testcase/ INST_ADDITIONS = $(INST_BIN)additions/ INST_ADDITIONS_ISO = $(INST_ADDITIONS) INST_LIB = lib/ INST_ADDITIONS_LIB = $(INST_LIB)additions/ VBOX_INST_DTRACE_LIB = $(INST_BIN)dtrace/lib/ VBOX_INST_DTRACE_TST = $(INST_BIN)dtrace/testcase/ INST_VBOXDBG_SYMS = $(INST_BIN)VBoxDbgSyms/ VBOX_INST_TOOLS = $(INST_BIN)tools/ endif INST_VALIDATIONKIT = validationkit/ INST_TESTBOXSCRIPT = testboxscript/ INST_DOC = doc/ INST_EXTPACK = $(INST_BIN)ExtensionPacks/ INST_EXTPACK_CERTS = $(INST_BIN)ExtPackCertificates/ INST_EXTPACK_PUEL = $(INST_EXTPACK)$(VBOX_PUEL_MANGLED_NAME)/ INST_PACKAGES = packages/ VBOX_PATH_SDK = $(patsubst %/,%,$(PATH_STAGE)/$(INST_SDK)) VBOX_PATH_DIST = $(patsubst %/,%,$(PATH_STAGE)/$(INST_DIST)) VBOX_PATH_VALIDATIONKIT = $(patsubst %/,%,$(PATH_STAGE)/$(INST_VALIDATIONKIT)) VBOX_PATH_ADDITIONS = $(patsubst %/,%,$(PATH_STAGE)/$(INST_ADDITIONS)) VBOX_PATH_ADDITIONS_ISO = $(patsubst %/,%,$(PATH_STAGE)/$(INST_ADDITIONS_ISO)) VBOX_PATH_ADDITIONS_LIB = $(patsubst %/,%,$(PATH_STAGE)/$(INST_ADDITIONS_LIB)) VBOX_PATH_EXTPACK_PUEL= $(patsubst %/,%,$(PATH_STAGE)/$(INST_EXTPACK_PUEL)) VBOX_PATH_PACKAGES = $(patsubst %/,%,$(PATH_STAGE)/$(INST_PACKAGES)) # Delete targets on failure. .DELETE_ON_ERROR: # Notify about important kBuild updates. if $(KBUILD_VERSION_MAJOR) == 0 \ && ( $(KBUILD_VERSION_MINOR) >= 2 \ || ( $(KBUILD_VERSION_MINOR) == 1 \ && $(KBUILD_VERSION_PATCH) >= 999)) if $(KMK_REVISION) >= 2689 # OK. else $(error You must update kBuild! Requires kBuild revision 2577 or later, found $(KMK_REVISION) ($(KBUILD_VERSION))) endif else $(error You must update kBuild! Requires 0.1.999 or later, found $(KBUILD_VERSION)) endif # # Define USERNAME early on. # ifndef USERNAME ifdef USER USERNAME = $(USER) else $(warning Warning: You must have USERNAME or USER in your environment.) endif endif # # Detect the darwin host version number so we can disable stuff that doesn't # currently build on Lion. # ifeq ($(KBUILD_HOST),darwin) VBOX_DARWIN_HOST_VERSION := $(subst ., ,$(shell uname -r)) VBOX_DARWIN_HOST_VERSION_MAJOR := $(expr $(word 1, $(VBOX_DARWIN_HOST_VERSION)) - 4) VBOX_DARWIN_HOST_VERSION_MINOR := $(word 2, $(VBOX_DARWIN_HOST_VERSION)) VBOX_DARWIN_HOST_VERSION_PATCH := $(word 3, $(VBOX_DARWIN_HOST_VERSION)) VBOX_DARWIN_HOST_VERSION := 10.$(VBOX_DARWIN_HOST_VERSION_MAJOR).$(VBOX_DARWIN_HOST_VERSION_MINOR) endif # # The VirtualBox version. # # Major version. VBOX_VERSION_MAJOR = 5 # Minor version. VBOX_VERSION_MINOR = 1 # This is the current build number. It should be increased every time we publish a # new build. The define is available in every source file. Only even build numbers # will be published, odd numbers are set during development. VBOX_VERSION_BUILD = 51 # 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 # comparison. VBOX_VERSION_STRING_RAW = $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) # This can be overridden in LocalConfig.kmk or elsewhere. # For the convension, see checks near the end of Config.kmk. VBOX_BUILD_PUBLISHER = # Full version string (may include more than just x.y.z, but no spaces or other problematic chars). # Note! The BETA[n],ALPHA[n],RC[n] indicators should be inserted before the # publisher so that RTStrVersionCompare have a chance of comparing # prerelease from different publishers correctly. VBOX_VERSION_STRING = $(VBOX_VERSION_STRING_RAW)$(VBOX_BUILD_PUBLISHER) # Just the BETA[n],ALPHA[n],RC[n] indicators. Set to empty string for release. VBOX_VERSION_PRERELEASE = # Force the additions.sh script to get an exact additions build when we're doing the release. ifeq ($(int-mod $(VBOX_VERSION_BUILD),2),0) VBOX_RELEASE_EXACT_MATCH=1 endif ifneq ($(VBOX_RELEASE_EXACT_MATCH),) export VBOX_ADDITIONS_SH_MODE = release export VBOX_DOCUMENTATION_SH_MODE = release export VBOX_EFI_SH_MODE = release export VBOX_EXTPACKS_SH_MODE = release endif # Some info on the vendor VBOX_VENDOR = Oracle Corporation VBOX_VENDOR_SHORT = Oracle VBOX_PRODUCT = Oracle VM VirtualBox # Not all could be done automatically. Here is a list of known places which # have to be updated manually, please keep this up to date: # src/VBox/Devices/PC/PXE/client/uinit.asm # src/VBox/RDP/webclient/flash/com/sun/network/rdp/Version.as # src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp # src/VBox/Frontends/VirtualBox/src/settings/global/VBoxGLSettingsLanguage.cpp # src/VBox/Frontends/VirtualBox/nls/*.ts # debian/control # src/VBox/Installer/linux/{debian,rpm} # src/VBox/Installer/linux/virtualbox.desktop # src/VBox/Additions/WINNT/Installer/ISO/ReadmeDrivers.txt # */*.inf, */*.rc # Maybe we want set this manually. VBOX_C_YEAR = $(date-utc %Y) # # The VirtualBox package type. # ifeq ($(KBUILD_TARGET),win) VBOX_PACKAGE_OS = WINDOWS else ifeq ($(KBUILD_TARGET),linux) VBOX_PACKAGE_OS = LINUX else ifeq ($(KBUILD_TARGET),darwin) VBOX_PACKAGE_OS = DARWIN else ifeq ($(KBUILD_TARGET),solaris) VBOX_PACKAGE_OS = SOLARIS else ifeq ($(KBUILD_TARGET),os2) VBOX_PACKAGE_OS = OS2 else ifeq ($(KBUILD_TARGET),haiku) VBOX_PACKAGE_OS = HAIKU else if1of ($(KBUILD_TARGET), dragonfly freebsd netbsd openbsd) VBOX_PACKAGE_OS = BSD else $(error Cannot determine VBOX_PACKAGE_OS) endif ifeq ($(KBUILD_TARGET_ARCH),x86) VBOX_PACKAGE_ARCH = 32BITS else VBOX_PACKAGE_ARCH = 64BITS endif # distribution, mostly for Linux/Solaris where we support different distributions # this strip will be overridden by the Linux packaging scripts VBOX_PACKAGE_DIST ?= GENERIC # Full string VBOX_PACKAGE_STRING = $(VBOX_PACKAGE_OS)_$(VBOX_PACKAGE_ARCH)_$(VBOX_PACKAGE_DIST) # # The VirtualBox Configuration Defaults. # # We try to document all the build configuration options here, thing which # aren't enabled by default is left commented out just to show that they # exist and which value they should have (usually 1, but anyway). # # Select new Xcode based on host OS X version. ifeq ($(KBUILD_HOST),darwin) if !defined(VBOX_WITH_NEW_XCODE) && !defined(VBOX_WITHOUT_NEW_XCODE) && $(KBUILD_HOST_VERSION_MAJOR) >= 13 # (OS X 10.9 Mavericks) VBOX_WITH_NEW_XCODE = 1 endif endif ## @name Additions ## @{ # This indicates that additions (of some kind or another) is being _built_. # VBOX_WITHOUT_ADDITIONS overrides it. VBOX_WITH_ADDITIONS = 1 # Build the optional ring-0 part of the additions for syntax checking. # (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) VBOX_WITH_ADDITION_DRIVERS = 1 endif # Build X11 additions. Can be disabled separately. if1of ($(KBUILD_TARGET), dragonfly freebsd linux netbsd openbsd solaris) VBOX_WITH_X11_ADDITIONS = 1 endif # Enable the building of shared folders in the windows additions. VBOX_WITH_WIN32_ADDITIONS_SHAREDFOLDERS = 1 # Take the binaries of the OS/2 Additions. VBOX_WITH_OS2_ADDITIONS_BIN = 1 # Use additions from the build server. #VBOX_WITH_ADDITIONS_FROM_BUILD_SERVER = 1 # Include additions in the package VBOX_WITH_ADDITIONS_PACKING = 1 # Only build the additions (for the additions build server). #VBOX_ONLY_ADDITIONS = 1 ifdef VBOX_ADDITIONS_ONLY # typical mistake. $(error It is VBOX_ONLY_ADDITIONS=1 not VBOX_ADDITIONS_ONLY!) endif # Don't bother with additions, overrides VBOX_WITH_ADDITIONS. # This is not used by makefiles, only Config.kmk, see below. ifdef VBOX_ONLY_SDK VBOX_WITHOUT_ADDITIONS = 1 endif # Don't create the additions ISO. # (Used by the additions build server, don't invert it.) #VBOX_WITHOUT_ADDITIONS_ISO = 1 ## @} ## @name Documentation ## @{ # The documentation VBOX_WITH_DOCS = 1 # Use documentation from the build server. #VBOX_WITH_DOCS_FROM_BUILD_SERVER = 1 # Include documentation in the package VBOX_WITH_DOCS_PACKING = 1 # Include CHM when building docs (unset in LocalConfig.kmk to suppress CHM) ifn1of ($(KBUILD_TARGET), linux) VBOX_WITH_DOCS_CHM = 1 endif # By default only include translations in documentation-only builds ifdef VBOX_ONLY_DOCS ifndef VBOX_NO_DOCS_TRANSLATIONS VBOX_WITH_DOCS_TRANSLATIONS = 1 endif endif # Default languages VBOX_MANUAL_LANGUAGES = en_US ifdef VBOX_WITH_DOCS_TRANSLATIONS VBOX_MANUAL_ADD_LANGUAGES = fr_FR endif # Don't bother with documentation, overrides VBOX_WITH_DOCS. # This is not used by makefiles, only Config.kmk, see below. #VBOX_WITHOUT_DOCS = 1 # Only build the documentation (for the documentation build server). #VBOX_ONLY_DOCS = 1 ifdef VBOX_DOCS_ONLY # typical mistake. $(error It is VBOX_ONLY_DOCS=1 not VBOX_DOCS_ONLY!) endif ## @} ## @name VMM related settings. ## @{ # Enable the tradition raw-mode virtualization. if !$(intersects $(KBUILD_TARGET), darwin) || defined(VBOX_ONLY_EXTPACKS) VBOX_WITH_RAW_MODE = 1 endif # Enable the ring-1 compression option (mainly for QNX). VBOX_WITH_RAW_RING1 = 1 # Enable safe STR (store task register) emulation for raw-mode. VBOX_WITH_SAFE_STR = 1 # Enable support for 64-bit guests. VBOX_WITH_64_BITS_GUESTS = 1 # Enable multi-core VCPUs. VBOX_WITH_MULTI_CORE = 1 # Activate this to force the VM to pre-allocate the guest RAM before startup VBOX_WITH_PREALLOC_RAM_BY_DEFAULT = # Enable the debugger. VBOX_WITH_DEBUGGER = 1 # Enable the debugger GUI. VBOX_WITH_DEBUGGER_GUI = 1 # Enables the second step using IEM (the interpreter). VBOX_WITH_2ND_IEM_STEP = 1 # Enables the third step using IEM (the interpreter). VBOX_WITH_3RD_IEM_STEP = 1 # Enables the new APIC code. VBOX_WITH_NEW_APIC = 1 # Enables the new I/O APIC code. VBOX_WITH_NEW_IOAPIC = 1 ## @} ## @name Devices, Drivers, ... ## @{ # Build the Host Guest Communication Manager component. VBOX_WITH_HGCM = 1 ## Build the bugcheck detection code. #VBOX_WITH_GUEST_BUGCHECK_DETECTION = # Enable the USB feature. This includes VBOX_WITH_VUSB! VBOX_WITH_USB = 1 # Enable the USB 1.1 controller plus virtual USB HID devices. VBOX_WITH_VUSB = 1 # Enable the USB 2.0 controller. VBOX_WITH_EHCI = 1 # Enable the ISCSI feature. VBOX_WITH_ISCSI = 1 # Enable INIP support in the ISCSI feature. VBOX_WITH_INIP = 1 # Enables lwip as a core of NAT service VBOX_WITH_LWIP_NAT = 1 # Enables compilation of NAT service VBOX_WITH_NAT_SERVICE = 1 # Enable the E1000 feature. VBOX_WITH_E1000 = 1 # Enable the Virtio feature. VBOX_WITH_VIRTIO = 1 ifn1of ($(KBUILD_TARGET), win darwin) # Enable OSS audio support. VBOX_WITH_AUDIO_OSS = 1 endif if1of ($(KBUILD_TARGET), linux) # Enable ALSA audio support. VBOX_WITH_AUDIO_ALSA = 1 endif if1of ($(KBUILD_TARGET), linux) # Enable PulseAudio audio support. VBOX_WITH_AUDIO_PULSE = 1 endif ifeq ($(KBUILD_TYPE),debug) ## @todo Only build if running on test boxes? VBOX_WITH_AUDIO_DEBUG = endif # Enable PCI passthrough support. VBOX_WITH_PCI_PASSTHROUGH = 1 # Enable statically linked dbus support. if1of ($(KBUILD_TARGET), linux solaris) VBOX_WITH_DBUS = 1 endif # Enable building PAM modules. if1of ($(KBUILD_TARGET), linux solaris) VBOX_WITH_PAM = 1 endif # Enable internal networking. VBOX_WITH_INTERNAL_NETWORKING = 1 # Enable vmsvga (svga2) graphics device variant, 2D part VBOX_WITH_VMSVGA = 1 # Enable vmsvga (svga2) graphics device variant, 3D part if1of ($(KBUILD_TARGET), darwin win) VBOX_WITH_VMSVGA3D = 1 endif # Enable Host Guest Shared Memory Interface. VBOX_WITH_HGSMI = 1 # Enable Video 2D Acceleration. if1of ($(KBUILD_TARGET), darwin linux win freebsd) VBOX_WITH_VIDEOHWACCEL = 1 endif # Enable Wddm Video driver for Vista+ guests. VBOX_WITH_WDDM = 1 # Enable Wddm Video driver for Windows 8 guests. VBOX_WITH_WDDM_W8 = 1 # Lazy developer!! VBOXWDDM_WITH_VBVA = 1 # Lazy developer!! ifdef VBOX_WITH_WDDM VBOX_WITH_VDMA = 1 else ifdef VBOX_WITH_VDMA undef VBOX_WITH_VDMA endif # Disable the Intel PXE ROM (uses Etherboot). VBOX_WITH_INTEL_PXE = # Enable EFI support VBOX_WITH_EFI = 1 # Fetch EFI firmware image from the build server #VBOX_WITH_EFIFW_FROM_BUILD_SERVER = 1 # Include the EFI firmware into the package VBOX_WITH_EFIFW_PACKING = 1 # Use kStuff for MACH-O and LX binary loading. if1of ($(KBUILD_TARGET_ARCH), x86 amd64) IPRT_WITH_KSTUFF = 1 endif # Enable setuid wrapper for Solaris host DVD. #VBOX_WITH_SUID_WRAPPER = 1 # Enable the virtual SATA/AHCI controller VBOX_WITH_AHCI = 1 # Enable the new async completion manager VBOX_WITH_PDM_ASYNC_COMPLETION = 1 ifdef VBOX_WITH_USB VBOX_WITH_VUSB = 1 VBOX_WITH_XHCI_IMPL=1 endif ifdef VBOX_WITH_EHCI VBOX_WITH_EHCI_IMPL = 1 endif ifdef VBOX_WITH_PCI_PASSTHROUGH VBOX_WITH_PCI_PASSTHROUGH_IMPL = 1 endif ifndef VBOX_WITHOUT_HOSTWEBCAM VBOX_WITH_USB_VIDEO_IMPL = 1 endif # Enable the hal/sysfs USB code on Linux. ifeq ($(KBUILD_TARGET),linux) VBOX_USB_WITH_SYSFS = 1 # Disabled for now # VBOX_USB_WITH_DBUS = 1 VBOX_USB_WITH_INOTIFY = 1 endif # Enable performance API. VBOX_WITH_RESOURCE_USAGE_API = 1 # Use VBoxVolInfo for getting FS dependecies. if1of ($(KBUILD_TARGET), linux) VBOX_WITH_DEVMAPPER = 1 endif # Enable BusLogic SCSI host adapter VBOX_WITH_BUSLOGIC = 1 # Enable LsiLogic SCSI host adapter VBOX_WITH_LSILOGIC = 1 # Enable SCSI drivers VBOX_WITH_SCSI = 1 # Enable this setting to force a fallback to default DMI data on configuration errors VBOX_BIOS_DMI_FALLBACK = # Enable the builtin PXE ROM VBOX_WITH_PXE_ROM = 1 # Enable MSI support in devices VBOX_WITH_MSI_DEVICES = 1 # Enable host network interface API. if1of ($(KBUILD_TARGET), darwin freebsd linux solaris win) VBOX_WITH_HOSTNETIF_API = 1 endif # Emulated USB smart card reader VBOX_WITH_USB_CARDREADER = 1 # Disk crypt plugin VBOX_WITH_PLUGIN_CRYPT = 1 # VirtualKD stub/loader device, only relevant on Windows host VBOX_WITH_VIRTUALKD = 1 # NVMe device emulation VBOX_WITH_NVME_IMPL = 1 ## @} # legacy ifdef VBOX_ONLY_TESTSUITE $(warning VBOX_ONLY_TESTSUITE was renamed to VBOX_ONLY_VALIDATIONKIT) VBOX_ONLY_VALIDATIONKIT = $(VBOX_ONLY_TESTSUITE) endif ## @name Other Component ## @{ # Build the installer. VBOX_WITH_INSTALLER = 1 # The kernel driver/module and related runtime libraries. VBOX_WITH_VBOXDRV = 1 # The main api. VBOX_WITH_MAIN = 1 # Enables proxy stub for MS COM (speeds up setting IPC for objects). # (The VBOX_MIDL_PROXY_CLSID and VBOX_MIDL_PROXY_CLSID_IS are just two # representations of the class ID for the proxy stub.) VBOX_WITH_MIDL_PROXY_STUB = 1 VBOX_MIDL_PROXY_CLSID := {0bb3b78c-1807-4249-5ba5-ea42d66af0bf} VBOX_MIDL_PROXY_CLSID_IS := {0x0bb3b78c,0x1807,0x4249,{0x5b,0xa5,0xea,0x42,0xd6,0x6a,0xf0,0xbf}} # Whether to also ship 32-bit main API on 64-bit systems. if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), solaris.amd64 win.amd64) if !defined(VBOX_ONLY_VALIDATIONKIT) && !defined(VBOX_ONLY_ADDITIONS) && !defined(VBOX_ONLY_DOCS) VBOX_WITH_32_ON_64_MAIN_API = 1 endif endif # Whether to generate a database of USB vendor IDs and device IDs into VBoxSVC. VBOX_WITH_MAIN_USB_ID_DATABASE = 1 # The recompiler. if !defined(VBOX_WITH_NEW_XCODE) || "$(KBUILD_TARGET)" != "darwin" VBOX_WITH_REM = 1 endif # Set this to prefix all C symbols in XPCOM, to avoid dynamic linking problems # caused by our XPCOM library polluting the symbol namespace for system libs. if1of ($(KBUILD_TARGET), linux solaris) VBOX_WITH_XPCOM_NAMESPACE_CLEANUP = 1 endif # The webservices api. VBOX_WITH_WEBSERVICES = 1 VBOX_WITH_WEBSERVICES_SSL = 1 # The Qt GUI. VBOX_WITH_QTGUI = 1 if1of ($(KBUILD_TARGET), linux win solaris) VBOX_WITH_QTGUI_V5 = 1 # r=bird: s/VBOX_WITH_QTGUI_V5/VBOX_WITH_QT5/g - our we released version 5.0 of the VirtualBox GUI last year, remember? else if "$(KBUILD_TARGET)" == "darwin" && $(KBUILD_HOST_VERSION_MAJOR) >= 13 # (OS X 10.9 Mavericks) VBOX_WITH_QTGUI_V5 = 1 endif # Indicates the Qt is Cocoa based on the Mac. ifeq ($(KBUILD_TARGET),darwin) VBOX_WITH_COCOA_QT = 1 endif # HiDPI support for OS X VBOX_GUI_WITH_HIDPI = 1 # The SDL based GUI. VBOX_WITH_VBOXSDL = 1 # Build VBoxSDL with secure label support. ifeq ($(filter win.amd64,$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)),) # too much work with freetype and all that. VBOX_WITH_SECURELABEL = 1 endif # The headless frontend. VBOX_WITH_HEADLESS = 1 # Enable the build of VRDP server. VBOX_WITH_VRDP = 1 # Build the VRDP authentication modules. VBOX_WITH_VRDP_AUTHMOD = 1 # Build enhanced version of rdesktop. VBOX_WITH_VRDP_RDESKTOP = 1 ## The Direct Framebuffer GUI. #VBOX_WITH_VBOXFB = 1 # Enables the Python<->XPCOM, Python<->COM and (WS enabled) Python<->WS bindings. VBOX_WITH_PYTHON ?= 1 # Enables the PERL<->WS binding (if WS enabled). #VBOX_WITH_PERL ?= 1 # Enables the PHP<->WS binding (if WS enabled). VBOX_WITH_PHP ?= 1 if1of ($(KBUILD_TARGET), darwin linux solaris) # Enable Java<->XPCOM bridge + glue code VBOX_WITH_JXPCOM ?= 1 endif if1of ($(KBUILD_TARGET), ) # Enable Java<->MSCOM glue, bridge is provided by an external lib (Jacob) VBOX_WITH_JMSCOM ?= 1 endif if1of ($(KBUILD_TARGET), darwin linux solaris) # Enable Java<->JAX-WS bridge VBOX_WITH_JWS ?= 1 endif # Use XPIDL instead of XSLT stylesheet VBOX_WITH_JAVA_SUPPORT_IN_XPIDL ?= # Build against multiple Python versions present in the system VBOX_WITH_MULTIVERSION_PYTHON ?= 1 # Enable the kchmviewer. VBOX_WITH_KCHMVIEWER = 1 # Build the Validation Kit. VBOX_WITH_VALIDATIONKIT = 1 # Build the testcases. VBOX_WITH_TESTCASES = 1 # Enable this to build vditool even if VBOX_WITH_TESTCASES is disabled VBOX_WITH_VDITOOL = # Enable this to build vbox-img even if VBOX_WITH_TESTCASES is disabled VBOX_WITH_VBOX_IMG = # Enables the VPX module for VM video capturing if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.x86 darwin.amd64 linux.x86 linux.amd64 solaris.amd64 win.x86 win.amd64) VBOX_WITH_VPX = 1 endif # Enable shared folders VBOX_WITH_SHARED_FOLDERS = 1 # Enable shared clipboard VBOX_WITH_SHARED_CLIPBOARD = 1 # Enable the host/guest information service (aka guest properties). VBOX_WITH_GUEST_PROPS = 1 # Enable this to prevent the guest from writing guest properties. VBOX_WITH_GUEST_PROPS_RDONLY_GUEST = # Compile the host channel VBOX_WITH_HOST_CHANNEL = 1 # Enable the guest control service. if1of ($(KBUILD_TARGET), darwin freebsd linux solaris win) VBOX_WITH_GUEST_CONTROL = 1 endif # Enable ballooning VBOX_WITH_MEMBALLOON = 1 # Enable crOpenGL service if1of ($(KBUILD_TARGET), darwin freebsd linux solaris win) VBOX_WITH_CROGL = 1 endif # Enable cURL (required for the network part of the GUI) VBOX_WITH_LIBCURL = 1 # Enable Host=>Guest Drag'n'Drop if1of ($(KBUILD_TARGET), darwin linux solaris win) VBOX_WITH_DRAG_AND_DROP = 1 if1of ($(KBUILD_TARGET), darwin linux solaris win) VBOX_WITH_DRAG_AND_DROP_GH = $(VBOX_WITH_DRAG_AND_DROP) endif ifdef VBOX_WITH_DRAG_AND_DROP_GH ifeq ($(KBUILD_TARGET),darwin) # On OS X (Darwin) this needs to be set in order to get proper # guest->host support. # Note: Setting this requires Qt also having this feature enabled! VBOX_WITH_DRAG_AND_DROP_PROMISES = $(VBOX_WITH_DRAG_AND_DROP) endif endif endif # Enable audio support for VRDE. VBOX_WITH_VRDE_AUDIO = 1 # Use the VRDE external authentication library from VBoxSVC. if1of ($(KBUILD_TARGET), win) VBOX_WITH_VRDEAUTH_IN_VBOXSVC = 1 endif # Enables use of merge modules in the windows installer. This will increase # the overall installer size significantly because merge modules are not able # to use a common .cab file to reduce their size. #VBOX_WITH_MSM_INSTALL = 1 ## @} ## @name Networking ## @{ # Use VBoxNetFlt for host interface networking. if1of ($(KBUILD_TARGET), darwin freebsd linux solaris win) VBOX_WITH_NETFLT = 1 ifeq ($(KBUILD_TARGET),solaris) # requires snv_159+. VBOX_WITH_NETFLT_CROSSBOW = 1 endif # Use VBoxNetAdp for host only networking. if1of ($(KBUILD_TARGET), darwin freebsd linux solaris win) VBOX_WITH_NETADP = 1 endif endif # Enables the UDP tunnel transport. VBOX_WITH_UDPTUNNEL = 1 # Enable the netshaper support VBOX_WITH_NETSHAPER = 1 # Enable Virtual Distributed Ethernet or not. if1of ($(KBUILD_TARGET), freebsd linux) VBOX_WITH_VDE = 1 endif ## @} ## @name Extension pack ## @{ # Enables the extension pack feature. VBOX_WITH_EXTPACK = 1 # Enables separating code into the Oracle VM VirtualBox Extension Pack, dubbed PUEL. VBOX_WITH_EXTPACK_PUEL = 1 # Enables building+packing the Oracle VM VirtualBox Extension Pack, includes VBOX_WITH_EXTPACK_PUEL VBOX_WITH_EXTPACK_PUEL_BUILD = 1 # Enable the BusMouse sample extension pack. #VBOX_WITH_EXTPACK_BUSMOUSESAMPLE = 1 # Enable the VNC server extension pack (GPL only). #VBOX_WITH_EXTPACK_VNC = 1 # Enables the VBoxDTrace extension pack. VBOX_WITH_EXTPACK_VBOXDTRACE = 1 ## @} ## @name Misc ## @{ # Enable to compile with OpenSSL 1.0 (only relevant for Windows, see src/VBox/Runtime/Makefile.kmk) #VBOX_WITH_OPENSSL_PRE_1_1 = 1 # Enable Seamless mode VBOX_X11_SEAMLESS_GUEST = 1 # Enables all the doxgen bits. VBOX_WITH_ALL_DOXYGEN_TARGETS = 1 # Set this to skip installing the redistributable compiler runtime. #VBOX_WITHOUT_COMPILER_REDIST = 1 # Enables VMMR0.r0 (++) loading using the native loader on solaris. # Good for debugging and analysis. Experimental. #VBOX_WITH_NATIVE_SOLARIS_LOADING = 1 # Set this to enable user mode dtrace probes. if1of ($(KBUILD_TARGET), darwin linux solaris) VBOX_WITH_DTRACE_R3 = 1 VBOX_WITH_DTRACE_R3_MAIN = 1 endif # Set this to enable kernel driver dtrace probes. if1of ($(KBUILD_TARGET), darwin solaris) VBOX_WITH_DTRACE_R0DRV = 1 endif # Set this to enable dtrace probes in platform agnostic kernel code. ifn1of ($(KBUILD_TARGET), os2) VBOX_WITH_DTRACE_R0 = 1 endif # Set this to enable dtrace probes raw-mode context code. if1of ($(KBUILD_TARGET), linux solaris) VBOX_WITH_DTRACE_RC = 1 endif # Set this to enable support for dtrace probes in guest code. #VBOX_WITH_DTRACE_GST = 1 # Set this to indicate that the host ships with DTrace. if1of ($(KBUILD_TARGET), darwin solaris) VBOX_WITH_NATIVE_DTRACE = 1 endif # Makes it possible to run some of the testcases and tools on older # windows versions (only define when buildling win.x86). #VBOX_WITH_MORE_NT4_COMPAT_BINARIES = 1 ## @} ## @name Compiler and linker config ## @{ # For treating compiler and linker warnings as errors where possible. if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.x86 darwin.amd64 linux.x86 linux.amd64 win.x86 win.amd64) VBOX_WITH_WARNINGS_AS_ERRORS = 1 endif # Whether we can use Open Watcom to build stuff. if1of ($(KBUILD_TARGET), darwin linux os2 win) VBOX_WITH_OPEN_WATCOM = 1 endif ## @} ## @name Hardening ## @{ # Enables hardening. # Most developers will want to disable this in their LocalConfig.kmk. VBOX_WITH_HARDENING = 1 # Where the application files are (going to be) installed. #VBOX_PATH_APP_PRIVATE = /usr/lib/virtualbox ifdef VBOX_WITH_HARDENING if1of ($(KBUILD_TARGET), linux solaris) VBOX_PATH_APP_PRIVATE = /opt/VirtualBox else ifeq ($(KBUILD_TARGET),darwin) VBOX_PATH_APP_PRIVATE = /Applications/VirtualBox.app/Contents/MacOS else ifeq ($(KBUILD_TARGET),freebsd) VBOX_PATH_APP_PRIVATE = /usr/local/lib/virtualbox else ifeq ($(KBUILD_TARGET),haiku) VBOX_PATH_APP_PRIVATE = /boot/system/apps/VirtualBox endif endif # Where the architecture specific application files are (going to be) installed. #VBOX_PATH_APP_PRIVATE_ARCH = /usr/lib/virtualbox ifdef VBOX_WITH_HARDENING if1of ($(KBUILD_TARGET), solaris) VBOX_PATH_APP_PRIVATE_ARCH_TOP = $(VBOX_PATH_APP_PRIVATE) VBOX_PATH_APP_PRIVATE_ARCH = $(VBOX_PATH_APP_PRIVATE_ARCH_TOP)/$(if-expr $(KBUILD_TARGET_ARCH) == "amd64",amd64,i386) else ifdef VBOX_PATH_APP_PRIVATE VBOX_PATH_APP_PRIVATE_ARCH = $(VBOX_PATH_APP_PRIVATE) endif endif # Where the shared libraries are (going to be) installed. #VBOX_PATH_SHARED_LIBS = /usr/lib ifdef VBOX_WITH_HARDENING if1of ($(KBUILD_TARGET), solaris) VBOX_PATH_SHARED_LIBS = $(VBOX_PATH_APP_PRIVATE)/$(if-expr $(KBUILD_TARGET_ARCH) == "amd64",amd64,i386) else ifdef VBOX_PATH_APP_PRIVATE VBOX_PATH_SHARED_LIBS = $(VBOX_PATH_APP_PRIVATE) endif endif # Where the documentation is (going to be) installed. #VBOX_PATH_APP_DOCS = /usr/share/doc/virtualbox ifdef VBOX_WITH_HARDENING ifdef VBOX_PATH_APP_PRIVATE VBOX_PATH_APP_DOCS = $(VBOX_PATH_APP_PRIVATE) endif endif # The DT_RPATH/DT_RUNPATH to embed into the binaries (ELF). # (This one is used for all binaries, there is no need to adjust this # depending on the location of the object.) #VBOX_WITH_RUNPATH = /usr/lib/virtualbox ifdef VBOX_WITH_HARDENING if1of ($(KBUILD_TARGET), solaris) VBOX_WITH_RUNPATH = $(VBOX_PATH_APP_PRIVATE)/$(if-expr $(KBUILD_TARGET_ARCH) == "amd64",amd64,i386) else if1of ($(KBUILD_TARGET), freebsd linux) VBOX_WITH_RUNPATH = $(VBOX_PATH_APP_PRIVATE) endif endif # Enable use of the $ORIGIN DT_RPATH/DT_RUNPATH feature (ELF). # Because of the setuid usage on all ELF platforms when hardening the build # things gets a bit complicated since the $ORIGIN+setuid policy differs. #VBOX_WITH_ORIGIN = 1 ifndef VBOX_WITH_HARDENING if1of ($(KBUILD_TARGET), linux solaris) VBOX_WITH_ORIGIN = 1 endif endif # Enable the system wide support service/daemon. # Very sketchy work in progress. #VBOX_WITH_SUPSVC = 1 # Continue to support Vista w/o any service pack, at least for now. VBOX_WITH_VISTA_NO_SP = 1 ## @} # Strip binaries of release and profile builds before packing them into the installer # archive. When building .deb/.rpms, don't strip the symbols as they are required for # the debug packages containing symbols for gdb located in /usr/lib/debug. VBOX_DO_STRIP := $(if $(filter release profile,$(KBUILD_TYPE)),1,) # # Config items for enabling work in progress. # # It's good pratice to add stuff here even if it is currently disabled by # default. # # Note! Please, do *not* add stuff to the global DEFS unless it is *really* # necessary! The other guys will hate for it you when they have to # recompile everything when the feature is enabled or disabled. Put # the ifdefs in target or template definitions. # # Mask all Local APIC interrupt vectors which are set up to NMI mode when switching # to/from the guest in raw mode. Modern Linux kernels use the performance counter # to raise an NMI from time to time. if1of ($(KBUILD_TARGET), linux) VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI = 1 endif ## For testing deadlock detection and lock order validation. # If issues are found, create high priority defects and temporarily comment # the next line. VBOX_WITH_STRICT_LOCKS = 1 # # Branding # 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_LICENSE_VER := VBOX_BRAND_GUI_ABOUT_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/NonOSE/about.png VBOX_BRAND_GUI_ABOUT_HIDPI_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/hidpi/NonOSE/about_hidpi.png VBOX_BRAND_GUI_ABOUT_16PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/NonOSE/about_16px.png VBOX_BRAND_GUI_ABOUT_16PX_HIDPI_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/hidpi/NonOSE/about_16px_hidpi.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_GUI_VBOX_SVG := $(PATH_ROOT)/src/VBox/Artwork/NonOSE/virtualbox.svg VBOX_BRAND_WIN_INST_DLGJPG := $(PATH_ROOT)/src/VBox/Installer/win/Binary/Dialog.jpg VBOX_BRAND_WIN_INST_EXT := 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 # # Skip stuff. # ifdef VBOX_ONLY_EXTPACKS # Clear some VBOX_WITH_XXX variables instead of adding ifdefs all over the place. VBOX_WITH_DEBUGGER = VBOX_WITH_ADDITIONS = VBOX_WITH_VBOXDRV = VBOX_WITH_TESTCASES = endif # VBOX_QUICK can be used by core developers to speed to the build ifdef VBOX_QUICK # undefine variables by assigning blank. VBOX_WITH_VALIDATIONKIT= VBOX_WITH_TESTCASES= VBOX_WITH_MAIN= VBOX_WITH_VBOXSDL= VBOX_WITH_QTGUI= VBOX_WITH_DEBUGGER_GUI= VBOX_WITH_DOCS= endif # VBOX_QUICK ifeq ($(KBUILD_TARGET),darwin) # Don't bother with SDL ttf for now. VBOX_WITH_SECURELABEL= # We'll use the native html/help viewer. VBOX_WITH_KCHMVIEWER= VBOX_WITH_VRDP_RDESKTOP= # Permanent (no working SDL). VBOX_WITH_VBOXSDL= endif ifeq ($(KBUILD_TARGET),freebsd) VBOX_WITH_DOCS= endif ifeq ($(KBUILD_TARGET),haiku) # Don't bother with SDL ttf for now. VBOX_WITH_SECURELABEL= # We'll use the native html/help viewer. VBOX_WITH_KCHMVIEWER= VBOX_WITH_VRDP_RDESKTOP= # Permanent (no working SDL). VBOX_WITH_VBOXSDL= VBOX_WITH_DOCS= VBOX_WITH_VBOXDRV= VBOX_WITH_VRDP= VBOX_WITH_HEADLESS= VBOX_WITH_VBOXSDL= VBOX_WITH_QTGUI= # VBOX_WITH_MAIN= VBOX_WITH_DOCS= VBOX_WITH_ISCSI= VBOX_WITH_INIP= VBOX_WITH_INTERNAL_NETWORKING= VBOX_WITH_PDM_ASYNC_COMPLETION= VBOX_WITH_KCHMVIEWER= VBOX_WITH_HARDENING= endif ifeq ($(KBUILD_TARGET),os2) VBOX_WITH_WEBSERVICES= VBOX_WITH_INSTALLER= VBOX_WITH_SECURELABEL= VBOX_WITH_VRDP_AUTHMOD= VBOX_WITH_VRDP_RDESKTOP= VBOX_WITH_VALIDATIONKIT= VBOX_WITH_QTGUI= VBOX_WITH_USB= VBOX_WITH_EHCI= VBOX_WITH_DOCS= VBOX_WITH_PDM_ASYNC_COMPLETION= VBOX_WITH_KCHMVIEWER= VBOX_WITH_HARDENING= endif ifeq ($(KBUILD_TARGET),solaris) VBOX_WITH_SECURELABEL= VBOX_WITH_OGL= endif ifeq ($(KBUILD_TARGET),win) VBOX_WITH_VRDP_RDESKTOP= VBOX_WITH_KCHMVIEWER= endif ifn1of ($(KBUILD_TARGET_ARCH), x86 amd64) VBOX_WITH_ADDITION_DRIVERS= VBOX_WITH_CROGL= VBOX_WITH_DEBUGGER= VBOX_WITH_DOCS= VBOX_WITH_EHCI= VBOX_WITH_HARDENING= VBOX_WITH_HEADLESS= VBOX_WITH_HGCM= VBOX_WITH_HGSMI= VBOX_WITH_INIP= VBOX_WITH_INSTALLER= VBOX_WITH_INTERNAL_NETWORKING= VBOX_WITH_ISCSI= VBOX_WITH_KCHMVIEWER= VBOX_WITH_MAIN= VBOX_WITH_PDM_ASYNC_COMPLETION= VBOX_WITH_QTGUI= VBOX_WITH_RAW_MODE= VBOX_WITH_SECURELABEL= VBOX_WITH_VALIDATIONKIT= VBOX_WITH_USB= VBOX_WITH_VBOXDRV= VBOX_WITH_VBOXSDL= VBOX_WITH_WEBSERVICES= VBOX_WITH_XPCOM= VBOX_WITHOUT_HARDENING=1 # remove later: VBOX_WITH_VRDP= VBOX_WITH_VRDP_AUTHMOD= VBOX_WITH_VRDP_RDESKTOP= endif # # Include automatic and local config file to override the above settings # and to provide defaults for the settings below this point. # ifndef AUTOCFG AUTOCFG := $(wildcard $(PATH_ROOT)/AutoConfig.kmk) endif ifneq ($(AUTOCFG),) include $(AUTOCFG) endif ifndef LOCALCFG LOCALCFG := $(wildcard $(PATH_ROOT)/LocalConfig.kmk) ifneq ($(LOCALCFG),) include $(LOCALCFG) endif else # Ignore it if it doesn't exist. if exists "$(LOCALCFG)" include $(LOCALCFG) else $(warning LOCALCFG='$(LOCALCFG)' does not exist) override LOCALCFG := endif endif # # Allow to overwrite the branding information from an external file # ifdef VBOX_BRANDING_CFG include $(VBOX_BRANDING_CFG) endif # # Bitch about old settings. # ifdef VBOX_WITHOUT_LINUX_COMPILER_H $(warning VBOX_WITHOUT_LINUX_COMPILER_H was renamed to VBOX_WITH_LINUX_COMPILER_H, the meaning is inverted.) endif # # Indicate VBOX_ONLY build if any of the VBOX_ONLY_* variables are set. # VBOX_ONLY_BUILD := $(strip $(foreach x, ADDITIONS DOCS EXTPACKS SDK VALIDATIONKIT\ , $(if-expr defined(VBOX_ONLY_$(x)),VBOX_ONLY_$(x)))) if $(words $(VBOX_ONLY_BUILD)) > 1 $(error VBox: More than one VBOX_ONLY build enabled! $(VBOX_ONLY_BUILD)) endif # # For the docs build box. # ifdef VBOX_ONLY_DOCS VBOX_WITH_DOCS_CHM = 1 endif # # Disable components that are not open sourced. # ifdef VBOX_OSE VBOX_WITH_VRDP= VBOX_WITH_EHCI_IMPL= VBOX_WITH_XHCI_IMPL= VBOX_WITH_USB_VIDEO_IMPL= VBOX_WITH_NVME_IMPL= VBOX_WITH_EXTPACK_PUEL= VBOX_WITH_EXTPACK_PUEL_BUILD= VBOX_WITH_PCI_PASSTHROUGH_IMPL= VBOX_WITH_OS2_ADDITIONS_BIN= VBOX_WITH_SECURELABEL= VBOX_WITH_KCHMVIEWER= VBOX_WITH_PLUGIN_CRYPT= VBOX_WITH_DRAG_AND_DROP_PROMISES= ifn1of ($(KBUILD_TARGET), linux) VBOX_WITH_DOCS= VBOX_WITH_DOCS_PACKING= endif if1of ($(KBUILD_TARGET), solaris) VBOX_WITH_32_ON_64_MAIN_API= endif # Enable any translations in OSE, even partial ones. ifndef ($(VBOX_NO_DOCS_TRANSLATIONS)) VBOX_WITH_DOCS_TRANSLATIONS = 1 endif VBOX_WITH_INTEL_PXE= # Disable for OSE, requires snv_159+. VBOX_WITH_NETFLT_CROSSBOW= ifn1of ($(KBUILD_TARGET), darwin linux solaris win) VBOX_WITH_INSTALLER= endif if1of ($(KBUILD_TARGET), win) VBOX_WITH_VPX= endif VBOX_GUI_WITH_HIDPI= # branding 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_HIDPI_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/about_hidpi.png VBOX_BRAND_GUI_ABOUT_16PX_PNG := $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/images/OSE/about_16px.png VBOX_BRAND_GUI_ABOUT_16PX_HIDPI_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_BRAND_GUI_VBOX_SVG := $(PATH_ROOT)/src/VBox/Artwork/OSE/virtualbox.svg endif # # VBOX_WITHOUT_HARDENING is for developers (put in LocalConfig.kmk). # Note that this is a bit rough since hardening governs more than one # variable... Also note that we allow VBOX_WITH_HARDENING=1 on the # command line to overrule VBOX_WITHOUT_HARDENING (the check below). # ifdef VBOX_WITHOUT_HARDENING VBOX_WITH_HARDENING= ifeq ($(VBOX_WITH_HARDENING),) VBOX_PATH_APP_PRIVATE= VBOX_PATH_APP_PRIVATE_ARCH= VBOX_PATH_APP_PRIVATE_ARCH_TOP= VBOX_PATH_SHARED_LIBS= VBOX_PATH_APP_DOCS= VBOX_WITH_RUNPATH= if1of ($(KBUILD_TARGET), linux solaris) VBOX_WITH_ORIGIN=1 endif endif endif # # Sanitize the additions build config variables. # ifdef VBOX_WITH_ADDITIONS_FROM_BUILD_SERVER VBOX_WITHOUT_ADDITIONS := 1 ifdef VBOX_ONLY_ADDITIONS $(error VBOX_ONLY_ADDITIONS + VBOX_WITH_ADDITIONS_FROM_BUILD_SERVER does not add up!) endif endif ifdef VBOX_ONLY_ADDITIONS ifdef VBOX_WITHOUT_ADDITIONS $(error VBOX_ONLY_ADDITIONS + VBOX_WITHOUT_ADDITIONS does not add up!) endif endif ifdef VBOX_WITHOUT_ADDITIONS # Zap anything that could be contradicting this. VBOX_WITH_ADDITIONS := endif # # Sanitize the documentation build config variables. # ifdef VBOX_WITH_DOCS_FROM_BUILD_SERVER VBOX_WITHOUT_DOCS := 1 ifdef VBOX_ONLY_DOCS $(error VBOX_ONLY_DOCS + VBOX_WITH_DOCS_FROM_BUILD_SERVER does not add up!) endif endif ifdef VBOX_ONLY_DOCS ifdef VBOX_WITHOUT_DOCS $(error VBOX_ONLY_DOCS + VBOX_WITHOUT_DOCS does not add up!) endif endif ifdef VBOX_WITHOUT_DOCS # Zap anything that could be contradicting this. VBOX_WITH_DOCS := VBOX_WITH_DOCS_CHM := endif # # Disable components for headless # ifdef VBOX_HEADLESS VBOX_WITH_QTGUI= VBOX_WITH_VBOXSDL= VBOX_WITH_OGL= VBOX_WITH_KCHMVIEWER= VBOX_WITH_VRDP_RDESKTOP= endif # # Undefined VBOX_WITH_MAIN implies exclusion of a few more items. # ifndef VBOX_WITH_MAIN VBOX_WITH_VBOXSDL= VBOX_WITH_QTGUI= VBOX_WITH_DEBUGGER_GUI= VBOX_WITH_HEADLESS= ifdef VBOX_ONLY_DOCS $(error Oh, does VBOX_ONLY_DOCS actually end up here. sweet.) endif VBOX_WITH_DOCS= endif ifndef VBOX_WITH_QTGUI VBOX_WITH_KCHMVIEWER= endif ifdef VBOX_WITH_EXTPACK_PUEL_BUILD VBOX_WITH_EXTPACK_PUEL = 1 endif ifdef VBOX_WITH_TESTSUITE $(warning VBOX_WITH_TESTSUITE was renamed to VBOX_WITH_VALIDATIONKIT) VBOX_WITH_VALIDATIONKIT = $(VBOX_WITH_TESTSUITE) endif # # Mark OSE builds clearly, helps figuring out limitations more easily. # ifdef VBOX_OSE # This can be overridden (e.g. in LocalConfig.kmk) by whoever publishes a set # of VirtualBox binaries. We request though that you always use something that # clearly identifies your build and makes it clear that it is not one done by # the VirtualBox team. VBOX_BUILD_PUBLISHER ?= _OSE endif # Keep in sync with G_virtualBoxPackage in glue-jaxws.xsl and glue-java.xsl # Changed with every new version, so beware! if $(VBOX_VERSION_BUILD) < 51 VBOX_API_VERSION = $(VBOX_VERSION_MAJOR)_$(VBOX_VERSION_MINOR) else VBOX_API_VERSION = $(VBOX_VERSION_MAJOR)_$(expr $(VBOX_VERSION_MINOR) + 1) endif VBOX_API_SUFFIX = _$(VBOX_API_VERSION) VBOX_JAVA_PACKAGE = org.virtualbox$(VBOX_API_SUFFIX) # # Derived / helper config indicators. Not configurable. # # Use the OpenGL module in qt when the video hardware acceleartion feature # is enabled. if defined(VBOX_WITH_VIDEOHWACCEL) && defined(VBOX_WITH_QTGUI) VBOX_GUI_USE_QGL = 1 else VBOX_GUI_USE_QGL= endif # Collection macro mainly for deciding whether VBoxDTrace needs shipping. VBOX_WITH_DTRACE := $(if-expr defined(VBOX_WITH_DTRACE_R0) || defined(VBOX_WITH_DTRACE_R0DRV) \ || defined(VBOX_WITH_DTRACE_R3) || defined(VBOX_WITH_DTRACE_RC),1,) # kSubmit / kWorker is only available on windows. ifdef VBOX_USE_KSUBMIT ifeq ($(KBUILD_HOST),win) TOOL_VCC100AMD64_USE_KSUBMIT := 1 TOOL_VCC100X86_USE_KSUBMIT := 1 TOOL_OPENWATCOM_USE_KSUBMIT := 1 TOOL_YASM_USE_KSUBMIT := 1 TOOL_NASM_USE_KSUBMIT := 1 TOOL_VBoxNasm_USE_KSUBMIT := 1 else VBOX_USE_KSUBMIT := endif endif # # Image and object format config. # if1of ($(KBUILD_TARGET), freebsd haiku linux netbsd openbsd solaris) VBOX_LDR_FMT = elf endif ifeq ($(KBUILD_TARGET),darwin) VBOX_LDR_FMT = macho endif ifeq ($(KBUILD_TARGET),os2) VBOX_LDR_FMT = lx VBOX_LDR_FMT32 = lx VBOX_LDR_FMT64 = elf DONT_USE_YASM = 1 # yasm doesn't implement omf yet. endif ifeq ($(KBUILD_TARGET),win) VBOX_LDR_FMT = pe endif VBOX_LDR_FMT32 ?= $(VBOX_LDR_FMT) VBOX_LDR_FMT64 ?= $(VBOX_LDR_FMT) # # Assembler setup. # # This is a bit complicated since we have to support two different assmblers # (yasm/nasm) and possibly two different formats (32-bit/64-bit). # ifeq ($(VBOX_LDR_FMT),elf) ifeq ($(KBUILD_TARGET_ARCH),x86) VBOX_ASFLAGS_FMT = -f elf32 -DASM_FORMAT_ELF else VBOX_ASFLAGS_FMT = -f elf64 -DASM_FORMAT_ELF endif VBOX_ASFLAGS_DBFINFO = -g dwarf2 endif ifeq ($(VBOX_LDR_FMT),lx) VBOX_ASFLAGS_FMT = -f obj -DASM_FORMAT_OMF VBOX_ASFLAGS_DBFINFO = -g stabs endif ifeq ($(VBOX_LDR_FMT),macho) ifeq ($(KBUILD_TARGET_ARCH),x86) VBOX_ASFLAGS_FMT = -f macho32 -DASM_FORMAT_MACHO else VBOX_ASFLAGS_FMT = -f macho64 -DASM_FORMAT_MACHO endif VBOX_ASFLAGS_DBFINFO = -g dwarf2 endif ifeq ($(VBOX_LDR_FMT),pe) ifeq ($(KBUILD_TARGET_ARCH),x86) VBOX_ASFLAGS_FMT = -f win32 -DASM_FORMAT_PE else VBOX_ASFLAGS_FMT = -f win64 -DASM_FORMAT_PE endif VBOX_ASFLAGS_DBFINFO = -g cv8 endif ifndef VBOX_ASFLAGS_FMT $(error VBOX_ASFLAGS_FMT is not defined. VBOX_LDR_FMT=$(VBOX_LDR_FMT)) endif ifeq ($(VBOX_LDR_FMT32),elf) VBOX_ASFLAGS_FMT32 = -f elf32 -DASM_FORMAT_ELF VBOX_ASFLAGS_DBFINFO32 = -g dwarf2 endif ifeq ($(VBOX_LDR_FMT32),lx) VBOX_ASFLAGS_FMT32 = -f obj -DASM_FORMAT_OMF VBOX_ASFLAGS_DBFINFO32 = -g stabs endif ifeq ($(VBOX_LDR_FMT32),macho) VBOX_ASFLAGS_FMT32 = -f macho32 -DASM_FORMAT_MACHO VBOX_ASFLAGS_DBFINFO32 = -g dwarf2 endif ifeq ($(VBOX_LDR_FMT32),pe) VBOX_ASFLAGS_FMT32 = -f win32 -DASM_FORMAT_PE VBOX_ASFLAGS_DBFINFO32 = -g cv8 endif ifndef VBOX_ASFLAGS_FMT32 $(error VBOX_ASFLAGS_FMT32 is not defined. VBOX_LDR_FMT32=$(VBOX_LDR_FMT32)) endif ifeq ($(VBOX_LDR_FMT64),elf) VBOX_ASFLAGS_FMT64 = -f elf64 -DASM_FORMAT_ELF VBOX_ASFLAGS_DBFINFO64 = -g dwarf2 endif ifeq ($(VBOX_LDR_FMT64),macho) VBOX_ASFLAGS_FMT64 = -f macho64 -DASM_FORMAT_MACHO VBOX_ASFLAGS_DBFINFO64 = -g dwarf2 endif ifeq ($(VBOX_LDR_FMT64),pe) VBOX_ASFLAGS_FMT64 = -f win64 -DASM_FORMAT_PE VBOX_ASFLAGS_DBFINFO64 = -g cv8 endif ifndef VBOX_ASFLAGS_FMT64 $(error VBOX_ASFLAGS_FMT64 is not defined. VBOX_LDR_FMT64=$(VBOX_LDR_FMT64)) endif ifndef DONT_USE_YASM VBOX_ASTOOL = YASM VBOX_LDR_FMT_2_YASM_DBGINFO.elf = -g dwarf2 VBOX_LDR_FMT_2_YASM_DBGINFO.lx = -g stabs VBOX_LDR_FMT_2_YASM_DBGINFO.macho = VBOX_LDR_FMT_2_YASM_DBGINFO.pe = -g cv8 VBOX_ASFLAGS = $(VBOX_ASFLAGS_FMT) -D__YASM__ -Worphan-labels $(VBOX_YASM_Wno-segreg-in-64bit) $(VBOX_LDR_FMT_2_YASM_DBGINFO.$(VBOX_LDR_FMT)) VBOX_ASFLAGS32 = $(VBOX_ASFLAGS_FMT32) -D__YASM__ -Worphan-labels $(VBOX_YASM_Wno-segreg-in-64bit) $(VBOX_LDR_FMT_2_YASM_DBGINFO.$(VBOX_LDR_FMT32)) VBOX_ASFLAGS64 = $(VBOX_ASFLAGS_FMT64) -D__YASM__ -Worphan-labels $(VBOX_YASM_Wno-segreg-in-64bit) $(VBOX_LDR_FMT_2_YASM_DBGINFO.$(VBOX_LDR_FMT64)) else VBOX_ASTOOL = NASM VBOX_ASFLAGS = $(subst elf32,elf,$(VBOX_ASFLAGS_FMT)) -D__NASM__ -w+orphan-labels -g VBOX_ASFLAGS32 = $(subst elf32,elf,$(VBOX_ASFLAGS_FMT32)) -D__NASM__ -w+orphan-labels -g VBOX_ASFLAGS64 = $(VBOX_ASFLAGS_FMT64) -D__NASM__ -w+orphan-labels -g endif # # Windows only has mingw handy. On *nix we have to deal with cross compiling # 32-bit targets on 64-bit platforms, meaning we'll be using gcc32/g++32. # In the latter case we'll also have to disable all the all the R0 driver related stuff. # ifndef VBOX_GCC_TOOL ifeq ($(KBUILD_TARGET),win) ifeq ($(KBUILD_TARGET_ARCH),x86) VBOX_GCC_TOOL := MINGW32 TOOL_MINGW32_CFLAGS := $(UNDEFINED) # override -g else VBOX_GCC_TOOL := MINGWW64 endif else ifeq ($(KBUILD_TARGET),os2) VBOX_GCC_TOOL := GXX3OMF else ifeq ($(KBUILD_TARGET),darwin) ifdef VBOX_WITH_NEW_XCODE VBOX_GCC_TOOL := VBoxXcode62 else VBOX_GCC_TOOL := GXX4MACHO endif else ifeq ($(KBUILD_TARGET),haiku) # Haiku shouldn't pass '-r' to the linker by default VBOX_GCC_TOOL := GXX3PLAIN else ifeq ($(KBUILD_TARGET),solaris) VBOX_GCC_TOOL := GXX3PLAIN VBOX_GCC32_TOOL := GCC3PLAIN ifeq ($(KBUILD_HOST),solaris) TOOL_GXX3PLAIN_LD_SYSMOD ?= /usr/ccs/bin/ld endif else VBOX_GCC_TOOL := GXX3 ifeq ($(KBUILD_TARGET_ARCH).$(KBUILD_HOST_ARCH),x86.amd64) ## @todo mixing target/host here! VBOX_GCC_TOOL := GXX32 VBOX_WITH_VBOXDRV= else ifeq ($(KBUILD_TARGET_ARCH).$(KBUILD_HOST_ARCH),amd64.x86) VBOX_GCC_TOOL := GXX64 VBOX_WITH_VBOXDRV= endif endif endif ifndef VBOX_GCC32_TOOL ifeq ($(KBUILD_TARGET_ARCH),x86) VBOX_GCC32_TOOL := $(VBOX_GCC_TOOL) else ifeq ($(KBUILD_TARGET),win) VBOX_GCC32_TOOL := MINGW32 else VBOX_GCC32_TOOL := GCC32 endif endif # # Decide which Visual C++ compiler version we're using by default. # ifndef VBOX_VCC_TOOL_STEM VBOX_VCC_TOOL_STEM := VCC100 else ifn1of ($(VBOX_VCC_TOOL_STEM), VCC100 VCC110) $(error VBox: VBOX_VCC_TOOL_STEM='$(VBOX_VCC_TOOL_STEM)' is not supported, only VCC100 and VCC110 is) endif ifndef VBOX_VCC_TOOL VBOX_VCC_TOOL := $(VBOX_VCC_TOOL_STEM)$(toupper $(KBUILD_TARGET_ARCH)) endif ## @todo Remove the default tool crap here! TOOL = $(VBOX_GCC_TOOL) TOOL.win.x86 = $(VBOX_VCC_TOOL_STEM)X86 TOOL.win.amd64 = $(VBOX_VCC_TOOL_STEM)AMD64 ASTOOL = $(VBOX_ASTOOL) # # Setup the global defines and includes. # # Note! The __SOMETHING__ #defines are deprecated as they violate the C/C++ specs. # INCS += $(PATH_ROOT)/include $(PATH_OUT) DEFS += VBOX DEFS.debug := DEBUG DEBUG_$(subst $(subst _, ,_),_,$(USERNAME)) DEBUG_USERNAME=$(subst $(subst _, ,_),_,$(USERNAME)) DEFS.dbgopt = $(DEFS.debug) 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.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.os-agnostic = RT_OS_AGNOSTIC DEFS.solaris = RT_OS_SOLARIS _FILE_OFFSET_BITS=64 DEFS.win = RT_OS_WINDOWS __WIN__ DEFS.win.x86 = __WIN32__ DEFS.win.amd64 = __WIN64__ # optional defines (use environment or make commandline) ifdef VBOX_WITH_STATISTICS DEFS += VBOX_WITH_STATISTICS endif ifdef VBOX_STRICT DEFS += VBOX_STRICT endif ifdef LOG_ENABLED DEFS += LOG_ENABLED endif ifdef VBOX_OSE DEFS += VBOX_OSE endif ifdef VBOX_WITH_64_BITS_GUESTS DEFS += VBOX_WITH_64_BITS_GUESTS endif ifdef VBOX_WITH_REM DEFS += VBOX_WITH_REM endif ifdef VBOX_WITH_RAW_MODE DEFS += VBOX_WITH_RAW_MODE endif # Don't flood CDEFS, old MASMs doesn't like too many defines. ifdef VBOX_WITH_DEBUGGER CDEFS += VBOX_WITH_DEBUGGER endif ifdef VBOX_WITH_HARDENING CDEFS += VBOX_WITH_HARDENING endif if defined(VBOX_WITH_STRICT_LOCKS) && ($(KBUILD_TYPE) == "debug" || $(KBUILD_TYPE) == "strict") CDEFS += RT_LOCK_STRICT RT_LOCK_STRICT_ORDER endif ifdef VBOX_WITH_EF_WRAPS CDEFS += RTMEM_WRAP_TO_EF_APIS RTMEM_WRAP_SOME_NEW_AND_DELETE_TO_EF endif # Quoted strings should not be passed to the assemblers since they might not # subscribe to C preprocessing semantics. ifdef VBOX_PATH_APP_PRIVATE CDEFS += RTPATH_APP_PRIVATE=\"$(VBOX_PATH_APP_PRIVATE)\" endif ifdef VBOX_PATH_APP_PRIVATE_ARCH CDEFS += RTPATH_APP_PRIVATE_ARCH=\"$(VBOX_PATH_APP_PRIVATE_ARCH)\" endif ifdef VBOX_PATH_APP_PRIVATE_ARCH_TOP CDEFS += RTPATH_APP_PRIVATE_ARCH_TOP=\"$(VBOX_PATH_APP_PRIVATE_ARCH_TOP)\" endif ifdef VBOX_PATH_SHARED_LIBS CDEFS += RTPATH_SHARED_LIBS=\"$(VBOX_PATH_SHARED_LIBS)\" endif ifdef VBOX_PATH_APP_DOCS CDEFS += RTPATH_APP_DOCS=\"$(VBOX_PATH_APP_DOCS)\" endif CXXDEFS += $(CDEFS) OBJCDEFS += $(CDEFS) USES += dtrace # # Decide which Windows DDK to use by default. # ifeq ($(VBOX_VCC_TOOL_STEM),VCC110) VBOX_WINDDK ?= WINDDK80 else VBOX_WINDDK ?= WINDDK71 endif VBOX_WINDDK_WLH ?= $(VBOX_WINDDK)WLH VBOX_WINDDK_GST ?= $(VBOX_WINDDK) VBOX_WINDDK_GST_W8 ?= WINDDK80W8 VBOX_WINDDK_GST_W7 ?= $(VBOX_WINDDK_GST)W7 VBOX_WINDDK_GST_WLH ?= $(VBOX_WINDDK_GST)WLH VBOX_WINDDK_GST_W2K3 ?= WINDDK71WNET ifeq ($(KBUILD_TARGET_ARCH),x86) VBOX_WINDDK_GST_WXP ?= WINDDK71WXP VBOX_WINDDK_GST_W2K ?= $(VBOX_WINDDK_GST_WXP) VBOX_WINDDK_GST_NT4 ?= $(VBOX_WINDDK_GST_WXP) else VBOX_WINDDK_GST_WXP ?= $(VBOX_WINDDK_GST_W2K3) VBOX_WINDDK_GST_W2K ?= $(VBOX_WINDDK_GST_W2K3) VBOX_WINDDK_GST_NT4 ?= $(VBOX_WINDDK_GST_W2K3) endif # # Decide which Windows SDK to use by default. # ifeq ($(VBOX_VCC_TOOL_STEM),VCC110) VBOX_WINPSDK ?= WINPSDK80 else VBOX_WINPSDK ?= WINPSDK71 endif VBOX_WINPSDK_GST ?= $(VBOX_WINPSDK) VBOX_WINPSDK_GST_W8 ?= WINPSDK80 VBOX_WINPSDK_GST_W7 ?= $(VBOX_WINPSDK_GST) VBOX_WINPSDK_GST_WLH ?= $(VBOX_WINPSDK_GST) VBOX_WINPSDK_GST_WXP ?= $(VBOX_WINPSDK_GST) ifeq ($(KBUILD_TARGET_ARCH),x86) VBOX_WINPSDK_GST_W2K ?= $(VBOX_WINPSDK_GST) VBOX_WINPSDK_GST_NT4 ?= $(VBOX_WINPSDK_GST) else VBOX_WINPSDK_GST_W2K ?= $(VBOX_WINPSDK_GST_WXP) VBOX_WINPSDK_GST_NT4 ?= $(VBOX_WINPSDK_GST_WXP) endif # # ARCH_BITS_DEFS. # if1of ($(KBUILD_TARGET_ARCH),amd64 sparc64) VBOX_HC_ARCH_BITS := 64 ARCH_BITS_DEFS := HC_ARCH_BITS=64 else if1of ($(KBUILD_TARGET_ARCH),x86 sparc32) VBOX_HC_ARCH_BITS := 32 ARCH_BITS_DEFS := HC_ARCH_BITS=32 else $(error VBox: KBUILD_TARGET_ARCH=$(KBUILD_TARGET_ARCH)) endif ifdef VBOX_WITH_64_BITS_GUESTS VBOX_GC_ARCH_BITS_DEFS := GC_ARCH_BITS=64 else VBOX_GC_ARCH_BITS_DEFS := GC_ARCH_BITS=32 endif ARCH_BITS_DEFS += $(VBOX_GC_ARCH_BITS_DEFS) # # Add the output dir(s) to the dynamic loader search path. # if1of ($(KBUILD_HOST), freebsd linux netbsd openbsd solaris) export LD_LIBRARY_PATH:=$(PATH_STAGE_BIN):$(PATH_STAGE_LIB):$(LD_LIBRARY_PATH) endif ifeq ($(KBUILD_HOST),haiku) export LIBRARY_PATH:=$(PATH_STAGE_BIN):$(PATH_STAGE_LIB):$(LIBRARY_PATH) endif ifeq ($(KBUILD_HOST),os2) #fixme! export BEGINLIBPATH:=$(PATH_STAGE_BIN);$(PATH_STAGE_LIB);$(BEGINLIBPATH) endif ifeq ($(KBUILD_HOST),win) # This check is a bit hacky, but avoids problems with PATH being changed # again when the makefiles are reread because some automatically generated # makefile has been modified. ifeq ($(findstring $(PATH_STAGE_BIN);$(PATH_STAGE_LIB);,$(PATH)),) export PATH:=$(PATH_STAGE_BIN);$(PATH_STAGE_LIB);$(PATH) endif endif # # Common libraries and tools. # ifeq ($(KBUILD_TARGET),darwin) LIB_RUNTIME = $(PATH_STAGE_BIN)/VBoxRT.dylib LIB_RUNTIME_EF = #$(PATH_STAGE_LIB)/RuntimeEFCPP.a VBOX_LIB_RUNTIME_X86 = $(PATH_STAGE_BIN)/VBoxRT-x86.dylib LIB_KPROFILE = $(PATH_STAGE_BIN)/kPrf2.dylib LIB_VMM = $(PATH_STAGE_BIN)/VBoxVMM.dylib LIB_VMMRC = $(PATH_STAGE_BIN)/VMMRC.rc LIB_REM = $(PATH_STAGE_LIB)/VBoxREM.dylib LIB_XPCOM = $(PATH_STAGE_BIN)/VBoxXPCOM.dylib VBOX_LIB_XPCOM_X86 = $(PATH_STAGE_BIN)/VBoxXPCOM-x86.dylib LIB_DDU = $(PATH_STAGE_BIN)/VBoxDDU.dylib endif if1of ($(KBUILD_TARGET), freebsd haiku linux netbsd openbsd solaris) LIB_RUNTIME = $(PATH_STAGE_BIN)/VBoxRT.so LIB_RUNTIME_EF = $(PATH_STAGE_LIB)/RuntimeEFCPP.a VBOX_LIB_RUNTIME_X86 = $(PATH_STAGE_BIN)/VBoxRT-x86.so LIB_KPROFILE = $(PATH_STAGE_BIN)/kPrf2.so LIB_VMM = $(PATH_STAGE_BIN)/VBoxVMM.so LIB_VMMRC = $(PATH_STAGE_BIN)/VMMRC.rc LIB_REM = $(PATH_STAGE_LIB)/VBoxREM.so LIB_XPCOM = $(PATH_STAGE_BIN)/VBoxXPCOM.so VBOX_LIB_XPCOM_X86 = $(PATH_STAGE_BIN)/VBoxXPCOM-x86.so LIB_DDU = $(PATH_STAGE_BIN)/VBoxDDU.so endif ifeq ($(KBUILD_TARGET),os2) LIB_RUNTIME = $(PATH_STAGE_BIN)/VBoxRT.dll LIB_RUNTIME_EF = #$(PATH_STAGE_LIB)/RuntimeEFCPP.a VBOX_LIB_RUNTIME_X86 = $(PATH_STAGE_BIN)/VBoxRT-x86.dll LIB_KPROFILE = $(PATH_STAGE_BIN)/kPrf2.dll LIB_VMM = $(PATH_STAGE_BIN)/VBoxVMM.dll LIB_VMMRC = $(PATH_STAGE_LIB)/VMMRCImp.lib LIB_REM = $(PATH_STAGE_LIB)/VBoxREMImp.lib LIB_XPCOM = $(PATH_STAGE_BIN)/VBoxXCOM.dll VBOX_LIB_XPCOM_X86 = $(PATH_STAGE_BIN)/VBoxXPCOM-x86.dll LIB_DDU = $(PATH_STAGE_BIN)/VBoxDDU.dll VBOX_OBJ_SYS0 = $(PATH_OBJ)/RuntimeR0/os2/sys0.obj endif ifeq ($(KBUILD_TARGET),win) LIB_RUNTIME = $(PATH_STAGE_LIB)/VBoxRT.lib LIB_RUNTIME_EF = #$(PATH_STAGE_LIB)/RuntimeEFCPP.lib VBOX_LIB_RUNTIME_X86 = $(PATH_STAGE_LIB)/VBoxRT-x86.lib LIB_KPROFILE = $(PATH_STAGE_LIB)/kPrf2.lib LIB_VMM = $(PATH_STAGE_LIB)/VBoxVMM.lib LIB_VMMRC = $(PATH_OBJ)/VMMRC/VMMRC.lib LIB_REM = $(PATH_STAGE_LIB)/VBoxREMImp.lib LIB_XPCOM = $(PATH_STAGE_BIN)/VBoxXPCOM.lib VBOX_LIB_XPCOM_X86 = $(PATH_STAGE_BIN)/VBoxXPCOM-x86.lib LIB_DDU = $(PATH_STAGE_LIB)/VBoxDDU.lib endif if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), win.amd64 linux.amd64) VBOX_LIB_VMM_LAZY = $(PATH_STAGE_LIB)/VMMR3LazyImp$(VBOX_SUFF_LIB) else VBOX_LIB_VMM_LAZY = $(LIB_VMM) endif VBOX_LIB_SUPHARDENED = $(PATH_STAGE_LIB)/SUPR3HardenedStatic$(VBOX_SUFF_LIB) VBOX_LIB_RUNTIME_STATIC = $(PATH_STAGE_LIB)/RuntimeR3$(VBOX_SUFF_LIB) ifndef VBOX_WITH_REM LIB_REM := endif # Python ifndef VBOX_BLD_PYTHON if1of ($(KBUILD_HOST), win) VBOX_BLD_PYTHON := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS)/win.x86/python/v*/python$(HOSTSUFF_EXE))) \ python-not-found.exe) else VBOX_BLD_PYTHON := $(firstword $(which python2.7$(HOSTSUFF_EXE)) $(which python2.6$(HOSTSUFF_EXE)) \ $(which python$(HOSTSUFF_EXE)) $(which python3$(HOSTSUFF_EXE)) \ python-not-found) endif endif # # pylint setup, see https://www.pylint.org/. # # Disabled: # W0301 - Unnecessary semicolon. # W0511 - TODO/XXX/FIXME/+++. # W0603 - Using the global statement. # W0702 - No exception type(s) specified. # W0703 - Catch "Exception". # I0011 - Locally disabling XXXXX. # C0321 - More than one statement on a single line. # R0201 - Method could be a function. # C0326 - ???? # W0123 - ???? # C0330:bad-continuation - Wrong continued indentation (add X spaces). # * Triggering on perfectly legal comments in array initializers and stuff. # C0413:wrong-import-position - Import "YYYYY XXXXX" should be placed at the top of the module. # * False positives due to __copyright__, __version__, probably. # E0012:bad-option-value - Bad option value XXXXX. # * Newer pylint doesn't grok older warning disables in sources (e.g. W0142 in db.py). Wonderful! # I0012:locally-enabled - Locally enabling XXXXX. # * We temporarily disable stuff and then renabled it. Very tedious. # # Note! Yes, --max-branchs is a typo, but not by me. # # Note! Users of older pylint release (< 1.0) needs to define # VBOX_WITH_PYLINT_PRE_V1_0 in LocalConfig because they changed the # output arguments in an backwards incompatible way and added more # attribute regex options. # ifndef VBOX_PYLINT VBOX_PYLINT := $(firstword $(which pylint-2.7) $(which pylint-2.6) $(which pylint2) $(which pylint)) ifdef VBOX_PYLINT VBOX_PYLINT := $(VBOX_BLD_PYTHON) $(VBOX_PYLINT) endif endif if !defined(VBOX_WITH_PYLINT) && defined(VBOX_PYLINT) VBOX_WITH_PYLINT := 1 ifndef VBOX_PYLINT_VERSION ifdef VBOX_WITH_PYLINT_PRE_V1_0 VBOX_PYLINT_VERSION = 9999 else ifdef VBOX_WITH_PYLINT_V1_2_1_PLUS VBOX_PYLINT_VERSION = 10201 else ifdef VBOX_WITH_PYLINT_V1_1_PLUS VBOX_PYLINT_VERSION = 10100 else VBOX_PYLINT_VERSION = 10000 endif endif endif VBOX_PYLINT_FLAGS = $(if-expr $(VBOX_PYLINT_VERSION) >= 10500,--reports=n,--report=n) \ $(if-expr $(VBOX_PYLINT_VERSION) >= 10000\ ,--msg-template='{path}:{line}: <{msg_id}>({obj}:{symbol}): {msg}' \ ,--output-format=msvs --include-ids=y) \ --persistent=n \ --rcfile=$(PATH_ROOT)/tools/pylintrc \ --max-line-length=130 \ --max-attributes=32 \ --max-branch$(if-expr $(VBOX_PYLINT_VERSION) >= 10000,e,)s=50 \ --max-statements=100 \ --max-returns=100 \ --max-public-methods=139 \ --max-args=9 \ --max-module-lines=4096 \ --max-locals=32 \ $(if-expr $(VBOX_PYLINT_VERSION) >= 10500,--max-bool-expr=99,) \ --min-public-methods=0 \ --function-rgx='[a-z_][a-zA-Z0-9_]{2,40}$(DOLLAR)' \ --method-rgx='[a-z_][a-zA-Z0-9_]{2,40}$(DOLLAR)' \ --argument-rgx='([a-z_][a-zA-Z0-9_]{2,30}|rc|hr|s|c|ch|cx|cy|cb|fn)$(DOLLAR)' \ --variable-rgx='([a-z_][a-zA-Z0-9_]{2,30}|rc|hr|s|c|ch|cx|cy|cb|fn)$(DOLLAR)' \ --attr-rgx='([a-z_][a-zA-Z0-9_]{2,30}|rc|hr|o)$(DOLLAR)' \ --module-rgx='(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+)|(td[A-Z][a-zA-Z0-9]+)|(t(e|)st(-|)[a-zA-Z0-9]+))$(DOLLAR)' \ --class-rgx='(td|)[A-Z_][a-zA-Z0-9_]+$(DOLLAR)' \ --const-rgx='(g_(k|)[abcdefhmnpilorstu]+[A-Z][a-zA-Z0-9]+|[A-Z_][A-Z0-9_]+|__copyright__|__version__|__file__|__all__)$(DOLLAR)' \ --good-names='i,j,k,t,o,c,e,ch,s,_' \ $(if-expr $(VBOX_PYLINT_VERSION) >= 10000,--class-attribute-rgx='(k[abcdefhmnpilorstu]+[A-Z0-9][a-zA-Z0-9_]{0,32}|[A-Z_][A-Z0-9_]{2,32})',) \ $(if-expr $(VBOX_PYLINT_VERSION) >= 10500,--max-nested-blocks=9,) \ $(if-expr $(VBOX_PYLINT_VERSION) >= 10100,--disable=C0326,) \ $(if-expr $(VBOX_PYLINT_VERSION) >= 10201,--disable=C0330 --disable=W0123,) \ $(if-expr $(VBOX_PYLINT_VERSION) >= 10201 && $(VBOX_PYLIN_VERSION) < 10500,--disable=bad-option-value,) \ $(if-expr $(VBOX_PYLINT_VERSION) >= 10500,--disable=C0413 --disable=E0012 --disable=locally-enabled,) \ --disable=W0301,W0511,W0603,W0702,W0703,C0321,R0201,I0011 \ --ignored-classes=testdriver.vboxcon \ # Define the macro for win path conversion. ifndef VBOX_ONLY_SDK VBOX_FN_MAKE_WIN_PATH = $(subst /,\\,$(1)) else # on Wine Z: is always FS root VBOX_FN_MAKE_WIN_PATH = $(subst /,\\,$(patsubst /%,Z:/%,$(1))) endif #!VBOX_ONLY_SDK # The kprofile build automagically links with kProfile. ifeq ($(KBUILD_TYPE),kprofile) LIB_RUNTIME += $(LIB_KPROFILE) endif # Enable C++ electric fence heap. (Warning: will easily run out of virtual memory / kernel stuff on Linux/Windows.) ifdef VBOX_WITH_CPP_EF LIB_RUNTIME <= $(LIB_RUNTIME_EF) endif # Overridable libraries (unix). LIB_PTHREAD ?= pthread # Xcursor (consider an SDK for this). ifeq ($(VBOX_XCURSOR_LIBS),) ifeq ($(KBUILD_TARGET),solaris) VBOX_XCURSOR_LIBS := $(lastword $(wildcard $(KBUILD_DEVTOOLS_TRG)/libXcursor/*/lib/libXcursor.a)) ifneq ($(VBOX_XCURSOR_LIBS),) VBOX_XCURSOR_INCS := $(patsubst %/lib/libXcursor.a,%/include, $(VBOX_XCURSOR_LIBS)) VBOX_XCURSOR_LIBS += X11 Xrender Xfixes endif endif ifeq ($(VBOX_XCURSOR_LIBS),) VBOX_XCURSOR_LIBS := Xcursor endif endif # Intel ASL compiler for ACPI VBOX_IASLCMD ?= $(firstword $(wildcard $(KBUILD_DEVTOOLS_HST)/bin/iasl$(HOSTSUFF_EXE)) iasl$(HOSTSUFF_EXE)) # libxslt XSLT processor. (see PATH_TOOL_YASM for explanation why it's temporarily located in bin.) ifeq ($(VBOX_XSLTPROC),) ifeq ($(KBUILD_HOST),win) VBOX_XSLTPROC := $(wildcard $(KBUILD_DEVTOOLS)/$(KBUILD_HOST).$(KBUILD_HOST_ARCH)/libxslt/10128/bin/xsltproc.exe) ifeq ($(VBOX_XSLTPROC),) VBOX_XSLTPROC := $(KBUILD_DEVTOOLS)/win.x86/bin/xsltproc.exe endif else ifeq ($(KBUILD_HOST),os2) VBOX_XSLTPROC := BEGINLIBPATH="$(KBUILD_DEVTOOLS_HST)/bin;$$BEGINLIBPATH" $(KBUILD_DEVTOOLS_HST)/bin/xsltproc.exe else ifeq ($(KBUILD_HOST),haiku) VBOX_XSLTPROC := $(KBUILD_DEVTOOLS)/haiku.x86/bin/xsltproc else VBOX_XSLTPROC := xsltproc$(HOSTSUFF_EXE) endif endif # bin2c (convert binary files into C arrays) VBOX_BIN2C ?= $(PATH_OBJ)/bin2c/bin2c$(HOSTSUFF_EXE) # RTManifest (extension pack manifest utility) VBOX_RTMANIFEST ?= $(PATH_OBJ)/bldRTManifest/bldRTManifest$(HOSTSUFF_EXE) # RTSignTool (certificate extraction tool) VBOX_RTSIGNTOOL ?= $(PATH_OBJ)/bldRTSignTool/bldRTSignTool$(HOSTSUFF_EXE) # VBoxCmp (simple /bin/cmp with more sensible output) VBOX_VBOXCMP ?= $(PATH_OBJ)/VBoxCmp/VBoxCmp$(HOSTSUFF_EXE) # VBoxCPP (special purpose C preprocessor) VBOX_VBOXCPP ?= $(PATH_OBJ)/VBoxCPP/VBoxCPP$(HOSTSUFF_EXE) # VBoxTpG (tracepoint generator) VBOX_VBOXTPG ?= $(PATH_OBJ)/VBoxTpG/VBoxTpG$(HOSTSUFF_EXE) # VBoxPeSetVersion (changes the minimum OS version of an image) VBOX_PE_SET_VERSION ?= $(PATH_OBJ)/VBoxPeSetVersion/VBoxPeSetVersion$(HOSTSUFF_EXE) # Visual C++ EditBin.exe. VBOX_VCC_EDITBIN = $(if $(PATH_TOOL_$(VBOX_VCC_TOOL)_BIN),$(PATH_TOOL_$(VBOX_VCC_TOOL)_BIN)/,)editbin.exe /NoLogo # filesplitter (splits java files) VBOX_FILESPLIT ?= $(PATH_OBJ)/filesplitter/filesplitter$(HOSTSUFF_EXE) # biossums (set BIOS checksums) VBOX_BIOSSUMS ?= $(PATH_OBJ)/biossums/biossums$(HOSTSUFF_EXE) # MakeAlternativeSource (for BIOSes) VBOX_MAKE_ALTERNATIVE_SOURCE ?= $(PATH_OBJ)/MakeAlternativeSource/MakeAlternativeSource$(HOSTSUFF_EXE) # VBoxDef2LazyLoad (lazy dynamic library loader assembly generator) VBOX_DEF_2_LAZY_LOAD ?= $(PATH_OBJ)/VBoxDef2LazyLoad/VBoxDef2LazyLoad$(HOSTSUFF_EXE) # VBoxCheckImports (checks what we imports from on windows) VBOX_CHECK_IMPORTS ?= $(PATH_OBJ)/VBoxCheckImports/VBoxCheckImports$(HOSTSUFF_EXE) # GNU tar if present. if1of ($(KBUILD_TARGET), linux os2 win) VBOX_GTAR ?= tar else if1of ($(KBUILD_TARGET), freebsd netbsd solaris) VBOX_GTAR ?= gtar endif # mkisofs ifeq ($(KBUILD_HOST),win) VBOX_MKISOFS ?= $(KBUILD_DEVTOOLS_HST)/bin/mkisofs.exe else VBOX_MKISOFS ?= mkisofs endif ifeq ($(KBUILD_HOST),win) VBOX_NM ?= $(PATH_TOOL_MINGW32)/bin/nm.exe -p else ifeq ($(KBUILD_HOST),darwin) # Xcode 7.3.1 nm doesn't like -t, and -x behaves very differently. Throwing in -B (bsd) to make sure. VBOX_NM ?= $(TOOL_$(VBOX_GCC_TOOL)_ENV_SETUP) $(PATH_TOOL_$(VBOX_GCC_TOOL)_TOOLCHAIN_BIN_SLASH)nm -p $(if-expr \ $(VBOX_XCODE_VERSION_MAJOR) > 7 || ($(VBOX_XCODE_VERSION_MAJOR) == 7 && $(VBOX_XCODE_VERSION_MINOR) >= 3),-B,) else VBOX_NM ?= nm -p -t x endif # Makeself for the linux installers. VBOX_MAKESELF ?= $(KBUILD_DEVTOOLS)/common/makeself/v2.1.5/makeself.sh # Microsoft HTML Help Workshop. VBOX_PATH_HTML_HELP_WORKSHOP ?= $(KBUILD_DEVTOOLS)/win.x86/HTML_Help_Workshop/v1.3/ # Path to the null soft installer. VBOX_PATH_NSIS ?= $(KBUILD_DEVTOOLS)/win.x86/nsis/v2.51-log-nsscm-r2 # Path to AutoIt3. VBOX_PATH_AUTOIT3 ?= $(KBUILD_DEVTOOLS)/win.x86/autoit/v3.2.10.0 # Windows install tools... # Note! The scripts has been moved to Bin in v8.0. VBOX_PATH_WIX ?= $(KBUILD_DEVTOOLS)/win.x86/wix/v3.8.1128.0 VBOX_PATH_MSITRAN ?= $(KBUILD_DEVTOOLS)/win.x86/sdk/v7.1/Bin/MsiTran.Exe VBOX_PATH_MSIDB ?= $(KBUILD_DEVTOOLS)/win.x86/sdk/v7.1/Bin/MsiDb.Exe VBOX_PATH_WISUBSTG ?= $(KBUILD_DEVTOOLS)/win.x86/sdk/v7.1/Samples/sysmgmt/msi/scripts/WiSubStg.vbs VBOX_PATH_WISUMINFO ?= $(KBUILD_DEVTOOLS)/win.x86/sdk/v7.1/Samples/sysmgmt/msi/scripts/WiSumInf.vbs VBOX_PATH_DIFX ?= $(KBUILD_DEVTOOLS)/win.$(KBUILD_TARGET_ARCH)/DIFx/v2.1-r3 VBOX_PATH_CABSDK ?= $(KBUILD_DEVTOOLS)/win.x86/cabsdk/r1 VBOX_PATH_MAKECAB ?= $(VBOX_PATH_CABSDK)/BIN/MAKECAB.EXE ifdef VBOX_OSE ## @todo try get rid of this crap! People can use the latest and greatest Yasm release, no need to check in the binary for OSE. # We need to export YASM for OSE, but since it was converted to .zip we need to # allow for the location used by the zip to be properly cleaned up first. if1of ($(KBUILD_HOST).$(KBUILD_HOST_ARCH), linux.x86 solaris.x86 win.x86) PATH_TOOL_YASM ?= $(KBUILD_DEVTOOLS_HST)/bin endif endif # The Microsoft IDL compiler (the SDK build needs this on non-Windows). VBOX_WIN_MIDL ?= $(EXEC_X86_WIN32) $(call VBOX_FN_MAKE_WIN_PATH,$(firstword $(wildcard $(addsuffix /[Mm][Ii][Dd][Ll].[Ee][Xx][Ee], \ $(KBUILD_DEVTOOLS)/win.x86/sdk/v7.1/Bin$(if-expr "$(KBUILD_HOST).$(KBUILD_HOST_ARCH)" == "win.amd64",/x64,) \ $(KBUILD_DEVTOOLS)/win.x86/ddk/7600.16385.1/bin/x86 \ $(KBUILD_DEVTOOLS)/win.x86/bin \ $(PATH_SDK_$(VBOX_WINPSDK)_BIN) \ $(PATH_SDK_$(VBOX_WINPSDK)) \ $(PATH_SDK_WINPSDK_BIN) \ $(PATH_SDK_WINPSDK) \ )) Sorry_Cannot_Find_The_Midl_Compiler_In_The_PSDK)) # XPCOM setup for all but win32. ifneq ($(KBUILD_TARGET),win) VBOX_WITH_XPCOM = 1 # if updating, also update xpidl_INST var in src/libs/xpcom18a4/Makefile.kmk VBOX_XPIDL ?= $(PATH_STAGE_BIN)/xpidl$(HOSTSUFF_EXE) ifeq ($(KBUILD_TARGET),os2) VBOX_XPIDL_ENV = BEGINLIBPATH="$(dir $(VBOX_XPIDL));$$BEGINLIBPATH"$(SP) endif VBOX_PATH_XPCOM_IDL ?= $(VBOX_PATH_SDK)/bindings/xpcom/idl VBOX_XPCOM_INCS ?= \ $(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 ifneq ($(KBUILD_TARGET),os2) # libIDL-config (for xpcom18a4) ifeq ($(origin VBOX_LIBIDL_CONFIG),undefined) export VBOX_LIBIDL_CONFIG := $(firstword $(shell which libIDL-config-2 libIDL-config 2> /dev/null)) endif endif endif # The X11 LIBPATH. (The amd64 hack is for RHEL4.) ifeq ($(KBUILD_TARGET_ARCH),amd64) VBOX_LIBPATH_X11 ?= /usr/X11R6/lib64 /usr/X11R6/lib else VBOX_LIBPATH_X11 ?= /usr/X11R6/lib endif # 32bit X11 LIBPATH for building 32bit guest additions VBOX_LIBPATH32_X11 ?= /usr/X11R6/lib32 /usr/X11R6/lib # Good windows shell. VBOX_GOOD_COMSPEC = $(subst \,/,$(SystemRoot))/System32/cmd.exe VBOX_GOOD_COMSPEC_BS ?= $(subst /,\,$(VBOX_GOOD_COMSPEC)) # # Macros dealing with the darwin version we're targeting. # The DEF in VBOX_DEF_MACOSX_VERSION_MIN mean default. The default min # version is assumed to be the # ifeq ($(KBUILD_TARGET),darwin) ifdef VBOX_WITH_NEW_XCODE VBOX_DEF_MACOSX_VERSION_MIN ?= 10.9 else VBOX_DEF_MACOSX_VERSION_MIN ?= 10.6 endif ifdef VBOX_WITH_NEW_XCODE # Use the tool path of the compiler (it's clang, not gcc in this instance). include $(KBUILD_TOOL_PATHS)/$(VBOX_GCC_TOOL).kmk VBOX_PATH_MACOSX_DEVEL_ROOT := $(PATH_TOOL_$(VBOX_GCC_TOOL)) else # Check for the Xcode 4.1 bits in tools/darwin.x86. if !defined(VBOX_WITH_MACOSX_COMPILERS_FROM_DEVEL) \ && !defined(VBOX_XCODE_VERSION) \ && exists "$(KBUILD_DEVTOOLS)/darwin.x86/xcode/v4.1" VBOX_WITH_MACOSX_COMPILERS_FROM_DEVEL := 1 VBOX_PATH_MACOSX_DEVEL_ROOT := $(KBUILD_DEVTOOLS)/darwin.x86/xcode/v4.1 VBOX_XCODE_VERSION := 4.1 endif endif # Fallback - system / LocalConfig.kmk. ifdef VBOX_WITH_NEW_XCODE ifndef VBOX_PATH_MACOSX_DEVEL_ROOT VBOX_PATH_MACOSX_DEVEL_ROOT := $(firstword $(wildcard /Applications/Xcode.app/Contents/Developer /Developer)) endif ifndef VBOX_PATH_MACOSX_SDK_ROOT VBOX_PATH_MACOSX_SDK_ROOT := $(firstword $(wildcard \ $(PATH_TOOL_$(VBOX_GCC_TOOL)_SDKS) \ $(VBOX_PATH_MACOSX_DEVEL_ROOT)/SDKs/. \ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/. \ /Developer/SDKs/. )) endif ifndef VBOX_PATH_MACOSX_TOOLCHAIN_ROOT VBOX_PATH_MACOSX_TOOLCHAIN_ROOT := $(firstword $(wildcard \ $(PATH_TOOL_$(VBOX_GCC_TOOL)_TOOLCHAIN) \ $(VBOX_PATH_MACOSX_DEVEL_ROOT)/Library/Developer/CommandLineTools/. \ $(VBOX_PATH_MACOSX_DEVEL_ROOT)/Toolchains/XcodeDefault.xctoolchain/. \ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/. \ /Library/Developer/CommandLineTools/. \ ) /. ) endif else VBOX_PATH_MACOSX_DEVEL_ROOT ?= /Developer VBOX_PATH_MACOSX_SDK_ROOT ?= $(VBOX_PATH_MACOSX_DEVEL_ROOT)/SDKs VBOX_PATH_MACOSX_TOOLCHAIN_ROOT ?= $(VBOX_PATH_MACOSX_DEVEL_ROOT) endif # Figure the default SDK location and obsolete linker tricks. ifeq ($(VBOX_DEF_MACOSX_VERSION_MIN),10.4) ifeq ($(origin VBOX_DARWIN_CLASSIC_LINKER),undefined) VBOX_DARWIN_CLASSIC_LINKER := $(shell ld -v 2>&1 ) ifneq ($(filter ld64%, $(subst :, , $(VBOX_DARWIN_CLASSIC_LINKER))),) export VBOX_DARWIN_CLASSIC_LINKER := -Wl,-classic_linker else export VBOX_DARWIN_CLASSIC_LINKER := endif endif VBOX_PATH_MACOSX_SDK ?= $(VBOX_PATH_MACOSX_SDK_ROOT)/MacOSX$(VBOX_DEF_MACOSX_VERSION_MIN)u.sdk else VBOX_PATH_MACOSX_SDK ?= $(VBOX_PATH_MACOSX_SDK_ROOT)/MacOSX$(VBOX_DEF_MACOSX_VERSION_MIN).sdk endif ## The Xcode version. ifeq ($(KBUILD_HOST),darwin) ifndef VBOX_XCODE_VERSION ifdef VBOX_WITH_NEW_XCODE VBOX_XCODE_VERSION := $(word 2, $(shell $(VBOX_PATH_MACOSX_DEVEL_ROOT)/usr/bin/xcodebuild -version)) else ifdef VBOX_WITH_MACOSX_COMPILERS_FROM_DEVEL VBOX_XCODE_VERSION := $(word 2, $(shell $(VBOX_PATH_MACOSX_DEVEL_ROOT)/usr/bin/xcodebuild -version)) else VBOX_XCODE_VERSION := $(word 2, $(shell xcodebuild -version)) endif ifdef VBOX_WITH_NEW_XCODE VBOX_XCODE_VERSION ?= 6.2 else VBOX_XCODE_VERSION ?= 4.1 endif endif ifdef VBOX_WITH_NEW_XCODE if defined(VBOX_WITH_REM) && "$(VBOX_XCODE_VERSION)" >= "4.2" $(warning Xcode $(VBOX_XCODE_VERSION) is not able to correctly build the recompiler! Please disabled it: 'VBOX_WITH_REM=') endif ifdef KBUILD_USE_KOBJCACHE $(warning KBUILD_USE_KOBJCACHE does _not_ currently work with this version of Xcode) endif else ifeq ($(VBOX_XCODE_VERSION),4.2) $(warning Xcode 4.2 is not able to correctly build the recompiler!) $(warning Please downgrade to Xcode 4.1 if you want a working VMM!) endif endif else VBOX_XCODE_VERSION ?= 4.1 endif VBOX_XCODE_VERSION_MAJOR := $(word 1, $(subst ., ,$(VBOX_XCODE_VERSION))) VBOX_XCODE_VERSION_MINOR := $(word 2, $(subst ., ,$(VBOX_XCODE_VERSION))) VBOX_XCODE_VERSION := $(VBOX_XCODE_VERSION_MAJOR).$(VBOX_XCODE_VERSION_MINOR) ifeq ($(KBUILD_TARGET_ARCH),x86) if1of ($(VBOX_DEF_MACOSX_VERSION_MIN), 10.4 10.5) VBOX_DARWIN_NO_COMPACT_LINKEDIT ?= $(VBOX_LD_no_compact_linkedit) TOOL_GXX4MACHO_SUFFIX ?= -4.0 endif else if $(VBOX_XCODE_VERSION_MAJOR) < 4 && "$(VBOX_XCODE_VERSION)" != "3.2" ifeq ($(PATH_CURRENT),$(PATH_ROOT)/tools) $(warning VBox: 64-bit darwin builds require Xcode 3.2 or later, you have $(VBOX_XCODE_VERSION)) else $(error VBox: 64-bit darwin builds require Xcode 3.2 or later, you have $(VBOX_XCODE_VERSION)) endif endif endif ifdef VBOX_WITH_NEW_XCODE override TOOL_StandardDTrace_DTRACE := $(TOOL_$(VBOX_GCC_TOOL)_ENV_SETUP) dtrace "-xcpppath=$(VBOX_PATH_MACOSX_DEVEL_ROOT)/usr/bin/gcc" export PATH:=$(VBOX_PATH_MACOSX_SDK)/usr/bin:$(PATH) else if $(VBOX_XCODE_VERSION_MAJOR) > 4 || ($(VBOX_XCODE_VERSION_MAJOR) == 4 && $(VBOX_XCODE_VERSION_MINOR) >= 2) TOOL_GXX4MACHO_PREFIX ?= llvm- endif if $(VBOX_XCODE_VERSION_MAJOR) < 5 TOOL_GXX4MACHO_SUFFIX ?= -4.2 endif VBOX_DARWIN_NO_COMPACT_LINKEDIT ?= TOOL_GCC4MACHO_SUFFIX ?= $(TOOL_GXX4MACHO_SUFFIX)$(HOSTSUFF_EXE) TOOL_GCC4MACHO_PREFIX ?= $(TOOL_GXX4MACHO_PREFIX) if defined(VBOX_WITH_MACOSX_COMPILERS_FROM_DEVEL) TOOL_GCC4MACHO_PREFIX := $(VBOX_PATH_MACOSX_TOOLCHAIN_ROOT)/usr/bin/$(TOOL_GCC4MACHO_PREFIX) TOOL_GXX4MACHO_PREFIX := $(VBOX_PATH_MACOSX_TOOLCHAIN_ROOT)/usr/bin/$(TOOL_GXX4MACHO_PREFIX) TOOL_GCC4MACHO_SUFFIX := $(TOOL_GCC4MACHO_SUFFIX) -isysroot $(VBOX_PATH_MACOSX_SDK) TOOL_GXX4MACHO_SUFFIX := $(TOOL_GXX4MACHO_SUFFIX) -isysroot $(VBOX_PATH_MACOSX_SDK) ifndef SVN # must expand first so we won't be using old svn. SVN := $(firstword $(which svn) svn) endif if $(VBOX_XCODE_VERSION_MAJOR) > 4 || ($(VBOX_XCODE_VERSION_MAJOR) == 4 && $(VBOX_XCODE_VERSION_MINOR) >= 2) export PATH:=$(VBOX_PATH_MACOSX_DEVEL_ROOT)/usr/bin/:$(VBOX_PATH_MACOSX_SDK)/usr/bin:$(VBOX_PATH_MACOSX_TOOLCHAIN_ROOT)/usr/bin:$(PATH) export DEVELOPER_DIR:=$(VBOX_PATH_MACOSX_DEVEL_ROOT) else export PATH:=$(VBOX_PATH_MACOSX_DEVEL_ROOT)/usr/bin/:$(PATH) endif TOOL_GXX32_CC = $(TOOL_GCC4MACHO_PREFIX)gcc$(TOOL_GCC4MACHO_SUFFIX) -m32 TOOL_GXX32_CXX = $(TOOL_GCC4MACHO_PREFIX)g++$(TOOL_GCC4MACHO_SUFFIX) -m32 TOOL_GXX32_LD = $(TOOL_GXX32_CXX) override TOOL_StandardDTrace_DTRACE := dtrace "-xcpppath=$(TOOL_GCC4MACHO_PREFIX)cpp-4.2" endif if $(VBOX_XCODE_VERSION_MAJOR) < 5 ## @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 endif endif VBOX_DARWIN_DEF_SDK_DEFS := MAC_OS_X_VERSION_MIN_REQUIRED=$(subst .,,$(VBOX_DEF_MACOSX_VERSION_MIN))0 \ MAC_OS_X_VERSION_MAX_ALLOWED=$(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) \ -Wl,-headerpad_max_install_names $(VBOX_DARWIN_CLASSIC_LINKER) $(VBOX_DARWIN_NO_COMPACT_LINKEDIT) # specific versions. ## @todo s/VBOX_DARWIN_DEF_SDK_10/VBOX_DARWIN_SDK_10/g if1of ($(VBOX_DEF_MACOSX_VERSION_MIN), 10.4) # classic linker detection is bust otherwise 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_CFLAGS := -mmacosx-version-min=10.4 -isysroot $(VBOX_PATH_MACOSX_SDK_10_4) 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) \ -Wl,-headerpad_max_install_names $(VBOX_DARWIN_CLASSIC_LINKER) else VBOX_PATH_MACOSX_SDK_10_4 = $(error VBox: $(if $(target),$(target): ,)Using 10.4 SDK) VBOX_DARWIN_DEF_SDK_10_4_CXXFLAGS = $(error VBox: $(if $(target),$(target): ,)Using 10.4 SDK) VBOX_DARWIN_DEF_SDK_10_4_LDFLAGS = $(error VBox: $(if $(target),$(target): ,)Using 10.4 SDK) endif if1of ($(VBOX_DEF_MACOSX_VERSION_MIN), 10.4 10.5) 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_CFLAGS := -mmacosx-version-min=10.5 -isysroot $(VBOX_PATH_MACOSX_SDK_10_5) 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) \ -Wl,-headerpad_max_install_names $(VBOX_DARWIN_NO_COMPACT_LINKEDIT) else VBOX_PATH_MACOSX_SDK_10_5 = $(error VBox: $(if $(target),$(target): ,)Using 10.5 SDK) VBOX_DARWIN_DEF_SDK_10_5_CXXFLAGS = $(error VBox: $(if $(target),$(target): ,)Using 10.5 SDK) VBOX_DARWIN_DEF_SDK_10_5_LDFLAGS = $(error VBox: $(if $(target),$(target): ,)Using 10.5 SDK) endif if1of ($(VBOX_DEF_MACOSX_VERSION_MIN), 10.4 10.5 10.6) 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_CFLAGS := -mmacosx-version-min=10.6 -isysroot $(VBOX_PATH_MACOSX_SDK_10_6) 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) \ -Wl,-headerpad_max_install_names else VBOX_PATH_MACOSX_SDK_10_6 = $(error VBox: $(if $(target),$(target): ,)Using 10.6 SDK) VBOX_DARWIN_DEF_SDK_10_6_CXXFLAGS = $(error VBox: $(if $(target),$(target): ,)Using 10.6 SDK) VBOX_DARWIN_DEF_SDK_10_6_LDFLAGS = $(error VBox: $(if $(target),$(target): ,)Using 10.6 SDK) endif if1of ($(VBOX_DEF_MACOSX_VERSION_MIN), 10.4 10.5 10.6 10.7) ifndef VBOX_PATH_MACOSX_SDK_10_7 ifneq ($(wildcard $(VBOX_PATH_MACOSX_SDK_ROOT)/MacOSX10.7.sdk),) VBOX_PATH_MACOSX_SDK_10_7 = $(VBOX_PATH_MACOSX_SDK_ROOT)/MacOSX10.7.sdk else VBOX_PATH_MACOSX_SDK_10_7 = $(KBUILD_DEVTOOLS)/darwin.x86/SDKs/MacOSX10.7.sdk endif endif 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_CFLAGS := -mmacosx-version-min=10.7 -isysroot $(VBOX_PATH_MACOSX_SDK_10_7) 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) \ -Wl,-headerpad_max_install_names else VBOX_PATH_MACOSX_SDK_10_7 = $(error VBox: $(if $(target),$(target): ,)Using 10.7 SDK) VBOX_DARWIN_DEF_SDK_10_7_CXXFLAGS = $(error VBox: $(if $(target),$(target): ,)Using 10.7 SDK) VBOX_DARWIN_DEF_SDK_10_7_LDFLAGS = $(error VBox: $(if $(target),$(target): ,)Using 10.7 SDK) endif # # Use bison and flex from Xcode to avoid linking issues (bison). # TOOL_BISON_YACC ?= $(TOOL_$(VBOX_GCC_TOOL)_ENV_SETUP) $(PATH_TOOL_$(VBOX_GCC_TOOL)_TOOLCHAIN_BIN_SLASH)bison TOOL_FLEX_LEX ?= $(TOOL_$(VBOX_GCC_TOOL)_ENV_SETUP) $(PATH_TOOL_$(VBOX_GCC_TOOL)_TOOLCHAIN_BIN_SLASH)flex endif # target=darwin # # Macro switching between @executable_path, @rpath and /Applications/VirtualBox.app # depending on whether the build is hardened or not (dylib install_name). # ifeq ($(KBUILD_TARGET),darwin) ifndef VBOX_DYLD_EXECUTABLE_PATH ifdef VBOX_WITH_HARDENING VBOX_DYLD_EXECUTABLE_PATH = $(VBOX_PATH_APP_PRIVATE_ARCH) else if 0 VBOX_DYLD_EXECUTABLE_PATH = @executable_path else VBOX_DYLD_EXECUTABLE_PATH = @rpath VBOX_WITH_RELATIVE_RUNPATH = @loader_path/ endif endif endif # # Check for incompatible rpath combinations. # if defined(VBOX_WITH_RUNPATH) && defined(VBOX_WITH_ORIGIN) $(error VBox: VBOX_WITH_RUNPATH and VBOX_WITH_ORIGIN are mutually exclusive) endif if defined(VBOX_WITH_RELATIVE_RUNPATH) && defined(VBOX_WITH_ORIGIN) $(error VBox: VBOX_WITH_RELATIVE_RUNPATH and VBOX_WITH_ORIGIN are mutually exclusive) endif if defined(VBOX_WITH_RUNPATH) && defined(VBOX_WITH_RELATIVE_RUNPATH) $(error VBox: VBOX_WITH_RUNPATH and VBOX_WITH_RELATIVE_RUNPATH are mutually exclusive) endif if defined(VBOX_WITH_RELATIVE_RUNPATH) && defined(VBOX_WITH_HARDENING) $(error VBox: VBOX_WITH_RELATIVE_RUNPATH and VBOX_WITH_HARDENING are mutually exclusive) endif # # VBOX_WITH_ORIGIN translates into VBOX_WITH_RELATIVE_RUNPATH. # # We use two helper variables for the VBOX_WITH_ORIGIN stuff: # VBOX_ORIGIN - Indirect expansion trick. # VBOX_GCC_RPATH_OPT - Different GCC/LD combinations needs different options. # VBOX_ORIGIN = $$ORIGIN ifeq ($(KBUILD_TARGET),solaris) VBOX_GCC_RPATH_OPT = -R else VBOX_GCC_RPATH_OPT = -Wl,-rpath, VBOX_GCC_ORIGIN_OPT = -Wl,-z,origin endif ifdef VBOX_WITH_ORIGIN VBOX_WITH_RELATIVE_RUNPATH = $$(VBOX_ORIGIN) endif # # The X11 headers. # VBOX_PATH_X11_ROOT = $(PATH_ROOT)/src/VBox/Additions/x11/x11include VBOX_PATH_X11_XFREE_4_3 = $(VBOX_PATH_X11_ROOT)/4.3 VBOX_PATH_X11_XORG_7_0 = $(VBOX_PATH_X11_ROOT)/7.0 VBOX_PATH_X11_XORG_7_1 = $(VBOX_PATH_X11_ROOT)/7.1 # # crOpenGL related paths and variables. # ifdef VBOX_WITH_CROGL ifdef VBOX_WITH_WDDM VBOX_WITH_CRHGSMI = 1 endif if1of ($(KBUILD_TARGET),darwin) #VBOX_WITH_CR_DISPLAY_LISTS = 1 endif VBOX_PATH_CROGL_GLAPI = $(PATH_ROOT)/src/VBox/GuestHost/OpenGL/glapi_parser VBOX_PATH_CROGL_GENFILES = $(PATH_OBJ)/VBoxOGLgen VBOX_PATH_CROGL_INCLUDE = $(PATH_ROOT)/src/VBox/GuestHost/OpenGL/include VBOX_CROGL_API_FILES = $(VBOX_PATH_CROGL_GLAPI)/apiutil.py $(VBOX_PATH_CROGL_GLAPI)/APIspec.txt VBOX_CROGL_PYTHON_ENV = $(REDIRECT) $(if $1,-E 'PYTHONPATH=$1',) $(if $2,-o $2,) $(if $3,-i $3) -- if1of ($(KBUILD_HOST), os2 win) VBOX_PATH_CROGL_PYTHON_INCLUDE = $(VBOX_PATH_CROGL_GLAPI);$(PATH_ROOT)/src/VBox/GuestHost/OpenGL/packer;$(PATH_ROOT)/src/VBox/HostServices/SharedOpenGL/crserverlib else VBOX_PATH_CROGL_PYTHON_INCLUDE = $(VBOX_PATH_CROGL_GLAPI):$(PATH_ROOT)/src/VBox/GuestHost/OpenGL/packer:$(PATH_ROOT)/src/VBox/HostServices/SharedOpenGL/crserverlib endif ifeq ($(KBUILD_TARGET),win) VBOX_LIB_OGL_CRUTIL = $(PATH_OBJ)/VBoxOGLcrutil/VBoxOGLcrutil$(VBOX_SUFF_LIB) VBOX_LIB_OGL_HOSTCRUTIL = $(PATH_OBJ)/VBoxOGLhostcrutil/VBoxOGLhostcrutil$(VBOX_SUFF_LIB) ifeq ($(KBUILD_TARGET),x86) VBOX_LIB_OGL_CRUTIL_X86 = $(VBOX_LIB_OGL_CRUTIL) else VBOX_LIB_OGL_CRUTIL_X86 = $(PATH_OBJ)/VBoxOGLcrutil-x86/VBoxOGLcrutil-x86$(VBOX_SUFF_LIB) endif else VBOX_LIB_OGL = $(VBOX_PATH_ADDITIONS)/VBoxOGL$(VBOX_SUFF_DLL) VBOX_LIB_OGL_CRUTIL = $(VBOX_PATH_ADDITIONS)/VBoxOGLcrutil$(VBOX_SUFF_DLL) VBOX_LIB_OGL_HOSTCRUTIL = $(PATH_STAGE_BIN)/VBoxOGLhostcrutil$(VBOX_SUFF_DLL) endif if1of ($(KBUILD_TARGET), freebsd linux solaris) ifndef VBOX_USE_SYSTEM_GL_HEADERS VBOX_GL_INCS = \ $(VBOX_PATH_X11_ROOT)/glproto-1.4.10 \ $(VBOX_PATH_X11_ROOT)/mesa-7.2 endif endif VBOX_DARWIN_OPENGL_INST = obj/VBoxOGL/GL/ VBOX_DARWIN_OPENGL_HEADERS = gl.h glu.h SDK_DARWIN-OPENGL = Workaround SDK for the darwin OpenGL include directorly layout layout. SDK_DARWIN-OPENGL_INCS = $(PATH_OUT)/obj/VBoxOGL SDK_DARWIN-OPENGL_ORDERDEPS = $(addprefix $(PATH_OUT)/obj/VBoxOGL/GL/,$(VBOX_DARWIN_OPENGL_HEADERS)) ## @todo kBuild: Using INTERMEDIATES doesn't work! endif # The icons to use. ifdef VBOX_OSE VBOX_WINDOWS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/win/OSE/VirtualBox_win.ico VBOX_WINDOWS_ADDITIONS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/win/OSE/VirtualBox_win.ico VBOX_NSIS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/win/OSE/VirtualBox_win.ico VBOX_MACOSX_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/darwin/OSE/VirtualBox.icns else ifeq ($(KBUILD_HOST),win) VBOX_WINDOWS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/win/NonOSE/VirtualBox-vista.ico VBOX_WINDOWS_ADDITIONS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/win/NonOSE/VirtualBoxGA-vista.ico VBOX_NSIS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/win/NonOSE/VirtualBoxGA-nsis.ico TOOL_VCC80X86_RC := $(KBUILD_DEVTOOLS)/win.x86/ddk/6000/bin/x86/rc.exe TOOL_VCC80AMD64_RC := $(KBUILD_DEVTOOLS)/win.x86/ddk/6000/bin/x86/rc.exe TOOL_VCC70_RC := $(KBUILD_DEVTOOLS)/win.x86/ddk/6000/bin/x86/rc.exe else VBOX_WINDOWS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/win/NonOSE/VirtualBox-winxp.ico VBOX_WINDOWS_ADDITIONS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/win/NonOSE/VirtualBoxGA-winxp.ico VBOX_NSIS_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/win/NonOSE/VirtualBox-nsis.ico endif VBOX_MACOSX_ICON_FILE ?= $(PATH_ROOT)/src/VBox/Artwork/darwin/NonOSE/VirtualBox.icns endif ifndef VBOX_NOINC_DYNAMIC_CONFIG_KMK # # GCC and YASM dynamic properties. # Most of this is resolved on first kmk invocation and cached in PATH_OUT. # # Note! That a harmless warning is printed if the file doesn't exist. # Note! Changes in GCC are not detected automatically (yet). # if $(pos VBox,$(VBOX_GCC_TOOL)) > 0 include $(KBUILD_TOOL_PATHS)/$(VBOX_GCC_TOOL).kmk else include $(KBUILD_PATH)/tools/$(VBOX_GCC_TOOL).kmk endif ifneq ($(VBOX_GCC_TOOL),$(VBOX_GCC32_TOOL)) if $(pos VBox,$(VBOX_GCC32_TOOL)) > 0 include $(KBUILD_TOOL_PATHS)/$(VBOX_GCC32_TOOL).kmk else include $(KBUILD_PATH)/tools/$(VBOX_GCC32_TOOL).kmk endif endif # These tests never worked on Windows because of /dev/null, so, there # can be no harm in just dropping them until cygwin is mp safe. ifeq ($(KBUILD_HOST),win) VBOX_GCC_CHECK_EX_CC = $(3) VBOX_GCC_CHECK_EX_CXX = $(3) VBOX_GCC_CHECK_EX_LD = $(3) VBOX_GCC_CHECK_CC = $(2) VBOX_GCC_CHECK_CXX = $(2) VBOX_GCC_CHECK_LD = $(2) VBOX_GCC32_CHECK_CXX = $(2) else VBOX_GCC_CHECK_EX_CC = $(shell \ if $(1) $(subst -Wno-,-W,$(2)) -Werror -c -o /dev/null -xc $(PATH_OUT)/DynamicConfig.c > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi; ) VBOX_GCC_CHECK_EX_CXX = $(shell \ if $(1) $(subst -Wno-,-W,$(2)) -Werror -c -o /dev/null -xc++ $(PATH_OUT)/DynamicConfig.cpp > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi; ) VBOX_GCC_CHECK_EX_LD = $(shell \ if $(1) -Wl,$(2) $(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; \ then echo "-Wl,$(2)"; else echo "$(3)"; fi; ) VBOX_GCC_CHECK_CC = $(call VBOX_GCC_CHECK_EX_CC, $(TOOL_$(VBOX_GCC_TOOL)_ENV_SETUP) $(TOOL_$(VBOX_GCC_TOOL)_CC),$1,$2) VBOX_GCC_CHECK_CXX = $(call VBOX_GCC_CHECK_EX_CXX, $(TOOL_$(VBOX_GCC_TOOL)_ENV_SETUP) $(TOOL_$(VBOX_GCC_TOOL)_CXX),$1,$2) VBOX_GCC_CHECK_LD = $(call VBOX_GCC_CHECK_EX_LD, $(TOOL_$(VBOX_GCC_TOOL)_ENV_SETUP) $(TOOL_$(VBOX_GCC_TOOL)_LD),$1,$2) VBOX_GCC32_CHECK_CXX = $(call VBOX_GCC_CHECK_EX_CXX, $(TOOL_$(VBOX_GCC32_TOOL)_ENV_SETUP) $(TOOL_$(VBOX_GCC32_TOOL)_CXX),$1,$2) endif ifeq ($(KBUILD_HOST),win) ## @todo can drop this now, we're not using cygwin. # This isn't important (yet) on windows, so cook the result until # cygwin is feeling better. VBOX_GCC_VERSION := $(int-add $(int-mul 10000, 3), $(int-mul 100, 3), 3) else # This is kind of bad, the returned string needs to be re-evaluated before use. # The reason for this hack is that the windows kmk_ash cannot deal with $((1+1)). # Some versions of gcc (e.g. openSUSE11) return only major.minor on `gcc -dumpversion`. VBOX_GCC_VERSION = $(shell \ $(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))|' ) endif # Find MinGW cross compilers for EFI on non-windows systems. We need to probe # them for supported options in the Dynamic Config.kmk section below. ifdef VBOX_WITH_EFI ifneq ($(KBUILD_HOST),win) ifndef VBOX_PATH_PREFIX_MINGW32 VBOX_PATH_PREFIX_MINGW32 := $(firstword \ $(which i686-w64-mingw32-gcc) \ $(which i686-w32-mingw32-gcc) \ $(which i686-pc-mingw32-gcc) \ $(which i586-mingw32msvc-gcc) \ )# Add more variants. ifdef VBOX_PATH_PREFIX_MINGW32 VBOX_PATH_PREFIX_MINGW32 := $(substr $(VBOX_PATH_PREFIX_MINGW32), 1, $(expr $(length-var VBOX_PATH_PREFIX_MINGW32) - 3)) endif endif ifndef VBOX_PATH_PREFIX_MINGW64 VBOX_PATH_PREFIX_MINGW64 := $(firstword \ $(which x86_64-w64-mingw64-gcc) \ $(which x86_64-w64-mingw32-gcc) \ $(which x86_64-pc-mingw64-gcc) \ $(which x86_64-pc-mingw32-gcc) \ $(which x86_64-w32-mingw32-gcc) \ )# Add more variants. ifdef VBOX_PATH_PREFIX_MINGW64 VBOX_PATH_PREFIX_MINGW64 := $(substr $(VBOX_PATH_PREFIX_MINGW64), 1, $(expr $(length-var VBOX_PATH_PREFIX_MINGW64) - 3)) endif endif if defined(VBOX_PATH_PREFIX_MINGW32) || defined(VBOX_PATH_PREFIX_MINGW64) if !defined(VBOX_PATH_PREFIX_MINGW32) VBOX_PATH_PREFIX_MINGW32 = $(VBOX_PATH_PREFIX_MINGW64) else if !defined(VBOX_PATH_PREFIX_MINGW64) VBOX_PATH_PREFIX_MINGW64 = $(VBOX_PATH_PREFIX_MINGW32) endif endif endif # !win endif # VBOX_WITH_EFI # YASM macros ifndef DONT_USE_YASM include $(KBUILD_PATH)/tools/YASM.kmk if1of ($(KBUILD_HOST), win os2) VBOX_YASM_CHECK = $(if-expr "$(shell $(TOOL_YASM_AS) -e -o nul $1 - < /dev/null 2>&1)" == "",$(1),) else VBOX_YASM_CHECK = $(if-expr "$(shell $(TOOL_YASM_AS) -e -o /dev/null $1 - < /dev/null 2>&1)" == "",$(1),) endif else VBOX_YASM_CHECK = endif # NASM macros (input and output must differ with recent versions (strcmp)). ifndef DONT_USE_NASM include $(KBUILD_PATH)/tools/NASM.kmk if1of ($(KBUILD_HOST), win os2) VBOX_NASM_CHECK = $(if-expr "$(shell $(TOOL_NASM_AS) -e -o nul $1 NUL 2>&1)" == "",$(1),$(2)) else VBOX_NASM_CHECK = $(if-expr "$(shell $(TOOL_NASM_AS) -e -o /dev/./null $1 /dev/null 2>&1)" == "",$(1),$(2)) endif else VBOX_NASM_CHECK = endif # Figures the pylin version. VBOX_PYLINT_FIGURE_VERSION = $(shell $(1) --version 2> /dev/null \ | $(SED_EXT) -n -e 's|^ *pylint *\([0-9][0-9]*\).\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$(DOLLAR)|$$(expr \1 * 10000 + \2 * 100 + \3)|p' ) # Test C and C++ files. $(PATH_OUT)/DynamicConfig.c $(PATH_OUT)/DynamicConfig.cpp: $(QUIET)$(MKDIR) -p $(@D) $(QUIET)$(APPEND) -tn "$@" "int foobar(void)" "{" " return 42;" "}" "" # No $(QUIET) here as it's interesting to see what goes into the file. $(PATH_OUT)/DynamicConfig.kmk: \ $(PATH_ROOT)/Config.kmk \ $(LOCALCFG) \ $(AUTOCFG) \ $(VBOX_GCC_PATH_CC) \ $(VBOX_GCC_PATH_CXX) \ $(VBOX_GCC32_PATH_CC) \ $(VBOX_GCC32_PATH_CXX) \ $(if-expr "$(KBUILD_HOST).$(KBUILD_HOST_ARCH)" == "solaris.amd64" && $(KBUILD_HOST_VERSION_MINOR) >= 11 \ , /platform/i86pc/kernel/$(KBUILD_HOST_ARCH)/unix,) \ | $(PATH_OUT)/DynamicConfig.c $(PATH_OUT)/DynamicConfig.cpp $(call MSG_GENERATE,,$@,) $(QUIET)$(RM) -f '$@' $(QUIET)$(MKDIR) -p $(@D) # HC compiler switch detection. $(QUIET)$(APPEND) '$@' 'VBOX_GCC_PATH_CC ?= $(which $(TOOL_$(VBOX_GCC_TOOL)_CC))' $(QUIET)$(APPEND) '$@' 'VBOX_GCC_PATH_CXX ?= $(which $(TOOL_$(VBOX_GCC_TOOL)_CXX))' $(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)' $(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-pointer-sign ?= $(call VBOX_GCC_CHECK_CC,-Wno-pointer-sign,)' $(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-array_bounds ?= $(call VBOX_GCC_CHECK_CC,-Wno-array-bounds,)' # -Wextra produces additional useful warnings but includes -Wno-missing-field-initializers (too noisy) $(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wextra ?= $(call VBOX_GCC_CHECK_CC,-Wextra,)' $(QUIET)$(APPEND) '$@' 'ifneq ($$(VBOX_GCC_VERSION_CC),)' $(QUIET)$(APPEND) '$@' ' ifneq ($$(int-ge $$(VBOX_GCC_VERSION_CC),40500),)' $(QUIET)$(APPEND) '$@' ' VBOX_GCC_Wlogical-op ?= $(call VBOX_GCC_CHECK_CC,-Wlogical-op,)' $(QUIET)$(APPEND) '$@' ' endif' $(QUIET)$(APPEND) '$@' 'endif' $(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-address ?= $(call VBOX_GCC_CHECK_CXX,-Wno-address,)' $(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-literal-suffix ?= $(call VBOX_GCC_CHECK_CXX,-Wno-literal-suffix,)' $(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-misleading-indentation ?= $(call VBOX_GCC_CHECK_CC,-Wno-misleading-indentation,)' $(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_Wno-vla ?= $(call VBOX_GCC_CHECK_CXX,-Wno-vla,)' $(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-overlength-strings?= $(call VBOX_GCC_CHECK_CC,-Wno-overlength-strings,)' $(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-overloaded-virtual?= $(call VBOX_GCC_CHECK_CXX,-Wno-overloaded-virtual,)' $(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_m64 ?= $(call VBOX_GCC_CHECK_CC,-m64,)' $(QUIET)$(APPEND) '$@' 'VBOX_GCC_no-pie ?= $(call VBOX_GCC_CHECK_CC,-no-pie,)' $(QUIET)$(APPEND) '$@' 'VBOX_GCC_fdiagnostics-show-option ?= $(call VBOX_GCC_CHECK_CC,-fdiagnostics-show-option,)' $(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wa_cma_nocompress_debug_sections ?= $(call VBOX_GCC_CHECK_CC,-Wa$(COMMA)--nocompress-debug-sections,)' # Produce code optimized for the most common IA32/AMD64/EM64T processors. Introduced with gcc version 4.2. $(QUIET)$(APPEND) '$@' 'VBOX_GCC_mtune-generic ?= $(call VBOX_GCC_CHECK_CC,-mtune=generic,)' $(QUIET)$(APPEND) '$@' 'VBOX_LD_as_needed ?= $(call VBOX_GCC_CHECK_LD,--as-needed,)' # gcc version < 3.4 has a bug in handling __attribute__((regparm(3))). # 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_BUGGY_REGPARM ?= $$(int-lt $$(VBOX_GCC_VERSION_CC),30400)' # Set default attribute for ELF and MACH-O symbols to ``hidden'' to reduce the number # of relocation entries and PLT indirections in shared libraries. Don't allow for gcc version < 4. $(QUIET)$(APPEND) '$@' 'ifneq ($$(VBOX_GCC_VERSION_CC),)' $(QUIET)$(APPEND) '$@' ' ifneq ($$(int-ge $$(VBOX_GCC_VERSION_CC),40000),)' $(QUIET)$(APPEND) '$@' ' VBOX_GCC_fvisibility-hidden ?= $(call VBOX_GCC_CHECK_CC,-fvisibility=hidden -DVBOX_HAVE_VISIBILITY_HIDDEN -DRT_USE_VISIBILITY_DEFAULT,)' $(QUIET)$(APPEND) '$@' ' endif' $(QUIET)$(APPEND) '$@' 'endif' ifn1of ($(KBUILD_TARGET),haiku) # Set default attribute for inline functions to ``hidden'' to reduce the number # of relocation entries and PLT indirections in shared libraries. Don't allow for gcc version < 4. $(QUIET)$(APPEND) '$@' 'ifneq ($$(VBOX_GCC_VERSION_CXX),)' $(QUIET)$(APPEND) '$@' ' ifneq ($$(int-ge $$(VBOX_GCC_VERSION_CXX),40000),)' $(QUIET)$(APPEND) '$@' ' VBOX_GCC_fvisibility-inlines-hidden ?= $(call VBOX_GCC_CHECK_CXX,-fvisibility-inlines-hidden,)' $(QUIET)$(APPEND) '$@' ' endif' $(QUIET)$(APPEND) '$@' 'endif' endif # Prevent warnings about unused parameters as of gcc-4.8 / clang 6 as this warning is now very verbose $(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-unused-parameter ?= $(call VBOX_GCC_CHECK_CC,-Wno-unused-parameter,)' # Clang 6. $(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-language-extension-token ?= $(call VBOX_GCC_CHECK_CC,-Wno-language-extension-token,)' $(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-extended-offsetof ?= $(call VBOX_GCC_CHECK_CC,-Wno-extended-offsetof,)' $(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-gnu-folding-constant ?= $(call VBOX_GCC_CHECK_CC,-Wno-gnu-folding-constant,)' $(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-return-type-c-linkage ?= $(call VBOX_GCC_CHECK_CXX,-Wno-return-type-c-linkage,)' $(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-string-plus-int ?= $(call VBOX_GCC_CHECK_CC,-Wno-string-plus-int,)' $(QUIET)$(APPEND) '$@' 'VBOX_GCC_Wno-nested-anon-types ?= $(call VBOX_GCC_CHECK_CC,-Wno-nested-anon-types,)' # C++ Std settings $(QUIET)$(APPEND) '$@' 'ifneq ($$(VBOX_GCC_VERSION_CXX),)' $(QUIET)$(APPEND) '$@' ' ifneq ($$(int-ge $$(VBOX_GCC_VERSION_CXX),40800),)' $(QUIET)$(APPEND) '$@' ' VBOX_GCC_std ?= -std=c++11' $(QUIET)$(APPEND) '$@' ' else ifneq ($$(int-ge $$(VBOX_GCC_VERSION_CXX),40600),)' $(QUIET)$(APPEND) '$@' ' VBOX_GCC_std ?= -std=c++0x' $(QUIET)$(APPEND) '$@' ' endif' $(QUIET)$(APPEND) '$@' 'endif' ifeq ($(KBUILD_TARGET),solaris) $(QUIET)$(APPEND) '$@' 'VBOX_GCC_msave-args ?= $(call VBOX_GCC_CHECK_CXX,-msave-args,)' # Detect the solaris assembler. It is used by the the 4.x gcc compilers, # apparently. It will not be able to handle IEMAll via a -pipe, only when # passed a file. The solaris assmbler rulez ... not! $(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: *//' )' $(QUIET)$(APPEND) '$@' 'if $$(pos Sun Compiler Common,$$(VBOX_AS_VERSION)) > 0' $(QUIET)$(APPEND) '$@' ' VBOX_GCC_USING_SOLARIS_AS=1' $(QUIET)$(APPEND) '$@' 'endif' $(QUIET)$(APPEND) '$@' 'ifndef VBOX_GCC_USING_SOLARIS_AS' $(QUIET)$(APPEND) '$@' ' VBOX_GCC_pipe ?= -pipe' $(QUIET)$(APPEND) '$@' 'endif' else $(QUIET)$(APPEND) '$@' 'VBOX_GCC_pipe ?= -pipe' endif # Find the compiler includes for IPRT no-crt. # Note that `$(dir $(gcc -print-libgcc-file-name))/include does not work for a 64-bit cross build on a 32-bit build host. ifeq ($(KBUILD_HOST),win) # With the cygwin issues and gcc on windows returning a useless path, just skip this on windows. $(QUIET)$(APPEND) '$@' 'VBOX_PATH_GCC_INCS ?= ' else $(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' endif # 32-bit (GC) compiler switch detection. $(QUIET)$(APPEND) '$@' 'VBOX_GCC32_PATH_CC ?= $(which $(TOOL_$(VBOX_GCC32_TOOL)_CC))' $(QUIET)$(APPEND) '$@' 'VBOX_GCC32_PATH_CXX ?= $(which $(TOOL_$(VBOX_GCC32_TOOL)_CXX))' $(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,)' # darwin no_compact_linkedit starting at Xcode 3.2 ifeq ($(KBUILD_HOST),darwin) $(QUIET)$(APPEND) '$@' 'VBOX_LD_no_compact_linkedit ?= $(call VBOX_GCC_CHECK_LD,-no_compact_linkedit,)' endif # YASM $(QUIET)$(APPEND) '$@' '# debug: TOOL_YASM_AS="$(TOOL_YASM_AS)"' $(QUIET)$(APPEND) '$@' 'VBOX_YASM_Wno-segreg-in-64bit ?= $(call VBOX_YASM_CHECK,-Wno-segreg-in-64bit,)' # NASM (--allow-64-bit: 2.12rc2) $(QUIET)$(APPEND) '$@' 'VBOX_NASM_allow_64_bit ?= $(call VBOX_NASM_CHECK,--allow-64-bit,)' ifeq ($(KBUILD_HOST),linux) $(QUIET)$(APPEND) '$@' 'VBOX_LD_HAS_LIBXCB ?= $(shell /sbin/ldconfig -p|grep -q "\" && echo "1")' endif ifdef VBOX_PATH_PREFIX_MINGW32 $(QUIET)$(APPEND) '$@' 'VBOX_MINGW32_VERSION_CC ?= $(call VBOX_GCC_VERSION,$(VBOX_PATH_PREFIX_MINGW32)gcc -m32)' $(QUIET)$(APPEND) '$@' 'VBOX_MINGW32_VERSION_CXX ?= $(call VBOX_GCC_VERSION,$(VBOX_PATH_PREFIX_MINGW32)g++ -m32)' $(QUIET)$(APPEND) '$@' 'VBOX_MINGW32_Wno-array-bounds ?= $(call VBOX_GCC_CHECK_EX_CXX,$(VBOX_PATH_PREFIX_MINGW32)g++ -m32,-Wno-array-bounds,)' $(QUIET)$(APPEND) '$@' 'VBOX_MINGW32_Wno-unused-but-set-variable ?= $(call VBOX_GCC_CHECK_EX_CXX,$(VBOX_PATH_PREFIX_MINGW32)g++ -m32,-Wno-unused-but-set-variable,)' $(QUIET)$(APPEND) '$@' 'VBOX_MINGW32_Wno-maybe-uninitialized ?= $(call VBOX_GCC_CHECK_EX_CXX,$(VBOX_PATH_PREFIX_MINGW32)g++ -m32,-Wno-maybe-uninitialized,)' $(QUIET)$(APPEND) '$@' 'VBOX_MINGW32_USER_LABEL_PREFIX ?= $(shell echo "__USER_LABEL_PREFIX__" | $(VBOX_PATH_PREFIX_MINGW32)g++ -m32 -E -xc++ - | $(SED) -e "/^$(HASH)/d")' endif ifdef VBOX_PATH_PREFIX_MINGW64 $(QUIET)$(APPEND) '$@' 'VBOX_MINGW64_VERSION_CC ?= $(call VBOX_GCC_VERSION,$(VBOX_PATH_PREFIX_MINGW64)gcc -m64)' $(QUIET)$(APPEND) '$@' 'VBOX_MINGW64_VERSION_CXX ?= $(call VBOX_GCC_VERSION,$(VBOX_PATH_PREFIX_MINGW64)g++ -m64)' $(QUIET)$(APPEND) '$@' 'VBOX_MINGW64_Wno-array-bounds ?= $(call VBOX_GCC_CHECK_EX_CXX,$(VBOX_PATH_PREFIX_MINGW64)g++ -m64,-Wno-array-bounds,)' $(QUIET)$(APPEND) '$@' 'VBOX_MINGW64_Wno-unused-but-set-variable ?= $(call VBOX_GCC_CHECK_EX_CXX,$(VBOX_PATH_PREFIX_MINGW64)g++ -m64,-Wno-unused-but-set-variable,)' $(QUIET)$(APPEND) '$@' 'VBOX_MINGW64_Wno-maybe-uninitialized ?= $(call VBOX_GCC_CHECK_EX_CXX,$(VBOX_PATH_PREFIX_MINGW64)g++ -m64,-Wno-maybe-uninitialized,)' $(QUIET)$(APPEND) '$@' 'VBOX_MINGW64_USER_LABEL_PREFIX ?= $(shell echo "__USER_LABEL_PREFIX__" | $(VBOX_PATH_PREFIX_MINGW64)g++ -m64 -E -xc++ - | $(SED) -e "/^$(HASH)/d")' endif ifeq ($(KBUILD_HOST),darwin) $(QUIET)$(APPEND) '$@' 'VBOX_HAVE_FLEX ?= 1' $(QUIET)$(APPEND) '$@' 'VBOX_HAVE_BISON ?= 1' else $(QUIET)$(APPEND) '$@' 'VBOX_HAVE_FLEX ?= $(if $(which flex),1,)' $(QUIET)$(APPEND) '$@' 'VBOX_HAVE_BISON ?= $(if $(which bison),1,)' endif $(QUIET)$(APPEND) '$@' 'VBOX_HAVE_XMLLINT ?= $(which xmllint)' if "$(KBUILD_HOST)" == "solaris" && $(KBUILD_HOST_VERSION_MAJOR) == 5 && $(KBUILD_HOST_VERSION_MINOR) == 11 # uname -v can report "snv_XYZ" or "11.X" $(QUIET)$(APPEND) '$@' 'VBOX_SOLARIS_11_VERSION ?= $(shell uname -v | sed "s/snv_//" | cut -f1 -d".")' # FULLVERSION format e.g. "5.11-0.175.1.0.0.16.0", we're interested in 175 (VERSION), 1 (UPDATE), 16 (BUILD). $(QUIET)$(APPEND) '$@' "VBOX_SOLARIS_11_FULLVERSION := $(shell pkg contents -H -t set -o pkg.fmri system/kernel | $(SED_EXT) -e '1!d' -e 's/^.*\@//;s/\:.*//;s/.*,//')" $(QUIET)$(APPEND) '$@' 'ifeq ($$(VBOX_SOLARIS_11_VERSION),11)' $(QUIET)$(APPEND) '$@' ' VBOX_SOLARIS_11_VERSION := $$(word 2, $$(subst ., ,$$(word 2,$$(subst -, ,$$(VBOX_SOLARIS_11_FULLVERSION)))))' $(QUIET)$(APPEND) '$@' 'endif' $(QUIET)$(APPEND) '$@' 'VBOX_SOLARIS_11_UPDATE_VERSION := $$(word 3, $$(subst ., ,$$(word 2,$$(subst -, ,$$(VBOX_SOLARIS_11_FULLVERSION)))))' $(QUIET)$(APPEND) '$@' 'VBOX_SOLARIS_11_BUILD_VERSION := $$(word 6, $$(subst ., ,$$(word 2,$$(subst -, ,$$(VBOX_SOLARIS_11_FULLVERSION)))))' endif if defined(VBOX_PYLINT) && !defined(VBOX_WITH_PYLINT_PRE_V1_0) && !defined(VBOX_WITH_PYLINT_V1_1_PLUS) && !defined(VBOX_WITH_PYLINT_V1_2_1_PLUS) $(QUIET)$(APPEND) '$@' "VBOX_PYLINT_VERSION := $(call VBOX_PYLINT_FIGURE_VERSION, $(VBOX_PYLINT))" endif $(QUIET)$(ECHO) '========= START OF $@ =========' $(QUIET)$(CAT) $@ $(QUIET)$(ECHO) '=========== END OF $@ =========' include $(PATH_OUT)/DynamicConfig.kmk endif # !VBOX_NOINC_DYNAMIC_CONFIG_KMK # # Compiler warning control. # VBOX_GCC_WARN ?= -Wall $(VBOX_GCC_Wextra) $(VBOX_GCC_Wno-missing-field-initializers) -Wno-unused -Wno-trigraphs \ $(VBOX_GCC_fdiagnostics-show-option) $(VBOX_GCC_Wno-unused-parameter) $(VBOX_GCC_Wno-language-extension-token) \ $(VBOX_GCC_Wno-extended-offsetof) $(VBOX_GCC_Wno-gnu-folding-constant) $(VBOX_GCC_Wlogical-op) \ $(VBOX_GCC_Wno-string-plus-int) $(VBOX_GCC_Wno-nested-anon-types) $(VBOX_GCC_Wno-variadic-macros) VBOX_GCC_WARN_PEDANTIC = -Wshadow $(VBOX_GCC_WARN) -Wno-long-long if $(VBOX_GCC_VERSION_CXX) >= 40200 || defined(VBOX_WITH_MASOCHISTIC_WARNINGS) # gcc 4.2.x+ (4.1.2 is causing trouble with the extpack & add builds) VBOX_GCC_WARN_MASOCHISTIC ?= -Wunused-variable -Wunused-function -Wunused-label -Wunused-parameter endif if $(KBUILD_TARGET) == "linux" \ || ($(KBUILD_TARGET) == "darwin" && defined(VBOX_WITH_NEW_XCODE)) \ || defined(VBOX_WITH_MASOCHISTIC_WARNINGS) VBOX_GCC_WARN_PEDANTIC += $(VBOX_GCC_WARN_MASOCHISTIC) endif VBOX_GCC_PEDANTIC_CXX ?= -pedantic $(VBOX_GCC_WARN_PEDANTIC) $(VBOX_GCC_Wno-return-type-c-linkage) $(VBOX_GCC_Wno-overloaded-virtual) VBOX_GCC_PEDANTIC_C ?= -pedantic $(VBOX_GCC_WARN_PEDANTIC) -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -Werror-implicit-function-declaration VBOX_GCC_NON_PEDANTIC_CXX ?= -Wno-sign-compare VBOX_GCC_NON_PEDANTIC_C ?= -Wno-sign-compare -Werror-implicit-function-declaration # Disabled Visual C++ warnings, W4: # -wd4065: switch statement contains 'default' but no 'case' labels # -wd4996: deprecated / insecure. # -wd4127: conditional expression is constant [level 4] # -wd4706: assignment within conditional expression [level 4] # -wd4201: nonstandard extension used : nameless struct/union [level 4] # -wd4214: nonstandard extension used : bit field types other than int [level 4] # -wd4510: 'VM::' : default constructor could not be generated # -wd4512: 'VM' : assignment operator could not be generated # -wd4610: union 'VM::' can never be instantiated - user defined constructor required # Disabled Visual C++ warnings, Wall: # -wd4514: unreferenced inline function has been removed # -wd4820: 'RTSTRSPACECORE' : '7' bytes padding added after data member 'RTSTRSPACECORE::uchHeight' # -wd4365: '=' : conversion from 'unsigned char' to 'char', signed/unsigned mismatch # -wd4987: nonstandard extension used: 'throw (...)' (setjmp.h + our stuff) # -wd4710: 'std::string std::_Narrow_str(std::wstring)' : function not inlined # -wd4061: enumerator 'RTASN1TYPE_END' in switch of enum 'RTASN1TYPE' is not explicitly handled by a case label # Note! C4062 checks for the same but includes the 'default' case, just like gcc. So, no trouble disabling this. # -wd4986: 'operator new[]': exception specification does not match previous declaration (crtdbg.h vs new, exception specification only) # -wd4191: 'type cast' : unsafe conversion from 'int (__cdecl *)(gzFile)' to 'PFNRT' # -wd4574: 'INCL_WINSOCK_API_TYPEDEFS' is defined to be '0': did you mean to use '#if INCL_WINSOCK_API_TYPEDEFS'? # -wd4917: 'OLE_XPOS_HIMETRIC' : a GUID can only be associated with a class, interface or namespace # -wd4711: function 'void __cdecl rtMemCacheFreeOne(struct RTMEMCACHEINT * __ptr64,void * __ptr64)' selected for automatic inline expansion # -wd4571: Informational: catch(...) semantics changed since Visual C++ 7.1; structured exceptions (SEH) are no longer caught # -wd4611: interaction between '_setjmp' and C++ object destruction is non-portable # -wd4324: '_TDI_PNP_CONTEXT_XP' : structure was padded due to __declspec(align()) # -wd4505: VBoxNetFltNobj.h(45) : warning C4505: 'VBoxNetFltNobj::Release' : unreferenced local function has been removed # Probably related to http://stackoverflow.com/questions/3051992/compiler-warning-at-c-template-base-class # -wd4263: 'int VRDPChannelClipboard::SendPacket(const void *,uint32_t)' : member function does not override any base class virtual member function # Probably useful, but impractical, just like the next one. # -wd4264: 'int VRDPOutputCtx::SendPacket(void)' : no override available for virtual member function from base 'VRDPOutputCtx'; function is hidden # -wd4738: storing 32-bit float result in memory, possible loss of performance # Want to enable these: # -wd4242: '=' : conversion from 'uint32_t' to 'uint8_t', possible loss of data # -wd4244: 'conversion' conversion from 'type1' to 'type2', possible loss of data VBOX_VCC_WARN_ALL ?= -W4 -Wall -wd4065 -wd4996 -wd4127 -wd4706 -wd4201 -wd4214 -wd4510 -wd4512 -wd4610 \ -wd4514 -wd4820 -wd4365 -wd4987 -wd4710 -wd4061 -wd4986 -wd4191 -wd4574 -wd4917 -wd4711 -wd4611 -wd4571 -wd4324 -wd4505 \ -wd4263 -wd4264 -wd4738 #ifndef VBOX_WITH_MASOCHISTIC_WARNINGS # VBOX_VCC_WARN_ALL += #endif VBOX_VCC_WARN_ALL += -wd4242 -wd4244 # Disable pedantic warnings for NP/NonPedantic templates. # -wd4131: 'bi_flush' : uses old-style declarator # -wd4255: 'tr_static_init' : no function prototype given: converting '()' to '(void)' # -wd4668: '_WIN32_WCE' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'/ # -wd4100: 'cinfo' : unreferenced formal parameter # -wd4189: 'sz' : local variable is initialized but not referenced # -wd4132: 'xmlStringComment' : const object should be initialized # -wd4152: nonstandard extension, function/data pointer conversion in expression # -wd4702: unreachable code # -wd4057: '=' : 'xmlChar *' differs in indirection to slightly different base types from 'char *' # -wd4296: '>=' : expression is always true # -wd4389: '==' : signed/unsigned mismatch # -wd4018: '<=' : signed/unsigned mismatch # -wd4245: '=' : conversion from 'int' to 'unsigned int', signed/unsigned mismatch # -wd4267: '+=' : conversion from 'size_t' to 'long', possible loss of data # -wd4295: 'vendor_string' : array is too small to include a terminating null character VBOX_VCC_NON_PEDANTIC = -wd4131 -wd4255 -wd4668 -wd4100 -wd4189 -wd4132 -wd4152 -wd4702 -wd4057 -wd4296 -wd4389 -wd4018 -wd4245 \ -wd4267 -wd4295 ifeq ($(KBUILD_TARGET),win) VBOX_C_CXX_FLAGS_NO_UNUSED_PARAMETERS = -wd4100 else VBOX_C_CXX_FLAGS_NO_UNUSED_PARAMETERS = -Wno-unused-parameter endif # # Compiler optimization flags. # ifeq ($(KBUILD_TYPE),debug) VBOX_GCC_FP ?= -fno-omit-frame-pointer VBOX_GCC_OPT ?= -O0 VBOX_VCC_FP ?= -Oy- VBOX_VCC_OPT ?= VBOX_GCC_R0_FP ?= -fno-omit-frame-pointer -fno-optimize-sibling-calls VBOX_GCC_R0_OPT ?= -O2 VBOX_VCC_R0_FP ?= -Oy- VBOX_VCC_R0_OPT ?= VBOX_GCC_GC_FP ?= -fno-omit-frame-pointer -fno-optimize-sibling-calls VBOX_GCC_GC_OPT ?= -O2 VBOX_VCC_GC_FP ?= -Oy- VBOX_VCC_GC_OPT ?= else # We should use -fomit-frame-pointer for GCC / -Oy for VCC. # -funwind-tables provides support for backtraces in gdb then. VBOX_GCC_FP ?= -fno-omit-frame-pointer VBOX_GCC_OPT ?= -O2 $(VBOX_GCC_mtune-generic) VBOX_VCC_FP ?= -Oy- VBOX_VCC_OPT ?= -O2 VBOX_GCC_R0_FP ?= -fno-omit-frame-pointer VBOX_GCC_R0_OPT ?= -O2 $(VBOX_GCC_mtune-generic) VBOX_VCC_R0_FP ?= -Oy- VBOX_VCC_R0_OPT ?= -O2 VBOX_GCC_GC_FP ?= -fno-omit-frame-pointer VBOX_GCC_GC_OPT ?= -O2 $(VBOX_GCC_mtune-generic) VBOX_VCC_GC_FP ?= -Oy- VBOX_VCC_GC_OPT ?= -O2 endif ifeq ($(KBUILD_TARGET_ARCH),x86) ifneq ($(KBUILD_TARGET),darwin) # (The '<=' operator is for prepending (kmk specific).) VBOX_GCC_OPT <= -march=i586 endif endif # # Select the CRT type we're using with Microsoft Visual C++. # if1of ($(KBUILD_TYPE), debug dbgopt strict) #not yet# VBOX_WITH_DEBUG_VCC_CRT = 1 endif ifdef VBOX_WITH_DEBUG_VCC_CRT VBOX_VCC_CRT_TYPE = d VBOX_VCC_CRT_TYPE_N = else VBOX_VCC_CRT_TYPE = VBOX_VCC_CRT_TYPE_N = d endif # # Warnings as errors. # # GCC: We disable warnings on non-X86 systems because of the variadic # macro usage in the logger. # ifdef VBOX_WITH_WARNINGS_AS_ERRORS if $(VBOX_GCC_VERSION_CXX) >= 40000 VBOX_GCC_WERR ?= -Werror endif VBOX_VCC_WERR ?= -WX VBOX_VCC_LD_WERR ?= ## @todo later also: -WX endif # # The general GCC/Clang no warning policy. # # Note! This doesn't control everything. Instead set VBOX_GCC_WERR=$(NO_SUCH_VARIABLE) to # completely disable -Werror. # if !defined(VBOX_WITHOUT_NO_GCC_WARNING_POLICY) && !defined(VBOX_WITH_NO_GCC_WARNING_POLICY) if defined(VBOX_WITH_MASOCHISTIC_WARNINGS) # gcc 4.6.x+ VBOX_WITH_NO_GCC_WARNING_POLICY = 1 else if $(KBUILD_TARGET) == "darwin" && defined(VBOX_WITH_NEW_XCODE) VBOX_WITH_NO_GCC_WARNING_POLICY = 1 else if1of ($(KBUILD_TARGET), linux) if $(VBOX_GCC_VERSION_CXX) >= 40600 # gcc 4.6.x+ VBOX_WITH_NO_GCC_WARNING_POLICY = 1 endif endif endif ifdef VBOX_WITH_NO_GCC_WARNING_POLICY $(info build debug: VBOX_WITH_NO_GCC_WARNING_POLICY is enabled) endif # # Misc stuff that should be after including DynamicConfig.kmk. # # libxml XML linter. ifeq ($(VBOX_XMLLINT),) ifeq ($(KBUILD_HOST),win) VBOX_XMLLINT := $(wildcard $(KBUILD_DEVTOOLS)/$(KBUILD_HOST).$(KBUILD_HOST_ARCH)/libxslt/10128/bin/xmllint.exe) endif ifeq ($(VBOX_XMLLINT),) VBOX_XMLLINT := $(VBOX_HAVE_XMLLINT) endif ifneq ($(VBOX_XMLLINT),) VBOX_HAVE_XMLLINT := 1 else VBOX_XMLLINT := xmllint VBOX_HAVE_XMLLINT := endif else VBOX_HAVE_XMLLINT := 1 endif # # Misc macros. # ## # Edits VirtualBox version, vendor and package strings in a text file. # # The rule using this must list $(VBOX_SVN_REV_KMK) as a prerequisite. # # @param 1 The input filename. # @param 2 The output filename. # VBOX_EDIT_VERSION_CMD_FN = $(SED) \ -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \ -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \ -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \ -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \ -e 's/@VBOX_SVN_REV@/$(VBOX_SVN_REV)/g' \ -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \ -e 's/@VBOX_VENDOR_SHORT@/$(VBOX_VENDOR_SHORT)/g' \ -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \ -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \ -e 's/@VBOX_PACKAGE_STRING@/$(VBOX_PACKAGE_STRING)/g' \ --output $(2) $(1) ## # Generates a rule for editing a file using VBOX_EDIT_VERSION_CMD_FN. # # @param 1 The target name. # @param 2 The input filename relative to the current sub-makefile. # @param 3 The output filename relative to the target output dir. # Optional, defaults to 2. # VBOX_EDIT_VERSION_RULE_FN = $(eval $(value VBOX_EDIT_VERSION_RULE_DEF)) define VBOX_EDIT_VERSION_RULE_DEF $$($(1)_0_OUTDIR)/$(if $(3),$(3),$(2)): $(PATH_SUB_CURRENT)/$(2) $(VBOX_SVN_REV_KMK) | $$(dir $$@) $(call MSG_GENERATE,$(1),$@,$<) $(QUIET)$(call VBOX_EDIT_VERSION_CMD_FN,$<,$@) endef ## # Fill in am import library target based on a somewhat special windows .def file. # # @param 1 The target name of the import library. # @param 2 The name of the real library. # @param 3 The .def-file paths relative to the current makefile. # VBOX_GENERATE_IMPORT_TARGET_FN = $(eval $(VBOX_GENERATE_IMPORT_TARGET_DEF)) define VBOX_GENERATE_IMPORT_TARGET_DEF $(1)_TEMPLATE = VBoxR3Dll $(1)_INST = $(INST_LIB) if $(KBUILD_TARGET) == "darwin" $(1)_LDFLAGS = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/$(2)$(SUFF_DLL) else ifn1of ($(KBUILD_TARGET), os2 win) $(1)_SONAME = $(2)$(SUFF_DLL) endif if1of ($(KBUILD_TARGET), os2 win) $(1)_SOURCES = $$($(1)_0_OUTDIR)/$(1)Imp.def $(1)_CLEAN = $$($(1)_0_OUTDIR)/$(1)Imp.def else $(1)_SOURCES = $$($(1)_0_OUTDIR)/$(1)Imp.c $(1)_CLEAN = $$($(1)_0_OUTDIR)/$(1)Imp.c endif $$$$($(1)_SOURCES): $(addprefix $(PATH_SUB_CURRENT)/,$(3)) $(PATH_ROOT)/src/bldprogs/deftoimp.sed | $$$$(dir $$$$@) $$(call MSG_GENERATE,,$$@) ifeq ($(KBUILD_TARGET),os2) $$(SED) \ -e '/not-$(KBUILD_TARGET)/d' \ -e '/not-$(KBUILD_TARGET_ARCH)/d' \ -e 's/^LIBRARY[[:space:]][[:space:]]*\(.*\)\.dll/LIBRARY \1 INITINSTANCE TERMINSTANCE\nDATA MULTIPLE\n/' \ -e 's/^[ \t][ \t]*\([_a-zA-Z]\)/ _\1/' \ -e 's/[ \t]DATA[ \t]*/ /' \ --output $$@ $(addprefix $(PATH_SUB_CURRENT)/,$(3)) else ifeq ($(KBUILD_TARGET),win) $$(SED) \ -e '/not-$(KBUILD_TARGET)/d' \ -e '/not-$(KBUILD_TARGET_ARCH)/d' \ --output $$@ $(addprefix $(PATH_SUB_CURRENT)/,$(3)) else $$(QUIET)$$(APPEND) -tn $$@ \ '#ifdef VBOX_HAVE_VISIBILITY_HIDDEN' \ '# define EXPORT __attribute__((visibility("default")))' \ '# define EXPORT_DATA __attribute__((visibility("default")))' \ '#else' \ '# define EXPORT' \ '# define EXPORT_DATA' \ '#endif' \ '' $$(SED) \ -e '/not-$(KBUILD_TARGET)/d' \ -e '/not-$(KBUILD_TARGET_ARCH)/d' \ -f $(PATH_ROOT)/src/bldprogs/deftoimp.sed \ --append $$@ $(addprefix $(PATH_SUB_CURRENT)/,$(3)) endif endef # VBOX_GENERATE_IMPORT_TARGET_DEF # # Code Signing. # # There are two signing modes; 'test' and 'release'. # - The 'test' mode is tailored local development, where typically test # certificates are involved. Only the bar minimum of files are signed and # nothing is timestamped (if we can control timestamping) in order to reduce # build time and to allow working offline. # - The 'release' mode is tailored for creating builds that are give to other # people, like the ones the build servers create. As much as possible is # signed and timestamped. # ifdef VBOX_SIGNING_MODE VBOX_SIGNING_MODE := $(strip $(VBOX_SIGNING_MODE)) ifn1of ($(VBOX_SIGNING_MODE), test release) $(error VBOX_SIGNING_MODE must be either 'test' or 'release'. The value '$(VBOX_SIGNING_MODE)' is not recognized.) endif ifeq ($(KBUILD_HOST),win) # # Windows # # VBOX_PATH_SELFSIGN points to the Vista WDK bin/SelfSign directory. ifndef VBOX_PATH_SELFSIGN VBOX_PATH_SELFSIGN := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS)/win.x86/selfsign/*))) ifeq ($(VBOX_PATH_SELFSIGN),) VBOX_PATH_SELFSIGN := $(KBUILD_DEVTOOLS)/win.x86/selfsign/r1 endif endif ifndef VBOX_PATH_SIGN_TOOLS VBOX_PATH_SIGN_TOOLS := $(firstword $(rsort $(wildcard \ $(addprefix $(KBUILD_DEVTOOLS)/win.x86/sdk/v8.1*/Bin/, x86 $(if-expr $(KBUILD_HOST_ARCH)=="amd64",x64,) ) ))) ifeq ($(VBOX_PATH_SIGN_TOOLS),) VBOX_PATH_SIGN_TOOLS := $(firstword $(rsort $(wildcard \ $(addprefix $(KBUILD_DEVTOOLS)/win.x86/sdk/v10*/Bin/, x86 $(if-expr $(KBUILD_HOST_ARCH)=="amd64",x64,) ) ))) ifeq ($(VBOX_PATH_SIGN_TOOLS),) VBOX_PATH_SIGN_TOOLS := $(VBOX_PATH_SELFSIGN) endif endif endif VBOX_RETRY ?= $(ASH) $(KBUILD_DEVTOOLS)/bin/retry.sh VBOX_SIGNTOOL ?= $(VBOX_RETRY) "$(VBOX_PATH_SIGN_TOOLS)/signtool.exe" VBOX_INF2CAT ?= $(VBOX_PATH_SELFSIGN)/inf2cat.exe ifeq ($(VBOX_SIGNING_MODE),test) VBOX_CERTIFICATE_SUBJECT_NAME ?= MyTestCertificate VBOX_CERTIFICATE_SUBJECT_NAME_ARGS ?= /n "$(VBOX_CERTIFICATE_SUBJECT_NAME)" else # release VBOX_CERTIFICATE_SUBJECT_NAME ?= Oracle Corporation VBOX_CERTIFICATE_SUBJECT_NAME_ARGS ?= /n "$(VBOX_CERTIFICATE_SUBJECT_NAME)" /a VBOX_CERTIFICATE_FINGERPRINT ?= 7e 92 b6 6b e5 1b 79 d8 ce 3f f2 5c 15 c2 df 6a b8 c7 f2 f2 VBOX_CROSS_CERTIFICATE_FILE ?= $(VBOX_PATH_SELFSIGN)/VeriSign Class 3 Public Primary Certification Authority - G5.cer VBOX_CROSS_CERTIFICATE_FILE_ARGS ?= /ac "$(VBOX_CROSS_CERTIFICATE_FILE)" VBOX_TSA_URL ?= http://timestamp.verisign.com/scripts/timestamp.dll VBOX_TSA_URL_ARGS ?= /t "$(VBOX_TSA_URL)" endif VBOX_CERTIFICATE_STORE ?= my VBOX_CERTIFICATE_STORE_ARGS ?= /s "$(VBOX_CERTIFICATE_STORE)" VBOX_CERTIFICATE_FINGERPRINT_ARGS := $(if-expr "$(VBOX_CERTIFICATE_FINGERPRINT)" != "" \ ,/sha1 "$(subst $(SP),,$(VBOX_CERTIFICATE_FINGERPRINT))",) ifeq ($(VBOX_SIGNING_MODE),test) #VBOX_CERTIFICATE_SHA2_SUBJECT_NAME ?= MyTestCertificateSha2 VBOX_CERTIFICATE_SHA2_SUBJECT_NAME_ARGS ?= /n "$(VBOX_CERTIFICATE_SHA2_SUBJECT_NAME)" else # release VBOX_CERTIFICATE_SHA2_SUBJECT_NAME_ARGS ?= /n "$(VBOX_CERTIFICATE_SHA2_SUBJECT_NAME)" /a VBOX_CERTIFICATE_SHA2_FINGERPRINT ?= 31 31 bb 58 8b 19 9e 6e 85 0f d3 35 82 b0 c5 82 55 e1 6c 49 VBOX_CERTIFICATE_SHA2_SUBJECT_NAME ?= Oracle Corporation VBOX_CROSS_CERTIFICATE_SHA2_FILE ?= $(VBOX_PATH_SELFSIGN)/VeriSign Class 3 Public Primary Certification Authority - G5.cer VBOX_CROSS_CERTIFICATE_SHA2_FILE_ARGS ?= /ac "$(VBOX_CROSS_CERTIFICATE_SHA2_FILE)" VBOX_TSA_SHA2_URL ?= http://sha256timestamp.ws.symantec.com/sha256/timestamp VBOX_TSA_SHA2_URL_ARGS ?= /tr "$(VBOX_TSA_SHA2_URL)" endif VBOX_CERTIFICATE_SHA2_STORE ?= my VBOX_CERTIFICATE_SHA2_STORE_ARGS ?= /s "$(VBOX_CERTIFICATE_SHA2_STORE)" VBOX_CERTIFICATE_SHA2_FINGERPRINT_ARGS := $(if-expr "$(VBOX_CERTIFICATE_SHA2_FINGERPRINT)" != "" \ ,/sha1 "$(subst $(SP),,$(VBOX_CERTIFICATE_SHA2_FINGERPRINT))",) # Still using SHA-1 for fingerprinting, it's good enough for that! ## Commands for signing a driver image after link. VBOX_SIGN_DRIVER_CMDS ?= $(if $(eq $(tool_do),LINK_LIBRARY),,$(call VBOX_SIGN_IMAGE_FN,$(out),,2)) ## Sign a file (generic). # @param 1 The file to sign. # @param 2 File description. Optional. # @param 3 Additional parameters. Optional. # @param 4 Set to 2 if the expression will be expanded twice before chopped into commands (for _CMDS). # @param 5 Disables dual signing if non-empty. ifndef VBOX_SIGN_FILE_FN ifdef VBOX_CERTIFICATE_SHA2_SUBJECT_NAME VBOX_SIGN_FILE_FN = $(VBOX_SIGNTOOL) \ sign /fd sha1\ $(VBOX_CROSS_CERTIFICATE_FILE_ARGS) \ $(VBOX_CERTIFICATE_STORE_ARGS) \ $(VBOX_CERTIFICATE_SUBJECT_NAME_ARGS) \ $(VBOX_CERTIFICATE_FINGERPRINT_ARGS) \ $(VBOX_TSA_URL_ARGS) \ $(if $(strip $(2)),/d "$(strip $(2))",) \ $(3) \ $(1) \ $(if-expr "$5" == "",\ $(if-expr "$4" == "2",$$(NLTAB),$(NLTAB))$(VBOX_SIGNTOOL) \ sign /as /fd sha256 \ $(VBOX_CROSS_CERTIFICATE_SHA2_FILE_ARGS) \ $(VBOX_CERTIFICATE_SHA2_STORE_ARGS) \ $(VBOX_CERTIFICATE_SHA2_SUBJECT_NAME_ARGS) \ $(VBOX_CERTIFICATE_SHA2_FINGERPRINT_ARGS) \ $(VBOX_TSA_SHA2_URL_ARGS) \ $(if $(strip $(2)),/d "$(strip $(2))",) \ $(3) \ $(1),) else VBOX_SIGN_FILE_FN = $(VBOX_SIGNTOOL) sign \ $(VBOX_CROSS_CERTIFICATE_FILE_ARGS) \ $(VBOX_CERTIFICATE_STORE_ARGS) \ $(VBOX_CERTIFICATE_SUBJECT_NAME_ARGS) \ $(VBOX_CERTIFICATE_FINGERPRINT_ARGS) \ $(VBOX_TSA_URL_ARGS) \ $(if $(strip $(2)),/d "$(strip $(2))",) \ $(3) \ $(1) endif endif ## Sign an executable image. # @param 1 The file to sign. # @param 2 File description. Optional. # @param 3 Set to 2 if the expression will be expanded twice before chopped into commands (for _CMDS). VBOX_SIGN_IMAGE_FN ?= $(call VBOX_SIGN_FILE_FN,$(1),$(2),/ph,$(3)) ## Create a security catalog file. # @param 1 The directory containing the stuff to sign. # @param 2 The expected .cat name. (Inf2Cat lowercases it) # @param 3 The list of OSes, separated by ';'. VBOX_MAKE_CAT_HLP_FN ?= \ $(RM) -f $(2)\ $(NL)$(TAB)$(VBOX_INF2CAT) /driver:$(strip $(1)) /os:$(strip $(subst ;,$(COMMA),$(3))) /verbose \ $(NL)$(TAB)$(MV) $(2) $(2) \ $(NL)$(TAB)$(call VBOX_SIGN_FILE_FN,$(2),,,$(NL)$(TAB)) VBOX_MAKE_CAT64_FN ?= $(call VBOX_MAKE_CAT_HLP_FN,$(1),$(2),XP_X64;Server2003_X64;Vista_X64) VBOX_MAKE_CAT32_FN ?= $(call VBOX_MAKE_CAT_HLP_FN,$(1),$(2),2000;XP_X86;Server2003_X86;Vista_X86) ifeq ($(KBUILD_TARGET_ARCH),x86) VBOX_MAKE_CAT_FN ?= $(call VBOX_MAKE_CAT32_FN,$(1),$(2)) else VBOX_MAKE_CAT_FN ?= $(call VBOX_MAKE_CAT64_FN,$(1),$(2)) endif # Go nuts, sign everything. if "$(VBOX_SIGNING_MODE)" == "release" || defined(VBOX_WITH_HARDENING) ## Commands for signing an executable or a dll image after link. VBOX_SIGN_IMAGE_CMDS ?= $(if $(eq $(tool_do),LINK_LIBRARY),,$(call VBOX_SIGN_IMAGE_FN,$(out),,2)) endif ## Enable signing of the additions. VBOX_SIGN_ADDITIONS ?= 1 else ifeq ($(KBUILD_HOST),darwin) # # Darwin code signing. # # Currently release signing is done when packing. This may change later. # (Installer package signing is done elsewhere (VBOX_MACOSX_INSTALLER_SIGN).) # if defined(VBOX_CERTIFICATE_FINGERPRINT) && !defined(VBOX_CERTIFICATE_SUBJECT_NAME) VBOX_CERTIFICATE_SUBJECT_NAME = $(subst $(SP),,$(VBOX_CERTIFICATE_FINGERPRINT)) endif ifeq ($(VBOX_SIGNING_MODE),test) VBOX_CERTIFICATE_SUBJECT_NAME ?= $(error You need to set VBOX_CERTIFICATE_SUBJECT_NAME in LocalConfig.kmk.) VBOX_CERTIFICATE_SUBJECT_NAME_ARGS ?= --sign "$(VBOX_CERTIFICATE_SUBJECT_NAME)" else VBOX_CERTIFICATE_SUBJECT_NAME ?= Developer ID Application: Oracle America, Inc. VBOX_CERTIFICATE_SUBJECT_NAME_ARGS ?= --sign "$(VBOX_CERTIFICATE_SUBJECT_NAME)" endif VBOX_CODESIGN ?= codesign if 0 VBOX_DARWIN_KEXT_SIGN_FILES = CodeDirectory CodeRequirement CodeResources CodeSignature else VBOX_DARWIN_KEXT_SIGN_FILES = CodeResources endif # The above version with complicated requirements is what Xcode 5.0.1GM suggest for kexts. VBOX_SIGN_BUNDLE_FN = $(call MSG_TOOL,SIGNTOOL,,$(1),$(2))$(NLTAB)$(VBOX_CODESIGN) \ --verbose=9 \ --force \ --file-list - \ $(3) \ $(VBOX_CERTIFICATE_SUBJECT_NAME_ARGS) \ $(1) $(if $(2),--identifier "$(2)",) ## Sign a Mach-O image. # @param 1 The bundle to sign. # @param 2 Identifier, optional. VBOX_SIGN_MACHO_FN = $(call MSG_TOOL,SIGNTOOL,,$(1),$(2))$(NLTAB)$(VBOX_CODESIGN) \ --verbose=9 \ --force \ --file-list - \ $(VBOX_CERTIFICATE_SUBJECT_NAME_ARGS) \ $(1) \ $(if $(2),--identifier "$(2)",) ## Sign a VMM Mach-O image. # @param 1 The bundle to sign. # @param 2 Identifier, optional. VBOX_SIGN_VMM_MOD_FN = $(VBOX_SIGN_MACHO_FN) ## Sign a non-executable file. # @param 1 The bundle to sign. # @param 2 Identifier, optional. VBOX_SIGN_FILE_FN = $(call MSG_TOOL,SIGNTOOL,,$(1),$(2))$(NLTAB)$(VBOX_CODESIGN) \ --verbose=9 \ --force \ --file-list - \ $(VBOX_CERTIFICATE_SUBJECT_NAME_ARGS) \ $(1) \ $(if $(2),--identifier "$(2)",) ## @def VBOX_TEST_SIGN_KEXT # Adds test signing to a $1.kext target (the plist installer target). # # After both targets has been defined: # $(evalcall2 VBOX_TEST_SIGN_KEXT,VBoxDrv) # # @param 1 The kext name. Assumes there is a SYSMODS target of name $1 # as well as an .plist installer by the name of '$1.kext'. # @remarks Currently assumes only binary + Info.plist in the bundle, no # other files. Should that be requirement, add them as a list # in the 2nd parameter. # @note This is only for the 'test' signing mode, we skip this in # 'release' signing mode as to not waste time on the build boxes. ifeq ($(VBOX_SIGNING_MODE),test) ## @todo when kBuild is updated to r2742+, this should be enabled for both modes. define VBOX_TEST_SIGN_KEXT $1_INSTTYPE.darwin = none $1.kext_SOURCES += $$($1.kext_0_OUTDIR)/Contents/MacOS/$1=>MacOS/$1 \ $(foreach extfile, $(VBOX_DARWIN_KEXT_SIGN_FILES) \ , $$($1.kext_0_OUTDIR)/Contents/_CodeSignature/$(extfile)=>_CodeSignature/$(extfile)) $1.kext_SYMLINKS += $(foreach symfile, $(VBOX_DARWIN_KEXT_SIGN_SYMLINKS), $(symfile)=>_CodeSignature/$(symfile)) $1.kext_CLEAN += \ $(foreach extfile, $(VBOX_DARWIN_KEXT_SIGN_FILES) , $$($1.kext_0_OUTDIR)/Contents/_CodeSignature/$(extfile)) \ $(foreach symfile, $(VBOX_DARWIN_KEXT_SIGN_SYMLINKS), $$($1.kext_0_OUTDIR)/Contents/$(symfile)) \ $$($1.kext_0_OUTDIR)/Contents/MacOS/$1 \ $$($1.kext_0_OUTDIR)/$1.kext/Contents/_CodeSignature/ $1.kext_BLDDIRS += $$($1.kext_0_OUTDIR)/Contents/MacOS/ $$$$($1.kext_0_OUTDIR)/Contents/MacOS/$1 \ + $(foreach file,$(VBOX_DARWIN_KEXT_SIGN_FILES), $$$$($1.kext_0_OUTDIR)/Contents/_CodeSignature/$(file)): \ $$$$($1.kext_0_OUTDIR)/Contents/Info.plist $$$$($1_1_TARGET) | $$$$($1.kext_0_OUTDIR)/ $(RM) -Rf -- "$$($1.kext_0_OUTDIR)/Contents/_CodeSignature/" "$$($1.kext_0_OUTDIR)/Contents/MacOS/" $(MKDIR) -p -- "$$($1.kext_0_OUTDIR)/Contents/MacOS/" $(INSTALL) -m 644 $$($1_1_TARGET) $$($1.kext_0_OUTDIR)/Contents/MacOS/$1 $(call VBOX_SIGN_BUNDLE_FN,$$($1.kext_0_OUTDIR),org.virtualbox.app.kext.$1,) endef else VBOX_TEST_SIGN_KEXT = endif else ifeq ($(KBUILD_HOST),solaris) # # Solaris code signing. # ifeq ($(VBOX_SIGNING_MODE),test) VBOX_CERTIFICATE_FILE ?= $(error You need to set VBOX_CERTIFICATE_FILE in LocalConfig.kmk.) VBOX_TOKEN_NAME ?= $(error You need to set VBOX_TOKEN_NAME in LocalConfig.kmk.) VBOX_PIN_FILE ?= $(error You need to set VBOX_PIN_FILE in LocalConfig.kmk.) else VBOX_CERTIFICATE_FILE ?= $(PATH_ROOT)/oracle.pem VBOX_TOKEN_NAME ?= "Sun Software PKCS\#11 softtoken" VBOX_PIN_FILE ?= $(PATH_ROOT)/oracle.pin endif VBOX_CERTIFICATE_FILE_ARGS ?= -c $(VBOX_CERTIFICATE_FILE) VBOX_TOKEN_NAME_ARGS ?= -T $(VBOX_TOKEN_NAME) VBOX_PIN_ARGS ?= -P $(VBOX_PIN_FILE) VBOX_ELFSIGN ?= elfsign ## Commands for signing a driver image after link. VBOX_SIGN_DRIVER_CMDS ?= $(if $(eq $(tool_do),LINK_LIBRARY),,$(call VBOX_SIGN_ELF_FN,$(out))) # Sign an ELF image. # @param 1 The elf object file to sign. VBOX_SIGN_ELF_FN ?= $(VBOX_ELFSIGN) \ sign \ $(VBOX_CERTIFICATE_FILE_ARGS) \ $(VBOX_TOKEN_NAME_ARGS) \ $(VBOX_PIN_ARGS) \ -e $(1) else # Not Windows, Mac OS X or Solaris build host, ignore. VBOX_SIGNING_MODE := endif # # Complain if windows hardening is enabled but not code signing. # else if "$(KBUILD_TARGET)" == "win" && defined(VBOX_WITH_HARDENING) && !defined(VBOX_ONLY_BUILD) $(error You need to enable code signing for a hardened windows build to work.) endif # # Windows .inf editing. # ifeq ($(KBUILD_TARGET_ARCH),x86) VBOX_EDIT_INF_FN = $(call VBOX_EDIT_INF32_FN,$(1),$(2)) else VBOX_EDIT_INF_FN = $(call VBOX_EDIT_INF64_FN,$(1),$(2)) endif ## Edit an inf file an x86 target. # @param 1 The inf file to edit. # @param 2 The output file. VBOX_EDIT_INF32_FN = $(SED) $(if $(VBOX_SIGNING_MODE),-e 's/^;cat *//', -e '/^;cat /d') \ -e 's/^;x86 *//' \ -e '/^;amd64 /d' \ -e 's/^;edit-DriverVer.*/DriverVer = $(date-utc %m\/%d\/%Y),$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)/' \ --output $(2) \ $(1) ## Edit an inf file an x86 target. # @param 1 The inf file to edit. # @param 2 The output file. VBOX_EDIT_INF64_FN = $(SED) \ $(if $(VBOX_SIGNING_MODE),-e 's/^;cat *//', -e '/^;cat /d')\ -e 's/^;amd64 *//' \ -e '/^;x86 /d' \ -e 's/^;edit-DriverVer.*/DriverVer = $(date-utc %m\/%d\/%Y),$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)/' \ --output $(2) \ $(1) ## # Helper macro for re-signing DLL images from tools that we ship so they won't # cause trouble for the hardened build requirements. # # Invoke via $(call VBOX_RE_SIGN_DLL_FN) inside the SOURCES list. Necessary # _CLEAN entry will be added to the target. If hardening is not enabled or # we're not on windows, the source will be returned. # # @returns Name of the output file name. May have leading space, but no trailing. # @param 1 Target name. # @param 2 The source name. # @param 3 Optional prefix to avoid name collisions. # if defined(VBOX_SIGNING_MODE) && "$(KBUILD_TARGET)" == "win" VBOX_RE_SIGN_DLL_FN = $(if-expr !defined($(1)_VBOX_RE_SIGNED_$(3)$(notdir $(2))),\ $(evalcall VBOX_RE_SIGN_DLL_INTERNAL_FN,$1,$2,$3)\ ,)$($(1)_0_OUTDIR)/$(3)$(notdir $2) define VBOX_RE_SIGN_DLL_INTERNAL_FN local n = $(3)$(notdir $2) ifndef $(1)_VBOX_RE_SIGNED_$(n) $(1)_VBOX_RE_SIGNED_$(n) := 1 $(eval $(1)_CLEAN += $$($(1)_0_OUTDIR)/$(n)) $$($(1)_0_OUTDIR)/$(n): $(2) $(VBOX_VERSION_STAMP) | $$(dir $$@) $(call MSG_TOOL,SIGNTOOL,,$<,$@) $(RM) -f -- "$@" $(CP) -- "$<" "$@" $(VBOX_VCC_EDITBIN) /LargeAddressAware /DynamicBase /NxCompat /Release /IntegrityCheck \ /Version:$(VBOX_VERSION_MAJOR)0$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \ "$@" $(call VBOX_SIGN_IMAGE_FN,$@) endif endef # VBOX_RESIGN_DLL_FN else VBOX_RE_SIGN_DLL_FN = $(2) endif ## # @param VBOX_RESIGN_DLL_FN = # # File version info and description macros (ignored on most OSes). # ## # Internal macro. # # @param 1 The target name. # @param 2 The description # @param 3 Optional icon file. # @param 4 The template base name. # @param 5 Additional RC options. # # @remarks ASSUMES RCFLAGS isn't a simple variable (var := value). define VBOX_SET_VER_INFO_INTERNAL ifeq ($(KBUILD_TARGET),win) $(1)_SOURCES.win += $(PATH_ROOT)/src/VBox/Artwork/win/$(4) $(1)_RCFLAGS += /nologo /dIN_INTERNAL_NAME="\"$(1)\"" /dIN_FILE_DESCRIPTION="\"$(2)\"" \ /dIN_ORIGINAL_NAME="\"$$(notdir $$($(1)_1_INST_TARGET))\"" \ $(if $(3), /dIN_ICON_FILE="\"$(subst \\,/,$(strip $(3)))\"") $(5) $$$$($(1)_0_OUTDIR)/src/VBox/Artwork/win/$(basename $(4)).res: \ $(PATH_ROOT)/include/VBox/version.h $$$$(VBOX_VERSION_HEADER) endif endef ## # Macro for setting DLL/SO/DYLIB version information and description. # # The macro must be invoked using evalcall2 after the whole target has # been declared. # # @param 1 The target name. # @param 2 The description # @param 3 Optional icon file. VBOX_SET_VER_INFO_DLL = $(evalcall2 VBOX_SET_VER_INFO_INTERNAL,$1,$2,$3,TemplateDll.rc,) ## # Macro for setting EXE version information and description. # # The macro must be invoked using call after the whole target has been declared. # # @param 1 The target name. # @param 2 The description # @param 3 Optional icon file. VBOX_SET_VER_INFO_EXE = $(evalcall2 VBOX_SET_VER_INFO_INTERNAL,$1,$2,$3,TemplateExe.rc,) ## # Macro for setting driver version information and description. # # The macro must be invoked using call after the whole target has been declared. # # @param 1 The target name. # @param 2 The description # @param 3 Optional icon file. # @param 4 Optional VFT2_DRV_xxx define for windows. Uses VFT2_UNKNOWN by default. VBOX_SET_VER_INFO_DRV = $(evalcall2 VBOX_SET_VER_INFO_INTERNAL,$1,$2,$3,TemplateDrv.rc,$(if $(4), /dIN_FILE_SUBTYPE=$(4))) ## # Macro for setting the version information and description for a ring-0 module. # # The macro must be invoked using call after the whole target has been declared. # # @param 1 The target name. # @param 2 The description # @param 3 Optional icon file. VBOX_SET_VER_INFO_R0 = $(evalcall2 VBOX_SET_VER_INFO_INTERNAL,$1,$2,$3,TemplateR0.rc,) ## # Macro for setting the version information and description for a raw-mode context module. # # The macro must be invoked using call after the whole target has been declared. # # @param 1 The target name. # @param 2 The description # @param 3 Optional icon file. VBOX_SET_VER_INFO_RC = $(evalcall2 VBOX_SET_VER_INFO_INTERNAL,$1,$2,$3,TemplateRc.rc,) # # Adjust kBuild defaults. # kBuildGlobalDefaults_DEBUG_NOSTAGE.win = true kBuildGlobalDefaults_DEBUG_NOSTAGE.os2 = true if1of ($(KBUILD_TARGET), darwin win) kBuildGlobalDefaults_LD_DEBUG = split endif # # Haiku resource and version generation. # ifeq ($(KBUILD_HOST),haiku) VBOX_HAIKU_RCTOOL := rc VBOX_HAIKU_XRESTOOL := xres VBOX_HAIKU_SETVERSIONTOOL := setversion # XXX: install won't preserve attributes... VBOX_HAIKU_MIMESETTOOL := mimeset ## Add optional resources to the program, set its version info, and sniff its mime properties. # @param 1 The file to add resources to. # @param 2 The resource files. # @param 3 The target name. define VBOX_HAIKU_XRES_SETVER_FN $(if $(2),$(call MSG_TOOL,HaikuAddResources,$(3),$(2)) $(QUIET)$(VBOX_HAIKU_XRESTOOL) -o $(1) $(2),) $(call MSG_TOOL,HaikuSetVersion,$(3)) $(QUIET)$(VBOX_HAIKU_SETVERSIONTOOL) $(1) \ -app $(VBOX_VERSION_MAJOR) $(VBOX_VERSION_MINOR) $(VBOX_VERSION_BUILD) d $(VBOX_SVN_REV) \ -short "$(VBOX_PRODUCT)" \ -long "$(VBOX_PRODUCT) $(VBOX_VERSION_STRING) $(shell /bin/echo -e '\xC2\xA9')2009-$(VBOX_C_YEAR) $(VBOX_VENDOR)" $(call MSG_TOOL,HaikuMimeSet,$(3)) $(QUIET)$(VBOX_HAIKU_MIMESETTOOL) -f $(1) endef VBOX_HAIKU_XRES_SETVER_CMDS ?= $(if $(eq $(tool_do),LINK_PROGRAM),$(call VBOX_HAIKU_XRES_SETVER_FN,$(out),$($(target)_RSRCS),$(target)),) endif # # Default prefixes and suffixes. # VBOX_PREF_LIB = if1of ($(KBUILD_TARGET), os2 win) VBOX_SUFF_LIB = .lib else VBOX_SUFF_LIB = .a endif if1of ($(KBUILD_HOST), os2 win) VBOX_HOSTSUFF_LIB = .lib else VBOX_HOSTSUFF_LIB = .a endif VBOX_SUFF_DLL = $(SUFF_DLL) ifeq ($(KBUILD_TARGET),os2) # GXX3OMF produces out .o at the moment. VBOX_SUFF_OBJ = .o else VBOX_SUFF_OBJ = $(SUFF_OBJ) endif VBOXW32GUEST_SUFF_LIB = .lib VBOXLNX32GUEST_SUFF_LIB = .a # # SDKs for external libraries. # SDK_VBOX_LIBXML2 = . SDK_VBOX_LIBXML2_INCS ?= $(PATH_ROOT)/src/libs/libxml2-2.9.2/include SDK_VBOX_LIBXML2_DEFS ?= _REENTRANT 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 # libxml against VBoxRT SDK_VBOX_LIBPNG = . SDK_VBOX_LIBPNG_INCS ?= $(PATH_ROOT)/src/libs/libpng-1.2.54 SDK_VBOX_LIBPNG_LIBS ?= $(PATH_STAGE_LIB)/VBox-libpng$(VBOX_SUFF_LIB) SDK_VBOX_ZLIB = . if1of ($(KBUILD_TARGET), os2 solaris win) SDK_VBOX_ZLIB_INCS ?= $(PATH_ROOT)/src/libs/zlib-1.2.8 SDK_VBOX_ZLIB_LIBS ?= $(PATH_STAGE_LIB)/VBox-zlib$(VBOX_SUFF_LIB) else SDK_VBOX_ZLIB_INCS ?= SDK_VBOX_ZLIB_LIBS ?= z SDK_VBOX_ZLIB_DEFS.linux ?= _LARGEFILE64_SOURCE endif SDK_VBOX_ZLIB-x86 = . SDK_VBOX_ZLIB-x86_EXTENDS = VBOX_ZLIB if1of ($(KBUILD_TARGET), os2 solaris win) SDK_VBOX_ZLIB_LIBS-x86 ?= $(PATH_STAGE_LIB)/VBox-zlib-x86$(VBOX_SUFF_LIB) endif SDK_VBOX_ZLIB_STATIC = . SDK_VBOX_ZLIB_STATIC_EXTENDS ?= VBOX_ZLIB if1of ($(KBUILD_TARGET), os2 win) # Not required on solaris. SDK_VBOX_ZLIB_STATIC_LIBS ?= $(PATH_STAGE_LIB)/VBox-zlib-static$(VBOX_SUFF_LIB) endif SDK_VBOX_OPENSSL = Only for VBoxRT and/or statically linked programs. SDK_VBOX_OPENSSL_VBOX_DEFAULT_INCS := $(PATH_OUT)/obj/crypto-1.1.0-headers/include SDK_VBOX_OPENSSL_INCS ?= $(SDK_VBOX_OPENSSL_VBOX_DEFAULT_INCS) SDK_VBOX_OPENSSL_ORDERDEPS ?= $(crypto-headers_1_TARGET) SDK_VBOX_OPENSSL_LIBS ?= \ $(PATH_STAGE_LIB)/VBox-libssl$(VBOX_SUFF_LIB) \ $(PATH_STAGE_LIB)/VBox-libcrypto$(VBOX_SUFF_LIB) SDK_VBOX_OPENSSL-x86 = Only for VBoxRT and/or statically linked programs. SDK_VBOX_OPENSSL-x86_VBOX_DEFAULT_INCS := $(PATH_OUT)/obj/crypto-1.1.0-headers/include SDK_VBOX_OPENSSL-x86_INCS ?= $(SDK_VBOX_OPENSSL_VBOX_DEFAULT_INCS) SDK_VBOX_OPENSSL-x86_ORDERDEPS ?= $(crypto-headers_1_TARGET) SDK_VBOX_OPENSSL-x86_LIBS ?= \ $(PATH_STAGE_LIB)/VBox-libssl-x86$(VBOX_SUFF_LIB) \ $(PATH_STAGE_LIB)/VBox-libcrypto-x86$(VBOX_SUFF_LIB) SDK_VBOX_OPENSSL2 = What you should be using. SDK_VBOX_OPENSSL2_EXTENDS = VBOX_OPENSSL if "$(SDK_VBOX_OPENSSL_INCS)" == "$(SDK_VBOX_OPENSSL_VBOX_DEFAULT_INCS)" SDK_VBOX_OPENSSL2_LIBS = $(NO_SUCH_VARIABLE) endif ifdef VBOX_WITH_LIBCURL SDK_VBOX_LIBCURL = . SDK_VBOX_LIBCURL_INCS ?= $(PATH_ROOT)/src/libs/curl-7.50.3/include SDK_VBOX_LIBCURL_LIBS ?= $(PATH_STAGE_LIB)/VBox-libcurl$(VBOX_SUFF_LIB) SDK_VBOX_LIBCURL_DEFS ?= BUILDING_LIBCURL SDK_VBOX_LIBCURL-x86 = . SDK_VBOX_LIBCURL-x86_INCS ?= $(PATH_ROOT)/src/libs/curl-7.50.3/include SDK_VBOX_LIBCURL-x86_LIBS.x86 ?= $(PATH_STAGE_LIB)/VBox-libcurl-x86$(VBOX_SUFF_LIB) SDK_VBOX_LIBCURL-x86_DEFS ?= BUILDING_LIBCURL endif SDK_VBOX_VPX = . SDK_VBOX_VPX_DEFAULT_INCS := $(PATH_ROOT)/src/libs/libvpx SDK_VBOX_VPX_INCS ?= $(SDK_VBOX_VPX_DEFAULT_INCS) SDK_VBOX_VPX_LIBS ?= $(PATH_STAGE_LIB)/VBox-libvpx$(VBOX_SUFF_LIB) # # Special SDK for the problematic NTDLL.LIB. # SDK_VBOX_NTDLL = Mini NTDLL import library, required IPRT. SDK_VBOX_NTDLL_LIBS.x86 ?= $(PATH_STAGE_LIB)/RuntimeR3NtDll-x86.lib SDK_VBOX_NTDLL_LIBS.amd64 ?= $(PATH_STAGE_LIB)/RuntimeR3NtDll-amd64.lib # # The linux kernel headers(/sources). # if1of ($(KBUILD_TARGET), linux) ifeq ($(origin VBOX_LINUX_SRC),undefined) 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 else export VBOX_LINUX_SRC := /usr/src/linux endif endif ifneq ($(VBOX_LINUX_SRC),) ifeq ($(origin VBOX_LINUX_INCS),undefined) export VBOX_LINUX_INCS := $(VBOX_LINUX_SRC)/include # XXX hack alert! Support split Linux kernels (make O=). kernelpath points to # the obj directory while VBOX_LINUX_SRC points to the virgin source directory. # XXX put this crap elsewhere kernelpath := $(shell $(SED_EXT) -ne 's+^KERNELSRC.*= *\(.*\)+\1+p' $(VBOX_LINUX_SRC)/Makefile) ifeq ($(kernelpath),) # Linux >= 2.6.25 kernelpath := $(shell $(SED_EXT) -ne 's+^MAKEARGS *:= *-C *\(\S*\).*+\1+p' $(VBOX_LINUX_SRC)/Makefile) endif ifneq ($(kernelpath),) # absolute path? ifneq ($(patsubst /%,,$(kernelpath)),) # no, relative path kernelpath := $(realpath $(VBOX_LINUX_SRC)/$(kernelpath)) endif endif ifneq ($(kernelpath),) VBOX_LINUX_INCS += $(VBOX_LINUX_SRC)/include2 $(kernelpath)/include else kernelpath := $(VBOX_LINUX_SRC) endif # VBOX_LINUX_INCS += $(kernelpath)/include/asm-i386/mach-default \ $(kernelpath)/include/asm-x86/mach-default \ $(kernelpath)/include/drm \ $(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 \ $(kernelpath)/include endif endif # Since Linux 2.6.15, is included like this. It cannot hurt to do the # same for older Linux kernels ifneq ($(wildcard $(kernelpath)/include/linux/kconfig.h),) # Linux >= 3.1 export VBOX_LINUX_INCLUDE := -include $(kernelpath)/include/linux/kconfig.h else ifneq ($(wildcard $(VBOX_LINUX_SRC)/include/generated/autoconf.h),) # Linux >= 2.6.33 export VBOX_LINUX_INCLUDE := -include $(VBOX_LINUX_SRC)/include/generated/autoconf.h else ifneq ($(wildcard $(VBOX_LINUX_SRC)/include/linux/autoconf.h),) # Linux < 2.6.33 export VBOX_LINUX_INCLUDE := -include $(VBOX_LINUX_SRC)/include/linux/autoconf.h endif endif # # Determine Solaris version. # ifeq ($(KBUILD_TARGET),solaris) VBOX_SOLARIS_VERSION := $(expr $(KBUILD_HOST_VERSION_MAJOR) * 100 + $(KBUILD_HOST_VERSION_MINOR)) ifeq ($(VBOX_SOLARIS_VERSION),510) DEFS.solaris += RT_OS_SOLARIS_10 # Solaris 10 does not include crossbow. VBOX_SOLARIS_10 = 1 # We cannot compile additions on Solaris 10, due kernel interface deps VBOX_WITHOUT_ADDITIONS := 1 VBOX_WITH_ADDITIONS = else ifeq ($(VBOX_SOLARIS_VERSION),511) # OSS audio support for Solaris VBOX_WITH_AUDIO_OSS := $(if-expr $(VBOX_SOLARIS_11_VERSION) >= 115,1,) endif # XPCOM namespace cleanup issue with Solaris GCC 4.5.2 and newer, see @bugref{5838}. if $(VBOX_GCC_VERSION_CXX) >= 40502 VBOX_WITH_XPCOM_NAMESPACE_CLEANUP = endif endif # # VBoxTpG tool. # TOOL_VBoxTpG = The VirtualBox Tracepoint Generator TOOL_VBoxTpG_DTRACE_DEPORD = $(VBOX_VBOXTPG) TOOL_VBoxTpG_DTRACE_HDR_FLAGS := \ $(if-expr $(intersects $(KBUILD_TARGET_ARCH),$(KBUILD_ARCHES_64)),-64,-32) \ -h --host-$(VBOX_HC_ARCH_BITS)-bit #-vvv define TOOL_VBoxTpG_DTRACE_HDR_CMDS $(QUIET)$(VBOX_VBOXTPG) $(flags) -o "$(out)" -s "$(source)" endef TOOL_VBoxTpG_DTRACE_OBJ_NOT_NEEDED := TOOL_VBoxTpG_DTRACE_OBJ_FLAGS := -G --host-$(VBOX_HC_ARCH_BITS)-bit #-vvv define TOOL_VBoxTpG_DTRACE_OBJ_CMDS $(QUIET)$(VBOX_VBOXTPG) \ $(if-expr $(intersects $(bld_trg_arch),$(KBUILD_ARCHES_64)),-64,-32) \ $(flags) \ -o "$(out)" -s "$(source)" endef # # VBoxTpG tool - Disabled, only generate the header. # TOOL_VBoxTpG-Disabled = The VirtualBox Tracepoint Generator, disabled. TOOL_VBoxTpG-Disabled_DTRACE_DEPORD = $(VBOX_VBOXTPG) TOOL_VBoxTpG-Disabled_DTRACE_HDR_FLAGS := -h define TOOL_VBoxTpG-Disabled_DTRACE_HDR_CMDS $(QUIET)$(VBOX_VBOXTPG) $(flags) -o "$(out)" -s "$(source)" endef TOOL_VBoxTpG-Disabled_DTRACE_OBJ_NOT_NEEDED := $(KBUILD_OSES) # # dtrace+VBoxTpG tool for ring-3 to ring-0 pointer conversion. # TOOL_DTraceAndVBoxTpG = DTrace and the VirtualBox Tracepoint Generator working together on static ring-3 probes. TOOL_DTraceAndVBoxTpG_EXTENDS = StandardDTrace TOOL_DTraceAndVBoxTpG_DTRACE_DEPORD = $(VBOX_VBOXTPG) TOOL_DTraceAndVBoxTpG_DTRACE_HDR_CMDS = define TOOL_DTraceAndVBoxTpG_DTRACE_HDR_CMDS $(TOOL_StandardDTrace_DTRACE_HDR_CMDS) $(QUIET)$(VBOX_VBOXTPG) --generate-wrapper-header --host-$(VBOX_HC_ARCH_BITS)-bit --ring-3-context \ $(filter-out -C, $(filter-out -h,$(flags))) \ -o "$(out).tmp" -s "$(source)" $(APPEND) "$(out).tmp" $(SED) -e 's/\(#define.*\)(arg0/\1_ORIGINAL(arg0/' --append "$(out).tmp" "$(out)" $(MV) -f -- "$(out).tmp" "$(out)" endef TOOL_DTraceAndVBoxTpG_DTRACE_OBJ_NOT_NEEDED = $(TOOL_StandardDTrace_DTRACE_OBJ_NOT_NEEDED) TOOL_DTraceAndVBoxTpG_DTRACE_OBJ_CMDS = $(TOOL_StandardDTrace_DTRACE_OBJ_CMDS) ifdef VBOX_WITH_RAW_MODE # # Template for building RC things. # # Disabled Visual C++ warnings: # -wd4505: 'iemRaisePageFaultJmp' : unreferenced local function has been removed # TEMPLATE_VBoxRc = VBox Raw-Mode Context TEMPLATE_VBoxRc_ASTOOL = $(VBOX_ASTOOL) TEMPLATE_VBoxRc_ASFLAGS = $(VBOX_ASFLAGS32) TEMPLATE_VBoxRc_DEFS = IN_RC IPRT_NO_CRT RT_WITH_NOCRT_ALIASES $(ARCH_BITS_DEFS) TEMPLATE_VBoxRc_INCS = $(PATH_ROOT)/include/iprt/nocrt TEMPLATE_VBoxRc_SYSSUFF = .rc TEMPLATE_VBoxRc_BLD_TRG_ARCH = x86 TEMPLATE_VBoxRc_MODE = a+r,u+w TEMPLATE_VBoxRc_USES += dtrace TEMPLATE_VBoxRc_DTRACE_HDR_FLAGS = --raw-mode-context TEMPLATE_VBoxRc_DTRACE_OBJ_FLAGS = --raw-mode-context --probe-fn-name "VMMRCProbeFire" ifdef VBOX_WITH_DTRACE_RC TEMPLATE_VBoxRc_DTRACETOOL = VBoxTpG TEMPLATE_VBoxRc_DEFS += VBOX_WITH_DTRACE VBOX_WITH_DTRACE_RC else TEMPLATE_VBoxRc_DTRACETOOL = VBoxTpG-Disabled endif ifeq ($(VBOX_LDR_FMT32),pe) TEMPLATE_VBoxRc_TOOL = $(VBOX_VCC_TOOL_STEM)X86 TEMPLATE_VBoxRc_RCDEFS = VBOX_SVN_REV=$(VBOX_SVN_REV) VBOX_SVN_REV_MOD_5K=$(expr $(VBOX_SVN_REV) % 50000) TEMPLATE_VBoxRc_CXXFLAGS = -Zi -Zl -GR- -EHs- -GF -GS- -Zc:wchar_t- -Gs8192 $(VBOX_VCC_GC_OPT) $(VBOX_VCC_GC_FP) \ $(VBOX_VCC_WARN_ALL) -wd4505 $(VBOX_VCC_WERR) TEMPLATE_VBoxRc_CFLAGS = $(TEMPLATE_VBoxRc_CXXFLAGS) TEMPLATE_VBoxRc_LDFLAGS = -Ignore:4197 \ -Driver -Subsystem:NATIVE -Incremental:NO -Align:64 -MapInfo:Exports -NoD $(VBOX_VCC_LD_WERR) -Release -Debug -Opt:Ref -Opt:Icf \ -Version:$(VBOX_VERSION_MAJOR)0$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \ -Stub:$(PATH_ROOT)/src/VBox/HostDrivers/Support/win/winstub.com ifdef VBOX_SIGNING_MODE TEMPLATE_VBoxRc_LDFLAGS += -IntegrityCheck endif TEMPLATE_VBoxRc_LIBS = \ $(PATH_SDK_$(VBOX_WINDDK)_LIB.x86)/int64.lib TEMPLATE_VBoxRc_LIBS += \ $(PATH_STAGE_LIB)/RuntimeRCStub$(VBOX_SUFF_LIB) TEMPLATE_VBoxRc_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS) endif # pe ifeq ($(VBOX_LDR_FMT32),elf) TEMPLATE_VBoxRc_TOOL = $(VBOX_GCC32_TOOL) TEMPLATE_VBoxRc_CXXFLAGS = -fno-pie -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 $(VBOX_GCC_IPRT_FMT_CHECK) TEMPLATE_VBoxRc_CFLAGS = -fno-pie -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) $(VBOX_GCC_IPRT_FMT_CHECK) ifeq ($(KBUILD_TARGET),solaris) TEMPLATE_VBoxRc_LDFLAGS = -r else TEMPLATE_VBoxRc_LDFLAGS = -nostdlib -Bsymbolic -g ## @todo WTF doesn't the globals work? Debug info is supposed to be split everywhere. GRR TEMPLATE_VBoxRc_LD_DEBUG = split endif ifn1of ($(KBUILD_TARGET), solaris freebsd) TEMPLATE_VBoxRc_LIBS = \ $(VBOX_GCC32_LIBGCC) # intrinsics endif if1of ($(KBUILD_TARGET),linux) TEMPLATE_VBoxRc_POST_CMDS = $(if $(eq $(tool_do),LINK_SYSMOD),if readelf -S $(out)|grep -q "[cd]tors"; then echo "Found ctors/dtors in $(out)!"; exit 1; fi) endif endif ifeq ($(VBOX_LDR_FMT32),macho) TEMPLATE_VBoxRc_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBoxRc_DEFS += $(VBOX_DARWIN_DEF_SDK_DEFS) 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 = $(VBOX_DARWIN_DEF_SDK_LDFLAGS) -m32 -nostdlib #TEMPLATE_VBoxRc_LDFLAGS.release = -Wl,-S ??? endif ifeq ($(VBOX_LDR_FMT32),lx) TEMPLATE_VBoxRc_TOOL = GXX3OMF 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 TEMPLATE_VBoxRc_LDFLAGS = -Zdll -nostdlib TEMPLATE_VBoxRc_LIBS = \ $(VBOX_GCC32_LIBGCC) \ $(VBOX_OBJ_SYS0) \ end endif # # Template for building a RC ring-3 testcase (tstVMStructGC, tstDevStructGC). # TEMPLATE_VBoxRcExe = VBox Raw-Mode as ring-3 testcase TEMPLATE_VBoxRcExe_EXTENDS = VBoxRc TEMPLATE_VBoxRcExe_DEFS = $(filter-out IPRT_NO_CRT RT_WITH_NOCRT_ALIASES,$(TEMPLATE_VBoxRc_DEFS)) TEMPLATE_VBoxRcExe_INCS = $(NO_SUCH_VARIABLE) TEMPLATE_VBoxRcExe_MODE = $(NO_SUCH_VARIABLE) ifeq ($(VBOX_LDR_FMT32),pe) TEMPLATE_VBoxRcExe_LDFLAGS = -Ignore:4197 \ -Incremental:NO -MapInfo:Exports -NoD -Debug -Opt:Ref -Opt:Icf \ -Version:$(VBOX_VERSION_MAJOR)0$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \ -Stub:$(PATH_ROOT)/src/VBox/HostDrivers/Support/win/winstub.com TEMPLATE_VBoxRcExe_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) TEMPLATE_VBoxRcExe_LIBS = \ $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)X86_LIB)/libcmt.lib \ $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)X86_LIB)/oldnames.lib endif ifeq ($(VBOX_LDR_FMT32),elf) TEMPLATE_VBoxRcExe_CFLAGS = $(filter-out -nostdinc,$(TEMPLATE_VBoxRc_CFLAGS)) -O0 TEMPLATE_VBoxRcExe_CXXFLAGS = $(filter-out -nostdinc,$(TEMPLATE_VBoxRc_CXXFLAGS)) -O0 TEMPLATE_VBoxRcExe_LDFLAGS = -g TEMPLATE_VBoxRcExe_LDFLAGS.dbgopt = -g TEMPLATE_VBoxRcExe_LDFLAGS.strict = -g TEMPLATE_VBoxRcExe_LDFLAGS.release = -g if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), freebsd.amd64) # The FreeBSD port of gcc isn't picking up -m32 where it should. 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_VBoxRcExe_LIBS.$(KBUILD_TARGET) = /usr/lib32/crtend.o /usr/lib32/crtn.o /usr/lib32/libc.so endif endif ifeq ($(VBOX_LDR_FMT32),macho) TEMPLATE_VBoxRcExe_CFLAGS = $(filter-out -static -nostdinc,$(TEMPLATE_VBoxRc_CFLAGS)) TEMPLATE_VBoxRcExe_CXXFLAGS = $(filter-out -static -nostdinc,$(TEMPLATE_VBoxRc_CXXFLAGS)) TEMPLATE_VBoxRcExe_LDFLAGS = -g -m32 endif ifeq ($(VBOX_LDR_FMT32),lx) TEMPLATE_VBoxRcExe_CFLAGS = $(filter-out -nostdinc,$(TEMPLATE_VBoxRc_CFLAGS)) TEMPLATE_VBoxRcExe_CXXFLAGS = $(filter-out -nostdinc,$(TEMPLATE_VBoxRc_CXXFLAGS)) TEMPLATE_VBoxRcExe_LDFLAGS = -g TEMPLATE_VBoxRcExe_LIBS = $(NO_SUCH_VARIABLE) endif endif # VBOX_WITH_RAW_MODE # # Template for building R0 things. # # Disabled Visual C++ warnings: # -wd4505: 'iemRaisePageFaultJmp' : unreferenced local function has been removed # TEMPLATE_VBoxR0 = VBox Ring 0 TEMPLATE_VBoxR0_ASTOOL = $(VBOX_ASTOOL) TEMPLATE_VBoxR0_ASFLAGS = $(VBOX_ASFLAGS) 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_SYSSUFF = .r0 TEMPLATE_VBoxR0_MODE = a+r,u+w TEMPLATE_VBoxR0_USES += dtrace TEMPLATE_VBoxR0_DTRACE_HDR_FLAGS = --ring-0-context-agnostic TEMPLATE_VBoxR0_DTRACE_OBJ_FLAGS = --ring-0-context-agnostic ifdef VBOX_WITH_DTRACE_R0 TEMPLATE_VBoxR0_DTRACETOOL = VBoxTpG TEMPLATE_VBoxR0_DEFS += VBOX_WITH_DTRACE VBOX_WITH_DTRACE_R0 else TEMPLATE_VBoxR0_DTRACETOOL = VBoxTpG-Disabled endif ifeq ($(VBOX_LDR_FMT),pe) TEMPLATE_VBoxR0_TOOL = $(VBOX_VCC_TOOL) TEMPLATE_VBoxR0_RCDEFS = VBOX_SVN_REV=$(VBOX_SVN_REV) VBOX_SVN_REV_MOD_5K=$(expr $(VBOX_SVN_REV) % 50000) TEMPLATE_VBoxR0_CXXFLAGS = -Zi -Zl -GR- -EHs- -GF -GS- -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP) \ $(VBOX_VCC_WARN_ALL) -wd4505 $(VBOX_VCC_WERR) TEMPLATE_VBoxR0_CFLAGS = $(TEMPLATE_VBoxR0_CXXFLAGS) TEMPLATE_VBoxR0_LDFLAGS = -Ignore:4197 \ -Driver -Subsystem:NATIVE -Incremental:NO -Align:4096 -MapInfo:Exports -NoD $(VBOX_VCC_LD_WERR) -Release -Debug -Opt:Ref -Opt:Icf \ -Version:$(VBOX_VERSION_MAJOR)0$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \ -Stub:$(PATH_ROOT)/src/VBox/HostDrivers/Support/win/winstub.com ifdef VBOX_WITH_DTRACE_R0 TEMPLATE_VBoxR0_LDFLAGS += -Merge:VTGPrLc.Data=VTGPrLc.Begin -Merge:VTGPrLc.End=VTGPrLc.Begin -Merge:VTGPrLc.Begin=VTGObj endif ifdef VBOX_SIGNING_MODE TEMPLATE_VBoxR0_LDFLAGS += -IntegrityCheck endif TEMPLATE_VBoxR0_LIBS = \ $(PATH_STAGE_LIB)/RuntimeR0Stub$(VBOX_SUFF_LIB) include $(KBUILD_PATH)/sdks/$(VBOX_WINDDK).kmk ## TODO: Add a kBuild feature for loading SDKs. TEMPLATE_VBoxR0_LIBS.x86 = \ $(PATH_SDK_$(VBOX_WINDDK)_LIB.x86)/int64.lib TEMPLATE_VBoxR0_POST_CMDS = $(VBOX_SIGN_DRIVER_CMDS) endif # pe ifeq ($(VBOX_LDR_FMT),elf) TEMPLATE_VBoxR0_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBoxR0_CFLAGS = -fno-pie -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 $(VBOX_GCC_IPRT_FMT_CHECK) TEMPLATE_VBoxR0_CXXFLAGS = -fno-pie -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 $(VBOX_GCC_IPRT_FMT_CHECK) 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 ifeq ($(KBUILD_TARGET),solaris) TEMPLATE_VBoxR0_LDFLAGS = -r TEMPLATE_VBoxR0_LDFLAGS.solaris = -u _init -u _info TEMPLATE_VBoxR0_LIBS.solaris = \ $(PATH_STAGE_LIB)/RuntimeR0Stub$(VBOX_SUFF_LIB) ifdef VBOX_GCC_USING_SOLARIS_AS TEMPLATE_VBoxR0_CFLAGS.amd64 += -Wa,-xmodel=kernel TEMPLATE_VBoxR0_CXXFLAGS.amd64 += -Wa,-xmodel=kernel endif # Solaris driver signing. TEMPLATE_VBoxR0_POST_CMDS = $(VBOX_SIGN_DRIVER_CMDS) else TEMPLATE_VBoxR0_LDFLAGS = -nostdlib -Bsymbolic -g ## @todo WTF doesn't the globals work? Debug info is supposed to be split everywhere. GRR TEMPLATE_VBoxR0_LD_DEBUG = split endif ifn1of ($(KBUILD_TARGET),solaris freebsd) TEMPLATE_VBoxR0_LIBS = \ $(VBOX_GCC_LIBGCC) # intrinsics endif if1of ($(KBUILD_TARGET),linux) TEMPLATE_VBoxR0_POST_CMDS = $(if $(eq $(tool_do),LINK_SYSMOD),if readelf -S $(out)|grep -q "[cd]tors"; then echo "Found ctors/dtors in $(out)!"; exit 1; fi) endif endif ifeq ($(VBOX_LDR_FMT),macho) TEMPLATE_VBoxR0_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBoxR0_DEFS += $(VBOX_DARWIN_DEF_SDK_DEFS) 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 \ -mno-sse -mno-mmx -mno-sse2 -mno-3dnow $(VBOX_GCC_fno-stack-protector) 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 \ -mno-sse -mno-mmx -mno-sse2 -mno-3dnow $(VBOX_GCC_fno-stack-protector) 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 = $(VBOX_DARWIN_DEF_SDK_LDFLAGS) -nostdlib #TEMPLATE_VBoxR0_LDFLAGS.release = -Wl,-S ??? TEMPLATE_VBoxR0_LDFLAGS.amd64 = -m64 -static TEMPLATE_VBoxR0_LDFLAGS.x86 = -m32 endif ifeq ($(VBOX_LDR_FMT),lx) TEMPLATE_VBoxR0_TOOL = GXX3OMF 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_VBoxR0_LDFLAGS = -nostdlib -Zdll TEMPLATE_VBoxR0_LIBS = \ $(VBOX_GCC_LIBGCC) \ $(VBOX_OBJ_SYS0) \ end endif # # Template for building SUPDRV R0 things. # # Disabled Visual C++ warnings: # -wd4996: deprecated / insecure. # -wd4127: conditional expression is constant [level 4] # -wd4201: nonstandard extension used : nameless struct/union [level 4] # -wd4214: nonstandard extension used : bit field types other than int [level 4] # -wd4706: assignment within conditional expression [level 4] # -wd4324: '_TDI_PNP_CONTEXT_XP' : structure was padded due to __declspec(align()) # # -wd4100: 'identifier' : unreferenced formal parameter [level 4] --- TODO: Enable this one! # TEMPLATE_VBOXR0DRV = VBox SUPDRV Ring 0 TEMPLATE_VBOXR0DRV_ASTOOL = $(VBOX_ASTOOL) TEMPLATE_VBOXR0DRV_ASFLAGS = $(VBOX_ASFLAGS) TEMPLATE_VBOXR0DRV_DEFS = IN_RING0 IN_RT_R0 $(ARCH_BITS_DEFS) TEMPLATE_VBOXR0DRV_USES += dtrace ifdef VBOX_WITH_DTRACE_R0DRV TEMPLATE_VBOXR0DRV_DTRACETOOL = VBoxTpG TEMPLATE_VBOXR0DRV_DEFS += VBOX_WITH_DTRACE VBOX_WITH_DTRACE_R0DRV ifdef VBOX_WITH_NATIVE_DTRACE TEMPLATE_VBOXR0DRV_DEFS += VBOX_WITH_NATIVE_DTRACE endif else TEMPLATE_VBOXR0DRV_DTRACETOOL = VBoxTpG-Disabled endif ifeq ($(KBUILD_TARGET),win) TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_VCC_TOOL) TEMPLATE_VBOXR0DRV_RCDEFS = VBOX_SVN_REV=$(VBOX_SVN_REV) VBOX_SVN_REV_MOD_5K=$(expr $(VBOX_SVN_REV) % 50000) TEMPLATE_VBOXR0DRV_DEFS.x86 = _X86_ TEMPLATE_VBOXR0DRV_DEFS.x86 += NO_INTERLOCKED_INTRINSICS # Avoids intrisic VC/WDK trouble 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 -GS- -Zc:wchar_t- $(VBOX_VCC_FP) -Gs4096 $(VBOX_VCC_OPT) \ $(VBOX_VCC_WARN_ALL) $(VBOX_VCC_WERR) TEMPLATE_VBOXR0DRV_CFLAGS = $(TEMPLATE_VBOXR0DRV_CXXFLAGS) TEMPLATE_VBOXR0DRV_LDFLAGS = -Ignore:4197 \ -Driver -Subsystem:NATIVE -Incremental:NO -Align:4096 -MapInfo:Exports -NoD -Release -Debug -Opt:Ref -Opt:Icf \ -Version:$(VBOX_VERSION_MAJOR)0$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \ -Stub:$(PATH_ROOT)/src/VBox/HostDrivers/Support/win/winstub.com ifdef VBOX_WITH_DTRACE_R0DRV TEMPLATE_VBOXR0DRV_LDFLAGS += -Merge:VTGPrLc.Data=VTGPrLc.Begin -Merge:VTGPrLc.End=VTGPrLc.Begin -Merge:VTGPrLc.Begin=VTGObj endif ifdef VBOX_SIGNING_MODE TEMPLATE_VBOXR0DRV_LDFLAGS += -IntegrityCheck endif TEMPLATE_VBOXR0DRV_POST_CMDS = $(VBOX_SIGN_DRIVER_CMDS) endif ifeq ($(KBUILD_TARGET),linux) TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBOXR0DRV_INSTTYPE.linux = none TEMPLATE_VBOXR0DRV_DEFS += __KERNEL__ MODULE TEMPLATE_VBOXR0DRV_INCS = $(VBOX_LINUX_INCS) TEMPLATE_VBOXR0DRV_CFLAGS = -fno-pie -nostdinc -iwithprefix include $(VBOX_LINUX_INCLUDE) \ $(VBOX_GCC_WARN) -Wstrict-prototypes $(VBOX_GCC_Wno-pointer-sign) -Wno-sign-compare $(VBOX_GCC_fdiagnostics-show-option) \ $(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 = -mpreferred-stack-boundary=2 -msoft-float TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow \ -fno-reorder-blocks -ffreestanding -fno-asynchronous-unwind-tables -funit-at-a-time -Wno-sign-compare TEMPLATE_VBOXR0DRV_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wno-pointer-sign -ffreestanding -Werror-implicit-function-declaration,$(TEMPLATE_VBOXR0DRV_CFLAGS) $(TEMPLATE_VBOXR0DRV_CFLAGS.$(KBUILD_TARGET_ARCH))) -fno-exceptions -fno-rtti ifndef VBOX_LINUX_VERSION_2_4 # 2.6 TEMPLATE_VBOXR0DRV_SYSSUFF = .ko TEMPLATE_VBOXR0DRV_LDFLAGS.x86 = -m elf_i386 -r TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -m elf_x86_64 -r else # 2.4 TEMPLATE_VBOXR0DRV_SYSSUFF = .o TEMPLATE_VBOXR0DRV_LDFLAGS = -r -s endif endif ifeq ($(KBUILD_TARGET),os2) TEMPLATE_VBOXR0DRV_TOOL = GXX3OMF 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_LIBS = $(VBOX_GCC_LIBGCC) # wlink thinks physdevice doesn't need fixups and should have a stack - stupid! TEMPLATE_VBOXR0DRV_LDFLAGS = -Zlinker Option -Zlinker internalrelocs, -Zlinker togglerelocs endif ifeq ($(KBUILD_TARGET),darwin) TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBOXR0DRV_DEFS += $(VBOX_DARWIN_DEF_SDK_DEFS) KERNEL KERNEL_PRIVATE DRIVER_PRIVATE APPLE NeXT ifdef VBOX_WITH_NEW_XCODE # Note xcode uses -fstrict-aliasing, we currently don't dare... We also add -mno-red-zone. TEMPLATE_VBOXR0DRV_INCS += \ $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/Kernel.framework/PrivateHeaders \ $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/Kernel.framework/Headers ## @todo try use VBOX_GCC_PEDANTIC_CXX # -Wno-c++11-extensions -Wno-c99-extensions -Wno-extra-semi -Wno-zero-length-array TEMPLATE_VBOXR0DRV_CXXFLAGS = $(VBOX_DARWIN_DEF_SDK_CXXFLAGS) -mkernel \ -g $(VBOX_GCC_pipe) $(VBOX_GCC_PEDANTIC_CXX) -Wno-long-long $(VBOX_GCC_fdiagnostics-show-option) \ -Wno-c++11-extensions -Wno-c99-extensions -Wno-extra-semi -Wno-zero-length-array \ -Wno-gnu-zero-variadic-macro-arguments -Wno-four-char-constants \ -fno-common -nostdinc -fno-builtin $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) \ -fno-exceptions -msoft-float -fapple-kext -fno-rtti -mkernel \ -fmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -Wnon-modular-include-in-framework-module \ -Werror=non-modular-include-in-framework-module \ $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fasm-blocks -fno-strict-aliasing -stdlib=libc++ # also used by xcode 6.2: \ # -Werror=return-type \ # -Werror=deprecated-objc-isa-usage \ # -Werror=objc-root-class \ # -Wno-missing-field-initializers -Wno-missing-prototypes -Wunreachable-code \ # -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function \ # -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body \ # -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants \ # -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion \ # -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -Wdeprecated-declarations -Winvalid-offsetof -Wno-sign-conversion TEMPLATE_VBOXR0DRV_CXXFLAGS.amd64 = -m64 -mno-red-zone TEMPLATE_VBOXR0DRV_CXXFLAGS.x86 = -m32 TEMPLATE_VBOXR0DRV_CFLAGS = $(VBOX_DARWIN_DEF_SDK_CFLAGS) -mkernel \ -g $(VBOX_GCC_pipe) $(VBOX_GCC_PEDANTIC_C) -Wno-long-long $(VBOX_GCC_fdiagnostics-show-option) \ -fno-common -nostdinc -fno-builtin $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) \ -fno-exceptions -msoft-float -fapple-kext -fno-rtti \ -fmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -Wnon-modular-include-in-framework-module \ -Werror=non-modular-include-in-framework-module \ $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fasm-blocks -fno-strict-aliasing TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 -mno-red-zone TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 if 1 TEMPLATE_VBOXR0DRV_CFLAGS += $(VBOX_GCC_WERR) TEMPLATE_VBOXR0DRV_CXXFLAGS += $(VBOX_GCC_WERR) endif TEMPLATE_VBOXR0DRV_LDFLAGS = $(filter-out $(VBOX_DARWIN_NO_COMPACT_LINKEDIT),$(VBOX_DARWIN_DEF_SDK_LDFLAGS)) \ -nostdlib -stdlib=libc++ -Wl,-kext -Wl,-keep_private_externs TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -m64 TEMPLATE_VBOXR0DRV_LDFLAGS.x86 = -m32 TEMPLATE_VBOXR0DRV_LIBS = kmodc++ kmod cc_kext else TEMPLATE_VBOXR0DRV_INCS += \ $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/Kernel.framework/PrivateHeaders \ $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/Kernel.framework/Headers ## @todo try use VBOX_GCC_PEDANTIC_CXX TEMPLATE_VBOXR0DRV_CXXFLAGS = $(VBOX_DARWIN_DEF_SDK_CXXFLAGS) \ -g $(VBOX_GCC_pipe) $(VBOX_GCC_WARN) -Wno-long-long $(VBOX_GCC_fdiagnostics-show-option) \ -fno-common -nostdinc -fno-builtin -finline $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) \ -fno-keep-inline-functions -fno-exceptions -msoft-float \ -fapple-kext -fno-rtti -fcheck-new -force_cpusubtype_ALL \ $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fasm-blocks TEMPLATE_VBOXR0DRV_CXXFLAGS.amd64 = -m64 -mkernel -mno-red-zone -gdwarf-2 TEMPLATE_VBOXR0DRV_CXXFLAGS.x86 = -m32 -static TEMPLATE_VBOXR0DRV_CFLAGS = $(VBOX_DARWIN_DEF_SDK_CFLAGS) \ -g $(VBOX_GCC_pipe) $(VBOX_GCC_WARN) -Wno-long-long -fno-common -nostdinc -fno-builtin -finline \ -fno-keep-inline-functions -fno-exceptions $(VBOX_GCC_fvisibility-hidden) -msoft-float \ -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations \ -Werror-implicit-function-declaration -force_cpusubtype_ALL \ $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fasm-blocks 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)) \ -nostdlib -Wl,-kext,-new_linker -Wl,-Y,1455 -keep_private_extern TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -m64 TEMPLATE_VBOXR0DRV_LDFLAGS.x86 = -m32 TEMPLATE_VBOXR0DRV_LIBS = kmodc++ kmod cc_kext cpp_kext $(VBOX_GCC_LIBGCC) endif endif ifeq ($(KBUILD_TARGET),solaris) ## The Solaris /usr/platform/i86pc/include and /usr/include directories. VBOX_SOLARIS_SYS_INCS ?= /usr/platform/i86pc/include /usr/include TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBOXR0DRV_DEFS += _MACHDEP _KERNEL _STRICT_STDC TEMPLATE_VBOXR0DRV_INCS = $(VBOX_SOLARIS_SYS_INCS) TEMPLATE_VBOXR0DRV_LDFLAGS = -r -dy TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = $(if $(eq $(KBUILD_HOST),solaris),-64,-m elf_x86_64) # Exclude -Wall because of solaris headers' pragma ident warnings that gcc refuses to supress. TEMPLATE_VBOXR0DRV_CFLAGS = -Wpointer-arith -Winline $(VBOX_GCC_Wno-pointer-sign) \ -Wmissing-prototypes -Wstrict-prototypes $(VBOX_GCC_fdiagnostics-show-option) \ -Wshadow -Wuninitialized -Wunused-function -Wunused-label -Wunused-value -Wunused-variable \ -Wformat -Wimplicit-int -Wimplicit-function-declaration -Werror-implicit-function-declaration -Wparentheses \ -O2 -fno-omit-frame-pointer -ffreestanding -nodefaultlibs -fno-strict-aliasing -fno-common -std=c99 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,) \ -fno-reorder-blocks -fno-asynchronous-unwind-tables -funit-at-a-time TEMPLATE_VBOXR0DRV_CXXFLAGS = -Wpointer-arith -Winline \ -Wshadow -Wuninitialized -Wunused-function -Wunused-label -Wunused-value -Wunused-variable \ -Wformat \ -O2 -nodefaultlibs -fno-omit-frame-pointer -fno-strict-aliasing -fno-common -fno-exceptions -fno-rtti TEMPLATE_VBOXR0DRV_CXXFLAGS.x86 = $(TEMPLATE_VBOXR0DRV_CFLAGS.x86) TEMPLATE_VBOXR0DRV_CXXFLAGS.amd64 = $(TEMPLATE_VBOXR0DRV_CFLAGS.amd64) TEMPLATE_VBOXR0DRV_POST_CMDS = $(VBOX_SIGN_DRIVER_CMDS) endif # Solaris ifeq ($(KBUILD_TARGET),freebsd) # x86 FreeBSD (6.2 or something): # cc -O2 -fno-strict-aliasing -pipe -Werror -D_KERNEL -DKLD_MODULE \ # -nostdinc -I- -I. -I@ -I@/contrib/altq -I@/../include -I/usr/include \ # -finline-limit=8000 -fno-common -mno-align-long-strings -mpreferred-stack-boundary=2 \ # -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -ffreestanding -Wall -Wredundant-decls -Wnested-externs \ # -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -fformat-extensions \ # -std=c99 -c ../my.c # ld -d -warn-common -r -d -o my.kld my.o # :> export_syms # awk -f /usr/src/sys/modules/my/../../conf/kmod_syms.awk my.kld export_syms | xargs -J% objcopy % my.kld # ld -Bsharable -d warn-commnon -o my.ko my.kld # # AMD64 FreeBSD (7.1): # 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 \ # -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx \ # -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -ffreestanding \ # -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign \ # -fformat-extensions -c /usr/src/sys/modules/my/../../dev/my/if_my.c # ld -d -warn-common -r -d -o if_my.ko if_my.o # :> export_syms # awk -f /usr/src/sys/modules/my/../../conf/kmod_syms.awk if_my.ko export_syms | xargs -J% objcopy % if_my.ko # Note: @ -> /usr/src/sys and machine -> /usr/src/sys/i386/include ## The location of the FreeBSD kernel source. VBOX_FREEBSD_SRC ?= /usr/src/sys ## The FreeBSD /usr/include. VBOX_FREEBSD_SYS_INCS ?= /usr/include TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBOXR0DRV_LDTOOL = FREEBSDKMODLD TEMPLATE_VBOXR0DRV_DEFS += _KERNEL KLD_MODULE TEMPLATE_VBOXR0DRV_INCS = \ $(VBOX_FREEBSD_SRC) \ $(VBOX_FREEBSD_SRC)/contrib/altq \ $(VBOX_FREEBSD_SRC)/../include \ $(VBOX_FREEBSD_SYS_INCS) # omitting: -Wcast-qual, -Wredundant-decls TEMPLATE_VBOXR0DRV_CFLAGS = \ $(VBOX_GCC_WARN) -Wpointer-arith -Winline $(VBOX_GCC_Wno-pointer-sign) $(VBOX_GCC_fdiagnostics-show-option) \ -Wstrict-prototypes -Wmissing-prototypes -Wstrict-prototypes \ -Wimplicit-function-declaration -Werror-implicit-function-declaration \ -O2 -ffreestanding -fno-strict-aliasing -fno-common -finline-limit=8000 \ $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \ -nostdinc -std=c99 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 \ -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx \ -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -Wundef TEMPLATE_VBOXR0DRV_CXXFLAGS = -fno-exceptions -fno-rtti \ $(VBOX_GCC_WARN) -Wpointer-arith -Winline \ -O2 -fno-strict-aliasing -fno-common -finline-limit=8000 \ $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \ -nostdinc TEMPLATE_VBOXR0DRV_CXXFLAGS.x86 = $(TEMPLATE_VBOXR0DRV_CFLAGS.x86) TEMPLATE_VBOXR0DRV_CXXFLAGS.amd64 = $(TEMPLATE_VBOXR0DRV_CFLAGS.amd64) TEMPLATE_VBOXR0DRV_SYSSUFF = .ko TEMPLATE_VBOXR0DRV_LDFLAGS = -d --warn-common TEMPLATE_VBOXR0DRV_LDFLAGS.x86 = -m elf_i386_fbsd TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -m elf_x86_64_fbsd TOOL_FREEBSDKMODLD = FreeBSD kernel module linker. # See kBuild/tools/GCC3.kmk for docs. TOOL_FREEBSDKMODLD_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map TOOL_FREEBSDKMODLD_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) TOOL_FREEBSDKMODLD_LINK_SYSMOD_DEPORD = ifeq ($(KBUILD_TARGET_ARCH),amd64) TOOL_FREEBSDKMODLD_LINK_SYSMOD_OUTPUT = define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS # Link intermediate .kld (a relocatable object). ld $(flags) -r -o $(out) $(objs) \ $(foreach p,$(libpath), -L$(p))\ $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) # Strip non-exported symbols private and localize the exported ones. awk -f $(VBOX_FREEBSD_SRC)/conf/kmod_syms.awk $(out) $(if $(othersrc), $(othersrc),/dev/null) \ | xargs -J% objcopy % $(out) ## Strip debug info (comment out if debugging or something). objcopy --strip-debug $(out) endef else # x86 TOOL_FREEBSDKMODLD_LINK_SYSMOD_OUTPUT = $(outbase).kld define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS # Link intermediate .kld (a relocatable object). ld $(flags) -r -o $(outbase).kld $(objs) \ $(foreach p,$(libpath), -L$(p))\ $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib))) # Strip non-exported symbols private and localize the exported ones. awk -f $(VBOX_FREEBSD_SRC)/conf/kmod_syms.awk $(outbase).kld $(if $(othersrc), $(othersrc),/dev/null) \ | xargs -J% objcopy % $(outbase).kld # Link the final .ko (a shared object). ld $(flags) -Bshareable -o $(out) $(outbase).kld endef endif # x86 endif # FreeBSD ifeq ($(KBUILD_TARGET),netbsd) # The location of the NetBSD sources. VBOX_NETBSD_SRC ?= /usr/src # NetBSD uses "i386" for 32-bit, "x86" for common 32- and 64-bit code. ifeq ($(KBUILD_TARGET_ARCH),amd64) VBOX_NETBSD_TARGET_ARCH=amd64 else VBOX_NETBSD_TARGET_ARCH=i386 endif VBOX_NETBSD_TARGET_SRC=$(VBOX_NETBSD_SRC)/sys/arch/$(VBOX_NETBSD_TARGET_ARCH) TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBOXR0DRV_DEFS += _KERNEL _MODULE TEMPLATE_VBOXR0DRV_INCS = \ $(VBOX_NETBSD_SRC)/sys \ $(VBOX_NETBSD_SRC)/common/include \ $(PATH_OBJ)/netbsd/include TEMPLATE_VBOXR0DRV_CFLAGS = \ $(VBOX_GCC_WARN) -Wpointer-arith -Winline $(VBOX_GCC_Wno-pointer-sign) \ $(VBOX_GCC_fdiagnostics-show-option) \ -Wstrict-prototypes -Wmissing-prototypes -Wstrict-prototypes \ -Wimplicit-function-declaration -Werror-implicit-function-declaration \ -O2 -ffreestanding -fno-strict-aliasing -fno-common -finline-limit=8000 \ $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \ -nostdinc -std=c99 -msoft-float TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 \ -mpreferred-stack-boundary=2 -mno-mmx -mno-sse -mno-avx \ -mno-fp-ret-in-387 TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 --param inline-unit-growth=100 \ --param large-function-growth=1000 -fno-omit-frame-pointer \ -mcmodel=kernel -mno-red-zone -mno-sse -mno-mmx -mno-avx \ -fno-asynchronous-unwind-tables -mno-fp-ret-in-387 TEMPLATE_VBOXR0DRV_CXXFLAGS = -fno-exceptions -fno-rtti \ $(VBOX_GCC_WARN) -Wpointer-arith -Winline \ -O2 -fno-strict-aliasing -fno-common -finline-limit=8000 \ $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \ -nostdinc -msoft-float TEMPLATE_VBOXR0DRV_CXXFLAGS.x86 = $(TEMPLATE_VBOXR0DRV_CFLAGS.x86) TEMPLATE_VBOXR0DRV_CXXFLAGS.amd64 = $(TEMPLATE_VBOXR0DRV_CFLAGS.amd64) TEMPLATE_VBOXR0DRV_SYSSUFF = .kmod TEMPLATE_VBOXR0DRV_LDFLAGS = -d --warn-common TEMPLATE_VBOXR0DRV_LDFLAGS.x86 = -m elf_i386 TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -m elf_x86_64 # symlink kernel includes TEMPLATE_VBOXR0DRV_ORDERDEPS += \ $(PATH_OBJ)/netbsd/include/$(VBOX_NETBSD_TARGET_ARCH) \ $(PATH_OBJ)/netbsd/include/x86 \ $(PATH_OBJ)/netbsd/include/machine $$(PATH_OBJ)/netbsd/include/$(VBOX_NETBSD_TARGET_ARCH): $(QUIET)$(MKDIR) -p $(@D) $(QUIET)$(LN_SYMLINK) $(VBOX_NETBSD_TARGET_SRC)/include $@ $$(PATH_OBJ)/netbsd/include/x86: $(QUIET)$(MKDIR) -p $(@D) $(QUIET)$(LN_SYMLINK) $(VBOX_NETBSD_SRC)/sys/arch/x86/include $@ $$(PATH_OBJ)/netbsd/include/machine: $(QUIET)$(MKDIR) -p $(@D) $(QUIET)$(LN_SYMLINK) $(VBOX_NETBSD_TARGET_ARCH) $@ endif # NetBSD ifeq ($(KBUILD_TARGET),haiku) ## The Haiku include directories VBOX_HAIKU_SYS_INCS ?= /boot/develop/headers/os/kernel /boot/develop/headers/os/drivers TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBOXR0DRV_LDTOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBOXR0DRV_DEFS = _KERNEL_MODE=1 _STRICT_STDC IN_RING0 IN_RT_R0 TEMPLATE_VBOXR0DRV_INCS = $(VBOX_HAIKU_SYS_INCS) #TODO: sort this out TEMPLATE_VBOXR0DRV_LDFLAGS = -shared -no-undefined -dc -dy -lroot -rpath-link /boot/system/develop/lib/x86 --no-add-needed /boot/system/develop/lib/_KERNEL_ --no-add-needed /boot/system/develop/lib/haiku_version_glue.o TEMPLATE_VBOXR0DRV_CFLAGS = -fno-PIC \ $(VBOX_GCC_WARN) -Wstrict-prototypes $(VBOX_GCC_Wno-pointer-sign) -Wno-sign-compare \ $(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 \ -fno-reorder-blocks -ffreestanding -fno-asynchronous-unwind-tables -funit-at-a-time \ -Wno-sign-compare TEMPLATE_VBOXR0DRV_CXXFLAGS = -fno-PIC -Wpointer-arith \ -Wshadow -Wuninitialized -Wunused-function -Wunused-label -Wunused-value -Wunused-variable \ -Wformat \ -O2 -nodefaultlibs -fno-omit-frame-pointer -fno-strict-aliasing -fno-common -fno-exceptions -fno-rtti TEMPLATE_VBOXR0DRV_CXXFLAGS.x86 = $(TEMPLATE_VBOXR0DRV_CFLAGS.x86) -fno-exceptions -fno-rtti TEMPLATE_VBOXR0DRV_CXXFLAGS.amd64 = $(TEMPLATE_VBOXR0DRV_CFLAGS.amd64) -fno-exceptions -fno-rtti endif # Haiku ifdef VBOX_WITH_VBOXDRV ifndef TEMPLATE_VBOXR0DRV_TOOL $(warning Warning: VBox Build: Target $(KBUILD_HOST) is not officially supported!) endif endif ifn1of ($(KBUILD_TARGET), darwin os2 win solaris) # This doesn't work if supdrv is natively loading VMMR0.r0 et al, but # fortunately it isn't really necessary. TEMPLATE_VBOXR0DRV_CFLAGS += -include $(PATH_ROOT)/include/VBox/SUPDrvMangling.h TEMPLATE_VBOXR0DRV_CXXFLAGS += -include $(PATH_ROOT)/include/VBox/SUPDrvMangling.h endif # # Template for building libraries used by ring-0 drivers. # TEMPLATE_VBoxR0DrvLib = VBox Ring 0 Driver Library TEMPLATE_VBoxR0DrvLib_EXTENDS = VBOXR0DRV TEMPLATE_VBoxR0DrvLib_INSTTYPE = stage TEMPLATE_VBoxR0DrvLib_INSTTYPE.linux = stage # # Template for building R3 executables and static libraries which are linked into executables. # Note! This is the base template for a whole lot of other ones, so be careful when changing it. # # Disabled Visual C++ warnings: # -wd4065: switch statement contains 'default' but no 'case' labels # -wd4244: 'conversion' conversion from 'type1' to 'type2', possible loss of data # -wd4996: deprecated / insecure. # TEMPLATE_VBOXR3EXE = VBox Ring 3 Exe TEMPLATE_VBOXR3EXE_ASTOOL = $(VBOX_ASTOOL) TEMPLATE_VBOXR3EXE_ASFLAGS.x86 = $(VBOX_ASFLAGS32) TEMPLATE_VBOXR3EXE_ASFLAGS.amd64 = $(VBOX_ASFLAGS64) TEMPLATE_VBOXR3EXE_DEFS = IN_RING3 $(ARCH_BITS_DEFS) TEMPLATE_VBOXR3EXE_DEFS.win = _CRT_SECURE_NO_DEPRECATE TEMPLATE_VBOXR3EXE_USES = dtrace if defined(VBOX_WITH_DTRACE_R3) && defined(VBOX_WITH_NATIVE_DTRACE) TEMPLATE_VBOXR3EXE_DTRACETOOL = DTraceAndVBoxTpG TEMPLATE_VBOXR3EXE_DTRACE_OBJ_FLAGS = -C TEMPLATE_VBOXR3EXE_DTRACE_HDR_FLAGS = -C TEMPLATE_VBOXR3EXE_DEFS += VBOX_WITH_DTRACE VBOX_WITH_DTRACE_R3 VBOX_WITH_NATIVE_DTRACE else TEMPLATE_VBOXR3EXE_DTRACE_HDR_FLAGS = --ring-3-context TEMPLATE_VBOXR3EXE_DTRACE_OBJ_FLAGS = --ring-3-context --pic --probe-fn-imported --probe-fn-name "SUPTracerFireProbe" if defined(VBOX_WITH_DTRACE_R3) TEMPLATE_VBOXR3EXE_DTRACETOOL = VBoxTpG TEMPLATE_VBOXR3EXE_DEFS += VBOX_WITH_DTRACE VBOX_WITH_DTRACE_R3 else TEMPLATE_VBOXR3EXE_DTRACETOOL = VBoxTpG-Disabled endif endif TEMPLATE_VBOXR3EXE_LIBS.kprofile = $(LIB_KPROFILE) ifeq ($(KBUILD_TARGET),win) # TEMPLATE_VBOXR3EXE_TOOL = $(VBOX_VCC_TOOL) TEMPLATE_VBOXR3EXE_TOOL.win.x86 = $(VBOX_VCC_TOOL_STEM)X86 TEMPLATE_VBOXR3EXE_TOOL.win.amd64 = $(VBOX_VCC_TOOL_STEM)AMD64 TEMPLATE_VBOXR3EXE_RCDEFS = VBOX_SVN_REV=$(VBOX_SVN_REV) VBOX_SVN_REV_MOD_5K=$(expr $(VBOX_SVN_REV) % 50000) TEMPLATE_VBOXR3EXE_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) TEMPLATE_VBOXR3EXE_CXXFLAGS = -Zi -Zl -GR- -EHsc -GF -MD$(VBOX_VCC_CRT_TYPE) -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP) \ $(VBOX_VCC_WARN_ALL) $(VBOX_VCC_WERR) TEMPLATE_VBOXR3EXE_CXXFLAGS.debug = -RTCsu TEMPLATE_VBOXR3EXE_CXXFLAGS.dbgopt = $(NO_SUCH_VARIABLE) TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = -Gh -GH TEMPLATE_VBOXR3EXE_CFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) TEMPLATE_VBOXR3EXE_CFLAGS.debug = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.debug) TEMPLATE_VBOXR3EXE_CFLAGS.dbgopt = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.dbgopt) TEMPLATE_VBOXR3EXE_CFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile) TEMPLATE_VBOXR3EXE_LDFLAGS = -Ignore:4197 \ /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LargeAddressAware /DynamicBase /NxCompat /Release /Debug /Opt:Ref /Opt:Icf \ /Version:$(VBOX_VERSION_MAJOR)0$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \ /STUB:$(PATH_ROOT)/src/VBox/HostDrivers/Support/win/winstub.com \ /DISALLOWLIB:libc.lib \ /DISALLOWLIB:libcd.lib \ /DISALLOWLIB:libcmt.lib \ /DISALLOWLIB:libcmtd.lib \ /DISALLOWLIB:msvcrt$(VBOX_VCC_CRT_TYPE_N).lib \ /DISALLOWLIB:msvcprt$(VBOX_VCC_CRT_TYPE_N).lib ifdef VBOX_WITH_DTRACE_R3 TEMPLATE_VBOXR3EXE_LDFLAGS += -Merge:VTGPrLc.Data=VTGPrLc.Begin -Merge:VTGPrLc.End=VTGPrLc.Begin -Merge:VTGPrLc.Begin=VTGObj endif if defined(VBOX_SIGNING_MODE) && defined(VBOX_WITH_HARDENING) TEMPLATE_VBOXR3EXE_LDFLAGS += -IntegrityCheck endif TEMPLATE_VBOXR3EXE_LIBS.x86 = \ $(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.x86)_LIB)/oldnames.lib TEMPLATE_VBOXR3EXE_LIBS.amd64 = \ $(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 \ $(PATH_TOOL_$(TEMPLATE_VBOXR3EXE_TOOL.win.amd64)_LIB)/oldnames.lib TEMPLATE_VBOXR3EXE_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS) if defined(VBOX_WITH_MORE_NT4_COMPAT_BINARIES) && "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.x86" TEMPLATE_VBOXR3EXE_POST_CMDS.win.x86 = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION) $(out)$$(NLTAB)$(TEMPLATE_VBOXR3EXE_POST_CMDS)) TEMPLATE_VBOXR3EXE_LNK_DEPS.win.x86 = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION)) TEMPLATE_VBOXR3EXE_LDFLAGS.win.x86 = \ -Include:_vcc100_kernel32_fakes_cpp \ -Include:_vcc100_kernel32_fakes_asm TEMPLATE_VBOXR3EXE_LIBS.win.x86 = \ $(PATH_STAGE_LIB)/RuntimeR3VccTricks2$(VBOX_SUFF_LIB) TEMPLATE_VBOXR3EXE_LIBS.x86 = \ $(PATH_TOOL_$(TEMPLATE_VBOXR3EXE_TOOL.win.x86)_LIB)/oldnames.lib \ $(PATH_TOOL_$(TEMPLATE_VBOXR3EXE_TOOL.win.x86)_LIB)/libcmt$(VBOX_VCC_CRT_TYPE).lib \ $(PATH_TOOL_$(TEMPLATE_VBOXR3EXE_TOOL.win.x86)_LIB)/libcpmt$(VBOX_VCC_CRT_TYPE).lib endif else # the gcc guys TEMPLATE_VBOXR3EXE_TOOL = $(VBOX_GCC_TOOL) 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) $(VBOX_GCC_IPRT_FMT_CHECK) ifdef VBOX_WITH_NO_GCC_WARNING_POLICY TEMPLATE_VBOXR3EXE_CXXFLAGS += $(VBOX_GCC_WERR) endif TEMPLATE_VBOXR3EXE_CXXFLAGS.x86 = -m32 TEMPLATE_VBOXR3EXE_CXXFLAGS.amd64 = -m64 TEMPLATE_VBOXR3EXE_CXXFLAGS.sparc32 = -m32 TEMPLATE_VBOXR3EXE_CXXFLAGS.sparc64 = -m64 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) $(VBOX_GCC_IPRT_FMT_CHECK) ifdef VBOX_WITH_NO_GCC_WARNING_POLICY TEMPLATE_VBOXR3EXE_CFLAGS += $(VBOX_GCC_WERR) endif TEMPLATE_VBOXR3EXE_CFLAGS.x86 = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.x86) TEMPLATE_VBOXR3EXE_CFLAGS.amd64 = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.amd64) TEMPLATE_VBOXR3EXE_CFLAGS.sparc32 = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.sparc32) TEMPLATE_VBOXR3EXE_CFLAGS.sparc64 = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.sparc64) TEMPLATE_VBOXR3EXE_CFLAGS.debug = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.debug) TEMPLATE_VBOXR3EXE_CFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile) TEMPLATE_VBOXR3EXE_OBJCFLAGS = $(TEMPLATE_VBOXR3EXE_CFLAGS) TEMPLATE_VBOXR3EXE_OBJCFLAGS.x86 = $(TEMPLATE_VBOXR3EXE_CFLAGS.x86) TEMPLATE_VBOXR3EXE_OBJCFLAGS.amd64 = $(TEMPLATE_VBOXR3EXE_CFLAGS.amd64) TEMPLATE_VBOXR3EXE_OBJCFLAGS.debug = $(TEMPLATE_VBOXR3EXE_CFLAGS.debug) TEMPLATE_VBOXR3EXE_OBJCFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CFLAGS.kprofile) TEMPLATE_VBOXR3EXE_OBJCXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) TEMPLATE_VBOXR3EXE_OBJCXXFLAGS.x86 = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.x86) TEMPLATE_VBOXR3EXE_OBJCXXFLAGS.amd64 = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.amd64) TEMPLATE_VBOXR3EXE_OBJCXXFLAGS.debug = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.debug) TEMPLATE_VBOXR3EXE_OBJCXXFLAGS.kprofile= $(TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile) TEMPLATE_VBOXR3EXE_LDFLAGS.x86 = -m32 TEMPLATE_VBOXR3EXE_LDFLAGS.amd64 = -m64 TEMPLATE_VBOXR3EXE_LDFLAGS.sparc32 = -m32 TEMPLATE_VBOXR3EXE_LDFLAGS.sparc64 = -m64 TEMPLATE_VBOXR3EXE_LDFLAGS.linux = -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed) TEMPLATE_VBOXR3EXE_LDFLAGS.solaris = -Wl,-z,ignore # same as VBOX_LD_as_needed ifeq ($(KBUILD_TARGET),linux) TEMPLATE_VBOXR3EXE_LIBS = pthread m rt dl else ifeq ($(KBUILD_TARGET),os2) TEMPLATE_VBOXR3EXE_TOOL = GXX3OMF TEMPLATE_VBOXR3EXE_LIBS = socket iconv else ifeq ($(KBUILD_TARGET),darwin) TEMPLATE_VBOXR3EXE_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBOXR3EXE_LIBS = 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 ifdef VBOX_WITH_DTRACE_R3 TEMPLATE_VBOXR3EXE_CXXFLAGS := $(filter-out -pedantic,$(TEMPLATE_VBOXR3EXE_CXXFLAGS)) -fdollars-in-identifiers # annoying gcc option precedence. endif else ifeq ($(KBUILD_TARGET),haiku) TEMPLATE_VBOXR3EXE_TOOL = GXX3 TEMPLATE_VBOXR3EXE_POST_CMDS = $(VBOX_HAIKU_XRES_SETVER_CMDS) TEMPLATE_VBOXR3EXE_LIBS = network iconv stdc++ supc++ TEMPLATE_VBOXR3EXE_LIBPATH += \ /boot/common/lib # Haiku uses PIC by default... TEMPLATE_VBOXR3EXE_CFLAGS += -fno-pic TEMPLATE_VBOXR3EXE_CXXFLAGS += -fno-pic TEMPLATE_VBOXR3EXE_LDFLAGS += -fno-pic else if1of ($(KBUILD_TARGET), freebsd openbsd) TEMPLATE_VBOXR3EXE_TOOL = GXX3 TEMPLATE_VBOXR3EXE_LIBS = pthread TEMPLATE_VBOXR3EXE_INCS += \ /usr/include \ /usr/X11R6/include \ /usr/local/include TEMPLATE_VBOXR3EXE_LIBPATH += \ /usr/lib \ /usr/X11R6/lib \ /usr/local/lib else ifeq ($(KBUILD_TARGET),netbsd) TEMPLATE_VBOXR3EXE_TOOL = GXX3 TEMPLATE_VBOXR3EXE_LIBS = pthread TEMPLATE_VBOXR3EXE_INCS += \ /usr/include \ /usr/X11R7/include TEMPLATE_VBOXR3EXE_LIBPATH += \ /usr/lib \ /usr/X11R7/lib else ifeq ($(KBUILD_TARGET),solaris) TEMPLATE_VBOXR3EXE_TOOL = GXX3PLAIN TEMPLATE_VBOXR3EXE_DEFS += LIBICONV_PLUG _REENTRANT # Avoid the GNU libiconv, for now at least. TEMPLATE_VBOXR3EXE_LIBS = rt socket else $(warning Warning: VBOX Build: Target $(KBUILD_TARGET) is not officially supported!) TEMPLATE_VBOXR3EXE_CXXFLAGS.profile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.release) TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.krelease) endif ifdef VBOX_WITH_RUNPATH TEMPLATE_VBOXR3EXE_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' else ifdef VBOX_WITH_RELATIVE_RUNPATH TEMPLATE_VBOXR3EXE_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)' endif ifdef VBOX_WITH_ORIGIN TEMPLATE_VBOXR3EXE_LDFLAGS.linux += $(VBOX_GCC_ORIGIN_OPT) endif endif # # Template for building R3 shared objects / DLLs. # This is mostly identical to the VBOXR3EXE template. (Avoid PIC if possible!) # - TEMPLATE_VBOXR3 = VBox Ring 3 SO/DLLs TEMPLATE_VBOXR3_EXTENDS = VBOXR3EXE TEMPLATE_VBOXR3_DEFS.darwin = $(TEMPLATE_VBOXR3EXE_DEFS.darwin) PIC TEMPLATE_VBOXR3_LDFLAGS.darwin = $(TEMPLATE_VBOXR3EXE_LDFLAGS.darwin) \ -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \ -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) ifn1of ($(KBUILD_TARGET), darwin win os2) TEMPLATE_VBOXR3_DEFS = $(TEMPLATE_VBOXR3EXE_DEFS) PIC TEMPLATE_VBOXR3_CFLAGS = $(TEMPLATE_VBOXR3EXE_CFLAGS) -fPIC TEMPLATE_VBOXR3_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) -fPIC TEMPLATE_VBOXR3_LDFLAGS = $(TEMPLATE_VBOXR3EXE_LDFLAGS) -fPIC endif ifeq ($(KBUILD_TARGET),haiku) # Haiku uses PIC by default... TEMPLATE_VBOXR3_CFLAGS = $(TEMPLATE_VBOXR3EXE_CFLAGS) -fno-pic TEMPLATE_VBOXR3_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) -fno-pic TEMPLATE_VBOXR3_LDFLAGS = $(TEMPLATE_VBOXR3EXE_LDFLAGS) -fno-pic endif # # Temporary: Renaming the template and warnings will be errors ("soon"). # TEMPLATE_VBoxR3Dll += VBox ring-3 SO/DLLs, no warnings TEMPLATE_VBoxR3Dll_EXTENDS += VBOXR3 TEMPLATE_VBoxR3Dll_EXTENDS_BY += appending ifeq ($(KBUILD_TARGET),win) TEMPLATE_VBoxR3Dll_CFLAGS += $(VBOX_VCC_WERR) TEMPLATE_VBoxR3Dll_CXXFLAGS += $(VBOX_VCC_WERR) TEMPLATE_VBoxR3Dll_LDFLAGS += $(VBOX_VCC_LD_WERR) else TEMPLATE_VBoxR3Dll_CFLAGS += $(VBOX_GCC_WERR) TEMPLATE_VBoxR3Dll_CXXFLAGS += $(VBOX_GCC_WERR) endif # x86 edition of the above template for use on AMD64 targets. TEMPLATE_VBoxR3Dll-x86 = 32-bit VBox ring-3 SO/DLLs, no warnings TEMPLATE_VBoxR3Dll-x86_EXTENDS = VBoxR3Dll TEMPLATE_VBoxR3Dll-x86_BLD_TRG_ARCH = x86 TEMPLATE_VBoxR3Dll-x86_DEFS = $(filter-out HC_ARCH_BITS%,$(TEMPLATE_VBoxR3Dll_DEFS)) \ HC_ARCH_BITS=32 ARCH_BITS=32 ifeq ($(KBUILD_TARGET),solaris) ifdef VBOX_WITH_RUNPATH TEMPLATE_VBoxR3Dll-x86_LDFLAGS = \ $(filter-out '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)',$(TEMPLATE_VBoxR3Dll_LDFLAGS)) \ '$(VBOX_GCC_RPATH_OPT)$(VBOX_PATH_APP_PRIVATE)' \ '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' endif endif # # Template for building performance critical stuff with warnings-as-errors. # TEMPLATE_VBoxR3DllNoPic = VBox ring-3 SO/DLLs without PIC, without warnings. TEMPLATE_VBoxR3DllNoPic_EXTENDS = VBOXR3 if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), linux.x86 freebsd.x86) TEMPLATE_VBoxR3DllNoPic_DEFS = $(TEMPLATE_VBOXR3EXE_DEFS) TEMPLATE_VBoxR3DllNoPic_CFLAGS = $(TEMPLATE_VBOXR3EXE_CFLAGS) $(VBOX_GCC_WERR) TEMPLATE_VBoxR3DllNoPic_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) $(VBOX_GCC_WERR) TEMPLATE_VBoxR3DllNoPic_LDFLAGS = $(TEMPLATE_VBOXR3EXE_LDFLAGS) else ifeq ($(KBUILD_TARGET),win) TEMPLATE_VBoxR3DllNoPic_CFLAGS = $(filter-out -W3 -wd%,$(TEMPLATE_VBOXR3_CFLAGS)) $(VBOX_VCC_WARN_ALL) $(VBOX_VCC_WERR) TEMPLATE_VBoxR3DllNoPic_CFLAGS.debug = $(filter-out -RTC%,$(TEMPLATE_VBOXR3_CFLAGS.debug)) TEMPLATE_VBoxR3DllNoPic_CFLAGS.release = $(TEMPLATE_VBOXR3_CFLAGS.release) -GS- TEMPLATE_VBoxR3DllNoPic_CXXFLAGS = $(filter-out -W3 -wd%,$(TEMPLATE_VBOXR3_CXXFLAGS)) $(VBOX_VCC_WARN_ALL) $(VBOX_VCC_WERR) TEMPLATE_VBoxR3DllNoPic_CXXFLAGS.debug = $(filter-out -RTC%,$(TEMPLATE_VBOXR3_CXXFLAGS.debug)) # RTCsu Prevents IEM opt. TEMPLATE_VBoxR3DllNoPic_CXXFLAGS.release = $(TEMPLATE_VBOXR3_CXXFLAGS.release) -GS- TEMPLATE_VBoxR3DllNoPic_LDFLAGS = $(TEMPLATE_VBOXR3_LDFLAGS) $(VBOX_VCC_LD_WERR) else TEMPLATE_VBoxR3DllNoPic_CFLAGS = $(TEMPLATE_VBOXR3_CFLAGS) $(VBOX_GCC_WERR) TEMPLATE_VBoxR3DllNoPic_CXXFLAGS = $(TEMPLATE_VBOXR3_CXXFLAGS) $(VBOX_GCC_WERR) endif # x86 edition of the above template for use on AMD64 targets. TEMPLATE_VBoxR3DllNoPic-x86 = 32-bit VBox ring-3 SO/DLLs without PIC, without warnings. TEMPLATE_VBoxR3DllNoPic-x86_EXTENDS = VBoxR3DllNoPic TEMPLATE_VBoxR3DllNoPic-x86_BLD_TRG_ARCH = x86 TEMPLATE_VBoxR3DllNoPic-x86_DEFS = $(filter-out HC_ARCH_BITS%,$(TEMPLATE_VBoxR3DllNoPic_DEFS)) \ HC_ARCH_BITS=32 ARCH_BITS=32 # # Template for building performance critical stuff without warnings-as-errors. # TEMPLATE_VBoxR3DllWarnNoPic = VBox ring-3 SO/DLLs without PIC, with warnings. TEMPLATE_VBoxR3DllWarnNoPic_EXTENDS = VBOXR3 if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), linux.x86 freebsd.x86) TEMPLATE_VBoxR3DllWarnNoPic_DEFS = $(TEMPLATE_VBOXR3EXE_DEFS) TEMPLATE_VBoxR3DllWarnNoPic_CFLAGS = $(TEMPLATE_VBOXR3EXE_CFLAGS) TEMPLATE_VBoxR3DllWarnNoPic_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) TEMPLATE_VBoxR3DllWarnNoPic_LDFLAGS = $(TEMPLATE_VBOXR3EXE_LDFLAGS) else ifeq ($(KBUILD_TARGET),win) TEMPLATE_VBoxR3DllWarnNoPic_CFLAGS.release = $(TEMPLATE_VBOXR3_CFLAGS.release) -GS- TEMPLATE_VBoxR3DllWarnNoPic_CXXFLAGS.release = $(TEMPLATE_VBOXR3_CXXFLAGS.release) -GS- endif # # Template for building static R3 executables and any static # libraries they link with. # TEMPLATE_VBOXR3STATIC = VBox Static Ring 3 EXE TEMPLATE_VBOXR3STATIC_EXTENDS = VBOXR3EXE TEMPLATE_VBOXR3STATIC_DEFS = IN_RT_STATIC IN_RT_R3 IN_SUP_STATIC $(TEMPLATE_VBOXR3EXE_DEFS) ifeq ($(KBUILD_TARGET),win) 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 TEMPLATE_VBOXR3STATIC_LIBS.x86 = \ $(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.x86)_LIB)/oldnames.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 TEMPLATE_VBOXR3STATIC_LIBS.amd64 = \ $(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 \ $(PATH_TOOL_$(TEMPLATE_VBOXR3STATIC_TOOL.win.amd64)_LIB)/oldnames.lib else ifn1of ($(KBUILD_TARGET), darwin linux solaris) # The gcc guys sans darwin, linux and solaris (don't depend on statically compiled system libs there) TEMPLATE_VBOXR3STATIC_CFLAGS = $(TEMPLATE_VBOXR3EXE_CFLAGS) -static TEMPLATE_VBOXR3STATIC_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) -static TEMPLATE_VBOXR3STATIC_OBJCFLAGS = $(TEMPLATE_VBOXR3EXE_OBJCFLAGS) -static TEMPLATE_VBOXR3STATIC_OBJCXXFLAGS = $(TEMPLATE_VBOXR3EXE_OBJCXXFLAGS) -static TEMPLATE_VBOXR3STATIC_LDFLAGS = $(TEMPLATE_VBOXR3EXE_LDFLAGS) -static else ifeq ($(KBUILD_TARGET),solaris) TEMPLATE_VBOXR3STATIC_LIBS = $(TEMPLATE_VBOXR3EXE_LIBS) nsl TEMPLATE_VBOXR3STATIC_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)',$(TEMPLATE_VBOXR3EXE_LDFLAGS)) else TEMPLATE_VBOXR3STATIC_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)',$(TEMPLATE_VBOXR3EXE_LDFLAGS)) endif # # Temporary: Renaming the template and warnings will be errors (soon). # Unlike VBOXR3STATIC, this is strict wrt warnings and includes IPRT. # TEMPLATE_VBoxR3Static = New name for VBOXR3STATIC TEMPLATE_VBoxR3Static_EXTENDS = VBOXR3STATIC TEMPLATE_VBoxR3Static_EXTENDS_BY = appending TEMPLATE_VBoxR3Static_SDKS += VBOX_OPENSSL TEMPLATE_VBoxR3Static_SDKS.win += VBOX_NTDLL ifeq ($(KBUILD_TARGET),win) TEMPLATE_VBoxR3Static_CFLAGS += $(VBOX_VCC_WERR) TEMPLATE_VBoxR3Static_CXXFLAGS += $(VBOX_VCC_WERR) TEMPLATE_VBoxR3Static_LDFLAGS += $(VBOX_VCC_LD_WERR) else TEMPLATE_VBoxR3Static_CFLAGS += $(VBOX_GCC_WERR) TEMPLATE_VBoxR3Static_CXXFLAGS += $(VBOX_GCC_WERR) endif TEMPLATE_VBoxR3Static_LIBS += \ $(VBOX_LIB_RUNTIME_STATIC) ifndef SDK_VBOX_OPENSSL_LIBS TEMPLATE_VBoxR3Static_LIBS += \ $(PATH_STAGE_LIB)/VBox-libcrypto$(VBOX_SUFF_LIB) \ $(PATH_STAGE_LIB)/VBox-libssl$(VBOX_SUFF_LIB) endif ifndef SDK_VBOX_LIBXML2_LIBS TEMPLATE_VBoxR3Static_LIBS += \ $(PATH_STAGE_LIB)/VBox-libxml2-static$(VBOX_SUFF_LIB) endif if1of ($(KBUILD_TARGET),os2 win) TEMPLATE_VBoxR3Static_LIBS += \ $(PATH_STAGE_LIB)/VBox-liblzf-static$(VBOX_SUFF_LIB) \ $(PATH_STAGE_LIB)/VBox-zlib-static$(VBOX_SUFF_LIB) else TEMPLATE_VBoxR3Static_LIBS += \ $(PATH_STAGE_LIB)/VBox-liblzf$(VBOX_SUFF_LIB) \ $(SDK_VBOX_ZLIB_LIBS) ifeq ($(KBUILD_TARGET),linux) TEMPLATE_VBoxR3Static_LIBS += crypt else if1of ($(KBUILD_TARGET),darwin freebsd) TEMPLATE_VBoxR3Static_LIBS += iconv else ifeq ($(KBUILD_TARGET),solaris) TEMPLATE_VBoxR3Static_LIBS += kstat endif endif # # Non-pedantic variation of VBoxR3Static # TEMPLATE_VBoxR3StaticNonPedantic = VBox Static Ring-3 EXE, non-pedantic. TEMPLATE_VBoxR3StaticNonPedantic_EXTENDS = VBoxR3Static ifeq ($(KBUILD_TARGET),win) TEMPLATE_VBoxR3StaticNonPedantic_CXXFLAGS = $(TEMPLATE_VBoxR3Static_CXXFLAGS) $(VBOX_VCC_NON_PEDANTIC) TEMPLATE_VBoxR3StaticNonPedantic_CFLAGS = $(TEMPLATE_VBoxR3Static_CFLAGS) $(VBOX_VCC_NON_PEDANTIC) else # gcc: TEMPLATE_VBoxR3StaticNonPedantic_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBoxR3StaticNonPedantic_CXXFLAGS = $(filter-out $(VBOX_GCC_WERR) $(VBOX_GCC_WARN_MASOCHISTIC) $(VBOX_GCC_PEDANTIC_CXX),$(TEMPLATE_VBoxR3Static_CXXFLAGS)) \ $(VBOX_GCC_NON_PEDANTIC_CXX) TEMPLATE_VBoxR3StaticNonPedantic_CFLAGS = $(filter-out $(VBOX_GCC_WERR) $(VBOX_GCC_WARN_MASOCHISTIC) $(VBOX_GCC_PEDANTIC_C) ,$(TEMPLATE_VBoxR3Static_CFLAGS)) \ $(VBOX_GCC_NON_PEDANTIC_CXX) endif # # Same as VBOXR3EXE but without C++ exceptions. # # VBOXR3EXE does C++ exceptions and may assumes that extern "C" functions # doesn't throw them. Use this template (and VBOXR3DLLNOXCPT) with care # and only where the C++ overhead is really unwanted. # TEMPLATE_VBOXR3EXENOXCPT = VBox Ring 3 Exe without C++ exception TEMPLATE_VBOXR3EXENOXCPT_EXTENDS = VBOXR3EXE ifeq ($(KBUILD_TARGET),win) TEMPLATE_VBOXR3EXENOXCPT_CFLAGS = $(filter-out -EH%,$(TEMPLATE_VBOXR3EXE_CFLAGS) ) -EHs- TEMPLATE_VBOXR3EXENOXCPT_CXXFLAGS = $(filter-out -EH%,$(TEMPLATE_VBOXR3EXE_CXXFLAGS)) -EHs- else TEMPLATE_VBOXR3EXENOXCPT_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) -fno-exceptions endif # # Same as VBOXR3 but without C++ exceptions. # TEMPLATE_VBOXR3DLLNOXCPT = VBox Ring 3 SO/DLLs without C++ exception TEMPLATE_VBOXR3DLLNOXCPT_EXTENDS = VBOXR3 ifeq ($(KBUILD_TARGET),win) TEMPLATE_VBOXR3DLLNOXCPT_CFLAGS = $(filter-out -EH%,$(TEMPLATE_VBOXR3_CFLAGS) ) -EHs- TEMPLATE_VBOXR3DLLNOXCPT_CXXFLAGS = $(filter-out -EH%,$(TEMPLATE_VBOXR3_CXXFLAGS)) -EHs- else TEMPLATE_VBOXR3DLLNOXCPT_CXXFLAGS = $(TEMPLATE_VBOXR3_CXXFLAGS) -fno-exceptions endif # # Template for building hardened Ring-3 executables. # These shall have no extra runpaths, esp. not origin ones. # TEMPLATE_VBOXR3HARDENEDEXE = Hardened VBox Ring-3 EXE TEMPLATE_VBOXR3HARDENEDEXE_EXTENDS = VBOXR3EXE TEMPLATE_VBOXR3HARDENEDEXE_DEBUG_INST.win = $(INST_DEBUG)hardened-exes/ ifdef VBOX_WITH_HARDENING TEMPLATE_VBOXR3HARDENEDEXE_LIBS = $(VBOX_LIB_SUPHARDENED) $(TEMPLATE_VBOXR3EXE_LIBS) else TEMPLATE_VBOXR3HARDENEDEXE_LIBS = $(TEMPLATE_VBOXR3EXE_LIBS) endif TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.darwin = $(TEMPLATE_VBOXR3EXE_LDFLAGS.darwin) -framework IOKit ifeq ($(KBUILD_TARGET),linux) # not necessary except USE_LIB_PCAP is defined in SUPR3HardenedMain.cpp # TEMPLATE_VBOXR3HARDENEDEXE_LIBS += cap endif ifeq ($(KBUILD_TARGET),win) # No CRT! TEMPLATE_VBOXR3HARDENEDEXE_SDKS = VBOX_NTDLL $(TEMPLATE_VBOXR3EXE_SDKS) TEMPLATE_VBOXR3HARDENEDEXE_LIBS.x86 = \ $(PATH_SDK_$(VBOX_WINDDK)_LIB.x86)/int64.lib \ $(PATH_TOOL_$(TEMPLATE_VBOXR3HARDENEDEXE_TOOL.win.x86)_LIB)/chkstk.obj TEMPLATE_VBOXR3HARDENEDEXE_CXXFLAGS = $(filter-out -RTC% -GZ -GS,$(TEMPLATE_VBOXR3EXE_CXXFLAGS)) -GS- TEMPLATE_VBOXR3HARDENEDEXE_CXXFLAGS.debug= $(filter-out -RTC% -GZ -GS,$(TEMPLATE_VBOXR3EXE_CXXFLAGS.debug)) -GS- #-O2 -Oy- TEMPLATE_VBOXR3HARDENEDEXE_CFLAGS = $(filter-out -RTC% -GZ -GS,$(TEMPLATE_VBOXR3EXE_CFLAGS)) -GS- TEMPLATE_VBOXR3HARDENEDEXE_CFLAGS.debug = $(filter-out -RTC% -GZ -GS,$(TEMPLATE_VBOXR3EXE_CFLAGS.debug)) -GS- -O2 -Oy- TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS = $(TEMPLATE_VBOXR3EXE_LDFLAGS) \ /DISALLOWLIB:msvcrt$(VBOX_VCC_CRT_TYPE).lib \ /DISALLOWLIB:msvcprt$(VBOX_VCC_CRT_TYPE).lib TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.win.x86 = $(TEMPLATE_VBOXR3EXE_LDFLAGS.win.x86) /entry:suplibHardenedWindowsMain TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.win.amd64 = $(TEMPLATE_VBOXR3EXE_LDFLAGS.win.amd64) /entry:suplibHardenedWindowsMain TEMPLATE_VBOXR3HARDENEDEXE_LIBS.x86 = $(NOT_SUCH_VARIABLE) TEMPLATE_VBOXR3HARDENEDEXE_LIBS.amd64 = $(NOT_SUCH_VARIABLE) else ifn1of ($(KBUILD_TARGET), os2 solaris) # We want to keep the RPATH on Solaris to be able to find libgcc_1/libstdc++ within $(VBOX_WITH_RUNPATH) 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)) endif # # Template for building hardened Ring-3 libraries. # TEMPLATE_VBOXR3HARDENEDLIB = Hardened VBox Ring-3 LIB TEMPLATE_VBOXR3HARDENEDLIB_EXTENDS = VBOXR3HARDENEDEXE TEMPLATE_VBOXR3HARDENEDLIB_LIBS = $(NO_SUCH_VARIABLE) # # Template for building hardened Ring-3 testcase executables. # TEMPLATE_VBoxR3HardenedTstExe = VBox Ring-3 Hardened Testcase Exe (currently windows only!) TEMPLATE_VBoxR3HardenedTstExe_EXTENDS = VBOXR3HARDENEDEXE TEMPLATE_VBoxR3HardenedTstExe_INST = $(INST_TESTCASE) # # Template for building hardened Ring-3 testcase DLLs (pairs with VBoxR3HardenedTstExe). # TEMPLATE_VBoxR3HardenedTstDll = VBox Ring-3 Hardened Testcase Dll (currently windows only!) TEMPLATE_VBoxR3HardenedTstDll_EXTENDS = VBoxR3TstDll TEMPLATE_VBoxR3HardenedTstDll_INST = $(INST_TESTCASE) TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS.win = $(TEMPLATE_VBoxR3TstDll_LDFLAGS.win) -IntegrityCheck ifn1of ($(KBUILD_TARGET), win os2) TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBoxR3TstDll_LDFLAGS)) TEMPLATE_VBoxR3HardenedTstDll_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBoxR3TstDll_LDFLAGS.linux)) endif # # Template for building set-uid-to-root helper programs. # In hardened builds, these may only contain absolute runpaths! # TEMPLATE_VBoxR3SetUidToRoot = Set-uid-to-root helper program. if1of ($(KBUILD_TARGET),win) TEMPLATE_VBoxR3SetUidToRoot_EXTENDS = VBOXR3EXE else TEMPLATE_VBoxR3SetUidToRoot_EXTENDS = VBOXR3HARDENEDEXE endif TEMPLATE_VBoxR3SetUidToRoot_LIBS = $(NO_SUCH_VARIABLE) ifdef VBOX_WITH_RUNPATH TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' endif ifndef VBOX_WITH_HARDENING ifdef VBOX_WITH_RELATIVE_RUNPATH TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)' endif ifdef VBOX_WITH_ORIGIN TEMPLATE_VBoxR3SetUidToRoot_LDFLAGS.linux += $(VBOX_GCC_ORIGIN_OPT) endif endif # # Template for building R3 tools. # TEMPLATE_VBoxR3Tool = VBox Ring 3 Tools TEMPLATE_VBoxR3Tool_EXTENDS = VBOXR3EXE TEMPLATE_VBoxR3Tool_INST = $(VBOX_INST_TOOLS) ifeq ($(KBUILD_TARGET),win) TEMPLATE_VBoxR3Tool_CFLAGS = $(TEMPLATE_VBOXR3EXE_CFLAGS) $(VBOX_VCC_WERR) TEMPLATE_VBoxR3Tool_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) $(VBOX_VCC_WERR) TEMPLATE_VBoxR3Tool_LDFLAGS = $(TEMPLATE_VBOXR3EXE_LDFLAGS) $(VBOX_VCC_LD_WERR) else TEMPLATE_VBoxR3Tool_CFLAGS = $(TEMPLATE_VBOXR3EXE_CFLAGS) $(VBOX_GCC_WERR) TEMPLATE_VBoxR3Tool_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) $(VBOX_GCC_WERR) ifdef VBOX_WITH_RUNPATH TEMPLATE_VBoxR3Tool_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' $(TEMPLATE_VBOXR3EXE_LDFLAGS) else ifdef VBOX_WITH_RELATIVE_RUNPATH TEMPLATE_VBoxR3Tool_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/..' $(TEMPLATE_VBOXR3EXE_LDFLAGS) endif endif TEMPLATE_VBoxR3Tool_LIBS = $(LIB_RUNTIME) $(TEMPLATE_VBOXR3EXE_LIBS) if defined(VBOX_WITH_MORE_NT4_COMPAT_BINARIES) && "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.x86" TEMPLATE_VBoxR3Tool_LIBS.x86 = \ $(PATH_STAGE_LIB)/RuntimeR3VccTricks2$(VBOX_SUFF_LIB) \ $(PATH_TOOL_$(TEMPLATE_VBOXR3EXE_TOOL.win.x86)_LIB)/oldnames.lib endif # # Template for building R3 shared objects / DLLs with the 10.5 Mac OS X SDK. # Identical to VBOXR3EXE, except for the DYLIB, the classic_linker and SDK bits. # TEMPLATE_VBOXR3OSX105 = VBox Ring 3 SO/DLLs for OS X 10.5 TEMPLATE_VBOXR3OSX105_EXTENDS = VBOXR3EXE 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) \ -read_only_relocs suppress \ -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \ -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) # # Template for building R3 shared objects / DLLs with the 10.7 Mac OS X SDK. # Identical to VBoxR3Dll, except for the DYLIB, the classic_linker and SDK bits. # TEMPLATE_VBoxR3DllOsX107 = VBox Ring 3 SO/DLLs for OS X 10.7 TEMPLATE_VBoxR3DllOsX107_EXTENDS = VBoxR3Dll TEMPLATE_VBoxR3DllOsX107_TOOL = LLVMGXX42MACHO TEMPLATE_VBoxR3DllOsX107_DEFS.darwin = $(VBOX_DARWIN_DEF_SDK_10_7_DEFS) PIC TEMPLATE_VBoxR3DllOsX107_CFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_7_CFLAGS) -fno-common TEMPLATE_VBoxR3DllOsX107_CXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_7_CXXFLAGS) TEMPLATE_VBoxR3DllOsX107_OBJCFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_7_OBJCFLAGS) TEMPLATE_VBoxR3DllOsX107_OBJCXXFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_7_OBJCFLAGS) TEMPLATE_VBoxR3DllOsX107_LDFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_10_7_LDFLAGS) \ -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \ -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) # # Ring-3 testcase, running automatically during the build. # This is the VBOXR3EXE template only with a different install dir. # TEMPLATE_VBOXR3AUTOTST = VBox Ring 3 Testcase Exe ifeq ($(KBUILD_TARGET),win) TEMPLATE_VBOXR3AUTOTST_EXTENDS = VBoxR3Static TEMPLATE_VBOXR3AUTOTST_LIBS = $(NO_SUCH_VARIABLE) else TEMPLATE_VBOXR3AUTOTST_EXTENDS = VBOXR3EXE endif TEMPLATE_VBOXR3AUTOTST_INST = $(INST_TESTCASE) if "$(KBUILD_TARGET)" == "win" && defined(VBOX_SIGNING_MODE) TEMPLATE_VBOXR3AUTOTST_POST_CMDS = $(NO_SUCH_VARIABLE) TEMPLATE_VBOXR3AUTOTST_LDFLAGS = $(filter-out -IntegrityCheck, $(TEMPLATE_VBoxR3Static_LDFLAGS)) endif # # Ring-3 testcase. # This is the VBOXR3EXE template only with a different install dir. # TEMPLATE_VBOXR3TSTEXE = VBox Ring 3 Testcase Exe TEMPLATE_VBOXR3TSTEXE_EXTENDS = VBOXR3EXE TEMPLATE_VBOXR3TSTEXE_INST = $(INST_TESTCASE) TEMPLATE_VBOXR3TSTEXE_LIBS = $(LIB_RUNTIME) $(TEMPLATE_VBOXR3EXE_LIBS) ifdef VBOX_WITH_RUNPATH TEMPLATE_VBOXR3TSTEXE_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' $(TEMPLATE_VBOXR3EXE_LDFLAGS) else ifdef VBOX_WITH_RELATIVE_RUNPATH TEMPLATE_VBOXR3TSTEXE_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/..' $(TEMPLATE_VBOXR3EXE_LDFLAGS) endif if "$(KBUILD_TARGET)" == "win" && defined(VBOX_SIGNING_MODE) TEMPLATE_VBOXR3TSTEXE_POST_CMDS = TEMPLATE_VBOXR3TSTEXE_LDFLAGS = $(filter-out -IntegrityCheck, $(TEMPLATE_VBOXR3EXE_LDFLAGS)) endif if defined(VBOX_WITH_MORE_NT4_COMPAT_BINARIES) && "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.x86" TEMPLATE_VBOXR3TSTEXE_POST_CMDS.win.x86 = $(if $(eq $(tool_do),LINK_LIBRARY),,$(VBOX_PE_SET_VERSION) $(out)) TEMPLATE_VBOXR3TSTEXE_LIBS.x86 = \ $(PATH_STAGE_LIB)/RuntimeR3VccTricks2$(VBOX_SUFF_LIB) \ $(PATH_TOOL_$(TEMPLATE_VBOXR3EXE_TOOL.win.x86)_LIB)/oldnames.lib endif # # Ring-3 testcase (no -pedantic) # TEMPLATE_VBOXR3TSTNPEXE = VBox Ring 3 Testcase Exe Non-pedantic TEMPLATE_VBOXR3TSTNPEXE_EXTENDS = VBOXR3TSTEXE ifneq ($(KBUILD_TARGET),win) # (only gcc) TEMPLATE_VBOXR3TSTNPEXE_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBOXR3TSTNPEXE_CXXFLAGS = $(filter-out $(VBOX_GCC_WERR) $(VBOX_GCC_WARN_MASOCHISTIC) $(VBOX_GCC_PEDANTIC_CXX),$(TEMPLATE_VBOXR3TSTEXE_CXXFLAGS)) \ -Wno-sign-compare TEMPLATE_VBOXR3TSTNPEXE_CFLAGS = $(filter-out $(VBOX_GCC_WERR) $(VBOX_GCC_WARN_MASOCHISTIC) $(VBOX_GCC_PEDANTIC_C) ,$(TEMPLATE_VBOXR3TSTEXE_CFLAGS)) \ -Wno-sign-compare endif # # Ring-3 testcase DLL. # TEMPLATE_VBoxR3TstDll = VBox Ring-3 Testcase Dll TEMPLATE_VBoxR3TstDll_EXTENDS = VBOXR3TSTEXE ifn1of ($(KBUILD_TARGET), darwin win os2) TEMPLATE_VBoxR3TstDll_DEFS = $(TEMPLATE_VBOXR3TSTEXE_DEFS) PIC TEMPLATE_VBoxR3TstDll_CFLAGS = $(TEMPLATE_VBOXR3TSTEXE_CFLAGS) -fPIC TEMPLATE_VBoxR3TstDll_CXXFLAGS = $(TEMPLATE_VBOXR3TSTEXE_CXXFLAGS) -fPIC TEMPLATE_VBoxR3TstDll_LDFLAGS = $(TEMPLATE_VBOXR3TSTEXE_LDFLAGS) -fPIC endif # # Template for the CppUnit kind of testcases. # TEMPLATE_VBOXCPPUNITEXE = VBox CppUnit Testcase Exe TEMPLATE_VBOXCPPUNITEXE_EXTENDS = VBOXR3TSTEXE ## @todo make a CPPUNIT SDK and add cppunit tools packages for windows, mac, solaris and OS/2. #TEMPLATE_VBOXCPPUNITEXE_SDKS = CPPUNIT - TEMPLATE_VBOXCPPUNITEXE_LIBS = \ $(TEMPLATE_VBOXR3TSTEXE_LIBS) \ cppunit # # Template for building bad C/C++ style R3 executables (no -pedantic). # TEMPLATE_VBOXR3NPEXE = VBox Ring 3 Non-pedantic TEMPLATE_VBOXR3NPEXE_EXTENDS = VBOXR3EXE ifneq ($(KBUILD_TARGET),win) # (only gcc) TEMPLATE_VBOXR3NPEXE_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBOXR3NPEXE_CXXFLAGS = $(filter-out $(VBOX_GCC_WERR) $(VBOX_GCC_WARN_MASOCHISTIC) $(VBOX_GCC_PEDANTIC_CXX),$(TEMPLATE_VBOXR3EXE_CXXFLAGS)) \ $(VBOX_GCC_NON_PEDANTIC_CXX) TEMPLATE_VBOXR3NPEXE_CFLAGS = $(filter-out $(VBOX_GCC_WERR) $(VBOX_GCC_WARN_MASOCHISTIC) $(VBOX_GCC_PEDANTIC_C) ,$(TEMPLATE_VBOXR3EXE_CFLAGS)) \ $(VBOX_GCC_NON_PEDANTIC_C) endif # # Template for building bad C/C++ style R3 shared libraries / Dlls (no -pedantic). # (Same transformation as for VBOXR3NPEXE.) # # @deprecated Use VBoxR3DllNonPedantic! # TEMPLATE_VBOXR3NP = VBox Ring 3 Non-pedantic TEMPLATE_VBOXR3NP_EXTENDS = VBOXR3 ifneq ($(KBUILD_TARGET),win) # (only gcc) TEMPLATE_VBOXR3NP_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBOXR3NP_CXXFLAGS = $(filter-out $(VBOX_GCC_WERR) $(VBOX_GCC_WARN_MASOCHISTIC) $(VBOX_GCC_PEDANTIC_CXX),$(TEMPLATE_VBOXR3_CXXFLAGS)) \ $(VBOX_GCC_NON_PEDANTIC_CXX) TEMPLATE_VBOXR3NP_CFLAGS = $(filter-out $(VBOX_GCC_WERR) $(VBOX_GCC_WARN_MASOCHISTIC) $(VBOX_GCC_PEDANTIC_C) ,$(TEMPLATE_VBOXR3_CFLAGS)) \ $(VBOX_GCC_NON_PEDANTIC_C) TEMPLATE_VBOXR3NP_OBJCFLAGS = $(filter-out $(VBOX_GCC_WERR) $(VBOX_GCC_WARN_MASOCHISTIC) -pedantic -Wstrict-prototypes,$(TEMPLATE_VBOXR3_OBJCFLAGS)) TEMPLATE_VBOXR3NP_OBJCXXFLAGS = $(filter-out $(VBOX_GCC_WERR) $(VBOX_GCC_WARN_MASOCHISTIC) -pedantic,$(TEMPLATE_VBOXR3_OBJCXXFLAGS)) endif # # Template for building bad C/C++ style R3 shared libraries / Dlls (no -pedantic). # (Same transformation as for VBoxR3ExeNonPedantic.) # TEMPLATE_VBoxR3DllNonPedantic = VBox ring-3 Non-pedantic, with warnings. TEMPLATE_VBoxR3DllNonPedantic_EXTENDS = VBOXR3 ifeq ($(KBUILD_TARGET),win) TEMPLATE_VBoxR3DllNonPedantic_CXXFLAGS = $(TEMPLATE_VBOXR3_CXXFLAGS) $(VBOX_VCC_NON_PEDANTIC) TEMPLATE_VBoxR3DllNonPedantic_CFLAGS = $(TEMPLATE_VBOXR3_CFLAGS) $(VBOX_VCC_NON_PEDANTIC) else # gcc: TEMPLATE_VBoxR3DllNonPedantic_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBoxR3DllNonPedantic_CXXFLAGS = $(filter-out $(VBOX_GCC_WERR) $(VBOX_GCC_WARN_MASOCHISTIC) $(VBOX_GCC_PEDANTIC_CXX),$(TEMPLATE_VBOXR3_CXXFLAGS)) \ $(VBOX_GCC_NON_PEDANTIC_CXX) TEMPLATE_VBoxR3DllNonPedantic_CFLAGS = $(filter-out $(VBOX_GCC_WERR) $(VBOX_GCC_WARN_MASOCHISTIC) $(VBOX_GCC_PEDANTIC_C) ,$(TEMPLATE_VBOXR3_CFLAGS)) \ $(VBOX_GCC_NON_PEDANTIC_C) endif # x86 edition of the above template for use on AMD64 targets. TEMPLATE_VBoxR3DllNonPedantic-x86 = 32-bit VBox ring-3 SO/DLLs, no warnings TEMPLATE_VBoxR3DllNonPedantic-x86_EXTENDS = VBoxR3DllNonPedantic TEMPLATE_VBoxR3DllNonPedantic-x86_BLD_TRG_ARCH = x86 TEMPLATE_VBoxR3DllNonPedantic-x86_DEFS = $(filter-out HC_ARCH_BITS%,$(TEMPLATE_VBoxR3DllNonPedantic_DEFS)) \ HC_ARCH_BITS=32 ARCH_BITS=32 # # Template for building libraries that are linked into VBoxRT.dll # and it's variations, pedantic variation. # TEMPLATE_VBoxR3RuntimeDll = For libraries that are linked into VBoxRT. TEMPLATE_VBoxR3RuntimeDll_EXTENDS = VBoxR3Dll if defined(VBOX_WITH_MORE_NT4_COMPAT_BINARIES) && "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.x86" TEMPLATE_VBoxR3RuntimeDll_CFLAGS = $(filter-out -MD$(VBOX_VCC_CRT_TYPE), $(TEMPLATE_VBoxR3Dll_CFLAGS)) -MT$(VBOX_VCC_CRT_TYPE) TEMPLATE_VBoxR3RuntimeDll_CXXFLAGS = $(filter-out -MD$(VBOX_VCC_CRT_TYPE), $(TEMPLATE_VBoxR3Dll_CXXFLAGS)) -MT$(VBOX_VCC_CRT_TYPE) TEMPLATE_VBoxR3RuntimeDll_LIBS.x86 = $(filter-out $(PATH_TOOL_$(TEMPLATE_VBOXR3EXE_TOOL.win.x86)_LIB)/%, $(TEMPLATE_VBoxR3Dll_LIBS.x86)) \ $(PATH_TOOL_$(TEMPLATE_VBoxR3RuntimeDll_TOOL.win.x86)_LIB)/oldnames.lib \ $(PATH_TOOL_$(TEMPLATE_VBoxR3RuntimeDll_TOOL.win.x86)_LIB)/libcmt$(VBOX_VCC_CRT_TYPE).lib \ $(PATH_TOOL_$(TEMPLATE_VBoxR3RuntimeDll_TOOL.win.x86)_LIB)/libcpmt$(VBOX_VCC_CRT_TYPE).lib endif # # Template for building libraries that are linked into VBoxRT.dll # and it's variations, non-pedantic variation. # TEMPLATE_VBoxR3RuntimeDllNonPedantic = For libraries that are linked into VBoxRT, but must be excluded from -pedantic warnings. TEMPLATE_VBoxR3RuntimeDllNonPedantic_EXTENDS = VBoxR3DllNonPedantic if defined(VBOX_WITH_MORE_NT4_COMPAT_BINARIES) && $(KBUILD_TARGET_ARCH) == "x86" TEMPLATE_VBoxR3RuntimeDllNonPedantic_CFLAGS = $(filter-out -MD$(VBOX_VCC_CRT_TYPE), $(TEMPLATE_VBoxR3DllNonPedantic_CFLAGS)) -MT$(VBOX_VCC_CRT_TYPE) TEMPLATE_VBoxR3RuntimeDllNonPedantic_CXXFLAGS = $(filter-out -MD$(VBOX_VCC_CRT_TYPE), $(TEMPLATE_VBoxR3DllNonPedantic_CXXFLAGS)) -MT$(VBOX_VCC_CRT_TYPE) endif # # Template for building libraries, shared libraries / modules # which only depends on IPRT for crt. # TEMPLATE_VBoxNoCrtGccLib = VBox no-crt GCC libraries and modules, yasm/nasm. TEMPLATE_VBoxNoCrtGccLib_DEFS = IN_RING3 IPRT_NO_CRT $(ARCH_BITS_DEFS) TEMPLATE_VBoxNoCrtGccLib_ASDEFS = ASM_CALL64_GCC TEMPLATE_VBoxNoCrtGccLib_CFLAGS = -nostdinc -fno-strict-aliasing -fno-math-errno $(VBOX_GCC_WARN) -Werror-implicit-function-declaration TEMPLATE_VBoxNoCrtGccLib_CFLAGS.x86 = -m32 TEMPLATE_VBoxNoCrtGccLib_CFLAGS.amd64 = -m64 -mcmodel=medium -fno-common TEMPLATE_VBoxNoCrtGccLib_CFLAGS.sparc32 = -m32 TEMPLATE_VBoxNoCrtGccLib_CFLAGS.sparc64 = -m64 TEMPLATE_VBoxNoCrtGccLib_CFLAGS.release = -O2 -fno-strict-aliasing TEMPLATE_VBoxNoCrtGccLib_CFLAGS.profile = $(TEMPLATE_VBoxNoCrtGccLib_CFLAGS.release) TEMPLATE_VBoxNoCrtGccLib_CFLAGS.kprofile = $(TEMPLATE_VBoxNoCrtGccLib_CFLAGS.release) TEMPLATE_VBoxNoCrtGccLib_CFLAGS.darwin = -static TEMPLATE_VBoxNoCrtGccLib_CXXFLAGS = $(filter-out -Werror-implicit-function-declaration,$(TEMPLATE_VBoxNoCrtGccLib_CFLAGS)) TEMPLATE_VBoxNoCrtGccLib_CXXFLAGS.$(KBUILD_TARGET) = $(TEMPLATE_VBoxNoCrtGccLib_CFLAGS.$(KBUILD_TARGET)) TEMPLATE_VBoxNoCrtGccLib_CXXFLAGS.$(KBUILD_TARGET_ARCH) = $(TEMPLATE_VBoxNoCrtGccLib_CFLAGS.$(KBUILD_TARGET_ARCH)) TEMPLATE_VBoxNoCrtGccLib_INCS = $(PATH_ROOT)/include/iprt/nocrt ifeq (disabled-by-mingw-w64 $(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),win.amd64) # cross compile to 64-bit ELF (linux). TEMPLATE_VBoxNoCrtGccLib_TOOL = XGCCAMD64LINUX TEMPLATE_VBoxNoCrtGccLib_ASTOOL = YASM TEMPLATE_VBoxNoCrtGccLib_ASFLAGS = -f elf64 -DASM_FORMAT_ELF -D__YASM__ -g dwarf2 -w+orphan-labels $(VBOX_YASM_Wno-segreg-in-64bit) TEMPLATE_VBoxNoCrtGccLib_LIBS = $(KBUILD_DEVTOOLS)/win.x86/x86_64-unknown-linux-gnu/20060701-r2/lib/gcc/x86_64-unknown-linux-gnu/3.4.6/libgcc.a TEMPLATE_VBoxNoCrtGccLib_LDFLAGS = -nostdlib else if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), win.x86 win.amd64) # Use the default GCC (MinGW) with the Microsoft linker. # (Drop all '-g' options as we're unable to strip the debug info.) TEMPLATE_VBoxNoCrtGccLib_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBoxNoCrtGccLib_ASTOOL = $(VBOX_ASTOOL) TEMPLATE_VBoxNoCrtGccLib_ASFLAGS = $(VBOX_ASFLAGS) TEMPLATE_VBoxNoCrtGccLib_LDTOOL = $(VBOX_VCC_TOOL) TEMPLATE_VBoxNoCrtGccLib_LDFLAGS = -Incremental:NO -MapInfo:Exports -NoD -Ignore:4197 TEMPLATE_VBoxNoCrtGccLib_LIBS = $(VBOX_GCC_LIBGCC) TEMPLATE_VBoxNoCrtGccLib_CFLAGS := $(filter-out -g,$(TEMPLATE_VBoxNoCrtGccLib_CFLAGS)) -s TEMPLATE_VBoxNoCrtGccLib_CXXFLAGS := $(filter-out -g,$(TEMPLATE_VBoxNoCrtGccLib_CXXFLAGS)) -s else # Use the default GCC. # The use of --exclude-libs ALL is to avoid confusing the linux ld.so. TEMPLATE_VBoxNoCrtGccLib_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBoxNoCrtGccLib_ASTOOL = $(VBOX_ASTOOL) TEMPLATE_VBoxNoCrtGccLib_ASFLAGS = $(VBOX_ASFLAGS) TEMPLATE_VBoxNoCrtGccLib_CFLAGS += $(VBOX_GCC_fno-stack-protector) TEMPLATE_VBoxNoCrtGccLib_CXXFLAGS += $(VBOX_GCC_fno-stack-protector) ifeq ($(KBUILD_TARGET_ARCH),amd64) # in 64-bit mode we'll build a sys-module (VBoxREM2). if1of ($(KBUILD_TARGET), darwin solaris) TEMPLATE_VBoxNoCrtGccLib_LDFLAGS.solaris= -64 -r else TEMPLATE_VBoxNoCrtGccLib_LDFLAGS = -nostdlib endif else # x86: TEMPLATE_VBoxNoCrtGccLib_LDFLAGS = -nostdlib ifn1of ($(KBUILD_TARGET), os2 darwin solaris) TEMPLATE_VBoxNoCrtGccLib_LDFLAGS += -Wl,--no-undefined endif endif # x86 TEMPLATE_VBoxNoCrtGccLib_LDFLAGS.darwin = $(VBOX_DARWIN_DEF_SDK_LDFLAGS) TEMPLATE_VBoxNoCrtGccLib_LIBS = # FIXME - has unwind mess. endif # # Same as VBoxNoCrtGccLib only it uses GAS as the assembler instead of yasm/nasm. # TEMPLATE_VBOXNOCRTGAS = VBox no-crt GCC libraries and modules, gas. TEMPLATE_VBOXNOCRTGAS_EXTENDS = VBoxNoCrtGccLib TEMPLATE_VBOXNOCRTGAS_ASTOOL = $(TEMPLATE_VBoxNoCrtGccLib_TOOL) ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),win.x86) TEMPLATE_VBOXNOCRTGAS_ASFLAGS = -s else TEMPLATE_VBOXNOCRTGAS_ASFLAGS = -g endif TEMPLATE_VBOXNOCRTGAS_ASFLAGS.x86 = -m32 TEMPLATE_VBOXNOCRTGAS_ASFLAGS.amd64 = -m64 # # Template for building executables that are part of the VBox Main component # (COM/XPCOM interface to VirtualBox). # TEMPLATE_VBOXMAINEXE = VBox Main Executable TEMPLATE_VBOXMAINEXE_ASTOOL = $(VBOX_ASTOOL) TEMPLATE_VBOXMAINEXE_ASFLAGS = $(VBOX_ASFLAGS) TEMPLATE_VBOXMAINEXE_DEFS = IN_RING3 UNICODE NDEBUG=1 TEMPLATE_VBOXMAINEXE_DEFS.win = _UNICODE TEMPLATE_VBOXMAINEXE_RCDEFS = $(TEMPLATE_VBOXR3EXE_RCDEFS) TEMPLATE_VBOXMAINEXE_LIBS.kprofile = $(LIB_KPROFILE) TEMPLATE_VBOXMAINEXE_USES = dtrace if defined(VBOX_WITH_DTRACE_R3_MAIN) && defined(VBOX_WITH_NATIVE_DTRACE) TEMPLATE_VBOXMAINEXE_DTRACETOOL = DTraceAndVBoxTpG TEMPLATE_VBOXMAINEXE_DTRACE_OBJ_FLAGS = -C TEMPLATE_VBOXMAINEXE_DTRACE_HDR_FLAGS = -C TEMPLATE_VBOXMAINEXE_DEFS += VBOX_WITH_DTRACE VBOX_WITH_DTRACE_R3 VBOX_WITH_DTRACE_R3_MAIN VBOX_WITH_NATIVE_DTRACE else TEMPLATE_VBOXMAINEXE_DTRACE_HDR_FLAGS = --ring-3-context TEMPLATE_VBOXMAINEXE_DTRACE_OBJ_FLAGS = --ring-3-context --pic --probe-fn-imported --probe-fn-name "SUPTracerFireProbe" if defined(VBOX_WITH_DTRACE_R3_MAIN) TEMPLATE_VBOXMAINEXE_DTRACETOOL = VBoxTpG TEMPLATE_VBOXMAINEXE_DEFS += VBOX_WITH_DTRACE VBOX_WITH_DTRACE_R3 VBOX_WITH_DTRACE_R3_MAIN else TEMPLATE_VBOXMAINEXE_DTRACETOOL = VBoxTpG-Disabled endif endif ifeq ($(KBUILD_TARGET),win) TEMPLATE_VBOXMAINEXE_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK) $(VBOX_WINDDK) #TEMPLATE_VBOXMAINEXE_TOOL = $(VBOX_VCC_TOOL) TEMPLATE_VBOXMAINEXE_TOOL.win.x86 = $(VBOX_VCC_TOOL_STEM)X86 TEMPLATE_VBOXMAINEXE_TOOL.win.amd64 = $(VBOX_VCC_TOOL_STEM)AMD64 TEMPLATE_VBOXMAINEXE_CXXFLAGS = -Zi -Zl -GR -EHsc -GF -MD$(VBOX_VCC_CRT_TYPE) -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP) # -wd4625: 'DisplaySourceBitmap' : copy constructor could not be generated because a base class copy constructor is inaccessible # -wd4626: 'DisplaySourceBitmap' : assignment operator could not be generated because a base class assignment operator is inaccessible # The two above can be cured by adding private: DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(xxxx); but too much work. # -wd4355: 'this' : used in base member initializer list (e.g. VirtualBoxBase.cpp) TEMPLATE_VBOXMAINEXE_CXXFLAGS += $(VBOX_VCC_WARN_ALL) -wd4625 -wd4626 -wd4355 $(VBOX_VCC_WERR) TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug = -RTCsu TEMPLATE_VBOXMAINEXE_CXXFLAGS.dbgopt = $(NO_SUCH_VARIABLE) TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile = -Gh -GH TEMPLATE_VBOXMAINEXE_CFLAGS = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS) TEMPLATE_VBOXMAINEXE_CFLAGS.debug = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug) TEMPLATE_VBOXMAINEXE_CFLAGS.dbgopt = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.dbgopt) TEMPLATE_VBOXMAINEXE_CFLAGS.kprofile = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile) TEMPLATE_VBOXMAINEXE_LDFLAGS = -Ignore:4197 \ /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LargeAddressAware /DynamicBase /NxCompat /Release /Debug /Opt:Ref /Opt:Icf \ /Version:$(VBOX_VERSION_MAJOR)0$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \ /STUB:$(PATH_ROOT)/src/VBox/HostDrivers/Support/win/winstub.com \ /DISALLOWLIB:libc.lib \ /DISALLOWLIB:libcd.lib \ /DISALLOWLIB:libcmt.lib \ /DISALLOWLIB:libcmtd.lib \ /DISALLOWLIB:msvcrt$(VBOX_VCC_CRT_TYPE_N).lib \ /DISALLOWLIB:msvcprt$(VBOX_VCC_CRT_TYPE_N).lib if defined(VBOX_SIGNING_MODE) && defined(VBOX_WITH_HARDENING) TEMPLATE_VBOXMAINEXE_LDFLAGS += -IntegrityCheck endif ifdef VBOX_WITH_DTRACE_R3_MAIN TEMPLATE_VBOXMAINEXE_LDFLAGS += -Merge:VTGPrLc.Data=VTGPrLc.Begin -Merge:VTGPrLc.End=VTGPrLc.Begin -Merge:VTGPrLc.Begin=VTGObj endif TEMPLATE_VBOXMAINEXE_LIBS = \ $(LIB_RUNTIME) TEMPLATE_VBOXMAINEXE_LIBS.x86 = \ $(PATH_TOOL_$(TEMPLATE_VBOXMAINEXE_TOOL.win.x86)_LIB)/msvcrt$(VBOX_VCC_CRT_TYPE).lib \ $(PATH_TOOL_$(TEMPLATE_VBOXMAINEXE_TOOL.win.x86)_LIB)/msvcprt$(VBOX_VCC_CRT_TYPE).lib \ $(PATH_TOOL_$(TEMPLATE_VBOXMAINEXE_TOOL.win.x86)_LIB)/oldnames.lib TEMPLATE_VBOXMAINEXE_LIBS.amd64 = \ $(PATH_TOOL_$(TEMPLATE_VBOXMAINEXE_TOOL.win.amd64)_LIB)/msvcrt$(VBOX_VCC_CRT_TYPE).lib \ $(PATH_TOOL_$(TEMPLATE_VBOXMAINEXE_TOOL.win.amd64)_LIB)/msvcprt$(VBOX_VCC_CRT_TYPE).lib \ $(PATH_TOOL_$(TEMPLATE_VBOXMAINEXE_TOOL.win.amd64)_LIB)/oldnames.lib TEMPLATE_VBOXMAINEXE_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS) else # the GCC guys: TEMPLATE_VBOXMAINEXE_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBOXMAINEXE_CXXFLAGS = -g $(VBOX_GCC_pipe) \ $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) -Wshadow \ -fshort-wchar -fpermissive -fexceptions -frtti $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing \ $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_std) $(VBOX_GCC_IPRT_FMT_CHECK) ifdef VBOX_WITH_NO_GCC_WARNING_POLICY TEMPLATE_VBOXMAINEXE_CXXFLAGS += $(VBOX_GCC_WERR) endif ifdef VBOX_WITH_DTRACE_R3_MAIN TEMPLATE_VBOXMAINEXE_CXXFLAGS := $(filter-out -pedantic,$(TEMPLATE_VBOXMAINEXE_CXXFLAGS)) -fdollars-in-identifiers # annoying gcc option precedence. endif TEMPLATE_VBOXMAINEXE_CXXFLAGS.x86 = -m32 TEMPLATE_VBOXMAINEXE_CXXFLAGS.amd64 = -m64 TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile = -finstrument-functions TEMPLATE_VBOXMAINEXE_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) $(VBOX_GCC_IPRT_FMT_CHECK) ifdef VBOX_WITH_NO_GCC_WARNING_POLICY TEMPLATE_VBOXMAINEXE_CFLAGS += $(VBOX_GCC_WERR) endif TEMPLATE_VBOXMAINEXE_CFLAGS.x86 = -m32 TEMPLATE_VBOXMAINEXE_CFLAGS.amd64 = -m64 TEMPLATE_VBOXMAINEXE_CFLAGS.kprofile = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile) TEMPLATE_VBOXMAINEXE_OBJCFLAGS = $(TEMPLATE_VBOXMAINEXE_CFLAGS) TEMPLATE_VBOXMAINEXE_OBJCFLAGS.x86 = $(TEMPLATE_VBOXMAINEXE_CFLAGS.x86) TEMPLATE_VBOXMAINEXE_OBJCFLAGS.amd64 = $(TEMPLATE_VBOXMAINEXE_CFLAGS.amd64) TEMPLATE_VBOXMAINEXE_OBJCFLAGS.kprofile = $(TEMPLATE_VBOXMAINEXE_CFLAGS.kprofile) TEMPLATE_VBOXMAINEXE_OBJCXXFLAGS = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS) TEMPLATE_VBOXMAINEXE_OBJCXXFLAGS.x86 = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.x86) TEMPLATE_VBOXMAINEXE_OBJCXXFLAGS.amd64 = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.amd64) TEMPLATE_VBOXMAINEXE_OBJCXXFLAGS.kprofile= $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile) TEMPLATE_VBOXMAINEXE_LDFLAGS.x86 = -m32 TEMPLATE_VBOXMAINEXE_LDFLAGS.amd64 = -m64 ifeq ($(KBUILD_TARGET),linux) TEMPLATE_VBOXMAINEXE_LIBS = pthread m rt $(LIB_RUNTIME) dl TEMPLATE_VBOXMAINEXE_LDFLAGS.linux = -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed) else ifeq ($(KBUILD_TARGET),os2) TEMPLATE_VBOXMAINEXE_TOOL = GXX3OMF TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) else ifeq ($(KBUILD_TARGET),darwin) TEMPLATE_VBOXMAINEXE_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBOXMAINEXE_DEFS += $(VBOX_DARWIN_DEF_SDK_DEFS) TEMPLATE_VBOXMAINEXE_CFLAGS += $(VBOX_DARWIN_DEF_SDK_CFLAGS) TEMPLATE_VBOXMAINEXE_CXXFLAGS += $(VBOX_DARWIN_DEF_SDK_CXXFLAGS) TEMPLATE_VBOXMAINEXE_OBJCFLAGS += $(VBOX_DARWIN_DEF_SDK_OBJCFLAGS) TEMPLATE_VBOXMAINEXE_OBJCXXFLAGS += $(VBOX_DARWIN_DEF_SDK_OBJCXXFLAGS) TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin += -bind_at_load TEMPLATE_VBOXMAINEXE_LDFLAGS += $(VBOX_DARWIN_DEF_SDK_LDFLAGS) -framework Carbon TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) else ifeq ($(KBUILD_TARGET),haiku) TEMPLATE_VBOXMAINEXE_TOOL = GXX3 TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) network stdc++ supc++ else if1of ($(KBUILD_TARGET), freebsd openbsd) TEMPLATE_VBOXMAINEXE_TOOL = GXX3 TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) TEMPLATE_VBOXMAINEXE_INCS += \ /usr/include \ /usr/X11R6/include \ /usr/local/include TEMPLATE_VBOXMAINEXE_LIBPATH += \ /usr/lib \ /usr/X11R6/lib \ /usr/local/lib else ifeq ($(KBUILD_TARGET),netbsd) TEMPLATE_VBOXMAINEXE_TOOL = GXX3 TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) TEMPLATE_VBOXMAINEXE_INCS += \ /usr/include \ /usr/X11R7/include TEMPLATE_VBOXMAINEXE_LIBPATH += \ /usr/lib \ /usr/X11R7/lib else ifeq ($(KBUILD_TARGET),solaris) TEMPLATE_VBOXMAINEXE_TOOL = GXX3PLAIN TEMPLATE_VBOXMAINEXE_DEFS += _REENTRANT TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) rt thread else $(warning Warning: VBOX Build: Target $(KBUILD_TARGET) is not officially supported!) TEMPLATE_VBOXMAINEXE_LIBS = endif TEMPLATE_VBOXMAINEXE_LDFLAGS.solaris = -Wl,-z,ignore # Same as VBOX_LD_as_needed. ifdef VBOX_WITH_RUNPATH TEMPLATE_VBOXMAINEXE_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' else ifdef VBOX_WITH_RELATIVE_RUNPATH TEMPLATE_VBOXMAINEXE_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)' endif ifdef VBOX_WITH_ORIGIN TEMPLATE_VBOXMAINEXE_LDFLAGS.linux += $(VBOX_GCC_ORIGIN_OPT) endif endif # !win # Add COM/XPCOM stuff TEMPLATE_VBOXMAINEXE_LIBS += \ $(PATH_STAGE_LIB)/VBoxCOM$(VBOX_SUFF_LIB) ifdef VBOX_WITH_XPCOM ## @todo may be worth creating the VBOX_XPCOM SDK def TEMPLATE_VBOXMAINEXE_DEFS += VBOX_WITH_XPCOM ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP TEMPLATE_VBOXMAINEXE_DEFS += VBOX_WITH_XPCOM_NAMESPACE_CLEANUP endif TEMPLATE_VBOXMAINEXE_INCS += \ $(VBOX_XPCOM_INCS) TEMPLATE_VBOXMAINEXE_LIBS += \ $(LIB_XPCOM) TEMPLATE_VBOXMAINEXE_INTERMEDIATES += \ $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h else # COM TEMPLATE_VBOXMAINEXE_INCS += \ $(VBOX_PATH_SDK)/bindings/mscom/include TEMPLATE_VBOXMAINEXE_INTERMEDIATES += \ $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h endif # COM # # Template for building the Main DLL modules (such as in-process COM/XPCOM # components for Main). # # This differs from VBOXMAINEXE only in PIC handling and similar DLL stuff. # TEMPLATE_VBOXMAINDLL = VBox Main Component (shared library) TEMPLATE_VBOXMAINDLL_EXTENDS = VBOXMAINEXE ifn1of ($(KBUILD_TARGET), darwin haiku os2 win) TEMPLATE_VBOXMAINDLL_DEFS = PIC $(TEMPLATE_VBOXMAINEXE_DEFS) TEMPLATE_VBOXMAINDLL_CFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_CFLAGS) TEMPLATE_VBOXMAINDLL_CXXFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_CXXFLAGS) TEMPLATE_VBOXMAINDLL_LDFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_LDFLAGS) endif TEMPLATE_VBOXMAINDLL_LDFLAGS.darwin = $(filter-out -bind_at_load,$(TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin)) \ -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \ -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) # # Template identical to VBOXMAINDLL except for where the stuff is # installed when using XPCOM (components/). # # Note! In the hardened build this gets a bit ugly since $ORIGIN/.. # doesn't work. So, we keep the $ORIGIN from VBOXMAINEXE and let # the installers do the necessary .so symlinking. # # (No difference when building against COM on Windows.) # TEMPLATE_VBOXMAINCOMP = VBox Main COM/XPCOM Component (shared library) TEMPLATE_VBOXMAINCOMP_EXTENDS = VBOXMAINEXE ifn1of ($(KBUILD_TARGET), win) TEMPLATE_VBOXMAINCOMP_INST = $(INST_BIN)components/ endif ifneq ($(KBUILD_TARGET),win) ifeq ($(filter-out solaris.x86 %.amd64 %.sparc32 %.sparc64,$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)),) ## TODO: cleanup! TEMPLATE_VBOXMAINCOMP_DEFS = PIC $(TEMPLATE_VBOXMAINEXE_DEFS) TEMPLATE_VBOXMAINCOMP_CFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_CFLAGS) TEMPLATE_VBOXMAINCOMP_CXXFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_CXXFLAGS) if defined(VBOX_WITH_RELATIVE_RUNPATH) && !defined(VBOX_WITH_HARDENING) TEMPLATE_VBOXMAINCOMP_LDFLAGS = -fPIC $(filter-out '$(VBOX_GCC_RPATH_OPT)%',$(TEMPLATE_VBOXMAINEXE_LDFLAGS)) '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/..' else TEMPLATE_VBOXMAINCOMP_LDFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_LDFLAGS) endif else ifndef VBOX_WITH_HARDENING ifdef VBOX_WITH_RELATIVE_RUNPATH TEMPLATE_VBOXMAINCOMP_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%',$(TEMPLATE_VBOXMAINEXE_LDFLAGS)) '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/..' endif endif endif TEMPLATE_VBOXMAINCOMP_LDFLAGS.darwin = $(filter-out -bind_at_load,$(TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin)) \ -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \ -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) TEMPLATE_VBoxMainComp-x86 = 32-bit VBox Main Component (shared library) TEMPLATE_VBoxMainComp-x86_EXTENDS = VBOXMAINCOMP TEMPLATE_VBoxMainComp-x86_BLD_TRG_ARCH = x86 TEMPLATE_VBoxMainComp-x86_INST.win = $(INST_DLL)x86/ TEMPLATE_VBoxMainComp-x86_DEFS = $(filter-out HC_ARCH_BITS%,$(TEMPLATE_VBOXMAINCOMP_DEFS)) HC_ARCH_BIT=32 ARCH_BITS=32 \ VBOX_IN_32_ON_64_MAIN_API TEMPLATE_VBoxMainComp-x86_LIBS = \ $(subst $(PATH_STAGE_LIB)/VBoxCOM$(VBOX_SUFF_LIB),$(PATH_STAGE_LIB)/VBoxCOM-x86$(VBOX_SUFF_LIB),\ $(subst $(LIB_RUNTIME),$(VBOX_LIB_RUNTIME_X86),\ $(subst $(LIB_XPCOM),$(VBOX_LIB_XPCOM_X86),\ $(TEMPLATE_VBOXMAINCOMP_LIBS)))) ifeq ($(KBUILD_TARGET),solaris) ifdef VBOX_WITH_RUNPATH TEMPLATE_VBoxMainComp-x86_LDFLAGS = \ $(filter-out '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)',$(TEMPLATE_VBOXMAINCOMP_LDFLAGS)) \ '$(VBOX_GCC_RPATH_OPT)$(VBOX_PATH_APP_PRIVATE)' \ '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' endif endif # # Template for building the Main static libraries. # # This differs from VBOXMAINDLL only that it zeroes out the _LIBS definition. # TEMPLATE_VBoxMainLib = VBox Main Component (static library) TEMPLATE_VBoxMainLib_EXTENDS = VBOXMAINDLL TEMPLATE_VBoxMainLib_LIBS = TEMPLATE_VBoxMainLib-x86 = 32-bit VBox Main Component (static library) TEMPLATE_VBoxMainLib-x86_EXTENDS = VBoxMainLib TEMPLATE_VBoxMainLib-x86_BLD_TRG_ARCH = x86 TEMPLATE_VBoxMainLib-x86_DEFS = $(filter-out HC_ARCH_BITS%,$(TEMPLATE_VBoxMainLib_DEFS)) HC_ARCH_BIT=32 ARCH_BITS=32 \ VBOX_IN_32_ON_64_MAIN_API # # Main unit testing, for compiling API implementation files into a testcase. # This is the VBOXMAINEXE template only with a different install dir. # TEMPLATE_VBOXMAINTSTEXE = VBox Main Testcase Exe TEMPLATE_VBOXMAINTSTEXE_EXTENDS = VBOXMAINEXE TEMPLATE_VBOXMAINTSTEXE_INST = $(INST_TESTCASE) ifdef VBOX_WITH_RUNPATH TEMPLATE_VBOXMAINTSTEXE_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' $(TEMPLATE_VBOXMAINEXE_LDFLAGS) else ifdef VBOX_WITH_RELATIVE_RUNPATH TEMPLATE_VBOXMAINTSTEXE_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/..' $(TEMPLATE_VBOXMAINEXE_LDFLAGS) endif if "$(KBUILD_TARGET)" == "win" && defined(VBOX_SIGNING_MODE) TEMPLATE_VBOXMAINTSTEXE_POST_CMDS = endif # # Template for building executables that use the VBox Main component. # TEMPLATE_VBOXMAINCLIENTEXE = VBox Main Client (executable) TEMPLATE_VBOXMAINCLIENTEXE_EXTENDS = VBOXMAINEXE ifeq ($(KBUILD_TARGET),win) TEMPLATE_VBOXMAINCLIENTEXE_DEPS = $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h TEMPLATE_VBOXMAINCLIENTEXE_LIBS.win = $(TEMPLATE_VBOXMAINEXE_LIBS.win) \ $(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 else TEMPLATE_VBOXMAINCLIENTEXE_DEPS = $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h TEMPLATE_VBOXMAINCLIENTEXE_DEFS = $(TEMPLATE_VBOXMAINEXE_DEFS) \ NDEBUG TRIMMED TEMPLATE_VBOXMAINCLIENTEXE_CXXFLAGS.linux = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.linux) \ -pthread endif # # Template for building shared libraries / DLLs that use the VBox Main component. # # This differs from VBOXMAINCLIENTEXE only in PIC handling and similar DLL stuff. # TEMPLATE_VBOXMAINCLIENTDLL = VBox MAIN Client (shared library) TEMPLATE_VBOXMAINCLIENTDLL_EXTENDS = VBOXMAINCLIENTEXE ifn1of ($(KBUILD_TARGET), darwin os2 win) TEMPLATE_VBOXMAINCLIENTDLL_DEFS = PIC $(TEMPLATE_VBOXMAINCLIENTEXE_DEFS) TEMPLATE_VBOXMAINCLIENTDLL_CFLAGS = -fPIC $(TEMPLATE_VBOXMAINCLIENTEXE_CFLAGS) TEMPLATE_VBOXMAINCLIENTDLL_CXXFLAGS = -fPIC $(TEMPLATE_VBOXMAINCLIENTEXE_CXXFLAGS) TEMPLATE_VBOXMAINCLIENTDLL_LDFLAGS = -fPIC $(TEMPLATE_VBOXMAINCLIENTEXE_LDFLAGS) endif TEMPLATE_VBOXMAINCLIENTDLL_LDFLAGS.darwin = $(filter-out -bind_at_load,$(TEMPLATE_VBOXMAINCLIENTEXE_LDFLAGS.darwin)) # # Template for building testcases which are API clients. # TEMPLATE_VBOXMAINCLIENTTSTEXE = VBox Main Client Testcase (executable) TEMPLATE_VBOXMAINCLIENTTSTEXE_EXTENDS = VBOXMAINCLIENTEXE TEMPLATE_VBOXMAINCLIENTTSTEXE_INST = $(INST_TESTCASE) ifdef VBOX_WITH_RUNPATH TEMPLATE_VBOXMAINCLIENTTSTEXE_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' $(TEMPLATE_VBOXMAINCLIENTEXE_LDFLAGS) else ifdef VBOX_WITH_RELATIVE_RUNPATH TEMPLATE_VBOXMAINCLIENTTSTEXE_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/..' $(TEMPLATE_VBOXMAINCLIENTEXE_LDFLAGS) endif if "$(KBUILD_TARGET)" == "win" && defined(VBOX_SIGNING_MODE) TEMPLATE_VBOXMAINCLIENTTSTEXE_POST_CMDS = endif # # Templates used for building the extension packs. # ifdef VBOX_WITH_EXTPACK # Base templates (native or portable). TEMPLATE_VBoxR3ExtPack = For the ring-3 context extension pack modules. if 1 # Native for now. TEMPLATE_VBoxR3ExtPack_EXTENDS = VBOXR3DLLNOXCPT TEMPLATE_VBoxR3ExtPack_DEFS = $(TEMPLATE_VBOXR3DLLNOXCPT_DEFS) VBOX_IN_EXTPACK VBOX_IN_EXTPACK_R3 else TEMPLATE_VBoxR3ExtPack_EXTENDS = VBoxNoCrtGccLib TEMPLATE_VBoxR3ExtPack_DEFS = $(TEMPLATE_VBoxNoCrtGccLib_DEFS) VBOX_IN_EXTPACK VBOX_IN_EXTPACK_R3 IPRT_NO_CRT IN_RING3 TEMPLATE_VBoxR3ExtPack_INCS = $(PATH_ROOT)/include/iprt/nocrt $(TEMPLATE_VBOXR3DLLNOXCPT_INCS) endif ifneq ($(KBUILD_TARGET),win) TEMPLATE_VBoxR3ExtPack_CXXFLAGS = $(TEMPLATE_VBOXR3DLLNOXCPT_CXXFLAGS) -fno-rtti endif TEMPLATE_VBoxR3ExtPack_INST = $(INST_EXTPACK)YouShallOverrideThis/ ifeq ($(KBUILD_TARGET),linux) TEMPLATE_VBoxR3ExtPack_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)', $(TEMPLATE_VBOXR3DLLNOXCPT_LDFLAGS)) else if !defined(VBOX_WITH_RUNPATH) && defined(VBOX_WITH_RELATIVE_RUNPATH) TEMPLATE_VBoxR3ExtPack_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/../../..' $(filter-out '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)', $(TEMPLATE_VBOXR3DLLNOXCPT_LDFLAGS)) endif endif ifdef VBOX_ONLY_EXTPACKS_USE_IMPLIBS if1of ($(KBUILD_TARGET), win os2) TEMPLATE_VBoxR3ExtPack_LIBS = \ $(TEMPLATE_LIBS_VBOXR3) \ $(if-expr "$(VBOX_LIB_VMM_LAZY)" == "$(LIB_VMM)", $(PATH_STAGE_LIB)/VMMR3Imp$(VBOX_SUFF_LIB), $(VBOX_LIB_VMM_LAZY)) \ $(PATH_STAGE_LIB)/VBoxRTImp$(VBOX_SUFF_LIB) else TEMPLATE_VBoxR3ExtPack_LIBS = \ $(TEMPLATE_LIBS_VBOXR3) \ $(if-expr "$(VBOX_LIB_VMM_LAZY)" == "$(LIB_VMM)", $(PATH_STAGE_LIB)/VMMR3Imp$(VBOX_SUFF_DLL), $(VBOX_LIB_VMM_LAZY)) \ $(PATH_STAGE_LIB)/VBoxRTImp$(VBOX_SUFF_DLL) endif else TEMPLATE_VBoxR3ExtPack_LIBS = \ $(TEMPLATE_LIBS_VBOXR3) \ $(LIB_RUNTIME) \ $(VBOX_LIB_VMM_LAZY) endif TEMPLATE_VBoxR0ExtPack = For the ring-0 context extension pack modules. TEMPLATE_VBoxR0ExtPack_EXTENDS = VBoxR0 TEMPLATE_VBoxR0ExtPack_EXTENDS_BY = appending TEMPLATE_VBoxR0ExtPack_INST = $(INST_EXTPACK)YouShallOverrideThis/ TEMPLATE_VBoxR0ExtPack_DEFS = VBOX_IN_EXTPACK VBOX_IN_EXTPACK_R0 if1of ($(VBOX_LDR_FMT), pe lx) TEMPLATE_VBoxR0ExtPack_LIBS = \ $(PATH_STAGE_LIB)/VMMR0Imp$(VBOX_SUFF_LIB) \ $(PATH_STAGE_LIB)/SUPR0$(VBOX_SUFF_LIB) endif TEMPLATE_VBoxRcExtPack = For the raw-mode context extension pack modules. TEMPLATE_VBoxRcExtPack_EXTENDS = VBoxRc TEMPLATE_VBoxRcExtPack_EXTENDS_BY = appending TEMPLATE_VBoxRcExtPack_SYSSUFF = .rc TEMPLATE_VBoxRcExtPack_INST = $(INST_EXTPACK)YouShallOverrideThis/ TEMPLATE_VBoxRcExtPack_DEFS = VBOX_IN_EXTPACK VBOX_IN_EXTPACK_RC if1of ($(VBOX_LDR_FMT32), pe lx) TEMPLATE_VBoxRcExtPack_LIBS = \ $(PATH_STAGE_LIB)/VMMRCBuiltin$(VBOX_SUFF_LIB) \ $(PATH_STAGE_LIB)/VMMRCImp$(VBOX_SUFF_LIB) endif TEMPLATE_VBoxInsExtPack = For the install targets of an extension pack. TEMPLATE_VBoxInsExtPack_MODE = 0644 TEMPLATE_VBoxInsExtPack_INST = $(INST_EXTPACK)YouShallOverrideThis/ # For each individual extension pack ifdef VBOX_WITH_EXTPACK_PUEL TEMPLATE_VBoxR3ExtPackPuel = For the ring-3 context modules in the PUEL extension pack. TEMPLATE_VBoxR3ExtPackPuel_EXTENDS = VBoxR3ExtPack TEMPLATE_VBoxR3ExtPackPuel_INST = $(INST_EXTPACK_PUEL)$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/ TEMPLATE_VBoxR3ExtPackPuel_DEFS = $(TEMPLATE_VBoxR3ExtPack_DEFS) VBOX_IN_PUEL_EXTPACK TEMPLATE_VBoxR3ExtPackPuelWithOpenSsl = For the ring-3 context modules in the PUEL extension pack using ExtPack OpenSSL. TEMPLATE_VBoxR3ExtPackPuelWithOpenSsl_EXTENDS = VBoxR3ExtPackPuel TEMPLATE_VBoxR3ExtPackPuelWithOpenSsl_INCS = \ $(TEMPLATE_VBoxR3ExtPack_INCS) \ $(SDK_VBOX_OPENSSL_VBOX_DEFAULT_INCS) TEMPLATE_VBoxR3ExtPackPuelWithOpenSsl_LIBS = \ $(PATH_STAGE_LIB)/VBoxExtPack-libssl$(VBOX_SUFF_LIB) \ $(PATH_STAGE_LIB)/VBoxExtPack-libcrypto$(VBOX_SUFF_LIB) \ $(TEMPLATE_VBoxR3ExtPack_LIBS) # Must come after the two libraries or we'll pick up SSL from VBoxRT! TEMPLATE_VBoxR0ExtPackPuel = For the ring-0 context modules in the PUEL extension pack. TEMPLATE_VBoxR0ExtPackPuel_EXTENDS = VBoxR0ExtPack TEMPLATE_VBoxR0ExtPackPuel_INST = $(INST_EXTPACK_PUEL)$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/ TEMPLATE_VBoxR0ExtPackPuel_DEFS = $(TEMPLATE_VBoxR0ExtPack_DEFS) VBOX_IN_PUEL_EXTPACK TEMPLATE_VBoxRcExtPackPuel = For the raw-mode context modules in the PUEL extension pack. TEMPLATE_VBoxRcExtPackPuel_EXTENDS = VBoxRcExtPack TEMPLATE_VBoxRcExtPackPuel_INST = $(INST_EXTPACK_PUEL)$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)/ TEMPLATE_VBoxRcExtPackPuel_DEFS = $(TEMPLATE_VBoxRcExtPack_DEFS) VBOX_IN_PUEL_EXTPACK TEMPLATE_VBoxInsExtPackPuel = For the install targets of an extension pack. TEMPLATE_VBoxInsExtPackPuel_EXTENDS = VBoxR0ExtPack TEMPLATE_VBoxInsExtPackPuel_INST = $(INST_EXTPACK_PUEL) endif endif # VBOX_WITH_EXTPACK # # Qt # Qt # Qt # ifdef VBOX_WITH_QTGUI # Guess VBOX_WITH_ORACLE_QT ifndef VBOX_WITH_ORACLE_QT ifndef VBOX_OSE if1of ($(KBUILD_TARGET), darwin solaris win) VBOX_WITH_ORACLE_QT := 1 endif endif endif # # Handmade configuration of Qt - very annoying, this needs to # be cleaned up properly later some time (not important now). # ifeq ($(VBOX_PATH_QT),) ifeq ($(KBUILD_TARGET),darwin) ifndef VBOX_WITH_QTGUI_V5 VBOX_PATH_QT := $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS_TRG)/qt/v4*))) else VBOX_PATH_QT := $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS_TRG)/qt/v5*))) endif ifeq ($(VBOX_PATH_QT),) ifneq ($(wildcard /Library/Frameworks/QtCore.framework),) # Using the global installation (for OSE). VBOX_PATH_QT ?= /usr VBOX_PATH_QT_FRAMEWORKS ?= /Library/Frameworks endif endif else if1of ($(KBUILD_TARGET), win) ifndef VBOX_WITH_QTGUI_V5 VBOX_PATH_QT ?= $(lastword $(filter %-$(tolower $(VBOX_VCC_TOOL_STEM)),$(sort $(wildcard $(KBUILD_DEVTOOLS_TRG)/qt/v4*)))) else VBOX_PATH_QT ?= $(lastword $(filter %-$(tolower $(VBOX_VCC_TOOL_STEM)),$(sort $(wildcard $(KBUILD_DEVTOOLS_TRG)/qt/v5*)))) endif else if1of ($(KBUILD_TARGET), linux solaris) ifndef VBOX_WITH_QTGUI_V5 VBOX_PATH_QT ?= $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS_TRG)/qt/v4*))) else VBOX_PATH_QT ?= $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS_TRG)/qt/v5*))) endif ifneq ($(VBOX_PATH_QT),) VBOX_WITH_ORACLE_QT = 1 endif endif endif ifeq ($(VBOX_PATH_QT),) if1of ($(USERNAME), bird) # gentoo (64-bit) VBOX_PATH_QT ?= /usr ifndef VBOX_WITH_QTGUI_V5 VBOX_PATH_QT_LIB ?= /usr/lib/qt4 else VBOX_PATH_QT_LIB ?= /usr/lib/qt5 endif endif endif VBOX_PATH_QT ?= /usr VBOX_PATH_QT_LIB ?= $(VBOX_PATH_QT)/lib ifdef VBOX_WITH_ORACLE_QT VBOX_QT_INFIX=VBox endif ifndef VBOX_WITH_QTGUI_V5 VBOX_QT_MOD = QtCore QtGui $(if $(VBOX_GUI_USE_QGL),QtOpenGL,) else # VBOX_WITH_QTGUI_V5 ifeq ($(KBUILD_TARGET), darwin) VBOX_QT_MOD = \ QtCore QtGui QtWidgets QtPrintSupport QtMacExtras \ $(if $(VBOX_GUI_USE_QGL),QtOpenGL,) else if1of ($(KBUILD_TARGET), linux freebsd netbsd openbsd solaris win) VBOX_QT_MOD += \ Qt5Core Qt5Gui Qt5Widgets Qt5PrintSupport \ $(if $(VBOX_GUI_USE_QGL),Qt5OpenGL,) if1of ($(KBUILD_TARGET), linux freebsd netbsd openbsd solaris) VBOX_QT_MOD += \ Qt5DBus Qt5XcbQpa Qt5X11Extras # legacy libraries required to be installed on EL5 VBOX_QT_LEGACY_LIBS = \ $(if $(VBOX_LD_HAS_LIBXCB),,libxcb.so.1 libX11.so.6 libX11-xcb.so.1) VBOX_QT_PLUGINS = plugins/platforms/libqxcb.so else ifeq ($(KBUILD_TARGET), win) VBOX_QT_MOD += \ Qt5WinExtras endif # win endif # linux freebsd netbsd openbsd solaris win endif # VBOX_WITH_QTGUI_V5 VBOX_QT_MOD_NAMES = $(foreach qtmod,$(VBOX_QT_MOD),$(qtmod)$(VBOX_QT_INFIX)) # Hack LD_LIBRARY_PATH for stuff in tools. ifdef VBOX_WITH_ORACLE_QT if1of ($(KBUILD_TARGET), linux solaris) export LD_LIBRARY_PATH := $(VBOX_PATH_QT_LIB):$(LD_LIBRARY_PATH) endif endif # # Template for building Qt GUI executables. # TEMPLATE_VBOXQTGUIEXE = VBox Qt GUI Executable ifndef VBOX_WITH_QTGUI_V5 TEMPLATE_VBOXQTGUIEXE_USES = qt4 TEMPLATE_VBOXQTGUIEXE_QTTOOL = QT4 TEMPLATE_VBOXQTGUIEXE_MOCTOOL = QT4 TEMPLATE_VBOXQTGUIEXE_UICTOOL = QT4 TEMPLATE_VBOXQTGUIEXE_RCCTOOL = QT4 TEMPLATE_VBOXQTGUIEXE_LRCTOOL = QT4 TEMPLATE_VBOXQTGUIEXE_SDKS = QT4 else # VBOX_WITH_QTGUI_V5 TEMPLATE_VBOXQTGUIEXE_USES = qt5 TEMPLATE_VBOXQTGUIEXE_QTTOOL = QT5 TEMPLATE_VBOXQTGUIEXE_MOCTOOL = QT5 TEMPLATE_VBOXQTGUIEXE_UICTOOL = QT5 TEMPLATE_VBOXQTGUIEXE_RCCTOOL = QT5 TEMPLATE_VBOXQTGUIEXE_LRCTOOL = QT5 TEMPLATE_VBOXQTGUIEXE_SDKS = QT5 TEMPLATE_VBOXQTGUIEXE_MOCDEFS.darwin += QT_VERSION=0x050602 endif # VBOX_WITH_QTGUI_V5 TEMPLATE_VBOXQTGUIEXE_QT_INFIX = $(VBOX_QT_INFIX) TEMPLATE_VBOXQTGUIEXE_DEFS = IN_RING3 QT_NO_DEBUG QT_THREAD_SUPPORT QT_SHARED HAVE_CONFIG_H $(ARCH_BITS_DEFS) TEMPLATE_VBOXQTGUIEXE_RCDEFS = $(TEMPLATE_VBOXR3EXE_RCDEFS) ifeq ($(KBUILD_TARGET),win) # Note! No use of VBOX_VCC_CRT_TYPE here yet as it requires a /MDd build of Qt as well. TEMPLATE_VBOXQTGUIEXE_TOOL = $(VBOX_VCC_TOOL) TEMPLATE_VBOXQTGUIEXE_DEFS += \ _WIN32_WINNT=0x0500 UNICODE _UNICODE \ QT_DLL _CRT_SECURE_NO_DEPRECATE \ $(QMAKE_PRL_DEFINES) TEMPLATE_VBOXQTGUIEXE_CXXFLAGS = -nologo -Zm200 -MD -Zi -EHsc -Zc:wchar_t- # -wd4481: nonstandard extension used: override specifier 'override' # -wd4625: 'QRubberBand' : copy constructor could not be generated because a base class copy constructor is inaccessible # -wd4626: 'QRubberBand' : assignment operator could not be generated because a base class assignment operator is inaccessible # -wd4640: qmetatype.h(2210): warning C4640: 'f' : construction of local static object is not thread-safe [too bad] # -wd4350: behavior change: 'int QStringList::indexOf(const QRegExp &,int) const' called instead of 'int QStringList::indexOf(QRegExp &,int) const' # -wd4371: UIActionPool.h(393) : warning C4371: 'UIActionPool::PointerToFunction' : layout of class may have changed from a previous version of the compiler due to better packing of member 'UIActionPool::PointerToFunction::ptfr' # -wd4121: UIActionPool.h(393) : warning C4121: 'UIActionPool::PointerToFunction' : alignment of a member was sensitive to packing # -wd4718: qmap.h(222) : warning C4718: 'QMapNode::destroySubTree' : recursive call has no side effects, deleting TEMPLATE_VBOXQTGUIEXE_CXXFLAGS += $(VBOX_VCC_WARN_ALL) -wd4481 -wd4625 -wd4626 -wd4640 -wd4350 -wd4371 -wd4121 -wd4718 $(VBOX_VCC_WERR) TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.debug = -RTCsu TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.dbgopt = $(NO_SUCH_VARIABLE) TEMPLATE_VBOXQTGUIEXE_LDFLAGS = -Ignore:4197 \ /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LargeAddressAware /DynamicBase /NxCompat /Release /Debug /Opt:Ref /Opt:Icf \ /Version:$(VBOX_VERSION_MAJOR)0$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \ /STUB:$(PATH_ROOT)/src/VBox/HostDrivers/Support/win/winstub.com if defined(VBOX_SIGNING_MODE) && defined(VBOX_WITH_HARDENING) TEMPLATE_VBOXQTGUIEXE_LDFLAGS += -IntegrityCheck endif TEMPLATE_VBOXQTGUIEXE_SDKS += $(VBOX_WINPSDK) TEMPLATE_VBOXQTGUIEXE_LIBS = \ $(VBOX_LIBS_QT) \ $(LIB_RUNTIME) \ $(VBOX_LIB_VMM_LAZY) \ $(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 TEMPLATE_VBOXQTGUIEXE_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS) else # the gcc guys: TEMPLATE_VBOXQTGUIEXE_TOOL = $(VBOX_GCC_TOOL) TEMPLATE_VBOXQTGUIEXE_DEFS.linux = _REENTRANT TEMPLATE_VBOXQTGUIEXE_DEFS.solaris = _REENTRANT ## @todo Use VBOX_GCC_PEDANTIC_CXX? TEMPLATE_VBOXQTGUIEXE_CXXFLAGS = \ -g $(VBOX_GCC_pipe) $(filter-out -Wno-unused,$(VBOX_GCC_WARN)) -frtti -fno-exceptions \ -Wno-long-long -fshort-wchar -fno-strict-aliasing \ $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden) \ $(VBOX_GCC_Wno-return-type-c-linkage) $(VBOX_GCC_std) $(VBOX_GCC_IPRT_FMT_CHECK) ifdef VBOX_WITH_NO_GCC_WARNING_POLICY TEMPLATE_VBOXQTGUIEXE_CXXFLAGS += $(VBOX_GCC_WERR) endif TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.x86 = -m32 TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.amd64 = -m64 TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.linux = -pthread TEMPLATE_VBOXQTGUIEXE_OBJCFLAGS = -g $(VBOX_GCC_pipe) $(VBOX_GCC_PEDANTIC_C) -fno-exceptions $(VBOX_GCC_IPRT_FMT_CHECK) TEMPLATE_VBOXQTGUIEXE_OBJCFLAGS.x86 = $(TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.x86) TEMPLATE_VBOXQTGUIEXE_OBJCFLAGS.amd64 = $(TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.amd64) TEMPLATE_VBOXQTGUIEXE_OBJCXXFLAGS = \ -g $(VBOX_GCC_pipe) $(VBOX_GCC_PEDANTIC_CXX) \ -frtti -fno-exceptions $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_IPRT_FMT_CHECK) ifdef VBOX_WITH_NO_GCC_WARNING_POLICY TEMPLATE_VBOXQTGUIEXE_OBJCXXFLAGS += $(VBOX_GCC_WERR) endif TEMPLATE_VBOXQTGUIEXE_OBJCXXFLAGS.x86 = $(TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.x86) TEMPLATE_VBOXQTGUIEXE_OBJCXXFLAGS.amd64 = $(TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.amd64) TEMPLATE_VBOXQTGUIEXE_LDFLAGS.x86 = -m32 TEMPLATE_VBOXQTGUIEXE_LDFLAGS.amd64 = -m64 TEMPLATE_VBOXQTGUIEXE_LIBS = \ $(VBOX_LIBS_QT) \ $(LIB_SDL) \ $(LIB_RUNTIME) \ $(if-expr "$(LIB_VMM)" == "$(VBOX_LIB_VMM_LAZY)",$(LIB_REM),) \ $(VBOX_LIB_VMM_LAZY) ifeq ($(KBUILD_TARGET),linux) TEMPLATE_VBOXQTGUIEXE_LDFLAGS += -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed) TEMPLATE_VBOXQTGUIEXE_LIBS += \ $(VBOX_XCURSOR_LIBS) \ Xext \ X11 TEMPLATE_VBOXQTGUIEXE_LIBPATH += \ $(VBOX_LIBPATH_X11) if defined(VBOX_WITH_QTGUI_V5) && defined(VBOX_WITH_ORACLE_QT) && !defined(VBOX_LD_HAS_LIBXCB) TEMPLATE_VBOXQTGUIEXE_LIBPATH += $(PATH_SDK_QT5_LIB)/legacy TEMPLATE_VBOXQTGUIEXE_INCS += $(PATH_SDK_QT5_INC)/legacy endif else ifeq ($(KBUILD_TARGET),darwin) TEMPLATE_VBOXQTGUIEXE_DEFS.darwin += $(VBOX_DARWIN_DEF_SDK_DEFS) TEMPLATE_VBOXQTGUIEXE_CFLAGS.darwin += $(VBOX_DARWIN_DEF_SDK_CFLAGS) TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.darwin += $(VBOX_DARWIN_DEF_SDK_CXXFLAGS) TEMPLATE_VBOXQTGUIEXE_OBJCFLAGS.darwin += $(VBOX_DARWIN_DEF_SDK_OBJCFLAGS) TEMPLATE_VBOXQTGUIEXE_OBJCXXFLAGS.darwin += $(VBOX_DARWIN_DEF_SDK_OBJCXXFLAGS) TEMPLATE_VBOXQTGUIEXE_LDFLAGS.darwin += $(VBOX_DARWIN_DEF_SDK_LDFLAGS) -bind_at_load TEMPLATE_VBOXQTGUIEXE_LIBS += TEMPLATE_VBOXQTGUIEXE_LIBPATH += else TEMPLATE_VBOXQTGUIEXE_INCS += \ $(VBOX_XCURSOR_INCS) TEMPLATE_VBOXQTGUIEXE_LIBS += \ $(VBOX_XCURSOR_LIBS) \ Xext \ X11 \ m \ $(LIB_PTHREAD) TEMPLATE_VBOXQTGUIEXE_LIBPATH += \ $(VBOX_LIBPATH_X11) ifeq ($(KBUILD_TARGET),freebsd) TEMPLATE_VBOXQTGUIEXE_INCS += \ /usr/include \ /usr/X11R6/include \ /usr/local/include TEMPLATE_VBOXQTGUIEXE_LIBPATH += \ /usr/lib \ /usr/X11R6/lib \ /usr/local/lib endif ifeq ($(KBUILD_TARGET),solaris) TEMPLATE_VBOXQTGUIEXE_LDFLAGS.solaris = -Wl,-z,ignore # Same as VBOX_LD_as_needed. TEMPLATE_VBOXQTGUIEXE_LIBS += \ rt socket nsl endif endif # Assume the Qt shared objects are in the same directory as the executable, on Solaris too. ifdef VBOX_WITH_RUNPATH TEMPLATE_VBOXQTGUIEXE_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' else ifdef VBOX_WITH_RELATIVE_RUNPATH TEMPLATE_VBOXQTGUIEXE_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)' endif endif # Add COM/XPCOM stuff TEMPLATE_VBOXQTGUIEXE_LIBS += \ $(PATH_STAGE_LIB)/VBoxCOM$(if-expr defined(VBOX_WITH_DEBUG_VCC_CRT) && $(KBUILD_TARGET) == win,-GUI,)$(VBOX_SUFF_LIB) ifdef VBOX_WITH_XPCOM ## @todo may be worth creating the VBOX_XPCOM SDK def, or just a SDK_VBOXXPCOM. TEMPLATE_VBOXQTGUIEXE_DEFS += VBOX_WITH_XPCOM ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP TEMPLATE_VBOXQTGUIEXE_DEFS += VBOX_WITH_XPCOM_NAMESPACE_CLEANUP endif TEMPLATE_VBOXQTGUIEXE_INCS += \ $(VBOX_XPCOM_INCS) TEMPLATE_VBOXQTGUIEXE_LIBS += \ $(LIB_XPCOM) TEMPLATE_VBOXQTGUIEXE_INTERMEDIATES += \ $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h else # COM TEMPLATE_VBOXQTGUIEXE_INCS += \ $(VBOX_PATH_SDK)/bindings/mscom/include TEMPLATE_VBOXQTGUIEXE_INTERMEDIATES += \ $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h endif # COM ifdef VBOX_WITH_QTGUI_V5 ifn1of ($(KBUILD_TARGET), darwin os2 win) TEMPLATE_VBOXQTGUIEXE_DEFS += PIC TEMPLATE_VBOXQTGUIEXE_CFLAGS += -fPIC TEMPLATE_VBOXQTGUIEXE_CXXFLAGS += -fPIC TEMPLATE_VBOXQTGUIEXE_LDFLAGS += -fPIC endif # not darwin, os2 or win endif # VBOX_WITH_QTGUI_V5 # # Template for building Qt GUI components. # TEMPLATE_VBOXQTGUI = VBox Qt GUI Components TEMPLATE_VBOXQTGUI_EXTENDS = VBOXQTGUIEXE TEMPLATE_VBOXQTGUI_LIBS = $(filter-out $(QTMAIN),$(TEMPLATE_VBOXQTGUIEXE_LIBS)) ifeq ($(KBUILD_TARGET),darwin) TEMPLATE_VBOXQTGUI_LDFLAGS.darwin += $(filter-out -bind_at_load,$(TEMPLATE_VBOXQTGUIEXE_LDFLAGS.darwin)) \ -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \ -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) endif ifn1of ($(KBUILD_TARGET), darwin os2 win) TEMPLATE_VBOXQTGUI_DEFS = PIC $(TEMPLATE_VBOXQTGUIEXE_DEFS) TEMPLATE_VBOXQTGUI_CFLAGS = -fPIC $(TEMPLATE_VBOXQTGUIEXE_CFLAGS) TEMPLATE_VBOXQTGUI_CXXFLAGS = -fPIC $(TEMPLATE_VBOXQTGUIEXE_CXXFLAGS) TEMPLATE_VBOXQTGUI_LDFLAGS = -fPIC $(TEMPLATE_VBOXQTGUIEXE_LDFLAGS) endif endif # VBOX_WITH_QTGUI # # Template for installing symbol files that we wish to ship. # TEMPLATE_VBoxDbgSyms = Symbol files for VBoxDbg and gurus. TEMPLATE_VBoxDbgSyms_INST = $(INST_VBOXDBG_SYMS) # # Template for building build bldprogs. # HACK ALERT! The BLD_TRG_* is a hack to allow building libraries as well. # TEMPLATE_VBoxBldProg = VBox Build Program TEMPLATE_VBoxBldProg_BLD_TRG := $(KBUILD_HOST) TEMPLATE_VBoxBldProg_BLD_TRG_ARCH := $(KBUILD_HOST_ARCH) TEMPLATE_VBoxBldProg_BLD_TRG_CPU := $(KBUILD_HOST_CPU) TEMPLATE_VBoxBldProg_DEFS := IN_RING3 LOG_DISABLED IN_BLD_PROG TEMPLATE_VBoxBldProg_DEFS.win := _CRT_SECURE_NO_DEPRECATE ifeq ($(KBUILD_TARGET),$(KBUILD_HOST)) TEMPLATE_VBoxBldProg_ASTOOL := $(VBOX_ASTOOL) TEMPLATE_VBoxBldProg_ASFLAGS.x86 := $(VBOX_ASFLAGS32) TEMPLATE_VBoxBldProg_ASFLAGS.amd64 := $(VBOX_ASFLAGS64) else TEMPLATE_VBoxBldProg_ASTOOL := YASM TEMPLATE_VBoxBldProg_ASFLAGS := -D__YASM__ -Worphan-labels $(VBOX_YASM_Wno-segreg-in-64bit) if1of ($(KBUILD_HOST),win) TEMPLATE_VBoxBldProg_ASFLAGS += -g cv8 -DASM_FORMAT_ELF TEMPLATE_VBoxBldProg_ASFLAGS.x86 := -f win32 TEMPLATE_VBoxBldProg_ASFLAGS.amd64 := -f win64 else if1of ($(KBUILD_HOST),darwin) TEMPLATE_VBoxBldProg_ASFLAGS += -DASM_FORMAT_MACHO TEMPLATE_VBoxBldProg_ASFLAGS.x86 := -f macho32 TEMPLATE_VBoxBldProg_ASFLAGS.amd64 := -f macho64 else TEMPLATE_VBoxBldProg_ASFLAGS += -g dwarf2 -DASM_FORMAT_ELF TEMPLATE_VBoxBldProg_ASFLAGS.x86 := -f elf32 TEMPLATE_VBoxBldProg_ASFLAGS.amd64 := -f elf64 endif endif ifeq ($(KBUILD_HOST),win) TEMPLATE_VBoxBldProg_TOOL := $(VBOX_VCC_TOOL_STEM)$(toupper $(KBUILD_HOST_ARCH)) TEMPLATE_VBoxBldProg_SDKS := ReorderCompilerIncs $(VBOX_WINPSDK) TEMPLATE_VBoxBldProg_CXXFLAGS := -Zi -Zl -GR- -EHsc -GF -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP) -MT$(VBOX_VCC_CRT_TYPE) \ $(VBOX_VCC_WARN_ALL) $(VBOX_VCC_WERR) TEMPLATE_VBoxBldProg_CXXFLAGS.debug := -RTCsu TEMPLATE_VBoxBldProg_CXXFLAGS.dbgopt = $(NO_SUCH_VARIABLE) TEMPLATE_VBoxBldProg_CXXFLAGS.profile = $(TEMPLATE_VBoxBldProg_CXXFLAGS.release) TEMPLATE_VBoxBldProg_CXXFLAGS.kprofile = $(TEMPLATE_VBoxBldProg_CXXFLAGS.release) TEMPLATE_VBoxBldProg_CFLAGS = $(TEMPLATE_VBoxBldProg_CXXFLAGS) TEMPLATE_VBoxBldProg_CFLAGS.debug = $(TEMPLATE_VBoxBldProg_CXXFLAGS.debug) TEMPLATE_VBoxBldProg_CFLAGS.dbgopt = $(TEMPLATE_VBoxBldProg_CXXFLAGS.dbgopt) TEMPLATE_VBoxBldProg_CFLAGS.release = $(TEMPLATE_VBoxBldProg_CXXFLAGS.release) TEMPLATE_VBoxBldProg_CFLAGS.profile = $(TEMPLATE_VBoxBldProg_CXXFLAGS.profile) TEMPLATE_VBoxBldProg_CFLAGS.kprofile = $(TEMPLATE_VBoxBldProg_CXXFLAGS.kprofile) TEMPLATE_VBoxBldProg_LDFLAGS = -Ignore:4197 \ /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LargeAddressAware /DynamicBase /NxCompat /Release /Debug /Opt:Ref /Opt:Icf \ /Version:$(VBOX_VERSION_MAJOR)0$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \ /DISALLOWLIB:libc$(VBOX_VCC_CRT_TYPE_N).lib \ /DISALLOWLIB:libcmt$(VBOX_VCC_CRT_TYPE_N).lib \ /DISALLOWLIB:msvcrt.lib \ /DISALLOWLIB:msvcrtd.lib \ /DISALLOWLIB:msvcprt.lib \ /DISALLOWLIB:msvcprtd.lib TEMPLATE_VBoxBldProg_LIBS = \ $(PATH_TOOL_$(TEMPLATE_VBoxBldProg_TOOL)_LIB)/oldnames.lib \ $(PATH_TOOL_$(TEMPLATE_VBoxBldProg_TOOL)_LIB)/libcmt$(VBOX_VCC_CRT_TYPE).lib \ $(PATH_TOOL_$(TEMPLATE_VBoxBldProg_TOOL)_LIB)/libcpmt$(VBOX_VCC_CRT_TYPE).lib else # (gcc of some kind ) TEMPLATE_VBoxBldProg_TOOL = GXX3 TEMPLATE_VBoxBldProg_CFLAGS = -g $(VBOX_GCC_pipe) $(VBOX_GCC_PEDANTIC_C) $(VBOX_GCC_Wno-variadic-macros) ifdef VBOX_WITH_NO_GCC_WARNING_POLICY TEMPLATE_VBoxBldProg_CFLAGS += $(VBOX_GCC_WERR) endif TEMPLATE_VBoxBldProg_CFLAGS.x86 = -m32 TEMPLATE_VBoxBldProg_CFLAGS.sparc32 = -m32 TEMPLATE_VBoxBldProg_CFLAGS.amd64 = -m64 TEMPLATE_VBoxBldProg_CFLAGS.sparc64 = -m64 TEMPLATE_VBoxBldProg_CFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing TEMPLATE_VBoxBldProg_CFLAGS.profile = $(TEMPLATE_VBoxBldProg_CXXFLAGS.profile) TEMPLATE_VBoxBldProg_CFLAGS.kprofile = $(TEMPLATE_VBoxBldProg_CXXFLAGS.kprofile) TEMPLATE_VBoxBldProg_CXXFLAGS = -g $(VBOX_GCC_pipe) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) ifdef VBOX_WITH_NO_GCC_WARNING_POLICY TEMPLATE_VBoxBldProg_CXXFLAGS += $(VBOX_GCC_WERR) endif TEMPLATE_VBoxBldProg_CXXFLAGS.x86 = -m32 TEMPLATE_VBoxBldProg_CXXFLAGS.sparc32 = -m32 TEMPLATE_VBoxBldProg_CXXFLAGS.amd64 = -m64 TEMPLATE_VBoxBldProg_CXXFLAGS.sparc64 = -m64 TEMPLATE_VBoxBldProg_CXXFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing TEMPLATE_VBoxBldProg_CXXFLAGS.profile = $(TEMPLATE_VBoxBldProg_CXXFLAGS.release) TEMPLATE_VBoxBldProg_CXXFLAGS.kprofile = $(TEMPLATE_VBoxBldProg_CXXFLAGS.release) TEMPLATE_VBoxBldProg_OBJCFLAGS = $(TEMPLATE_VBoxBldProg_CFLAGS) TEMPLATE_VBoxBldProg_OBJCFLAGS.x86 = $(TEMPLATE_VBoxBldProg_CFLAGS.x86) TEMPLATE_VBoxBldProg_OBJCFLAGS.amd64 = $(TEMPLATE_VBoxBldProg_CFLAGS.amd64) TEMPLATE_VBoxBldProg_OBJCFLAGS.release = $(TEMPLATE_VBoxBldProg_CFLAGS.release) TEMPLATE_VBoxBldProg_OBJCFLAGS.profile = $(TEMPLATE_VBoxBldProg_CFLAGS.profile) TEMPLATE_VBoxBldProg_OBJCFLAGS.kprofile = $(TEMPLATE_VBoxBldProg_CFLAGS.kprofile) TEMPLATE_VBoxBldProg_OBJCXXFLAGS = $(TEMPLATE_VBoxBldProg_CXXFLAGS) TEMPLATE_VBoxBldProg_OBJCXXFLAGS.x86 = $(TEMPLATE_VBoxBldProg_CXXFLAGS.x86) TEMPLATE_VBoxBldProg_OBJCXXFLAGS.amd64 = $(TEMPLATE_VBoxBldProg_CXXFLAGS.amd64) TEMPLATE_VBoxBldProg_OBJCXXFLAGS.release = $(TEMPLATE_VBoxBldProg_CXXFLAGS.release) TEMPLATE_VBoxBldProg_OBJCXXFLAGS.profile = $(TEMPLATE_VBoxBldProg_CXXFLAGS.profile) TEMPLATE_VBoxBldProg_OBJCXXFLAGS.kprofile= $(TEMPLATE_VBoxBldProg_CXXFLAGS.kprofile) TEMPLATE_VBoxBldProg_LDFLAGS.x86 = -m32 TEMPLATE_VBoxBldProg_LDFLAGS.sparc32 = -m32 TEMPLATE_VBoxBldProg_LDFLAGS.amd64 = -m64 TEMPLATE_VBoxBldProg_LDFLAGS.sparc64 = -m64 ifeq ($(KBUILD_HOST),linux) TEMPLATE_VBoxBldProg_LIBS = pthread m rt dl else ifeq ($(KBUILD_HOST),os2) TEMPLATE_VBoxBldProg_TOOL = GXX3OMF TEMPLATE_VBoxBldProg_LIBS = socket iconv else ifeq ($(KBUILD_HOST),darwin) TEMPLATE_VBoxBldProg_TOOL = $(VBOX_GCC_TOOL) if "$(VBOX_DEF_MACOSX_VERSION_MIN)" == "10.7" || "$(VBOX_DARWIN_HOST_VERSION_MAJOR)" == "7" 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) else if "$(VBOX_DEF_MACOSX_VERSION_MIN)" == "10.6" || "$(VBOX_DARWIN_HOST_VERSION_MAJOR)" == "6" 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) else 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) endif TEMPLATE_VBoxBldProg_LIBS = else ifeq ($(KBUILD_HOST),haiku) TEMPLATE_VBoxBldProg_TOOL = GXX3 TEMPLATE_VBoxBldProg_LIBS = network iconv TEMPLATE_VBoxBldProg_LIBPATH += \ /boot/common/lib else if1of ($(KBUILD_HOST), freebsd openbsd) TEMPLATE_VBoxBldProg_TOOL = GXX3 TEMPLATE_VBoxBldProg_LIBS = pthread TEMPLATE_VBoxBldProg_INCS += \ /usr/include \ /usr/X11R6/include \ /usr/local/include TEMPLATE_VBoxBldProg_LIBPATH += \ /usr/lib \ /usr/X11R6/lib \ /usr/local/lib else ifeq ($(KBUILD_HOST),netbsd) TEMPLATE_VBoxBldProg_TOOL = GXX3 TEMPLATE_VBoxBldProg_LIBS = pthread TEMPLATE_VBoxBldProg_INCS += \ /usr/include \ /usr/X11R7/include TEMPLATE_VBoxBldProg_LIBPATH += \ /usr/lib \ /usr/X11R7/lib else ifeq ($(KBUILD_HOST),solaris) TEMPLATE_VBoxBldProg_TOOL = GXX3PLAIN TEMPLATE_VBoxBldProg_LIBS = rt else $(warning Warning: VBOX Build: Target $(KBUILD_HOST) is not officially supported!) endif endif # !win # # Advanced build programs using IPRT and stuff. # TEMPLATE_VBoxAdvBldProg = Advanced VBox Build Program TEMPLATE_VBoxAdvBldProg_EXTENDS = VBoxBldProg TEMPLATE_VBoxAdvBldProg_SDKS = $(TEMPLATE_VBoxBldProg_SDKS) TEMPLATE_VBoxAdvBldProg_SDKS.win= $(TEMPLATE_VBoxBldProg_SDKS.win) VBOX_NTDLL TEMPLATE_VBoxAdvBldProg_DEFS = $(TEMPLATE_VBoxBldProg_DEFS) IN_RT_R3 IN_ADV_BLD_PROG ifeq ($(KBUILD_HOST),win) TEMPLATE_VBoxAdvBldProg_CFLAGS = $(TEMPLATE_VBoxBldProg_CFLAGS) $(VBOX_VCC_WERR) TEMPLATE_VBoxAdvBldProg_CXXFLAGS = $(TEMPLATE_VBoxBldProg_CXXFLAGS) $(VBOX_VCC_WERR) endif TEMPLATE_VBoxAdvBldProg_LIBS = \ $(PATH_STAGE_LIB)/RuntimeBldProg$(VBOX_HOSTSUFF_LIB) \ $(if-expr defined(IPRT_WITH_KSTUFF), \ $(PATH_STAGE_LIB)/VBox-kStuffStaticBldProg$(VBOX_HOSTSUFF_LIB) \ $(PATH_STAGE_LIB)/RuntimeBldProg$(VBOX_HOSTSUFF_LIB) \ ,) \ $(TEMPLATE_VBoxBldProg_LIBS) TEMPLATE_VBoxAdvBldProg_LIBS.darwin = \ $(TEMPLATE_VBoxAdvBldProg_LIBS) \ iconv \ $(TEMPLATE_VBoxBldProg_LIBS.darwin) TEMPLATE_VBoxAdvBldProg_LIBS.freebsd = \ $(TEMPLATE_VBoxAdvBldProg_LIBS) \ iconv \ rt \ $(TEMPLATE_VBoxBldProg_LIBS.freebsd) TEMPLATE_VBoxAdvBldProg_LIBS.linux = \ $(TEMPLATE_VBoxAdvBldProg_LIBS) \ crypt \ $(TEMPLATE_VBoxBldProg_LIBS.linux) TEMPLATE_VBoxAdvBldProg_LIBS.solaris = \ $(TEMPLATE_VBoxAdvBldProg_LIBS) \ contract \ kstat \ rt \ socket \ nsl \ $(TEMPLATE_VBoxBldProg_LIBS.solaris) # # Windows rc workaround for crosscompiling. # (Some (old) Wine versions fails loading msvcrt.dll from the VCC bin directory.) # ifneq ($(KBUILD_HOST),win) TOOL_VCC80X86_RC := $(EXEC_X86_WIN32) $(KBUILD_DEVTOOLS)/win.x86/bin/rc.exe TOOL_VCC80AMD64_RC := $(EXEC_X86_WIN32) $(KBUILD_DEVTOOLS)/win.x86/bin/rc.exe TOOL_VCC70_RC := $(EXEC_X86_WIN32) $(KBUILD_DEVTOOLS)/win.x86/bin/rc.exe WIN32_MC = $(EXEC_X86_WIN32) $(KBUILD_DEVTOOLS)/win.x86/bin/mc.exe else WIN32_MC = $(EXEC_X86_WIN32) $(firstword $(wildcard \ $(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\ $(KBUILD_DEVTOOLS)/win.x86/bin/mc.exe\ ) Sorry_Cannot_find_mc_in_the_PSDK) endif # # Template for building R3 programs for the guest additions. # TEMPLATE_VBOXGUESTR3EXE = VBox Guest Program ifeq ($(KBUILD_TARGET),win) TEMPLATE_VBOXGUESTR3EXE_EXTENDS = VBOXR3EXE TEMPLATE_VBOXGUESTR3EXE_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK_GST) VBOX_NTDLL 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)) \ /DISALLOWLIB:msvcrt$(VBOX_VCC_CRT_TYPE).lib \ /DISALLOWLIB:msvcprt$(VBOX_VCC_CRT_TYPE).lib TEMPLATE_VBOXGUESTR3EXE_LIBS.x86 = \ $(PATH_TOOL_$(TEMPLATE_VBOXGUESTR3EXE_TOOL.win.x86)_LIB)/oldnames.lib \ $(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 TEMPLATE_VBOXGUESTR3EXE_LIBS.amd64 = \ $(PATH_TOOL_$(TEMPLATE_VBOXGUESTR3EXE_TOOL.win.amd64)_LIB)/oldnames.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 # Hack for running on NT4, W2K and XP w/o SP: Change OS and subsystem version in the image. # HACK ALERT! Double expansion of $$(NLTAB). 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)) if defined(VBOX_WITH_MORE_NT4_COMPAT_BINARIES) && "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.x86" TEMPLATE_VBOXGUESTR3EXE_LIBS.win.x86 = $(NO_SUCH_VARIABLE)# Ditch RuntimeR3VccTricks2 endif else # the gcc guys ifdef VBOX_WITH_COMPATIBLE_LINUX_GUEST_PACKAGE ifneq ($(KBUILD_TARGET),linux) override VBOX_WITH_COMPATIBLE_LINUX_GUEST_PACKAGE := endif endif TEMPLATE_VBOXGUESTR3EXE_EXTENDS = VBOXR3EXE TEMPLATE_VBOXGUESTR3EXE_TOOL := $(subst GXX,GCC,$(TEMPLATE_VBOXR3EXE_TOOL)) TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) -fno-exceptions TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.linux)) ifdef VBOX_WITH_COMPATIBLE_LINUX_GUEST_PACKAGE ifeq ($(KBUILD_TARGET_ARCH),x86) TEMPLATE_VBOXGUESTR3EXE_TOOL := VBoxXGccX86RedHatLinux else ifeq ($(KBUILD_TARGET_ARCH),amd64) TEMPLATE_VBOXGUESTR3EXE_TOOL := VBoxXGccAmd64LinuxGnu TEMPLATE_VBOXGUESTR3EXE_TOOL.x86 := VBoxXGccX86RedHatLinux endif TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS := $(filter-out $(VBOX_GCC_Wextra) $(VBOX_GCC_WERR) \ $(VBOX_GCC_Wno-missing-field-initializers) $(VBOX_GCC_fdiagnostics-show-option) $(VBOX_GCC_Wno-variadic-macros) \ $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_mtune-generic) $(VBOX_GCC_Wlogical-op)\ ,$(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS)) -pipe TEMPLATE_VBOXGUESTR3EXE_CFLAGS := $(filter-out $(VBOX_GCC_Wextra) $(VBOX_GCC_WERR) \ $(VBOX_GCC_Wno-missing-field-initializers) $(VBOX_GCC_fdiagnostics-show-option) $(VBOX_GCC_Wno-variadic-macros) \ $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_mtune-generic) $(VBOX_GCC_Wlogical-op)\ ,$(TEMPLATE_VBOXGUESTR3EXE_CFLAGS)) -pipe TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux := $(filter-out $(VBOX_GCC_ORIGIN_OPT) $(VBOX_LD_as_needed),$(TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux)) endif TEMPLATE_VBOXGUESTR3EXE_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBOXR3EXE_LDFLAGS)) endif TEMPLATE_VBOXGUESTR3EXE_INST = $(INST_ADDITIONS) 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 ifeq ($(KBUILD_TARGET),linux) # As few libs as possible on linux. TEMPLATE_VBOXGUESTR3EXE_LIBS = pthread rt m dl else if1of ($(KBUILD_TARGET), darwin freebsd openbsd) TEMPLATE_VBOXGUESTR3EXE_LIBS = $(TEMPLATE_VBOXR3EXE_LIBS) iconv else ifeq ($(KBUILD_TARGET), solaris) TEMPLATE_VBOXGUESTR3EXE_LIBS = $(TEMPLATE_VBOXR3EXE_LIBS) nsl endif # # Template for building normal R3 programs for the guest additions. # TEMPLATE_NewVBoxGuestR3Exe = VBox Guest Program w/ IPRT and VBGL. TEMPLATE_NewVBoxGuestR3Exe_EXTENDS = VBOXGUESTR3EXE TEMPLATE_NewVBoxGuestR3Exe_LIBS = \ $(VBOX_LIB_IPRT_GUEST_R3) \ $(VBOX_LIB_VBGL_R3) \ $(VBOX_LIB_IPRT_GUEST_R3) \ $(TEMPLATE_VBOXGUESTR3EXE_LIBS) # # Template for building normal R3 programs for the guest additions, strict. # TEMPLATE_VBoxGuestR3Exe = VBox Guest Program w/ IPRT and VBGL. TEMPLATE_VBoxGuestR3Exe_EXTENDS = NewVBoxGuestR3Exe TEMPLATE_VBoxGuestR3Exe_EXTENDS_BY = appending ifeq ($(KBUILD_TARGET),win) TEMPLATE_VBoxGuestR3Exe_CFLAGS += $(VBOX_VCC_WERR) TEMPLATE_VBoxGuestR3Exe_CXXFLAGS += $(VBOX_VCC_WERR) TEMPLATE_VBoxGuestR3Exe_LDFLAGS += $(VBOX_VCC_LD_WERR) else ifndef VBOX_WITH_COMPATIBLE_LINUX_GUEST_PACKAGE TEMPLATE_VBoxGuestR3Exe_CFLAGS += $(VBOX_GCC_WERR) TEMPLATE_VBoxGuestR3Exe_CXXFLAGS += $(VBOX_GCC_WERR) endif # # Template for building R3 (dynamic) libraries for the guest additions. # TEMPLATE_VBOXGUESTR3DLL = VBox Guest User Dynamic Libraries TEMPLATE_VBOXGUESTR3DLL_EXTENDS = VBOXGUESTR3EXE ## @todo add a INSTFUN that separates dlls and libs. ifn1of ($(KBUILD_TARGET), darwin os2 win) TEMPLATE_VBOXGUESTR3DLL_DEFS = $(TEMPLATE_VBOXGUESTR3EXE_DEFS) PIC TEMPLATE_VBOXGUESTR3DLL_CFLAGS = $(TEMPLATE_VBOXGUESTR3EXE_CFLAGS) -fPIC TEMPLATE_VBOXGUESTR3DLL_CXXFLAGS = $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS) -fPIC -fno-exceptions TEMPLATE_VBOXGUESTR3DLL_LDFLAGS = $(TEMPLATE_VBOXGUESTR3EXE_LDFLAGS) -fPIC endif # # Template for building normal R3 (dynamic) libraries for the guest additions, allows warnings. # ## @todo rename to VBoxGuestR3DllWarn TEMPLATE_NewVBoxGuestR3Dll = VBox Guest User Dynamic Libraries w/ IPRT and VBGL. TEMPLATE_NewVBoxGuestR3Dll_EXTENDS = VBOXGUESTR3DLL TEMPLATE_NewVBoxGuestR3Dll_LIBS = \ $(VBOX_LIB_IPRT_GUEST_R3_SHARED) \ $(VBOX_LIB_VBGL_R3_SHARED) \ $(VBOX_LIB_IPRT_GUEST_R3_SHARED) \ $(TEMPLATE_VBOXGUESTR3DLL_LIBS) # # Template for building normal R3 (dynamic) libraries for the guest additions, strict. # TEMPLATE_VBoxGuestR3Dll = VBox Guest User Dynamic Libraries w/ IPRT and VBGL. TEMPLATE_VBoxGuestR3Dll_EXTENDS = NewVBoxGuestR3Dll TEMPLATE_VBoxGuestR3Dll_EXTENDS_BY = appending ifeq ($(KBUILD_TARGET),win) TEMPLATE_VBoxGuestR3Dll_CFLAGS += $(VBOX_VCC_WERR) TEMPLATE_VBoxGuestR3Dll_CXXFLAGS += $(VBOX_VCC_WERR) TEMPLATE_VBoxGuestR3Dll_LDFLAGS += $(VBOX_VCC_LD_WERR) else ifndef VBOX_WITH_COMPATIBLE_LINUX_GUEST_PACKAGE TEMPLATE_VBoxGuestR3Dll_CFLAGS += $(VBOX_GCC_WERR) TEMPLATE_VBoxGuestR3Dll_CXXFLAGS += $(VBOX_GCC_WERR) endif # # Template for building R3 (static) libraries for the guest additions, allows warnings. # ## @todo rename to VBoxGuestR3LibWarn. TEMPLATE_VBOXGUESTR3LIB = VBox Guest User Libraries TEMPLATE_VBOXGUESTR3LIB_EXTENDS = VBOXGUESTR3EXE TEMPLATE_VBOXGUESTR3LIB_INST = $(INST_ADDITIONS_LIB) # # Template for building R3 (static) libraries for the guest additions, strict. # TEMPLATE_VBoxGuestR3Lib = VBox Guest User Dynamic Libraries w/ IPRT and VBGL. TEMPLATE_VBoxGuestR3Lib_EXTENDS = VBOXGUESTR3LIB TEMPLATE_VBoxGuestR3Lib_EXTENDS_BY = appending ifeq ($(KBUILD_TARGET),win) TEMPLATE_VBoxGuestR3Lib_CFLAGS += $(VBOX_VCC_WERR) TEMPLATE_VBoxGuestR3Lib_CXXFLAGS += $(VBOX_VCC_WERR) TEMPLATE_VBoxGuestR3Lib_LDFLAGS += $(VBOX_VCC_LD_WERR) else ifndef VBOX_WITH_COMPATIBLE_LINUX_GUEST_PACKAGE TEMPLATE_VBoxGuestR3Lib_CFLAGS += $(VBOX_GCC_WERR) TEMPLATE_VBoxGuestR3Lib_CXXFLAGS += $(VBOX_GCC_WERR) endif # # Template for building R3 programs for the guest additions (no -pedantic) # TEMPLATE_VBOXGUESTR3NPEXE = VBox Guest Program Non-pedantic TEMPLATE_VBOXGUESTR3NPEXE_EXTENDS = VBOXGUESTR3EXE ifneq ($(KBUILD_TARGET),win) # gcc only TEMPLATE_VBOXGUESTR3NPEXE_CXXFLAGS = $(filter-out $(VBOX_GCC_WERR) $(VBOX_GCC_WARN_MASOCHISTIC) $(VBOX_GCC_PEDANTIC_CXX),$(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS)) \ -Wno-sign-compare TEMPLATE_VBOXGUESTR3NPEXE_CFLAGS = $(filter-out $(VBOX_GCC_WERR) $(VBOX_GCC_WARN_MASOCHISTIC) $(VBOX_GCC_PEDANTIC_C) ,$(TEMPLATE_VBOXGUESTR3EXE_CFLAGS)) \ -Wno-sign-compare endif # # Template for building R3 (dynamic) libraries for the guest additions (no -pedantic) # TEMPLATE_VBOXGUESTR3NPDLL = VBox Guest User Dynamic Libraries Non-pedantic TEMPLATE_VBOXGUESTR3NPDLL_EXTENDS = VBOXGUESTR3NPEXE ## @todo add a INSTFUN that separates dlls and libs. ifn1of ($(KBUILD_TARGET), darwin os2 win) TEMPLATE_VBOXGUESTR3NPDLL_DEFS = $(TEMPLATE_VBOXGUESTR3NPEXE_DEFS) PIC TEMPLATE_VBOXGUESTR3NPDLL_CFLAGS = $(TEMPLATE_VBOXGUESTR3NPEXE_CFLAGS) -fPIC TEMPLATE_VBOXGUESTR3NPDLL_CXXFLAGS = $(TEMPLATE_VBOXGUESTR3NPEXE_CXXFLAGS) -fPIC -fno-exceptions TEMPLATE_VBOXGUESTR3NPDLL_LDFLAGS = $(TEMPLATE_VBOXGUESTR3NPEXE_LDFLAGS) -fPIC endif # # Template for building R3 (static) libraries for the guest additions (no -pedantic) # TEMPLATE_VBOXGUESTR3NPLIB = VBox Guest User Libraries Non-pedantic TEMPLATE_VBOXGUESTR3NPLIB_EXTENDS = VBOXGUESTR3NPEXE TEMPLATE_VBOXGUESTR3NPLIB_INST = $(INST_ADDITIONS_LIB) # # Template for XFree86 guest modules (relocatable module, i.e. sysmod). # This mostly about zapping the VBOXR3EXE linker flags and libraries. # TEMPLATE_VBOXGUESTR3XF86MOD = VBox XFree86 Guest Module TEMPLATE_VBOXGUESTR3XF86MOD_EXTENDS = VBOXGUESTR3EXE TEMPLATE_VBOXGUESTR3XF86MOD_LIBS.$(KBUILD_TYPE) = $(NO_SUCH_VARIABLE) TEMPLATE_VBOXGUESTR3XF86MOD_LIBS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE) TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE) TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.$(KBUILD_TYPE) = $(NO_SUCH_VARIABLE) TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS = -r if1of ($(KBUILD_TARGET), dragonfly freebsd linux netbsd openbsd) # the gnu ld guys. TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.release = -S TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.x86 = -m elf_i386 TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.amd64 = -m elf_x86_64 endif TEMPLATE_VBOXGUESTR3XF86MOD_CFLAGS = $(TEMPLATE_VBOXGUESTR3EXE_CFLAGS) -fno-pie -fno-merge-constants -std=c99 -ffreestanding TEMPLATE_VBOXGUESTR3XF86MOD_CXXFLAGS= $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS) -fno-pie -fno-merge-constants -ffreestanding ifndef VBOX_WITH_COMPATIBLE_LINUX_GUEST_PACKAGE TEMPLATE_VBOXGUESTR3XF86MOD_CFLAGS += $(VBOX_GCC_fno-stack-protector) TEMPLATE_VBOXGUESTR3XF86MOD_CXXFLAGS += $(VBOX_GCC_fno-stack-protector) endif TEMPLATE_VBOXGUESTR3XF86MOD_SYSSUFF = .o TEMPLATE_VBOXGUESTR3XF86MOD_LIBS = \ $(VBOX_LIB_VBGL_R3_XFREE86) TEMPLATE_VBOXGUESTR3XF86MOD_DEFS = $(TEMPLATE_VBOXGUESTR3DLL_DEFS) VBOX_GUESTR3XF86MOD RTMEM_NO_WRAP_TO_EF_APIS # # Template for XFree86 guest libraries. # TEMPLATE_VBOXGUESTR3XF86LIB = VBox XFree86 Guest Library TEMPLATE_VBOXGUESTR3XF86LIB_EXTENDS = VBOXGUESTR3XF86MOD TEMPLATE_VBOXGUESTR3XF86LIB_INST = $(INST_ADDITIONS_LIB) # # Template for X.org guest modules (shared libs). # This mostly about zapping unnecessary LIBS from VBOXGUESTR3DLL and adding some flags. # TEMPLATE_VBOXGUESTR3XORGMOD = VBox X.org Guest Module TEMPLATE_VBOXGUESTR3XORGMOD_EXTENDS = VBOXGUESTR3DLL TEMPLATE_VBOXGUESTR3XORGMOD_LIBS.$(KBUILD_TYPE) = $(NO_SUCH_VARIABLE) TEMPLATE_VBOXGUESTR3XORGMOD_LIBS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE) TEMPLATE_VBOXGUESTR3XORGMOD_CFLAGS = $(TEMPLATE_VBOXGUESTR3DLL_CFLAGS) -std=c99 if1of ($(KBUILD_TARGET), linux) TEMPLATE_VBOXGUESTR3XORGMOD_CFLAGS += -Wno-conversion -Wno-unused-parameter ifndef VBOX_WITH_COMPATIBLE_LINUX_GUEST_PACKAGE TEMPLATE_VBOXGUESTR3XORGMOD_CFLAGS += $(VBOX_GCC_Wno-variadic-macros) endif endif TEMPLATE_VBOXGUESTR3XORGMOD_DEFS = $(TEMPLATE_VBOXGUESTR3DLL_DEFS) VBOX_GUESTR3XORGMOD RTMEM_NO_WRAP_TO_EF_APIS ifeq ($(KBUILD_TARGET_ARCH),amd64) TEMPLATE_VBOXGUESTR3XORGMOD_DEFS += _XSERVER64 endif TEMPLATE_VBOXGUESTR3XORGMOD_LIBS = \ $(VBOX_LIB_VBGL_R3_XORG) TEMPLATE_VBOXGUESTR3XORGMOD_LIBS.freebsd += \ iconv # # Template for X.Org guest libraries. # TEMPLATE_VBOXGUESTR3XORGLIB = VBox X.Org Guest Library TEMPLATE_VBOXGUESTR3XORGLIB_EXTENDS = VBOXGUESTR3XORGMOD TEMPLATE_VBOXGUESTR3XORGLIB_INST = $(INST_ADDITIONS_LIB) # # Template for building R0 drivers for the guest additions. # TEMPLATE_VBOXGUESTR0 = VBox Guest Driver TEMPLATE_VBOXGUESTR0_EXTENDS = VBOXR0DRV TEMPLATE_VBOXGUESTR0_INST = $(INST_ADDITIONS) 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 TEMPLATE_VBOXGUESTR0_LIBS.win.x86 = \ $(PATH_SDK_$(VBOX_WINDDK)_LIB)/int64.lib TEMPLATE_VBOXGUESTR0_DEFS = $(TEMPLATE_VBOXR0DRV_DEFS) IN_GUEST IN_GUEST_R0 TEMPLATE_VBOXGUESTR0_DEFS.linux = RT_NO_EXPORT_SYMBOL ifeq ($(KBUILD_TARGET),solaris) TEMPLATE_VBOXGUESTR0_LDFLAGS = -r -dy endif ifn1of (darwin os2 win, $(KBUILD_TARGET)) 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)) endif # # Template for building R0 libraries for the guest additions. # TEMPLATE_VBOXGUESTR0LIB = VBox Guest Driver Libraries TEMPLATE_VBOXGUESTR0LIB_EXTENDS = VBOXGUESTR0 TEMPLATE_VBOXGUESTR0LIB_INSTTYPE = stage TEMPLATE_VBOXGUESTR0LIB_INSTTYPE.linux = stage TEMPLATE_VBOXGUESTR0LIB_INST = $(INST_ADDITIONS_LIB) ifeq ($(KBUILD_TARGET),haiku) TEMPLATE_VBOXGUESTR0LIB_LDFLAGS = -r -dy endif # # Template for building OpenGL host dlls. # TEMPLATE_VBOXCROGLR3HOSTDLL = VBox OpenGL Host DLLs TEMPLATE_VBOXCROGLR3HOSTDLL_EXTENDS := $(if-expr "$(KBUILD_TARGET)" == "win",VBOXR3,VBOXR3NP) TEMPLATE_VBOXCROGLR3HOSTDLL_EXTENDS_BY = prepending TEMPLATE_VBOXCROGLR3HOSTDLL_DEFS = CHROMIUM_THREADSAFE VBOX_WITH_HGCM UNPACKS 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_DEFS.freebsd = FreeBSD=1 _GNU_SOURCE TEMPLATE_VBOXCROGLR3HOSTDLL_INCS = $(VBOX_PATH_CROGL_INCLUDE) $(VBOX_PATH_CROGL_GENFILES) TEMPLATE_VBOXCROGLR3HOSTDLL_SDKS.darwin = DARWIN-OPENGL TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.darwin = -framework AppKit TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.darwin += \ -framework OpenGL \ -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \ -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.linux = -Wl,--no-as-needed TEMPLATE_VBOXCROGLR3HOSTDLL_BLDDIRS = $(VBOX_PATH_CROGL_GENFILES)/ ifeq ($(KBUILD_TARGET),darwin) TEMPLATE_VBOXCROGLR3HOSTDLL_CFLAGS = $(TEMPLATE_VBOXR3NP_CFLAGS) -Wno-deprecated-declarations TEMPLATE_VBOXCROGLR3HOSTDLL_CXXFLAGS = $(TEMPLATE_VBOXR3NP_CXXFLAGS) -Wno-deprecated-declarations TEMPLATE_VBOXCROGLR3HOSTDLL_OBJCFLAGS = $(TEMPLATE_VBOXR3NP_OBJCFLAGS) -Wno-deprecated-declarations endif # # Template for building OpenGL host libraries. # TEMPLATE_VBOXCROGLR3HOSTLIB = VBox OpenGL Host Libraries TEMPLATE_VBOXCROGLR3HOSTLIB_EXTENDS = VBOXCROGLR3HOSTDLL TEMPLATE_VBOXCROGLR3HOSTLIB_INST = $(INST_LIB) # # Template for building OpenGL guest dlls. # TEMPLATE_VBOXCROGLR3GUESTDLL = VBox OpenGL Guest DLLs if "$(KBUILD_TARGET)" == "win" || defined(VBOX_WITH_MASOCHISTIC_WARNINGS) || defined(VBOX_WITH_NO_GCC_WARNING_POLICY) ## @todo use VBoxGuestR3Dll everywhere TEMPLATE_VBOXCROGLR3GUESTDLL_EXTENDS = VBoxGuestR3Dll else TEMPLATE_VBOXCROGLR3GUESTDLL_EXTENDS = VBOXGUESTR3NPDLL endif TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS = $(TEMPLATE_$(TEMPLATE_VBOXCROGLR3GUESTDLL_EXTENDS)_DEFS) CHROMIUM_THREADSAFE VBOX_WITH_HGCM TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS.win = $(TEMPLATE_$(TEMPLATE_VBOXCROGLR3GUESTDLL_EXTENDS)_DEFS.win) WINDOWS=1 TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS.linux = $(TEMPLATE_$(TEMPLATE_VBOXCROGLR3GUESTDLL_EXTENDS)_DEFS.linux) Linux=1 _GNU_SOURCE TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS.solaris = $(TEMPLATE_$(TEMPLATE_VBOXCROGLR3GUESTDLL_EXTENDS)_DEFS.solaris) SunOS=1 _GNU_SOURCE #GLEXT_64_TYPES_DEFINED TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS.darwin = $(TEMPLATE_$(TEMPLATE_VBOXCROGLR3GUESTDLL_EXTENDS)_DEFS.darwin) DARWIN=1 GL_GLEXT_LEGACY _GNU_SOURCE VBOX_WITH_COCOA_QT TEMPLATE_VBOXCROGLR3GUESTDLL_DEFS.freebsd = $(TEMPLATE_$(TEMPLATE_VBOXCROGLR3GUESTDLL_EXTENDS)_DEFS.freebsd) FreeBSD=1 _GNU_SOURCE TEMPLATE_VBOXCROGLR3GUESTDLL_INCS = $(VBOX_PATH_CROGL_INCLUDE) $(VBOX_PATH_CROGL_GENFILES) $(TEMPLATE_$(TEMPLATE_VBOXCROGLR3GUESTDLL_EXTENDS)_INCS) TEMPLATE_VBOXCROGLR3GUESTDLL_SDKS.darwin = DARWIN-OPENGL $(TEMPLATE_$(TEMPLATE_VBOXCROGLR3GUESTDLL_EXTENDS)_SDKS) ifneq ($(KBUILD_TARGET),win) TEMPLATE_VBOXCROGLR3GUESTDLL_CFLAGS = $(filter-out -pedantic, $(TEMPLATE_$(TEMPLATE_VBOXCROGLR3GUESTDLL_EXTENDS)_CFLAGS)) \ $(if-expr !defined(VBOX_WITH_COMPATIBLE_LINUX_GUEST_PACKAGE),$(VBOX_GCC_Wno-overlength-strings),) TEMPLATE_VBOXCROGLR3GUESTDLL_CXXFLAGS = $(filter-out -pedantic, $(TEMPLATE_$(TEMPLATE_VBOXCROGLR3GUESTDLL_EXTENDS)_CXXFLAGS)) endif TEMPLATE_VBOXCROGLR3GUESTDLL_LDFLAGS.darwin = $(TEMPLATE_$(TEMPLATE_VBOXCROGLR3GUESTDLL_EXTENDS)_LDFLAGS.darwin)\ -framework AppKit \ -framework OpenGL \ -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \ -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) TEMPLATE_VBOXCROGLR3GUESTDLL_BLDDIRS = $(TEMPLATE_$(TEMPLATE_VBOXCROGLR3GUESTDLL_EXTENDS)_BLDDIRS) $(VBOX_PATH_CROGL_GENFILES)/ # # Template for building OpenGL guest libraries. # TEMPLATE_VBOXCROGLR3GUESTLIB = VBox OpenGL Guest Libraries TEMPLATE_VBOXCROGLR3GUESTLIB_EXTENDS = VBOXCROGLR3GUESTDLL TEMPLATE_VBOXCROGLR3GUESTLIB_INST = $(INST_ADDITIONS_LIB) # # Template for building Mesa guest library, Linux-only so far. # TEMPLATE_VBOXMESAR3GUESTLIB = VBox Mesa Guest Library TEMPLATE_VBOXMESAR3GUESTLIB_EXTENDS = VBOXCROGLR3GUESTDLL TEMPLATE_VBOXMESAR3GUESTLIB_INST = $(INST_ADDITIONS_LIB) TEMPLATE_VBOXMESAR3GUESTLIB_DEFS.linux = Linux=1 TEMPLATE_VBOXMESAR3GUESTLIB_DEFS.solaris = SunOS=1 TEMPLATE_VBOXMESAR3GUESTLIB_DEFS.darwin = DARWIN=1 GL_GLEXT_LEGACY ifeq ($(KBUILD_TARGET),linux) TEMPLATE_VBOXMESAR3GUESTLIB_ASTOOL = $(TEMPLATE_VBOXCROGLR3GUESTDLL_TOOL) TEMPLATE_VBOXMESAR3GUESTLIB_ASFLAGS = $(NO_SUCH_VARIABLE) TEMPLATE_VBOXMESAR3GUESTLIB_ASFLAGS.x86 = -m32 TEMPLATE_VBOXMESAR3GUESTLIB_ASFLAGS.amd64 = -m64 TEMPLATE_VBOXMESAR3GUESTLIB_ASDEFS = $(NO_SUCH_VARIABLE) endif # # Guest additions libraries (all static). # The _MINI and _SHARED are both compiled as PIC and intended for linking into a .so/.dll/.dylib. # VBOX_LIB_IPRT_GUEST_R3 = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR3$(VBOX_SUFF_LIB) VBOX_LIB_IPRT_GUEST_R3_SHARED = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR3Shared$(VBOX_SUFF_LIB) VBOX_LIB_IPRT_GUEST_R0 = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR0$(VBOX_SUFF_LIB) ifeq ($(KBUILD_TARGET_ARCH),x86) VBOX_LIB_IPRT_GUEST_R0_NT4 = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR0NT4$(VBOX_SUFF_LIB) else VBOX_LIB_IPRT_GUEST_R0_NT4 = $(VBOX_LIB_IPRT_GUEST_R0) endif VBOX_LIB_VBGL_R3 = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR3Lib$(VBOX_SUFF_LIB) \ $(if $(VBOX_WITH_DRAG_AND_DROP),$(VBOX_PATH_ADDITIONS_LIB)/VBoxDnDGuestR3Lib$(VBOX_SUFF_LIB)) VBOX_LIB_VBGL_R3_XFREE86 = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR3LibXFree86$(VBOX_SUFF_LIB) VBOX_LIB_VBGL_R3_XORG = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR3LibXOrg$(VBOX_SUFF_LIB) VBOX_LIB_VBGL_R3_SHARED = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR3LibShared$(VBOX_SUFF_LIB) VBOX_LIB_VBGL_R0BASE = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR0LibBase$(VBOX_SUFF_LIB) VBOX_LIB_VBGL_R0 = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR0Lib$(VBOX_SUFF_LIB) ifeq ($(KBUILD_TARGET),x86) VBOX_LIB_IPRT_GUEST_R3_X86 = $(VBOX_LIB_IPRT_GUEST_R3) VBOX_LIB_IPRT_GUEST_R3_SHARED_X86 = $(VBOX_LIB_IPRT_GUEST_R3_SHARED) VBOX_LIB_VBGL_R3_X86 = $(VBOX_LIB_VBGL_R3) VBOX_LIB_VBGL_R3_SHARED_X86 = $(VBOX_LIB_VBGL_R3_SHARED) else VBOX_LIB_IPRT_GUEST_R3_X86 = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR3-x86$(VBOX_SUFF_LIB) VBOX_LIB_IPRT_GUEST_R3_SHARED_X86 = $(VBOX_PATH_ADDITIONS_LIB)/RuntimeGuestR3Shared-x86$(VBOX_SUFF_LIB) VBOX_LIB_VBGL_R3_X86 = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR3Lib-x86$(VBOX_SUFF_LIB) VBOX_LIB_VBGL_R3_SHARED_X86 = $(VBOX_PATH_ADDITIONS_LIB)/VBoxGuestR3LibShared-x86$(VBOX_SUFF_LIB) endif # # Check the publisher and version string. # # We are being very strict because the version string is visible in various # APIs and logs and must be machine readable. # VBOX_VERSION_COMP_VALID_CHAR_SET = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz()[]{}+-., ifneq ($(VBOX_BUILD_PUBLISHER),) if $(length $(VBOX_BUILD_PUBLISHER)) > 10 $(error VBox: VBOX_BUILD_PUBLISHER must not be longer than 10 characters!) endif if "$(substr $(VBOX_BUILD_PUBLISHER), 1, 1)" != "_" $(error VBox: VBOX_BUILD_PUBLISHER must start with an underscore!) endif if "$(translate $(substr $(VBOX_BUILD_PUBLISHER),2),$(VBOX_VERSION_COMP_VALID_CHAR_SET),)" != "" $(error VBox: VBOX_BUILD_PUBLISHER='$(VBOX_BUILD_PUBLISHER)' contains bad characters! Valid set is:$(NLTAB)$(VBOX_VERSION_COMP_VALID_CHAR_SET)) endif endif if $(words $(VBOX_VERSION_STRING)) != 1 $(error VBox: VBOX_VERSION_STRING='$(VBOX_VERSION_STRING)' contains spaces or is empty.) endif if "$(subst __,-,$(VBOX_VERSION_STRING))" != "$(VBOX_VERSION_STRING)" $(error VBox: VBOX_VERSION_STRING='$(VBOX_VERSION_STRING)' contains double underscores.) endif VBOX_VER_TMP1 := $(subst _,$(SP),$(VBOX_VERSION_STRING)) if $(words $(VBOX_VER_TMP1)) > 3 $(error VBox: VBOX_VERSION_STRING='$(VBOX_VERSION_STRING)' contains too many parts (underscores), max 3!) endif if "$(translate $(word 1,$(VBOX_VER_TMP1)),0123456789,)" != ".." $(error VBox: The x.y.z part of VBOX_VERSION_STRING='$(VBOX_VERSION_STRING)' is malformed: '$(word 1,$(VBOX_VER_TMP1))') endif if "$(word 1,$(VBOX_VER_TMP1))" != "$(VBOX_VERSION_STRING_RAW)" $(error VBox: VBOX_VERSION_STRING='$(VBOX_VERSION_STRING)' does not start with VBOX_VERSION_STRING_RAW='$(VBOX_VERSION_STRING_RAW)') endif if $(words $(VBOX_VER_TMP1)) == 3 || ($(words $(VBOX_VER_TMP1)) == 2 && "$(VBOX_BUILD_PUBLISHER)" == "") if "$(substr $(word 2,$(VBOX_VER_TMP1)),1,4)" == "BETA" VBOX_VER_TMP2 = 5 else if "$(substr $(word 2,$(VBOX_VER_TMP1)),1,5)" == "ALPHA" VBOX_VER_TMP2 = 6 else if "$(substr $(word 2,$(VBOX_VER_TMP1)),1,2)" == "RC" VBOX_VER_TMP2 = 3 else $(error VBox: VBOX_VERSION_STRING='$(VBOX_VERSION_STRING)' uses an unknown build type: '$(word 2,$(VBOX_VER_TMP1))') endif if "$(translate $(substr $(word 2,$(VBOX_VER_TMP1)),$(VBOX_VER_TMP2)),0123456789)" != "" $(error VBox: VBOX_VERSION_STRING='$(VBOX_VERSION_STRING)' uses an unknown build type: '$(word 2,$(VBOX_VER_TMP1))') endif endif VBOX_VER_TMP1 := VBOX_VER_TMP2 := # # Two targets to coordinate version number changes properly. Note that the # only way to get a really consistent build is to run 'kmk' in the top-level # directory. If you don't run it there, you get a consistent sub-tree only. # VBOX_BAD_CHAR_SET = ,;:/\$(SP)$(TAB)$(HASH)=![]@%&''()*""<>?^{}|~ 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)-$(USERNAME),$(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 $(call MSG_GENERATE,,$@) $(QUIET)$(MKDIR) -p $(@D) $(QUIET)$(RM) -f $(wildcard $(PATH_OUT)/version-stamp-*) $(QUIET)$(APPEND) $@ $(VBOX_VERSION_STRING) $(VBOX_VERSION_HEADER): $(VBOX_VERSION_STAMP) $(call MSG_GENERATE,,$@) $(QUIET)$(MKDIR) -p $(@D) $(QUIET)$(RM) -f $@ $@.tmp $(QUIET)$(APPEND) $@.tmp '#ifndef ___version_generated_h___' $(QUIET)$(APPEND) $@.tmp '#define ___version_generated_h___' $(QUIET)$(APPEND) $@.tmp '' $(QUIET)$(APPEND) $@.tmp '#define VBOX_VERSION_MAJOR $(VBOX_VERSION_MAJOR)' $(QUIET)$(APPEND) $@.tmp '#define VBOX_VERSION_MINOR $(VBOX_VERSION_MINOR)' $(QUIET)$(APPEND) $@.tmp '#define VBOX_VERSION_BUILD $(VBOX_VERSION_BUILD)' ifneq ($(VBOX_VERSION_PRERELEASE),) $(QUIET)$(APPEND) $@.tmp '#define VBOX_VERSION_PRERELEASE "$(strip $(VBOX_VERSION_PRERELEASE))"' endif $(QUIET)$(APPEND) $@.tmp '#define VBOX_VERSION_STRING_RAW "$(VBOX_VERSION_STRING_RAW)"' $(QUIET)$(APPEND) $@.tmp '#define VBOX_VERSION_STRING "$(VBOX_VERSION_STRING)"' $(QUIET)$(APPEND) $@.tmp '#define VBOX_API_VERSION_STRING "$(VBOX_API_VERSION)"' $(QUIET)$(APPEND) $@.tmp '' ifdef VBOX_BUILD_SERVER_BUILD $(QUIET)$(APPEND) $@.tmp '#define VBOX_BUILD_SERVER_BUILD 1' else $(QUIET)$(APPEND) $@.tmp '#define VBOX_PRIVATE_BUILD_DESC "Private build by $(USERNAME)"' endif $(QUIET)$(APPEND) $@.tmp '' $(QUIET)$(APPEND) $@.tmp '#endif' $(QUIET)$(MV) -f $@.tmp $@ VBOX_PACKAGE_HEADER = $(PATH_OUT)/package-generated.h $(VBOX_PACKAGE_HEADER): $(call MSG_GENERATE,,$@) $(QUIET)$(MKDIR) -p $(@D) $(QUIET)$(RM) -f $@ $@.tmp $(QUIET)$(APPEND) $@.tmp '#ifndef ___package_generated_h___' $(QUIET)$(APPEND) $@.tmp '#define ___package_generated_h___' $(QUIET)$(APPEND) $@.tmp '' $(QUIET)$(APPEND) $@.tmp '#define VBOX_PACKAGE_STRING "$(VBOX_PACKAGE_STRING)"' $(QUIET)$(APPEND) $@.tmp '' $(QUIET)$(APPEND) $@.tmp '#endif' $(QUIET)$(MV) -f $@.tmp $@ VBOX_PRODUCT_HEADER = $(PATH_OUT)/product-generated.h $(VBOX_PRODUCT_HEADER): $(VBOX_VERSION_STAMP) $(call MSG_GENERATE,,$@) $(QUIET)$(MKDIR) -p $(@D) $(QUIET)$(RM) -f $@ $@.tmp $(QUIET)$(APPEND) $@.tmp '#ifndef ___product_generated_h___' $(QUIET)$(APPEND) $@.tmp '#define ___product_generated_h___' $(QUIET)$(APPEND) $@.tmp '' $(QUIET)$(APPEND) $@.tmp '#define VBOX_VENDOR "$(VBOX_VENDOR)"' $(QUIET)$(APPEND) $@.tmp '#define VBOX_VENDOR_SHORT "$(VBOX_VENDOR_SHORT)"' $(QUIET)$(APPEND) $@.tmp '#define VBOX_PRODUCT "$(VBOX_PRODUCT)"' $(QUIET)$(APPEND) $@.tmp '#define VBOX_BUILD_PUBLISHER "$(VBOX_BUILD_PUBLISHER)"' $(QUIET)$(APPEND) $@.tmp '#define VBOX_C_YEAR "$(VBOX_C_YEAR)"' $(QUIET)$(APPEND) $@.tmp '' $(QUIET)$(APPEND) $@.tmp '#endif' $(QUIET)$(MV) -f $@.tmp $@ # # Used for external makefiles which cannot include Config.kmk # $(VBOX_VERSION_MK): $(VBOX_VERSION_STAMP) $(call MSG_GENERATE,,$@) $(QUIET)$(RM) -f $@ $@.tmp $(QUIET)$(MKDIR) -p $(@D) $(QUIET)$(APPEND) $@.tmp 'VBOX_VERSION_MAJOR = $(VBOX_VERSION_MAJOR)' $(QUIET)$(APPEND) $@.tmp 'VBOX_VERSION_MINOR = $(VBOX_VERSION_MINOR)' $(QUIET)$(APPEND) $@.tmp 'VBOX_VERSION_BUILD = $(VBOX_VERSION_BUILD)' $(QUIET)$(APPEND) $@.tmp 'VBOX_VERSION_STRING = $(VBOX_VERSION_STRING)' ifneq ($(VBOX_VERSION_PRERELEASE),) $(QUIET)$(APPEND) $@.tmp 'VBOX_VERSION_PRERELEASE = $(strip $(VBOX_VERSION_PRERELEASE))' endif $(QUIET)$(APPEND) $@.tmp 'VBOX_VENDOR = $(VBOX_VENDOR)' $(QUIET)$(APPEND) $@.tmp 'VBOX_VENDOR_SHORT = $(VBOX_VENDOR_SHORT)' $(QUIET)$(APPEND) $@.tmp 'VBOX_PRODUCT = $(VBOX_PRODUCT)' $(QUIET)$(APPEND) $@.tmp 'VBOX_C_YEAR = $(VBOX_C_YEAR)' ifdef VBOX_BUILD_SERVER_BUILD $(QUIET)$(APPEND) $@.tmp 'VBOX_BUILD_SERVER_BUILD = 1' else $(QUIET)$(APPEND) $@.tmp 'VBOX_PRIVATE_BUILD_DESC = Private build by $(USERNAME)' endif $(QUIET)$(MV) -f $@.tmp $@ if !defined(VBOX_OSE) && !defined(VBOX_NOINC_LICENSE_VER_KMK) if1of ($(KBUILD_TARGET), freebsd linux netbsd openbsd solaris) # VBOX_LICENSE_VER is used in several Makefiles VBOX_LICENSE_VER_KMK = $(PATH_OUT)/license-version.kmk $(VBOX_LICENSE_VER_KMK): $(VBOX_BRAND_LICENSE_HTML) $(call MSG_GENERATE,,$(VBOX_LICENSE_VER_KMK)) $(QUIET)$(MKDIR) -p $(@D) ifdef VBOX_BRAND_LICENSE_VER $(QUIET)$(RM) -f '$@' $(APPEND) '$@' 'VBOX_LICENSE_VER=$(VBOX_BRAND_LICENSE_VER)' else $(QUIET)$(SED) -e "s/.*License version \([0-9.]*\) *[,&].*/VBOX_LICENSE_VER=\1/;t;d" --output $@ $(VBOX_BRAND_LICENSE_HTML) endif -include $(VBOX_LICENSE_VER_KMK) ifdef VBOX_LICENSE_VER VBOX_LICENSE_FILES = \ License-$(VBOX_LICENSE_VER).html \ $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES),License-$(VBOX_LICENSE_VER)-$(f).html) VBOX_LICENSE_BINS = $(addprefix $(PATH_STAGE_BIN)/,$(VBOX_LICENSE_FILES)) endif endif endif ifndef VBOX_NOINC_MISC # Force building of the version header file as the first thing anywhere in # the tree. This eliminates the need for manual dependencies on it. ## @todo there gotta be a better way of doing this. Makefile.kmk: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK) $(VBOX_PRODUCT_HEADER) $(VBOX_PACKAGE_HEADER) endif # # Subversion tree revision. # # The VBOX_SVN_REV contains our best guess. Use svn info on the root of the # tree to determine this it if .svn/wc.db or .svn/entries is found (the former # also up to two directory levels higher to allow for checkouts of the entire # repository), otherwise fall back on the Config.kmk revision. # # Makefile rules using this information shall list $(VBOX_SVN_REV_KMK) as a # prerequisite. # SVN ?= svn$(HOSTSUFF_EXE) VBOX_SVN_REV_KMK = $(PATH_OUT)/revision.kmk ifndef VBOX_SVN_REV VBOX_SVN_REV_FALLBACK := $(patsubst %:,, $Rev: 64544 $ ) VBOX_SVN_DEP := $(firstword $(wildcard $(PATH_ROOT)/.svn/wc.db $(abspath $(PATH_ROOT)/../.svn/wc.db) $(abspath $(PATH_ROOT)/../../.svn/wc.db) $(PATH_ROOT)/.svn/entries)) ifeq ($(which $(SVN)),) VBOX_SVN_DEP := endif # Rule for generating a timestamp and updating the real thing on change. $(VBOX_SVN_REV_KMK).ts +| $(VBOX_SVN_REV_KMK): $(if $(VBOX_SVN_DEP), $(VBOX_SVN_DEP), $(PATH_ROOT)/Config.kmk) $(call MSG_GENERATE,,$(VBOX_SVN_REV_KMK)) $(QUIET)$(RM) -f $@ $@.tmp $(QUIET)$(MKDIR) -p $(@D) ifneq ($(VBOX_SVN_DEP),) $(REDIRECT) -E 'LC_ALL=C' -wo $@.tmp -- $(SVN) info $(PATH_ROOT) $(SED) -e '/^Last Changed Rev/!d' -e 's/Last Changed Rev\: */export VBOX_SVN_REV=/' --output $@ $@.tmp $(QUIET)$(RM) -f $@.tmp else $(QUIET)$(APPEND) $@ 'export VBOX_SVN_REV=$(VBOX_SVN_REV_FALLBACK)' endif $(QUIET)$(CP) --changed -fv $@ $(VBOX_SVN_REV_KMK) ifndef VBOX_NOINC_SVN_REV_KMK include $(VBOX_SVN_REV_KMK) endif else # allow to overwrite VBOX_SVN_REV externally (mainly for building .debs/.rpms) $(VBOX_SVN_REV_KMK): $(call MSG_GENERATE,,$(VBOX_SVN_REV_KMK)) $(QUIET)$(RM) -f $@ $(QUIET)$(MKDIR) -p $(@D) $(QUIET)$(APPEND) $@ 'export VBOX_SVN_REV=$(VBOX_SVN_REV)' $(QUIET)echo '* $(VBOX_SVN_REV_KMK) was externally overwritten:' $(QUIET)$(CAT) $(VBOX_SVN_REV_KMK) endif # only needed for VBoxGuest for Linux/FreeBSD guests VBOX_SVN_REV_HEADER = $(PATH_OUT)/revision-generated.h $(VBOX_SVN_REV_HEADER): $(VBOX_SVN_REV_KMK) $(call MSG_GENERATE,,$@) $(QUIET)$(RM) -f $@ $@.tmp $(QUIET)$(MKDIR) -p $(@D) $(QUIET)$(APPEND) $@.tmp '#define VBOX_SVN_REV $(VBOX_SVN_REV)' $(QUIET)$(MV) -f $@.tmp $@ # # Shared definitions of the XIDL file to use as a source for # generating various other files (VBoxSVC, webservice, docs, front-ends, ...) # # Real XIDL source file; from this we strip the elements to generate # 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 # Java stuff. ifeq ($(KBUILD_TARGET), darwin) VBOX_JAVA_COMMANDS = $(firstword $(wildcard \ /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Commands \ /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) VBOX_JAVAC = $(VBOX_JAVA_COMMANDS)/javac VBOX_JAVAH = $(VBOX_JAVA_COMMANDS)/javah VBOX_JAR = $(VBOX_JAVA_COMMANDS)/jar VBOX_JAVADOC = $(VBOX_JAVA_COMMANDS)/javadoc VBOX_WSIMPORT = $(VBOX_JAVA_COMMANDS)/wsimport 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 else VBOX_JAVA_INC = $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Headers endif else ifeq ($(KBUILD_TARGET),linux) ifeq ($(origin VBOX_JAVA_HOME),undefined) # Add correct detection for you distro after the /usr/../java-6-sun line. VBOX_JAVA_HOME := $(firstword $(wildcard \ $(KBUILD_DEVTOOLS)/linux.x86/jdk1.6.0_27 \ /usr/lib/jvm/java-6-sun \ /usr/lib/jvm/java-6-openjdk \ /usr/lib/jvm/java-6-openjdk-i386 \ /usr/lib/jvm/java-6-openjdk-amd64 \ /usr/lib/jvm/java-7-openjdk-i386 \ /usr/lib/jvm/java-7-openjdk-amd64 \ /usr/lib/jvm/default-java \ /usr/lib/jvm/java \ \ /usr/lib/jvm/sun-jdk-1.6 \ ) /usr/lib/jvm/java-6-sun) endif endif ifeq ($(KBUILD_TARGET),solaris) # VBOX_JAVA_HOME ?= /usr/jdk/jdk1.6.0 VBOX_JAVA_HOME ?= $(firstword $(abspath $(wildcard \ /usr/jdk/latest/include/.. \ /usr/jdk/instances/jdk1.8*/include/.. \ /usr/jdk/instances/jdk1.7*/include/.. \ /usr/jdk/instances/jdk1.6*/include/.. \ )) /usr/java) endif ifeq ($(KBUILD_TARGET),win) VBOX_JAVA_HOME ?= c:/jdk endif 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 # correct for targets we care about VBOX_MD_OS = $(KBUILD_TARGET) VBOX_JAVA_INC = \ $(VBOX_JAVA_HOME)/include \ $(VBOX_JAVA_HOME)/include/$(VBOX_MD_OS) endif # # VBOX_SEP needs to be quoted when used on the shell command line. # if1of ($(KBUILD_TARGET), os2 win) VBOX_SEP = $(SEMICOLON) else VBOX_SEP = $(COLON) endif VBOX_JAVAC_OPTS = -encoding UTF-8 -source 1.5 -target 1.5 -Xlint:unchecked VBOX_JAVADOC_OPTS = -encoding UTF-8 # # Legacy. # ## @todo try remove this. ifneq ($(LOCALCFG),) include $(LOCALCFG) endif # # For efficiently build serveral build types / archs. # both-debug-release both-release-debug: \ build-release-$(KBUILD_TARGET_ARCH) \ build-debug-$(KBUILD_TARGET_ARCH) both-x86-amd64 both-amd64-x86: \ build-$(KBUILD_TYPE)-x86 \ build-$(KBUILD_TYPE)-x86 both-types-archs both-archs-types: \ build-debug-x86 \ build-release-x86 \ build-debug-amd64 \ build-release-amd64 build-release-x86: +$(MAKE) KBUILD_TYPE=release KBUILD_TARGET_ARCH=x86 build-debug-x86: +$(MAKE) KBUILD_TYPE=debug KBUILD_TARGET_ARCH=x86 build-release-amd64: +$(MAKE) KBUILD_TYPE=release KBUILD_TARGET_ARCH=amd64 build-debug-amd64: +$(MAKE) KBUILD_TYPE=debug KBUILD_TARGET_ARCH=amd64 # # Some extra goals. # .PHONY: up update st stat status up update:: $(SVN) up up2 update2:: $(SVN) up --ignore-externals st stat status: $(SVN) status quick: $(MAKE) VBOX_QUICK=1