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