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