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