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