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