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