VirtualBox

source: vbox/trunk/Config.kmk@ 628

Last change on this file since 628 was 616, checked in by vboxsync, 18 years ago

VBoxSDL builds works on darwin (with crude XPCOM event hack), so enable it.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 73.8 KB
Line 
1# $Id: Config.kmk 616 2007-02-05 01:09:52Z vboxsync $
2## @file
3#
4# The global build configuration file for VBox.
5#
6# This file gets included by all makefiles through the
7# include $(PATH_KBUILD)/header.kmk statement.
8#
9
10#
11# Copyright (C) 2006 InnoTek Systemberatung GmbH
12#
13# This file is part of VirtualBox Open Source Edition (OSE), as
14# available from http://www.virtualbox.org. This file is free software;
15# you can redistribute it and/or modify it under the terms of the GNU
16# General Public License as published by the Free Software Foundation,
17# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
18# distribution. VirtualBox OSE is distributed in the hope that it will
19# be useful, but WITHOUT ANY WARRANTY of any kind.
20#
21# If you received this file as part of a commercial VirtualBox
22# distribution, then only the terms of your commercial VirtualBox
23# license agreement apply instead of the previous paragraph.
24#
25
26
27#
28# kBuild stuff
29#
30
31# Enable automatic installation of what's built.
32KBUILD_DO_AUTO_INSTALL := 1
33# Add the GPLExport pass.
34PASSES := $(filter-out PACKING,$(PASSES)) PACKING # temporary hack
35PASSES += GPLEXPORT
36# Modify the order of the INSTALLS and OTHERS passes.
37DEFAULT_PASSES := BLDPROGS LIBRARIES DLLS BINARIES INSTALLS OTHERS
38
39## PASS: gplexport
40# This pass processes custom gplexport rules listed in
41# the GPLEXPORTS variable.
42PASS_GPLEXPORT := GPL and LGPL source export
43PASS_GPLEXPORT_trgs :=
44PASS_GPLEXPORT_vars := GPLEXPORTS
45PASS_GPLEXPORT_pass := gplexport
46#alias
47gplexport: pass_gplexport
48
49# Install paths.
50PATH_INS := $(PATH_OUT)
51PATH_BIN = $(PATH_INS)/bin
52PATH_DLL = $(PATH_INS)/bin
53PATH_SYS = $(PATH_INS)/bin
54PATH_LIB = $(PATH_INS)/lib
55PATH_DOC = $(PATH_INS)/doc
56INST_TESTCASE = bin/testcase/
57INST_ADDITIONS = bin/additions/
58INST_ADDITIONS_LIB = lib/additions/
59INST_SDK = bin/sdk
60INST_SDK_SAMPLES = $(INST_SDK)/samples
61
62# Delete targets on failure.
63.DELETE_ON_ERROR:
64
65# Notify about important kBuild updates.
66ifneq ($(call int-ge,$(KMK_REVISION),830),1)
67 $(error You must update kBuild!)
68endif
69
70#
71# Define USERNAME early on.
72#
73ifndef USERNAME
74 ifdef USER
75 USERNAME = $(USER)
76 else
77 $(warning Warning: You must have USERNAME or USER in your environment.)
78 endif
79endif
80
81#
82# The VirtualBox version.
83#
84
85# Major version.
86VBOX_VERSION_MAJOR = 1
87# Minor version.
88VBOX_VERSION_MINOR = 3
89# This is the current build number. It should be increased every time we publish a
90# new build. The define is available in every source file. Only even build numbers
91# will be published, odd numbers are set during development.
92VBOX_VERSION_BUILD = 3
93# For convenience
94VBOX_VERSION = $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
95
96
97#
98# The VirtualBox Configuration Defaults.
99#
100
101# Build linux / win32 additions.
102ifeq ($(BUILD_TARGET),linux)
103 ifeq ($(BUILD_TARGET_ARCH),x86) # later on amd64 too.
104 VBOX_WITH_LINUX_ADDITIONS = 1
105 VBOX_WITH_WIN32_ADDITIONS = 1
106 endif
107endif
108ifeq ($(BUILD_TARGET),l4)
109 VBOX_WITH_LINUX_ADDITIONS = 1
110 VBOX_WITH_WIN32_ADDITIONS = 1
111endif
112ifeq ($(BUILD_TARGET),win)
113 VBOX_WITH_WIN32_ADDITIONS = 1
114endif
115# Enable the building of shared folders in the windows additions.
116VBOX_WITH_WIN32_ADDITIONS_SHAREDFOLDERS = 1
117
118# build the installer
119VBOX_WITH_INSTALLER = 1
120# enable VRDP server
121VBOX_WITH_VRDP = 1
122# build VRDP authentication modules
123VBOX_WITH_VRDP_AUTHMOD = 1
124# build enhanced version of rdesktop
125VBOX_WITH_VRDP_RDESKTOP = 1
126ifeq ($(BUILD_TARGET),darwin)
127# build the support driver & library without IDT patching.
128## @todo invert this!
129VBOX_WITHOUT_IDT_PATCHING = 1
130endif
131# The kernel driver/module and related runtime libraries.
132VBOX_WITH_VBOXDRV = 1
133# build with secure label support
134ifneq ($(BUILD_TARGET),win64) # too much work with freetype and all that.
135VBOX_WITH_SECURELABEL = 1
136endif
137
138# the main api
139VBOX_WITH_MAIN = 1
140# the SDL based GUI
141VBOX_WITH_VBOXSDL = 1
142# the basic frontend (w/o Main)
143VBOX_WITH_VBOXBFE = 1
144# the Qt GUI
145VBOX_WITH_QTGUI = 1
146## the Direct Framebuffer GUI
147#VBOX_WITH_VBOXFB = 1
148# the gui debugger
149ifneq ($(BUILD_TYPE),release)
150VBOX_WITH_DEBUGGER_GUI = 1
151endif
152# the documentation
153VBOX_WITH_DOCS = 1
154# build the Host Guest Communication Manager component
155VBOX_WITH_HGCM = 1
156# Enable the USB feature.
157VBOX_WITH_USB = 1
158# Enable the ISCSI feature.
159VBOX_WITH_ISCSI = 1
160# Disable ALSA support for Linux (currently broken).
161VBOX_WITH_ALSA =
162# Enable the kchmviewer
163VBOX_WITH_KCHMVIEWER = 1
164# Build the testsuite.
165VBOX_WITH_TESTSUITE = 1
166# Build the testcases.
167VBOX_WITH_TESTCASES = 1
168# Set this to not use COM or XPCOM in places where it can be avoided.
169#VBOX_WITHOUT_COM = 1
170# Set this to skip installing the redistributable compiler runtime.
171#VBOX_WITHOUT_COMPILER_REDIST = 1
172
173
174#
175# Skip stuff.
176#
177
178# VBOX_QUICK can be used by core developers to speed to the build
179ifdef VBOX_QUICK
180 # undefine variables by assigning blank.
181 VBOX_WITH_TESTSUITE=
182 VBOX_WITH_TESTCASES=
183 VBOX_WITH_MAIN =
184 VBOX_WITH_VBOXSDL =
185 VBOX_WITH_VBOXBFE =
186 VBOX_WITH_QTGUI =
187 VBOX_WITH_DEBUGGER_GUI =
188 VBOX_WITH_DOCS =
189endif # VBOX_QUICK
190
191# l4 have to skip a few things.
192ifeq ($(BUILD_TARGET),l4)
193 VBOX_WITH_VBOXDRV=
194 VBOX_WITH_VRDP=
195 VBOX_WITH_VBOXSDL=
196 VBOX_WITH_QTGUI=
197 VBOX_WITH_MAIN=
198 VBOX_WITH_DOCS=
199 VBOX_WITH_ISCSI=
200endif
201
202# Most stuff doesn't build yet on the two new targets.
203ifneq ($(filter darwin os2 freebsd,$(BUILD_TARGET)),)
204 #VBOX_WITH_VBOXBFE=
205 ifeq ($(filter darwin,$(BUILD_TARGET)),)
206 VBOX_WITH_MAIN=
207 VBOX_WITH_VBOXSDL=
208 endif
209 VBOX_WITH_QTGUI=
210 VBOX_WITH_DEBUGGER_GUI=
211 VBOX_WITH_INSTALLER=
212 VBOX_WITH_SECURELABEL=
213 VBOX_WITH_VRDP=
214 VBOX_WITH_VRDP_AUTHMOD=
215 VBOX_WITH_VRDP_RDESKTOP=
216 VBOX_WITH_TESTSUITE=
217 VBOX_WITH_USB=
218 VBOX_WITH_DOCS=
219endif
220
221
222#
223# Include automatic and local config file to override the above settings
224# and to provide defaults for the settings below this point.
225#
226AUTOCFG := $(wildcard $(PATH_ROOT)/AutoConfig.kmk)
227ifeq ($(AUTOCFG),)
228 # deprecated name. to be removed.
229 AUTOCFG := $(wildcard $(PATH_ROOT)/Config.kmkconf)
230 ifneq ($(AUTOCFG),)
231 $(warning Config.kmkconf has been renamed. Please re-run configure.)
232 endif
233endif
234ifneq ($(AUTOCFG),)
235 include $(AUTOCFG)
236endif
237
238LOCALCFG := $(wildcard $(PATH_ROOT)/LocalConfig.kmk)
239ifeq ($(LOCALCFG),)
240 # deprecated name. to be removed.
241 LOCALCFG := $(wildcard $(PATH_ROOT)/Config.kmklocal)
242 ifneq ($(LOCALCFG),)
243 $(warning Please rename your Config.kmklocal to LocalConfig.kmk.)
244 endif
245endif
246ifneq ($(LOCALCFG),)
247 include $(LOCALCFG)
248endif
249
250
251#
252# Disable components that are not open sourced.
253#
254ifdef VBOX_OSE
255 VBOX_WITH_VRDP=
256 VBOX_WITH_USB=
257 VBOX_WITH_ISCSI=
258 VBOX_WITH_DEBUGGER_GUI=
259 VBOX_WITH_WIN32_ADDITIONS_SHAREDFOLDERS=
260 VBOX_WITH_SECURELABEL=
261 VBOX_WITH_INSTALLER=
262 VBOX_WITH_KCHMVIEWER=
263 VBOX_WITH_DOCS=
264 VBOX_WITH_TESTSUITE=
265 PASSES := $(filter-out PACKING,$(PASSES))
266endif
267
268#
269# HACK ALERT!
270# OVerride anyone attempting to build Linux/GNU additions when targeting AMD64.
271#
272ifdef VBOX_WITH_LINUX_ADDITIONS
273 ifeq ($(BUILD_TARGET_ARCH),amd64)
274 VBOX_WITH_LINUX_ADDITIONS :=
275 endif
276endif
277
278#
279# Image and object format config.
280#
281ifeq ($(filter-out linux l4 freebsd netbsd openbsd solaris,$(BUILD_TARGET)),)
282 VBOX_LDR_FMT = elf
283endif
284ifeq ($(BUILD_TARGET),darwin)
285 VBOX_LDR_FMT = macho
286 DONT_USE_YASM = 1 # yasm doesn't implement macho yet.
287endif
288ifeq ($(BUILD_TARGET),os2)
289 VBOX_LDR_FMT = lx
290 VBOX_LDR_FMT32 = lx
291 VBOX_LDR_FMT64 = elf
292 DONT_USE_YASM = 1 # yasm doesn't implement omf yet.
293endif
294ifeq ($(BUILD_TARGET),win)
295 VBOX_LDR_FMT = pe
296endif
297VBOX_LDR_FMT32 ?= $(VBOX_LDR_FMT)
298VBOX_LDR_FMT64 ?= $(VBOX_LDR_FMT)
299
300#
301# Assembler setup.
302#
303# This is a bit complicated since we have to support two different assmblers
304# (yasm/nasm) and possibly two different formats (32-bit/64-bit).
305#
306ifeq ($(VBOX_LDR_FMT),elf)
307 ifeq ($(BUILD_TARGET_ARCH),x86)
308VBOX_ASFLAGS_FMT = -f elf32 -DASM_FORMAT_ELF
309 else
310VBOX_ASFLAGS_FMT = -f elf64 -DASM_FORMAT_ELF
311 endif
312VBOX_ASFLAGS_DBFINFO = -g dwarf2
313endif
314ifeq ($(VBOX_LDR_FMT),lx)
315 VBOX_ASFLAGS_FMT = -f obj -DASM_FORMAT_OMF
316 VBOX_ASFLAGS_DBFINFO = -g stabs
317endif
318ifeq ($(VBOX_LDR_FMT),macho)
319 VBOX_ASFLAGS_FMT = -f macho -DASM_FORMAT_MACHO
320 VBOX_ASFLAGS_DBFINFO = -g dwarf2
321endif
322ifeq ($(VBOX_LDR_FMT),pe)
323 ifeq ($(BUILD_TARGET_ARCH),x86)
324VBOX_ASFLAGS_FMT = -f win32 -DASM_FORMAT_PE
325 else
326VBOX_ASFLAGS_FMT = -f win64 -DASM_FORMAT_PE
327 endif
328endif
329ifndef VBOX_ASFLAGS_FMT
330 $(error VBOX_ASFLAGS_FMT is not defined. VBOX_LDR_FMT=$(VBOX_LDR_FMT))
331endif
332
333ifeq ($(VBOX_LDR_FMT32),elf)
334 VBOX_ASFLAGS_FMT32 = -f elf32 -DASM_FORMAT_ELF
335 VBOX_ASFLAGS_DBFINFO32 = -g dwarf2
336endif
337ifeq ($(VBOX_LDR_FMT32),lx)
338 VBOX_ASFLAGS_FMT32 = -f obj -DASM_FORMAT_OMF
339 VBOX_ASFLAGS_DBFINFO32 = -g stabs
340endif
341ifeq ($(VBOX_LDR_FMT32),macho)
342 VBOX_ASFLAGS_FMT32 = -f macho -DASM_FORMAT_MACHO
343 VBOX_ASFLAGS_DBFINFO32 = -g dwarf2
344endif
345ifeq ($(VBOX_LDR_FMT32),pe)
346 VBOX_ASFLAGS_FMT32 = -f win32 -DASM_FORMAT_PE
347endif
348ifndef VBOX_ASFLAGS_FMT32
349 $(error VBOX_ASFLAGS_FMT32 is not defined. VBOX_LDR_FMT32=$(VBOX_LDR_FMT32))
350endif
351
352ifeq ($(VBOX_LDR_FMT64),elf)
353 VBOX_ASFLAGS_FMT64 = -f elf64 -DASM_FORMAT_ELF
354 VBOX_ASFLAGS_DBFINFO64 = -g dwarf2
355endif
356ifeq ($(VBOX_LDR_FMT64),macho)
357 VBOX_ASFLAGS_FMT64 = -f macho -DASM_FORMAT_MACHO
358 VBOX_ASFLAGS_DBFINFO64 = -g dwarf2
359endif
360ifeq ($(VBOX_LDR_FMT64),pe)
361 VBOX_ASFLAGS_FMT64 = -f win64 -DASM_FORMAT_PE
362endif
363ifndef VBOX_ASFLAGS_FMT64
364 $(error VBOX_ASFLAGS_FMT64 is not defined. VBOX_LDR_FMT64=$(VBOX_LDR_FMT64))
365endif
366
367ifndef DONT_USE_YASM
368 VBOX_ASTOOL = YASM
369 VBOX_LDR_FMT_2_YASM_DBGINFO.elf = -g dwarf2
370 VBOX_LDR_FMT_2_YASM_DBGINFO.lx = -g stabs
371 VBOX_LDR_FMT_2_YASM_DBGINFO.macho = -g dwarf2
372 VBOX_LDR_FMT_2_YASM_DBGINFO.pe =
373 VBOX_ASFLAGS = $(VBOX_ASFLAGS_FMT) -D__YASM__ -w+orphan-labels $(VBOX_LDR_FMT_2_YASM_DBGINFO.$(VBOX_LDR_FMT))
374 VBOX_ASFLAGS32 = $(VBOX_ASFLAGS_FMT32) -D__YASM__ -w+orphan-labels $(VBOX_LDR_FMT_2_YASM_DBGINFO.$(VBOX_LDR_FMT32))
375 VBOX_ASFLAGS64 = $(VBOX_ASFLAGS_FMT64) -D__YASM__ -w+orphan-labels $(VBOX_LDR_FMT_2_YASM_DBGINFO.$(VBOX_LDR_FMT64))
376else
377 VBOX_ASTOOL = NASM
378 VBOX_ASFLAGS = $(subst elf32,elf,$(VBOX_ASFLAGS_FMT)) -D__NASM__ -w+orphan-labels -g
379 VBOX_ASFLAGS32 = $(subst elf32,elf,$(VBOX_ASFLAGS_FMT32)) -D__NASM__ -w+orphan-labels -g
380 VBOX_ASFLAGS64 = $(VBOX_ASFLAGS_FMT64) -D__NASM__ -w+orphan-labels -g
381endif
382
383#
384# Windows only has mingw handy. On *nix we have to deal with cross compiling
385# 32-bit targets on 64-bit platforms, meaning we'll be using gcc32/g++32.
386# In the latter case we'll also have to disable all the all the R0 driver related stuff.
387#
388ifndef VBOX_GCC_TOOL
389 ifeq ($(BUILD_TARGET),win)
390 VBOX_GCC_TOOL := MINGW32
391 TOOL_MINGW32_CFLAGS := $(UNDEFINED) # override -g
392 else ifeq ($(BUILD_TARGET),os2)
393 VBOX_GCC_TOOL := GCC3OMF
394 else ifeq ($(BUILD_TARGET),darwin)
395 VBOX_GCC_TOOL := GCC4MACHO
396 else
397 VBOX_GCC_TOOL := GCC3
398 ifeq ($(BUILD_TARGET),$(BUILD_PLATFORM))
399 ifneq ($(BUILD_TARGET_ARCH),$(BUILD_PLATFORM_ARCH))
400 VBOX_GCC_TOOL := GCC32
401 VBOX_WITH_VBOXDRV=
402 VBOX_WITH_LINUX_ADDITIONS=
403 VBOX_WITH_WIN32_ADDITIONS=
404 endif
405 endif
406 endif
407endif
408ifndef VBOX_GCC32_TOOL
409 ifeq ($(BUILD_TARGET_ARCH),x86)
410 VBOX_GCC32_TOOL := $(VBOX_GCC_TOOL)
411 else ifeq ($(BUILD_TARGET),win)
412 VBOX_GCC32_TOOL := MINGW32
413 else
414 VBOX_GCC32_TOOL := GCC32
415 endif
416endif
417
418#
419# Decide which Visual C++ compiler version we're using by default.
420#
421ifndef VBOX_VCC_TOOL
422 ifdef VBOX_USE_VCC80
423 ifeq ($(BUILD_TARGET_ARCH),x86)
424 VBOX_VCC_TOOL := VCC80X86
425 else
426 VBOX_VCC_TOOL := VCC80AMD64
427 endif
428 else
429 VBOX_VCC_TOOL := VCC70
430 endif
431endif
432
433#
434# The kBuild tools and SDKs are using PATH_DEVTOOLS, PATH_DEVTOOLS_BLD
435# and PATH_DEVTOOLS_TRG to find things if we give them specific locations.
436#
437PATH_DEVTOOLS ?= $(PATH_ROOT)/tools
438PATH_DEVTOOLS := $(abspath $(PATH_DEVTOOLS))
439PATH_DEVTOOLS_BLD ?= $(PATH_DEVTOOLS)/$(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)
440PATH_DEVTOOLS_TRG ?= $(PATH_DEVTOOLS)/$(BUILD_TARGET).$(BUILD_TARGET_ARCH)
441
442## @todo Remove the default tool crap here!
443TOOL = $(VBOX_GCC_TOOL)
444ifdef VBOX_USE_VCC80
445 TOOL.win.x86 = VCC80X86
446 TOOL.win.amd64 = VCC80AMD64
447else
448 TOOL.win = VCC70
449endif
450ASTOOL = $(VBOX_ASTOOL)
451
452#
453# L4.
454#
455ifdef L4_DIR
456 # default CPU type
457 ifeq ($(L4_CPU),)
458 L4_CPU = 586
459 endif
460 ifeq ($(L4_API),)
461 L4_API = l4v2
462 endif
463 L4_OBJ := $(L4_DIR)/build-x86-$(L4_CPU)-$(L4_API)
464 ifeq ($(BUILD_TARGET),l4)
465 L4_INCDIR := \
466 $(L4_OBJ)/include/uclibc++ \
467 $(L4_OBJ)/include/x86/uclibc \
468 $(L4_OBJ)/include/uclibc \
469 $(L4LINUX26_DIR)/include \
470 $(L4LINUX26_DIR)/include/asm-l4/i386-arch \
471 $(L4_OBJ)/include/x86/$(L4_API) \
472 $(L4_OBJ)/include/x86 \
473 $(L4_OBJ)/include \
474 $(L4_DIR)/tool/dice/include
475 L4_LIBDIR := \
476 $(L4_DIR)/build-x86-$(L4_CPU)-$(L4_API)/lib/x86_$(L4_CPU)/$(L4_API)
477 endif # BUILD_TARGET == l4
478endif # L4_DIR
479
480# Produce debugging information that the Fiasco kernel debugger can read.
481ifeq ($(BUILD_TARGET).$(BUILD_TYPE),l4.debug)
482 DEBUG_L4 = -gstabs+
483endif
484
485#
486# Setup the global defines and includes.
487#
488## @todo PATH_CURRENT has to go, fix the places where we rely on it.
489INCS += $(PATH_ROOT)/include $(PATH_CURRENT) $(PATH_OUT)
490DEFS += VBOX
491DEFS.debug := DEBUG DEBUG_$(subst $(subst _, ,_),_,$(USERNAME)) DEBUG_USERNAME=$(subst $(subst _, ,_),_,$(USERNAME))
492DEFS.profile = VBOX_WITH_STATISTICS
493DEFS.x86 = __X86__
494DEFS.amd64 = __AMD64__
495DEFS.darwin = __DARWIN__
496DEFS.freebsd = __FREEBSD__
497DEFS.l4 = __L4__ __L4ENV__ L4API_l4v2 __NO_CTYPE _FILE_OFFSET_BITS=64
498ifeq ($(L4_API),l4v2onv4)
499 DEFS.l4 += L4API_l4v2onv4 STATIC_L4_INLINE
500endif
501DEFS.linux = __LINUX__ _FILE_OFFSET_BITS=64
502DEFS.netbsd = __NETBSD__
503DEFS.openbsd = __OPENBSD__
504DEFS.os2 = __OS2__
505DEFS.solaris = __SOLARIS__
506DEFS.win = __WIN__
507DEFS.win.x86 = __WIN32__
508DEFS.win.amd64 = __WIN64__
509# optional defines (use environment or make commandline)
510ifdef VBOX_WITH_DEBUGGER
511 DEFS += VBOX_WITH_DEBUGGER
512endif
513ifdef VBOX_WITH_DEBUGGER_GUI
514 DEFS += VBOX_WITH_DEBUGGER_GUI
515endif
516ifdef VBOX_WITH_STATISTICS
517 DEFS += VBOX_WITH_STATISTICS
518endif
519ifdef VBOX_STRICT
520 DEFS += VBOX_STRICT
521endif
522ifdef VBOX_WITHOUT_IDT_PATCHING
523 DEFS += VBOX_WITHOUT_IDT_PATCHING
524endif
525ifdef LOG_ENABLED
526 DEFS += LOG_ENABLED
527endif
528ifdef VBOX_OSE
529 DEFS += VBOX_OSE
530endif
531
532#
533# Compiler optimization flags.
534#
535ifeq ($(BUILD_TYPE),debug)
536 VBOX_GCC_FP ?= -fno-omit-frame-pointer
537 VBOX_GCC_OPT ?= -O0
538 VBOX_VCC_FP ?= -Oy-
539 VBOX_VCC_OPT ?=
540 VBOX_GCC_GC_FP ?= -fno-omit-frame-pointer
541 VBOX_GCC_GC_OPT ?= -O0
542 VBOX_VCC_GC_FP ?= -Oy-
543 VBOX_VCC_GC_OPT ?=
544else
545 # We should use -fomit-frame-pointer for GCC / -Oy for VCC.
546 # -funwind-tables provides support for backtraces in gdb then.
547 VBOX_GCC_FP ?= -fno-omit-frame-pointer
548 VBOX_GCC_OPT ?= -O2
549 VBOX_VCC_FP ?= -Oy-
550 ifdef VBOX_USE_VCC80
551 VBOX_VCC_OPT ?= -O2 -GS-
552 else
553 VBOX_VCC_OPT ?= -Ogitb2
554 endif
555 VBOX_GCC_GC_FP ?= -fno-omit-frame-pointer
556 VBOX_GCC_GC_OPT ?= -O2
557 VBOX_VCC_GC_FP ?= -Oy-
558 ifdef VBOX_USE_VCC80
559 VBOX_VCC_GC_OPT ?= -O2
560 else
561 VBOX_VCC_GC_OPT ?= -Ogitb2
562 endif
563endif
564
565#
566# ARCH_BITS_DEFS.
567#
568ifeq ($(BUILD_TARGET_ARCH),amd64)
569 ARCH_BITS_DEFS := HC_ARCH_BITS=64 GC_ARCH_BITS=32
570else ifeq ($(BUILD_TARGET_ARCH),x86)
571 ARCH_BITS_DEFS := HC_ARCH_BITS=32 GC_ARCH_BITS=32
572else
573 error BUILD_TARGET_ARCH=$(BUILD_TARGET_ARCH)
574endif
575
576#
577# Add the output dir(s) to the dynamic loader search path.
578#
579ifeq ($(filter-out linux l4 freebsd netbsd openbsd solaris,$(BUILD_TARGET)),)
580 export LD_LIBRARY_PATH:=$(PATH_BIN):$(PATH_LIB):$(LD_LIBRARY_PATH)
581endif
582ifeq ($(BUILD_TARGET),os2)
583 #fixme! export BEGINLIBPATH:=$(PATH_BIN);$(PATH_LIB);$(BEGINLIBPATH)
584endif
585ifeq ($(BUILD_TARGET),win)
586 export PATH:=$(PATH_BIN);$(PATH_LIB);$(PATH)
587endif
588
589#
590# Common libraries and tools.
591#
592ifeq ($(BUILD_TARGET),darwin)
593 LIB_RUNTIME = $(PATH_BIN)/VBoxRT.dylib
594 LIB_RUNTIME_EF = #$(PATH_LIB)/RuntimeEFCPP.a
595 LIB_KPROFILE = $(PATH_BIN)/kPrf2.dylib
596 LIB_VMM = $(PATH_BIN)/VBoxVMM.dylib
597 LIB_VMMGC = $(PATH_BIN)/VMMGC.gc
598 LIB_REM = $(PATH_BIN)/VBoxREMImp.dylib
599endif
600ifeq ($(BUILD_TARGET),l4)
601 LIB_RUNTIME = $(PATH_BIN)/VBoxRT.s.so
602 LIB_RUNTIME_EF = #$(PATH_LIB)/RuntimeEFCPP.a
603 LIB_KPROFILE = $(PATH_BIN)/kPrf2.s.so
604 LIB_VMM = $(PATH_BIN)/VBoxVMM.s.so
605 LIB_VMMGC = $(PATH_BIN)/VMMGC.gc
606 LIB_REM = $(PATH_BIN)/VBoxREMImp.s.so
607endif
608ifeq ($(filter-out linux freebsd netbsd openbsd solaris,$(BUILD_TARGET)),)
609 LIB_RUNTIME = $(PATH_BIN)/VBoxRT.so
610 LIB_RUNTIME_EF = $(PATH_LIB)/RuntimeEFCPP.a
611 LIB_KPROFILE = $(PATH_BIN)/kPrf2.so
612 LIB_VMM = $(PATH_BIN)/VBoxVMM.so
613 LIB_VMMGC = $(PATH_BIN)/VMMGC.gc
614 LIB_REM = $(PATH_BIN)/VBoxREMImp.so
615endif
616ifeq ($(BUILD_TARGET),os2)
617 LIB_RUNTIME = $(PATH_BIN)/VBoxRT.dll
618 LIB_RUNTIME_EF = #$(PATH_LIB)/RuntimeEFCPP.a
619 LIB_KPROFILE = $(PATH_BIN)/kPrf2.dll
620 LIB_VMM = $(PATH_BIN)/VBoxVMM.dll
621 LIB_VMMGC = $(PATH_LIB)/VMMGCImp.lib
622 LIB_REM = $(PATH_LIB)/VBoxREMImp.lib
623 OBJ_SYS0 = $(PATH_OBJ)/src/VBox/Runtime/RuntimeR0/os2/sys0.obj
624endif
625ifeq ($(BUILD_TARGET),win)
626 LIB_RUNTIME = $(PATH_LIB)/VBoxRT.lib
627 LIB_RUNTIME_EF = #$(PATH_LIB)/RuntimeEFCPP.lib
628 LIB_KPROFILE = $(PATH_LIB)/kPrf2.lib
629 LIB_VMM = $(PATH_LIB)/VBoxVMM.lib
630 LIB_VMMGC = $(PATH_OUT)/obj/src/VBox/VMM/VMMGC/VMMGC.lib
631 LIB_REM = $(PATH_LIB)/VBoxREMImp.lib
632endif
633
634# The kprofile build automagically links with kProfile.
635ifeq ($(BUILD_TYPE),kprofile)
636 LIB_RUNTIME += $(LIB_KPROFILE)
637endif
638
639# Overridable libraries (unix).
640LIB_UUID ?= uuid
641LIB_PTHREAD ?= pthread
642LIB_XCURSOR ?= Xcursor
643
644## Enable C++ electric fence heap.
645#LIB_RUNTIME += $(LIB_RUNTIME_EF) $(LIB_RUNTIME)
646
647# Intel ASL compiler for ACPI
648VBOX_IASLCMD ?= $(firstword $(wildcard $(PATH_DEVTOOLS_BLD)/bin/iasl$(HOSTSUFF_EXE)) iasl$(HOSTSUFF_EXE))
649
650# Bruce's C compile is a C-compiler for BIOS-related 8086 code
651VBOX_BCC ?= $(PATH_DEVTOOLS_BLD)/bin/bcc$(HOSTSUFF_EXE) -B $(PATH_DEVTOOLS_BLD)/bin/
652
653# Assembler for BIOS-related 8086 code
654VBOX_AS86 ?= $(PATH_DEVTOOLS_BLD)/bin/as86$(HOSTSUFF_EXE)
655
656# libxslt XSLT processor. (see PATH_TOOL_YASM for explanation why it's temporarily located in bin.)
657ifeq ($(BUILD_PLATFORM),win)
658# VBOX_XSLTPROC ?= $(PATH_DEVTOOLS)/win.x86/libxslt/10114/xsltproc.exe
659 VBOX_XSLTPROC ?= $(PATH_DEVTOOLS)/win.x86/bin/xsltproc.exe
660else
661 VBOX_XSLTPROC ?= xsltproc$(HOSTSUFF_EXE)
662endif
663
664# bin2c (convert binary files into C arrays)
665VBOX_BIN2C ?= $(PATH_OBJ)/src/bldprogs/bin2c/bin2c$(HOSTSUFF_EXE)
666
667# mkisofs
668ifeq ($(BUILD_PLATFORM),win)
669 VBOX_MKISOFS ?= $(PATH_DEVTOOLS_BLD)/bin/mkisofs.exe
670else
671 VBOX_MKISOFS ?= mkisofs
672endif
673
674# Makeself for the linux installers.
675VBOX_MAKESELF ?= $(PATH_DEVTOOLS)/common/makeself/v2.1.4_1/makeself.sh
676
677# Microsoft HTML Help Workshop.
678VBOX_PATH_HTML_HELP_WORKSHOP ?= $(PATH_DEVTOOLS)/win.x86/HTML_Help_Workshop/v1.3/
679
680# Path to the null soft installer.
681VBOX_PATH_NSIS ?= $(PATH_DEVTOOLS)/win.x86/nsis/v2.22
682
683# Windows install tools...
684VBOX_PATH_WIX ?= $(PATH_DEVTOOLS)/win.x86/wix/v2.0.4611.0
685VBOX_PATH_DIFX ?= $(PATH_DEVTOOLS)/win.x86/DIFx/v2.1
686
687# We need to export YASM for OSE, but since it was converted to .zip we need to
688# allow for the location used by the zip to be properly cleaned up first.
689ifeq ($(filter-out win.x86 linux.x86, $(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)),)
690 PATH_TOOL_YASM ?= $(PATH_DEVTOOLS_BLD)/bin
691endif
692
693# XPCOM setup for all but win32.
694ifneq ($(BUILD_TARGET),win)
695 VBOX_WITH_XPCOM = 1
696 VBOX_XPIDL ?= $(PATH_OBJ)/src/libs/xpcom18a4/xpidl/xpidl$(HOSTSUFF_EXE)
697 VBOX_PATH_XPCOM_IDL ?= $(PATH_BIN)/sdk/idl
698 VBOX_XPCOM_INCS ?= \
699 $(PATH_BIN)/sdk/include \
700 $(PATH_BIN)/sdk/include/xpcom \
701 $(PATH_BIN)/sdk/include/xpcom/nsprpub \
702 $(PATH_BIN)/sdk/include/xpcom/string \
703 $(PATH_BIN)/sdk/include/xpcom/xpcom \
704 $(PATH_BIN)/sdk/include/xpcom/ipcd
705endif
706
707#
708# GCC stuff properties.
709#
710# These will be resolved on the first kmk invocation and passed on to recursive
711# instances in the environment.
712#q
713# Note. If we add much more to here, we should seriously consider moving this to a
714# gcc configure script which we invoke automatically.
715#
716include $(PATH_KBUILD)/tools/$(VBOX_GCC_TOOL).kmk
717
718ifndef VBOX_GCC_LIBGCC
719 export VBOX_GCC_LIBGCC := $(shell $(TOOL_$(VBOX_GCC_TOOL)_CC) -print-libgcc-file-name)
720endif
721
722# HC compiler switch detction.
723VBOX_GCC_CHECK_CC = $(shell \
724 if $(TOOL_$(VBOX_GCC_TOOL)_CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
725 then echo "$(1)"; \
726 else echo "$(2)"; fi; )
727VBOX_GCC_CHECK_CXX = $(shell \
728 if $(TOOL_$(VBOX_GCC_TOOL)_CXX) $(1) -S -o /dev/null -xc++ /dev/null > /dev/null 2>&1; \
729 then echo "$(1)"; \
730 else echo "$(2)"; fi; )
731ifeq ($(origin VBOX_GCC_Wno-pointer-sign),undefined)
732 export VBOX_GCC_Wno-pointer-sign := $(call VBOX_GCC_CHECK_CC,-Wno-pointer-sign,)
733endif
734ifeq ($(origin VBOX_GCC_Wno-variadic-macros),undefined)
735 export VBOX_GCC_Wno-variadic-macros := $(call VBOX_GCC_CHECK_CXX,-Wno-variadic-macros,)
736endif
737ifeq ($(origin VBOX_GCC_Wno-invalid-offsetof),undefined)
738 export VBOX_GCC_Wno-invalid-offsetof := $(call VBOX_GCC_CHECK_CXX,-Wno-invalid-offsetof,)
739endif
740ifeq ($(origin VBOX_GCC_fno-stack-protector),undefined)
741 export VBOX_GCC_fno-stack-protector := $(call VBOX_GCC_CHECK_CC,-fno-stack-protector,)
742endif
743
744# 32-bit (GC) compiler switch detection.
745VBOX_GCC32_CHECK_CXX = $(shell \
746 if $(TOOL_$(VBOX_GCC32_TOOL)_CXX) $(1) -S -o /dev/null -xc++ /dev/null > /dev/null 2>&1; \
747 then echo "$(1)"; \
748 else echo "$(2)"; fi; )
749ifneq ($(VBOX_GCC_TOOL),$(VBOX_GCC32_TOOL))
750 include $(PATH_KBUILD)/tools/$(VBOX_GCC32_TOOL).kmk
751 ifeq ($(origin VBOX_GCC32_Wno-variadic-macros),undefined)
752 export VBOX_GCC32_Wno-variadic-macros := $(call VBOX_GCC32_CHECK_CXX,-Wno-variadic-macros,)
753 endif
754 ifndef VBOX_GCC32_LIBGCC
755 export VBOX_GCC32_LIBGCC := $(shell $(TOOL_$(VBOX_GCC32_TOOL)_CC) -print-libgcc-file-name)
756 endif
757else
758 VBOX_GCC32_Wno-variadic-macros ?= $(VBOX_GCC_Wno-variadic-macros)
759 VBOX_GCC32_LIBGCC ?= $(VBOX_GCC_LIBGCC)
760endif
761
762# Find the compiler defines (for IPRT no-crt).
763ifndef VBOX_PATH_GCC_INCS
764 export VBOX_PATH_GCC_INCS := $(abspath $(dir $(shell LC_ALL=C $(TOOL_$(VBOX_GCC_TOOL)_CC) -print-libgcc-file-name)))/include
765endif
766
767# L4
768ifeq ($(BUILD_TARGET),l4)
769 ifndef VBOX_PATH_L4_GCC3_INSTALL
770 export VBOX_PATH_L4_GCC3_INSTALL := $(shell LANG=C $(TOOL_$(VBOX_GCC_TOOL)_CC) -print-search-dirs|sed -ne 's+^install: \(.*[^/][^/]*\)/\?+\1+p')
771 endif
772 VBOX_L4_GCC3_INCS := $(VBOX_PATH_L4_GCC3_INSTALL)/include
773 # L4_GPP3_INCS := \
774 # $(VBOX_PATH_L4_GCC3_INSTALL)/include/g++-v3/ \
775 # $(VBOX_PATH_L4_GCC3_INSTALL)/include/g++-v3/i386-pc-linux-gnu/
776endif
777
778#
779# Default prefixes and suffixes.
780#
781VBOX_PREF_LIB =
782ifeq ($(filter-out win os2,$(BUILD_TARGET)),)
783VBOX_SUFF_LIB = .lib
784else
785VBOX_SUFF_LIB = .a
786endif
787VBOX_SUFF_DLL = $(SUFF_DLL)
788VBOXW32GUEST_SUFF_LIB = .lib
789VBOXLNX32GUEST_SUFF_LIB = .a
790
791#
792# SDKs for external libraries.
793#
794SDK_VBOX_XERCES = .
795SDK_VBOX_XERCES_INCS ?= $(PATH_ROOT)/src/libs/xerces-2.6.0/src
796SDK_VBOX_XERCES_LIBS ?= $(PATH_LIB)/VBox-xerces$(VBOX_SUFF_LIB)
797
798SDK_VBOX_XALAN = .
799SDK_VBOX_XALAN_INCS ?= $(PATH_ROOT)/src/libs/xalan-1.10.0
800SDK_VBOX_XALAN_LIBS ?= $(PATH_LIB)/VBox-xalan$(VBOX_SUFF_LIB)
801
802SDK_VBOX_LIBPNG = .
803SDK_VBOX_LIBPNG_INCS ?= $(PATH_ROOT)/src/libs/libpng-1.2.8
804SDK_VBOX_LIBPNG_LIBS ?= $(PATH_LIB)/VBox-libpng$(VBOX_SUFF_LIB)
805
806SDK_VBOX_ZLIB = .
807ifeq ($(filter-out win os2,$(BUILD_TARGET)),)
808 SDK_VBOX_ZLIB_INCS ?= $(PATH_ROOT)/src/libs/zlib-1.2.1
809 SDK_VBOX_ZLIB_LIBS ?= $(PATH_LIB)/VBox-zlib$(VBOX_SUFF_LIB)
810else
811 SDK_VBOX_ZLIB_INCS ?=
812 SDK_VBOX_ZLIB_LIBS ?= z
813endif
814
815SDK_VBOX_OPENSSL = .
816SDK_VBOX_OPENSSL_INCS?= $(PATH_ROOT)/src/libs/openssl-0.9.7e/include
817SDK_VBOX_OPENSSL_LIBS?= $(PATH_LIB)/VBox-libcrypto$(VBOX_SUFF_LIB)
818
819SDK_VBOX_FFMPEG = .
820ifeq ($(filter-out win os2,$(BUILD_TARGET)),)
821 SDK_VBOX_FFMPEG_INCS ?= \
822 $(PATH_ROOT)/src/libs/ffmpeg-20060710/libavutil \
823 $(PATH_ROOT)/src/libs/ffmpeg-20060710/libavcodec \
824 $(PATH_ROOT)/src/libs/ffmpeg-20060710/libavformat
825 ifeq ($(BUILD_TARGET),win)
826 ## Michael! Where is $(PATH_LIB)/VBoxFFmpegImp$(VBOX_SUFF_LIB) supposed to come from?
827 SDK_VBOX_FFMPEG_LIBS ?= $(PATH_LIB)/VBoxFFmpeg.a
828 else
829 SDK_VBOX_FFMPEG_LIBS ?= $(PATH_BIN)/VBoxFFmpeg$(SUFF_DLL)
830 endif
831else
832 SDK_VBOX_FFMPEG_INCS ?=
833 SDK_VBOX_FFMPEG_LIBS ?= avutil avcodec avformat
834endif
835
836#
837# Special SDK for the problematic NTDLL.LIB.
838#
839SDK_VBOX_NTDLL = Requires W2K3DDK
840SDK_VBOX_NTDLL_LIBS ?= $(PATH_SDK_W2K3DDK_LIB)/ntdll.lib
841
842
843#
844# Qt build tools, for Linux we require it to be present on the system
845#
846## @todo convert this into SDK and integrate the Qt stuff into kBuild.
847ifeq ($(BUILD_TARGET),win)
848 ifeq ($(BUILD_TARGET_ARCH),x86)
849 VBOX_PATH_QT ?= $(PATH_DEVTOOLS_TRG)/qt/v3.3.3
850 LIB_QT ?= $(VBOX_PATH_QT)/lib/dynamic/qt-mt333.lib
851 else
852 VBOX_PATH_QT ?= $(PATH_DEVTOOLS_TRG)/qt/v3.3.6
853 LIB_QT ?= $(VBOX_PATH_QT)/lib/dynamic/qt-mt336.lib
854 endif
855 LIB_QTMAIN ?= $(VBOX_PATH_QT)/lib/dynamic/qtmain.lib
856 ifndef QTDIR
857 QTDIR := $(sort $(wildcard $(PATH_DEVTOOLS_BLD)/v*))
858 QTDIR := $(call lastword,$(QTDIR))
859 endif
860endif
861ifndef VBOX_PATH_QT
862 VBOX_PATH_QT ?= $(QTDIR)
863 LIB_QT ?= qt-mt
864endif
865ifeq ($(BUILD_PLATFORM),$(BUILD_TARGET))
866 VBOX_PATH_QT_HOST ?= $(VBOX_PATH_QT)
867else
868 VBOX_PATH_QT_HOST ?= $(QTDIR)
869endif
870VBOX_UIC ?= $(VBOX_PATH_QT_HOST)/bin/uic$(HOSTSUFF_EXE)
871VBOX_MOC ?= $(VBOX_PATH_QT_HOST)/bin/moc$(HOSTSUFF_EXE)
872VBOX_LUPDATE ?= $(VBOX_PATH_QT_HOST)/bin/lupdate$(HOSTSUFF_EXE)
873VBOX_LRELEASE ?= $(VBOX_PATH_QT_HOST)/bin/lrelease$(HOSTSUFF_EXE)
874
875#
876# The linux kernel headers(/sources).
877#
878ifneq ($(filter linux l4,$(BUILD_TARGET)),)
879 ifeq ($(origin VBOX_LINUX_SRC),undefined)
880 ifneq ($(wildcard /lib/modules/$(shell uname -r)/build/include/linux/autoconf.h),)
881 export VBOX_LINUX_SRC := /lib/modules/$(shell uname -r)/build
882 else
883 export VBOX_LINUX_SRC := /usr/src/linux
884 endif
885 endif
886endif
887
888
889#
890# Template for building GC things.
891#
892TEMPLATE_VBOXGC = VBox GC
893TEMPLATE_VBOXGC_ASTOOL = $(VBOX_ASTOOL)
894TEMPLATE_VBOXGC_ASFLAGS = $(VBOX_ASFLAGS32)
895TEMPLATE_VBOXGC_DEFS = IN_GC $(ARCH_BITS_DEFS)
896TEMPLATE_VBOXGC_SYSSUFF = .gc
897TEMPLATE_VBOXGC_BLD_TRG_ARCH = x86
898
899ifeq ($(VBOX_LDR_FMT32),pe)
900ifdef VBOX_USE_VCC80
901 TEMPLATE_VBOXGC_TOOL = VCC80X86
902 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)
903else
904 TEMPLATE_VBOXGC_TOOL = VCC70
905 TEMPLATE_VBOXGC_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -W3 -wd4244 $(VBOX_VCC_GC_OPT) $(VBOX_VCC_GC_FP)
906endif
907TEMPLATE_VBOXGC_CFLAGS = $(TEMPLATE_VBOXGC_CXXFLAGS)
908TEMPLATE_VBOXGC_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:32 -MapInfo:Lines -MapInfo:Exports -NoD
909ifdef VBOX_USE_VCC80
910 include $(PATH_KBUILD)/sdks/W2K3DDKX86.kmk
911 TEMPLATE_VBOXGC_LIBS = \
912 $(PATH_SDK_W2K3DDKX86_LIB)/int64.lib
913else
914 TEMPLATE_VBOXGC_LIBS = \
915 $(PATH_TOOL_VCC70_LIB)/libcmt.lib # for 64-bit int
916endif
917endif
918
919ifeq ($(VBOX_LDR_FMT32),elf)
920TEMPLATE_VBOXGC_TOOL = $(VBOX_GCC32_TOOL)
921TEMPLATE_VBOXGC_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC32_Wno-variadic-macros) -pipe -fno-exceptions -fno-rtti $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector)
922TEMPLATE_VBOXGC_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC32_Wno-variadic-macros) -pipe -Wmissing-prototypes -Wstrict-prototypes $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector)
923TEMPLATE_VBOXGC_LDFLAGS = -nostdlib -Bsymbolic
924# temporarily, must fix the loader.
925TEMPLATE_VBOXGC_LDFLAGS += -S
926TEMPLATE_VBOXGC_LDFLAGS.release = -S
927TEMPLATE_VBOXGC_LIBS = \
928 $(VBOX_GCC32_LIBGCC) # instricts
929endif
930
931ifeq ($(VBOX_LDR_FMT32),macho)
932TEMPLATE_VBOXGC_TOOL = GCC4MACHO
933TEMPLATE_VBOXGC_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC32_Wno-variadic-macros) -pipe -fno-common -msoft-float -fno-exceptions -fno-rtti $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing
934TEMPLATE_VBOXGC_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC32_Wno-variadic-macros) -pipe -fno-common -msoft-float -Wno-trigraphs -Wmissing-prototypes -Wstrict-prototypes $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing
935TEMPLATE_VBOXGC_LDFLAGS = -dynamic -nostdlib
936#TEMPLATE_VBOXGC_LDFLAGS.release = -Wl,-S ???
937TEMPLATE_VBOXGC_LIBS = \
938 $(VBOX_GCC32_LIBGCC) # instricts
939endif
940
941ifeq ($(VBOX_LDR_FMT32),lx)
942TEMPLATE_VBOXGC_TOOL = GCC3OMF
943TEMPLATE_VBOXGC_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC32_Wno-variadic-macros) -pipe -fno-exceptions -fno-rtti $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing
944TEMPLATE_VBOXGC_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC32_Wno-variadic-macros) -pipe -Wmissing-prototypes -Wstrict-prototypes $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing
945TEMPLATE_VBOXGC_LDFLAGS = -Zdll -nostdlib
946TEMPLATE_VBOXGC_LIBS = \
947 $(VBOX_GCC32_LIBGCC) \
948 $(OBJ_SYS0) \
949 end
950endif
951
952
953#
954# Template for building a GC ring-3 testcase (tstVMStructGC, tstDevStructGC).
955#
956TEMPLATE_VBOXGCEXE = VBox GC as ring-3 testcase
957TEMPLATE_VBOXGCEXE_EXTENDS = VBOXGC
958
959ifeq ($(VBOX_LDR_FMT32),pe)
960 TEMPLATE_VBOXGCEXE_LDFLAGS = -Incremental:NO -MapInfo:Exports -NoD -Debug
961 TEMPLATE_VBOXGCEXE_SDKS = WIN32SDK
962 ifdef VBOX_USE_VCC80
963 TEMPLATE_VBOXGCEXE_LIBS = \
964 $(PATH_TOOL_VCC80X86_LIB)/libcmt.lib \
965 $(PATH_TOOL_VCC80X86_LIB)/oldnames.lib
966 else
967 TEMPLATE_VBOXGCEXE_LIBS = \
968 $(PATH_TOOL_VCC70_LIB)/libcmt.lib \
969 $(PATH_TOOL_VCC70_LIB)/oldnames.lib
970 endif
971endif
972
973ifeq ($(VBOX_LDR_FMT32),elf)
974 TEMPLATE_VBOXGCEXE_LDFLAGS := -g
975 TEMPLATE_VBOXGCEXE_LDFLAGS.release := -g
976endif
977
978ifeq ($(VBOX_LDR_FMT32),macho)
979 TEMPLATE_VBOXGCEXE_LDFLAGS := -g
980endif
981
982ifeq ($(VBOX_LDR_FMT32),lx)
983 TEMPLATE_VBOXGCEXE_LDFLAGS := -g
984 TEMPLATE_VBOXGCEXE_LIBS := $(NO_SUCH_VARIABLE)
985endif
986
987
988#
989# Template for building R0 things.
990#
991TEMPLATE_VBOXR0 = VBox Ring 0
992TEMPLATE_VBOXR0_ASTOOL = $(VBOX_ASTOOL)
993TEMPLATE_VBOXR0_ASFLAGS = $(VBOX_ASFLAGS)
994TEMPLATE_VBOXR0_DEFS = IN_RING0 $(ARCH_BITS_DEFS)
995
996ifeq ($(VBOX_LDR_FMT),pe)
997TEMPLATE_VBOXR0_TOOL = $(VBOX_VCC_TOOL)
998ifdef VBOX_USE_VCC80
999 TEMPLATE_VBOXR0_CXXFLAGS = -Zi -Zl -GR- -GS- -EHs-c- -GF- -W3 -wd4244 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1000else
1001 TEMPLATE_VBOXR0_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -W3 -wd4244 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1002endif
1003TEMPLATE_VBOXR0_CFLAGS = $(TEMPLATE_VBOXR0_CXXFLAGS)
1004TEMPLATE_VBOXR0_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:32 -MapInfo:Exports -NoD
1005ifdef VBOX_USE_VCC80
1006 TEMPLATE_VBOXR0_LIBS.x86 = \
1007 $(PATH_SDK_W2K3DDKX86_LIB)/int64.lib
1008else
1009 TEMPLATE_VBOXR0_LIBS.x86 = \
1010 $(PATH_TOOL_VCC70_LIB)/libcmt.lib # for 64-bit int
1011endif
1012endif # pe
1013
1014ifeq ($(VBOX_LDR_FMT),elf)
1015TEMPLATE_VBOXR0_TOOL = $(VBOX_GCC_TOOL)
1016TEMPLATE_VBOXR0_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -Wmissing-prototypes -Wstrict-prototypes $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector)
1017TEMPLATE_VBOXR0_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -fno-rtti -fno-exceptions $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector)
1018TEMPLATE_VBOXR0_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables -ffreestanding
1019TEMPLATE_VBOXR0_CXXFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables
1020TEMPLATE_VBOXR0_LDFLAGS = -nostdlib -Bsymbolic
1021# temporarily, must fix the loader.
1022TEMPLATE_VBOXR0_LDFLAGS += -S
1023TEMPLATE_VBOXR0_LDFLAGS.release = -S
1024TEMPLATE_VBOXR0_LIBS = \
1025 $(VBOX_GCC_LIBGCC) # instricts
1026endif
1027
1028ifeq ($(VBOX_LDR_FMT),macho)
1029TEMPLATE_VBOXR0_TOOL = GCC4MACHO
1030TEMPLATE_VBOXR0_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -fno-common -msoft-float -fno-rtti -fno-exceptions $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
1031TEMPLATE_VBOXR0_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -fno-common -msoft-float -Wmissing-prototypes -Wstrict-prototypes $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
1032TEMPLATE_VBOXR0_LDFLAGS = -dynamic -nostdlib
1033#TEMPLATE_VBOXR0_LDFLAGS.release = -Wl,-S ???
1034TEMPLATE_VBOXR0_LIBS = \
1035 $(VBOX_GCC_LIBGCC) # instricts
1036endif
1037
1038ifeq ($(VBOX_LDR_FMT),lx)
1039TEMPLATE_VBOXR0_TOOL = GCC3OMF
1040TEMPLATE_VBOXR0_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -fno-rtti -fno-exceptions $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
1041TEMPLATE_VBOXR0_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -Wmissing-prototypes -Wstrict-prototypes $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
1042TEMPLATE_VBOXR0_LDFLAGS = -Zdll -nostdlib
1043TEMPLATE_VBOXR0_LIBS = \
1044 $(VBOX_GCC_LIBGCC) \
1045 $(OBJ_SYS0) \
1046 end
1047endif
1048
1049
1050#
1051# Template for building SUPDRV R0 things.
1052#
1053TEMPLATE_VBOXR0DRV = VBox SUPDRV Ring 0
1054TEMPLATE_VBOXR0DRV_ASTOOL = $(VBOX_ASTOOL)
1055TEMPLATE_VBOXR0DRV_ASFLAGS = $(VBOX_ASFLAGS)
1056TEMPLATE_VBOXR0DRV_DEFS = IN_RING0 IN_RT_R0 $(ARCH_BITS_DEFS)
1057
1058ifeq ($(BUILD_TARGET),win)
1059 TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_VCC_TOOL)
1060 TEMPLATE_VBOXR0DRV_RCDEFS = \
1061 VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
1062 VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
1063 VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
1064 VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
1065 VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
1066 VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD)
1067 TEMPLATE_VBOXR0DRV_DEFS.x86 = _X86_
1068 TEMPLATE_VBOXR0DRV_DEFS.amd64 = _AMD64_
1069 ifdef VBOX_USE_VCC80
1070 TEMPLATE_VBOXR0DRV_CXXFLAGS = -Zi -Zl -GR- -GS- -EHs-c- -GF- -Gz -W3 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1071 else
1072 TEMPLATE_VBOXR0DRV_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -Gz -W3 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1073 endif
1074 TEMPLATE_VBOXR0DRV_CFLAGS = $(TEMPLATE_VBOXR0DRV_CXXFLAGS)
1075 TEMPLATE_VBOXR0DRV_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:32 -MapInfo:Exports -NoD -Debug
1076endif
1077
1078ifeq ($(BUILD_TARGET),linux)
1079TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_GCC_TOOL)
1080TEMPLATE_VBOXR0DRV_DEFS = __KERNEL__ MODULE IN_RING0 IN_RT_R0
1081TEMPLATE_VBOXR0DRV_INCS.x86 = \
1082 $(VBOX_LINUX_SRC)/include \
1083 $(VBOX_LINUX_SRC)/include/asm-i386/mach-default
1084TEMPLATE_VBOXR0DRV_INCS.amd64 = \
1085 $(VBOX_LINUX_SRC)/include
1086TEMPLATE_VBOXR0DRV_CFLAGS = -nostdinc -iwithprefix include \
1087 -Wall -Wstrict-prototypes -Wno-trigraphs $(VBOX_GCC_Wno-pointer-sign) \
1088 $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing -fno-common
1089TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -mpreferred-stack-boundary=2 -msoft-float
1090TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow \
1091 -fno-reorder-blocks -ffreestanding -fno-asynchronous-unwind-tables -funit-at-a-time \
1092 -Wno-sign-compare -Wdeclaration-after-statement
1093TEMPLATE_VBOXR0DRV_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wno-pointer-sign,$(TEMPLATE_VBOXR0DRV_CFLAGS)) -fno-exceptions -fno-rtti
1094 ifndef VBOX_LINUX_VERSION_2_4
1095# 2.6
1096TEMPLATE_VBOXR0DRV_SYSSUFF = .ko
1097TEMPLATE_VBOXR0DRV_LDFLAGS.x86 = -m elf_i386 -r
1098TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -m elf_x86_64 -r
1099 else
1100# 2.4
1101TEMPLATE_VBOXR0DRV_SYSSUFF = .o
1102TEMPLATE_VBOXR0DRV_LDFLAGS = -r -s
1103 endif
1104endif
1105
1106ifeq ($(BUILD_TARGET),os2)
1107TEMPLATE_VBOXR0DRV_TOOL = GCC3OMF
1108TEMPLATE_VBOXR0DRV_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
1109TEMPLATE_VBOXR0DRV_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
1110endif
1111
1112ifeq ($(BUILD_TARGET),darwin)
1113TEMPLATE_VBOXR0DRV_TOOL = GCC4MACHO
1114TEMPLATE_VBOXR0DRV_DEFS += KERNEL KERNEL_PRIVATE DRIVER_PRIVATE APPLE NeXT
1115TEMPLATE_VBOXR0DRV_INCS += \
1116 /System/Library/Frameworks/Kernel.framework/PrivateHeaders \
1117 /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Kernel.framework/Headers
1118TEMPLATE_VBOXR0DRV_CXXFLAGS = \
1119 -g -Wall -Wno-long-long -Wno-trigraphs -pipe -fno-common -nostdinc -fno-builtin -finline \
1120 -fno-keep-inline-functions -force_cpusubtype_ALL -fno-exceptions -msoft-float -static \
1121 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
1122 -fapple-kext -fno-rtti -fcheck-new
1123TEMPLATE_VBOXR0DRV_CXXFLAGS.release = $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing -fasm-blocks
1124TEMPLATE_VBOXR0DRV_CXXFLAGS.profile = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.release)
1125TEMPLATE_VBOXR0DRV_CXXFLAGS.kprofile = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.release)
1126TEMPLATE_VBOXR0DRV_CFLAGS = \
1127 -g -Wall -Wno-long-long -Wno-trigraphs -pipe -fno-common -nostdinc -fno-builtin -finline \
1128 -fno-keep-inline-functions -force_cpusubtype_ALL -fno-exceptions -msoft-float -static \
1129 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
1130 -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
1131TEMPLATE_VBOXR0DRV_CFLAGS.release = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.release)
1132TEMPLATE_VBOXR0DRV_CFLAGS.profile = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.profile)
1133TEMPLATE_VBOXR0DRV_CFLAGS.kprofile = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.kprofile)
1134TEMPLATE_VBOXR0DRV_LDFLAGS = -static -nostdlib -r -Wl,-Y,1455 \
1135 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
1136TEMPLATE_VBOXR0DRV_LIBS = kmodc++ kmod cc_kext cpp_kext $(VBOX_GCC_LIBGCC)
1137endif
1138
1139ifeq ($(filter-out freebsd netbsd openbsd,$(BUILD_TARGET)),) # pure guess work just to avoid the warning below
1140TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_GCC_TOOL)
1141TEMPLATE_VBOXR0DRV_DEFS = __KERNEL__ IN_RING0 IN_RT_R0
1142TEMPLATE_VBOXR0DRV_CFLAGS = \
1143 -Wall -Wstrict-prototypes -Wno-trigraphs $(VBOX_GCC_Wno-pointer-sign) \
1144 $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing -fno-common
1145TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -msoft-float
1146TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow \
1147 -fno-reorder-blocks -ffreestanding -fno-asynchronous-unwind-tables -funit-at-a-time \
1148 -Wno-sign-compare -Wdeclaration-after-statement
1149TEMPLATE_VBOXR0DRV_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wno-pointer-sign,$(TEMPLATE_VBOXR0DRV_CFLAGS)) -fno-exceptions -fno-rtti
1150TEMPLATE_VBOXR0DRV_SYSSUFF = .ko
1151TEMPLATE_VBOXR0DRV_LDFLAGS.x86 = -m elf_i386 -r
1152TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -m elf_x86_64 -r
1153endif
1154
1155ifdef VBOX_WITH_VBOXDRV
1156 ifndef TEMPLATE_VBOXR0DRV_TOOL
1157 $(warning Warning: VBox Build: Target $(BUILD_PLATFORM) is not officially supported!)
1158 endif
1159endif
1160
1161
1162
1163#
1164# Template for building R3 executables and static libraries which are linked into executables.
1165#
1166TEMPLATE_VBOXR3EXE = VBox Ring 3 Exe
1167TEMPLATE_VBOXR3EXE_ASTOOL = $(VBOX_ASTOOL)
1168TEMPLATE_VBOXR3EXE_ASFLAGS = $(VBOX_ASFLAGS)
1169TEMPLATE_VBOXR3EXE_DEFS = IN_RING3
1170TEMPLATE_VBOXR3EXE_LIBS.kprofile = $(LIB_KPROFILE)
1171ifeq ($(BUILD_TARGET),win)
1172 TEMPLATE_VBOXR3EXE_TOOL = $(VBOX_VCC_TOOL)
1173 TEMPLATE_VBOXR3EXE_RCDEFS = \
1174 VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
1175 VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
1176 VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
1177 VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
1178 VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
1179 VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD)
1180 TEMPLATE_VBOXR3EXE_SDKS = WINPSDK
1181 ifdef VBOX_USE_VCC80
1182 TEMPLATE_VBOXR3EXE_CXXFLAGS = -Zi -Zl -GR- -EHs-c- -GF- -MD -W3 -wd4065 -wd4244 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1183 TEMPLATE_VBOXR3EXE_CXXFLAGS.debug = -RTCsu
1184 else
1185 TEMPLATE_VBOXR3EXE_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -MD -W3 -wd4065 -wd4244 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1186 TEMPLATE_VBOXR3EXE_CXXFLAGS.debug = -GZ
1187 endif
1188 TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = -Gh -GH
1189 TEMPLATE_VBOXR3EXE_CFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS)
1190 TEMPLATE_VBOXR3EXE_CFLAGS.debug = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.debug)
1191 TEMPLATE_VBOXR3EXE_CFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile)
1192 TEMPLATE_VBOXR3EXE_LDFLAGS = \
1193 /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE /DEBUG \
1194 /DISALLOWLIB:libc.lib \
1195 /DISALLOWLIB:libcd.lib \
1196 /DISALLOWLIB:libcmt.lib \
1197 /DISALLOWLIB:libcmtd.lib \
1198 /DISALLOWLIB:msvcrtd.lib
1199 TEMPLATE_VBOXR3EXE_LIBS = \
1200 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
1201 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
1202 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib
1203
1204else # the gcc guys
1205TEMPLATE_VBOXR3EXE_TOOL = $(VBOX_GCC_TOOL)
1206TEMPLATE_VBOXR3EXE_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
1207# L4 currently can't handle exception handling.
1208TEMPLATE_VBOXR3EXE_CXXFLAGS.l4 = -fno-exceptions -nostdinc \
1209 $(addprefix -I,$(VBOX_L4_GCC3_INCS) $(L4_INCDIR) $(FILE_TOOL_GPP3_INCDIR)) \
1210 $(DEBUG_L4)
1211TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = -finstrument-functions
1212TEMPLATE_VBOXR3EXE_CFLAGS.debug = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.debug)
1213TEMPLATE_VBOXR3EXE_CFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile)
1214TEMPLATE_VBOXR3EXE_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
1215TEMPLATE_VBOXR3EXE_CFLAGS.darwin = -fno-common
1216TEMPLATE_VBOXR3EXE_CFLAGS.l4 = -nostdinc \
1217 $(addprefix -I,$(VBOX_L4_GCC3_INCS) $(L4_INCDIR)) $(DEBUG_L4)
1218TEMPLATE_VBOXR3EXE_DEFS.l4 = L4_THREAD_SAFE
1219TEMPLATE_VBOXR3EXE_LDFLAGS.l4 = \
1220 $(L4_LIBDIR)/../crt0.o \
1221 -T$(L4_LIBDIR)/../main_dyn.ld -nostdlib \
1222 -Wl,--export-dynamic,--dynamic-linker=libld-l4.s.so \
1223 -Wl,--rpath-link,$(L4_LIBDIR)
1224 ifeq ($(BUILD_TARGET),linux)
1225TEMPLATE_VBOXR3EXE_LIBS = pthread m $(LIB_UUID) rt dl
1226 else ifeq ($(BUILD_TARGET),l4)
1227TEMPLATE_VBOXR3EXE_LIBS = \
1228 $(L4_LIBDIR)/libvboxserver.s.so \
1229 $(L4_LIBDIR)/libuc++.0.s.so \
1230 supc++ gcc_eh gcc \
1231 $(L4_LIBDIR)/libdl.s.so \
1232 $(L4_LIBDIR)/libuc.0.s.so
1233 else ifeq ($(BUILD_TARGET),os2)
1234TEMPLATE_VBOXR3EXE_TOOL = GCC3OMF
1235TEMPLATE_VBOXR3EXE_LIBS = socket iconv
1236 else ifeq ($(BUILD_TARGET),darwin)
1237TEMPLATE_VBOXR3EXE_TOOL = GCC4MACHO
1238TEMPLATE_VBOXR3EXE_LIBS =
1239TEMPLATE_VBOXR3EXE_LDFLAGS = -read_only_relocs suppress
1240 else ifeq ($(filter-out freebsd netbsd openbsd,$(BUILD_TARGET)),)
1241TEMPLATE_VBOXR3EXE_TOOL = GCC3
1242TEMPLATE_VBOXR3EXE_LIBS = pthread
1243 else ifeq ($(BUILD_TARGET),solaris)
1244$(warning Warning: VBOX Build: Target $(BUILD_TARGET) is not officially supported!)
1245TEMPLATE_VBOXR3EXE_TOOL = GCC3PLAIN
1246TEMPLATE_VBOXR3EXE_LIBS = rt
1247 else
1248$(warning Warning: VBOX Build: Target $(BUILD_TARGET) is not officially supported!)
1249TEMPLATE_VBOXR3EXE_CXXFLAGS.profile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.release)
1250TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.krelease)
1251 endif
1252endif
1253
1254#
1255# Template for building R3 shared objects / DLLs.
1256# This is mostly identical to the VBOXR3EXE template. (Avoid PIC if possible!)
1257#
1258TEMPLATE_VBOXR3 = VBox Ring 3 SO/DLLs
1259TEMPLATE_VBOXR3_EXTENDS = VBOXR3EXE
1260TEMPLATE_VBOXR3_LDFLAGS.l4 = $(L4_LIBDIR)/../crt0.s.o -T$(L4_LIBDIR)/../main_rel.ld -nostdlib
1261TEMPLATE_VBOXR3_DEFS.darwin = $(TEMPLATE_VBOXR3EXE_DEFS.darwin) PIC
1262ifeq ($(BUILD_TARGET_ARCH),amd64)
1263 ifneq ($(BUILD_TARGET),win)
1264 TEMPLATE_VBOXR3_DEFS = $(TEMPLATE_VBOXR3EXE_DEFS) PIC
1265 TEMPLATE_VBOXR3_CFLAGS = $(TEMPLATE_VBOXR3EXE_CFLAGS) -fPIC
1266 TEMPLATE_VBOXR3_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) -fPIC
1267 TEMPLATE_VBOXR3_LDFLAGS = $(TEMPLATE_VBOXR3EXE_LDFLAGS) -fPIC
1268 endif
1269endif
1270
1271#
1272# Ring-3 testcase.
1273# This is the VBOXR3EXE template only with a different install dir.
1274#
1275TEMPLATE_VBOXR3TSTEXE = VBox Ring 3 Testcase Exe
1276TEMPLATE_VBOXR3TSTEXE_EXTENDS = VBOXR3EXE
1277TEMPLATE_VBOXR3TSTEXE_INST = $(INST_TESTCASE)
1278TEMPLATE_VBOXR3TSTEXE_LIBS = $(LIB_RUNTIME) $(TEMPLATE_VBOXR3EXE_LIBS)
1279
1280#
1281# Template for building bad C/C++ style R3 executables (no -pedantic).
1282#
1283TEMPLATE_VBOXR3NPEXE = VBox Ring 3 Non-pedantic
1284TEMPLATE_VBOXR3NPEXE_EXTENDS = VBOXR3EXE
1285ifneq ($(BUILD_TARGET),win)
1286 # (only gcc)
1287 TEMPLATE_VBOXR3NPEXE_TOOL = $(VBOX_GCC_TOOL)
1288 TEMPLATE_VBOXR3NPEXE_CXXFLAGS = $(filter-out -pedantic,$(TEMPLATE_VBOXR3EXE_CXXFLAGS))
1289 TEMPLATE_VBOXR3NPEXE_CFLAGS = $(filter-out -pedantic -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations ,$(TEMPLATE_VBOXR3EXE_CXXFLAGS))
1290endif
1291
1292#
1293# Template for building bad C/C++ style R3 shared libraries / Dlls (no -pedantic).
1294# This is mostly identical to the VBOXR3NPEXE template.
1295#
1296TEMPLATE_VBOXR3NP= VBox Ring 3 Non-pedantic
1297TEMPLATE_VBOXR3NP_EXTENDS = VBOXR3NPEXE
1298TEMPLATE_VBOXR3NP_LDFLAGS.l4 = \
1299 $(L4_LIBDIR)/../crt0.s.o \
1300 -T$(L4_LIBDIR)/../main_rel.ld \
1301 -nostdlib
1302ifeq ($(BUILD_TARGET_ARCH),amd64)
1303 ifneq ($(BUILD_TARGET),win)
1304 TEMPLATE_VBOXR3NP_DEFS = $(TEMPLATE_VBOXR3NPEXE_DEFS) PIC
1305 TEMPLATE_VBOXR3NP_CFLAGS = $(TEMPLATE_VBOXR3NPEXE_CFLAGS) -fPIC
1306 TEMPLATE_VBOXR3NP_CXXFLAGS = $(TEMPLATE_VBOXR3NPEXE_CXXFLAGS) -fPIC
1307 TEMPLATE_VBOXR3NP_LDFLAGS = $(TEMPLATE_VBOXR3NPEXE_LDFLAGS) -fPIC
1308 endif
1309endif
1310
1311
1312#
1313# Template for building libraries, shared libraries / modules
1314# which only depends on IPRT for crt.
1315#
1316TEMPLATE_VBOXNOCRTGCC = VBox no-crt GCC libraries and modules, yasm/nasm.
1317TEMPLATE_VBOXNOCRTGCC_DEFS = IN_RING3 IPRT_NO_CRT $(ARCH_BITS_DEFS)
1318TEMPLATE_VBOXNOCRTGCC_ASDEFS = ASM_CALL64_GCC
1319## @todo C++
1320TEMPLATE_VBOXNOCRTGCC_CFLAGS = -nostdinc -fno-strict-aliasing -fno-math-errno -Wall
1321TEMPLATE_VBOXNOCRTGCC_CFLAGS.amd64 = -mcmodel=medium -fno-common
1322#TEMPLATE_VBOXNOCRTGCC_CFLAGS.release = -O0 -fno-math-errno -fno-peephole2 -fno-strict-aliasing - for win64.
1323TEMPLATE_VBOXNOCRTGCC_CFLAGS.release = -O2 -fno-strict-aliasing
1324TEMPLATE_VBOXNOCRTGCC_CFLAGS.profile = $(TEMPLATE_VBOXNOCRTGCC_CFLAGS.release)
1325TEMPLATE_VBOXNOCRTGCC_CFLAGS.kprofile = $(TEMPLATE_VBOXNOCRTGCC_CFLAGS.release)
1326TEMPLATE_VBOXNOCRTGCC_CFLAGS.darwin = -mdynamic-no-pic
1327TEMPLATE_VBOXNOCRTGCC_INCS = $(VBOX_PATH_GCC_INCS) $(PATH_ROOT)/include/iprt/nocrt
1328#TEMPLATE_VBOXNOCRTGCC_INCS.l4 = $(VBOX_PATH_GCC_INCS) $(L4_INCDIR) - enable if necessary.
1329
1330ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.amd64)
1331 # cross compile to 64-bit ELF (linux).
1332 TEMPLATE_VBOXNOCRTGCC_TOOL = XGCCAMD64LINUX
1333 TEMPLATE_VBOXNOCRTGCC_ASTOOL = yasm
1334 TEMPLATE_VBOXNOCRTGCC_ASFLAGS = -f elf64 -DASM_FORMAT_ELF -D__YASM__ -w+orphan-labels -g dwarf2
1335 TEMPLATE_VBOXNOCRTGCC_INCS = $(PATH_DEVTOOLS)/win.x86/x86_64-unknown-linux-gnu/20060701/libc/gcc/x86_64-unknown-linux-gnu/3.4.6/include
1336 TEMPLATE_VBOXNOCRTGCC_LIBS = $(PATH_DEVTOOLS)/win.x86/x86_64-unknown-linux-gnu/20060701/libc/gcc/x86_64-unknown-linux-gnu/3.4.6/libgcc.a
1337 TEMPLATE_VBOXNOCRTGCC_LDFLAGS = -nostdlib
1338
1339else ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.x86)
1340 # Use the default GCC (MinGW) with the Microsoft linker.
1341 # (Drop all '-g' options as we're unable to strip the debug info.)
1342 TEMPLATE_VBOXNOCRTGCC_TOOL = $(VBOX_GCC_TOOL)
1343 TEMPLATE_VBOXNOCRTGCC_ASTOOL = $(VBOX_ASTOOL)
1344 TEMPLATE_VBOXNOCRTGCC_ASFLAGS = $(VBOX_ASFLAGS)
1345 TEMPLATE_VBOXNOCRTGCC_LDTOOL = $(VBOX_VCC_TOOL)
1346 TEMPLATE_VBOXNOCRTGCC_LDFLAGS = -Incremental:NO -MapInfo:Exports -NoD
1347 TEMPLATE_VBOXNOCRTGCC_LIBS = $(VBOX_GCC_LIBGCC)
1348 TEMPLATE_VBOXNOCRTGCC_CFLAGS := $(filter-out -g,$(TEMPLATE_VBOXNOCRTGCC_CFLAGS)) -s
1349
1350else
1351 # Use the default GCC.
1352 # The use of --exclude-libs ALL is to avoid confusing the linux ld.so.
1353 TEMPLATE_VBOXNOCRTGCC_TOOL = $(VBOX_GCC_TOOL)
1354 TEMPLATE_VBOXNOCRTGCC_ASTOOL = $(VBOX_ASTOOL)
1355 TEMPLATE_VBOXNOCRTGCC_ASFLAGS = $(VBOX_ASFLAGS)
1356 TEMPLATE_VBOXNOCRTGCC_LDFLAGS = -nostdlib
1357 ifneq ($(filter-out os2 darwin solaris,$(BUILD_TARGET)),)
1358 ifneq ($(BUILD_TARGET_ARCH),amd64)
1359 TEMPLATE_VBOXNOCRTGCC_LDFLAGS += -Wl,--no-undefined
1360 endif
1361 endif
1362 TEMPLATE_VBOXNOCRTGCC_LIBS = $(VBOX_GCC_LIBGCC)
1363endif
1364
1365
1366#
1367# Same as VBOXNOCRTGCC only it uses GAS as the assembler instead of yasm/nasm.
1368#
1369TEMPLATE_VBOXNOCRTGAS = VBox no-crt GCC libraries and modules, gas.
1370TEMPLATE_VBOXNOCRTGAS_EXTENDS = VBOXNOCRTGCC
1371TEMPLATE_VBOXNOCRTGAS_ASTOOL = $(TEMPLATE_VBOXNOCRTGCC_TOOL)
1372ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.x86)
1373 TEMPLATE_VBOXNOCRTGAS_ASFLAGS = -s
1374else
1375 TEMPLATE_VBOXNOCRTGAS_ASFLAGS = -g
1376endif
1377
1378
1379#
1380# Template for building executables that is part of the VBox MAIN component.
1381#
1382TEMPLATE_VBOXMAINEXE = VBox Main Executables
1383TEMPLATE_VBOXMAINEXE_ASTOOL = $(VBOX_ASTOOL)
1384TEMPLATE_VBOXMAINEXE_ASFLAGS = $(VBOX_ASFLAGS)
1385TEMPLATE_VBOXMAINEXE_DEFS = IN_RING3 UNICODE
1386TEMPLATE_VBOXMAINEXE_LIBS.kprofile = $(LIB_KPROFILE)
1387
1388ifeq ($(BUILD_TARGET),win)
1389 TEMPLATE_VBOXMAINEXE_SDKS = WINPSDK W2K3DDK
1390 ifdef VBOX_USE_VCC80
1391 TEMPLATE_VBOXMAINEXE_TOOL = $(VBOX_VCC_TOOL)
1392 TEMPLATE_VBOXMAINEXE_CXXFLAGS = -Zi -Zl -GR -GF- -MD -EHsc -W3 -wd4065 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1393 TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug = -RTCsu
1394 else
1395 TEMPLATE_VBOXMAINEXE_TOOL = VCC70
1396 TEMPLATE_VBOXMAINEXE_CXXFLAGS = -Zi -Zl -GR -GX- -GF- -MD -EHsc -W3 -wd4065 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1397 TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug = -GZ
1398 endif
1399 TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile = -Gh -GH
1400 TEMPLATE_VBOXMAINEXE_CFLAGS = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS)
1401 TEMPLATE_VBOXMAINEXE_CFLAGS.debug = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug)
1402 TEMPLATE_VBOXMAINEXE_CFLAGS.kprofile = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile)
1403 TEMPLATE_VBOXMAINEXE_INCS = \
1404 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC)
1405 TEMPLATE_VBOXMAINEXE_LDFLAGS = \
1406 /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE /DEBUG\
1407 /DISALLOWLIB:libc.lib \
1408 /DISALLOWLIB:libcd.lib \
1409 /DISALLOWLIB:msvcrt.lib \
1410 /DISALLOWLIB:msvcrtd.lib \
1411 /DISALLOWLIB:libcmtd.lib \
1412 /DISALLOWLIB:libcmt.lib
1413 TEMPLATE_VBOXMAINEXE_LIBS = \
1414 $(LIB_RUNTIME) \
1415 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
1416 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
1417 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \
1418 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib
1419
1420else # the GCC guys:
1421
1422TEMPLATE_VBOXMAINEXE_DEFS += VBOX_WITH_XPCOM
1423TEMPLATE_VBOXMAINEXE_TOOL = $(VBOX_GCC_TOOL)
1424TEMPLATE_VBOXMAINEXE_CXXFLAGS = -g -Wall -Wno-long-long -Wno-trigraphs -pipe -Wno-non-virtual-dtor -fshort-wchar -fpermissive $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
1425TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug = -fno-inline
1426TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile = -finstrument-functions
1427TEMPLATE_VBOXMAINEXE_CFLAGS = -g -Wall -Wno-long-long -Wno-trigraphs -pipe -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
1428TEMPLATE_VBOXMAINEXE_CFLAGS.debug = -fno-inline
1429TEMPLATE_VBOXMAINEXE_CFLAGS.kprofile = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile)
1430 ifeq ($(BUILD_TARGET),linux)
1431TEMPLATE_VBOXMAINEXE_LIBS = pthread m $(LIB_UUID) rt
1432 else ifeq ($(BUILD_TARGET),l4)
1433TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME)
1434# no libs as yet in l4 target - must be added later
1435 else ifeq ($(BUILD_TARGET),os2)
1436TEMPLATE_VBOXMAINEXE_TOOL = GCC3OMF
1437TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME)
1438 else ifeq ($(BUILD_TARGET),darwin)
1439TEMPLATE_VBOXMAINEXE_TOOL = GCC4MACHO
1440TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME)
1441TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin = -bind_at_load -framework Carbon
1442 else ifeq ($(filter-out freebsd netbsd openbsd,$(BUILD_TARGET)),)
1443TEMPLATE_VBOXMAINEXE_TOOL = GCC3
1444TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME)
1445 else ifeq ($(BUILD_TARGET),solaris)
1446$(warning Warning: VBOX Build: Target $(BUILD_TARGET) is not officially supported!)
1447TEMPLATE_VBOXMAINEXE_TOOL = GCC3PLAIN
1448TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) rt
1449 else
1450$(warning Warning: VBOX Build: Target $(BUILD_TARGET) is not officially supported!)
1451TEMPLATE_VBOXMAINEXE_LIBS =
1452 endif
1453
1454endif # !win
1455
1456#
1457# Template for building the Main (+GUI) components
1458# This differ from VBOXMAINEXE only in PIC handling and similar DLL stuff.
1459#
1460TEMPLATE_VBOXMAIN = VBox MAIN
1461TEMPLATE_VBOXMAIN_EXTENDS = VBOXMAINEXE
1462ifeq ($(BUILD_TARGET_ARCH),amd64)
1463 ifneq ($(BUILD_TARGET),win)
1464 TEMPLATE_VBOXMAIN_DEFS = PIC $(TEMPLATE_VBOXMAINEXE_DEFS)
1465 TEMPLATE_VBOXMAIN_CFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_CFLAGS)
1466 TEMPLATE_VBOXMAIN_CXXFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_CXXFLAGS)
1467 TEMPLATE_VBOXMAIN_LDFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_LDFLAGS)
1468 endif
1469endif
1470TEMPLATE_VBOXMAIN_LDFLAGS.darwin = $(filter-out -bind_at_load,$(TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin))
1471
1472#
1473# Template for building executables that is part of the VBox MAIN component.
1474# This is (pretty much) identical to VBOXMAIN except for PIC handling (which will be fixed later).
1475#
1476TEMPLATE_VBOXMAIN = VBox Main
1477TEMPLATE_VBOXMAIN_EXTENDS = VBOXMAINEXE
1478
1479
1480#
1481# Template for building executables that use the VBox MAIN component (COM stuff etc.)
1482#
1483TEMPLATE_VBOXMAINCLIENT = VBox MAIN Client
1484TEMPLATE_VBOXMAINCLIENT_EXTENDS = VBOXMAINEXE
1485TEMPLATE_VBOXMAINCLIENT_INCS = $(TEMPLATE_VBOXMAINEXE_INCS) \
1486 $(PATH_BIN)/sdk/include
1487ifdef VBOX_WITH_XPCOM
1488TEMPLATE_VBOXMAINCLIENT_INCS += \
1489 $(VBOX_XPCOM_INCS)
1490endif
1491TEMPLATE_VBOXMAINCLIENT_LIBS = $(TEMPLATE_VBOXMAINEXE_LIBS) \
1492 $(LIB_RUNTIME)
1493ifeq ($(BUILD_TARGET),win)
1494 TEMPLATE_VBOXMAINCLIENT_LIBS.win = $(TEMPLATE_VBOXMAINEXE_LIBS.win) \
1495 $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \
1496 $(PATH_SDK_WINPSDK_LIB)/User32.Lib \
1497 $(PATH_SDK_WINPSDK_LIB)/Shell32.Lib \
1498 $(PATH_SDK_WINPSDK_LIB)/ShLwApi.Lib \
1499 $(PATH_SDK_WINPSDK_LIB)/Ole32.Lib \
1500 $(PATH_SDK_WINPSDK_LIB)/OleAut32.Lib \
1501 $(PATH_SDK_WINPSDK_LIB)/Uuid.Lib
1502else
1503 TEMPLATE_VBOXMAINCLIENT_LIBS = $(TEMPLATE_VBOXMAINEXE_LIBS) \
1504 $(PATH_LIB)/VBoxXPCOM$(VBOX_SUFF_LIB) \
1505 $(PATH_LIB)/VBoxXPCOMGlue$(VBOX_SUFF_LIB) \
1506 $(PATH_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL) \
1507 $(LIB_RUNTIME)
1508
1509 TEMPLATE_VBOXMAINCLIENT_DEFS = $(TEMPLATE_VBOXMAINEXE_DEFS) \
1510 NDEBUG TRIMMED
1511 ## Wonder why we compile main with defaults for these two and then drops it in the client executables...
1512 TEMPLATE_VBOXMAINCLIENT_CXXFLAGS = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS) \
1513 -fno-rtti -fno-exceptions
1514 TEMPLATE_VBOXMAINCLIENT_CXXFLAGS.linux = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.linux) \
1515 -pthread
1516 TEMPLATE_VBOXMAINCLIENT_LDFLAGS.darwin = $(TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin) \
1517 -bind_at_load -framework Carbon
1518endif
1519
1520
1521#
1522# Template for building Qt GUI executables.
1523#
1524TEMPLATE_VBOXQTGUIEXE = VBox Qt GUI Executable
1525TEMPLATE_VBOXQTGUIEXE_DEFS = IN_RING3 QT_NO_DEBUG QT_THREAD_SUPPORT $(ARCH_BITS_DEFS)
1526TEMPLATE_VBOXQTGUIEXE_INCS = \
1527 $(PATH_BIN)/sdk/include \
1528 $(VBOX_PATH_QT)/include
1529
1530ifeq ($(BUILD_TARGET),win)
1531 TEMPLATE_VBOXQTGUIEXE_TOOL = $(VBOX_VCC_TOOL)
1532 TEMPLATE_VBOXQTGUIEXE_DEFS += _WIN32_WINNT=0x0500 UNICODE QT_DLL _CRT_SECURE_NO_DEPRECATE
1533 ## @todo VCC70 flags?
1534 ifdef VBOX_USE_VCC80
1535 TEMPLATE_VBOXQTGUIEXE_CXXFLAGS = \
1536 -nologo -Zm200 -W3 -MD -EHsc -Zc:wchar_t-
1537 TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.debug = -RTCsu
1538 else
1539 TEMPLATE_VBOXQTGUIEXE_CXXFLAGS = \
1540 -nologo -Zm200 -W3 -MD -GX
1541 TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.debug = -GZ
1542 endif
1543 TEMPLATE_VBOXQTGUIEXE_INCS += \
1544 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC)
1545 TEMPLATE_VBOXQTGUIEXE_LDFLAGS = \
1546 /NOD /NOLOGO /INCREMENTAL:NO /MAPINFO:EXPORTS /DEBUG \
1547 /DELAYLOAD:oleaut32.dll
1548 TEMPLATE_VBOXQTGUIEXE_SDKS = WINPSDK
1549 TEMPLATE_VBOXQTGUIEXE_LIBS = \
1550 $(LIB_QT) \
1551 $(LIB_QTMAIN) \
1552 $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \
1553 $(LIB_RUNTIME) \
1554 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
1555 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
1556 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \
1557 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib \
1558 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib
1559
1560else # the gcc guys:
1561 TEMPLATE_VBOXQTGUIEXE_TOOL = $(VBOX_GCC_TOOL)
1562 TEMPLATE_VBOXQTGUIEXE_DEFS += VBOX_WITH_XPCOM
1563 TEMPLATE_VBOXQTGUIEXE_DEFS.linux = _REENTRANT
1564
1565 TEMPLATE_VBOXQTGUIEXE_INCS += \
1566 $(LIB_SDL_INC) \
1567 $(VBOX_XPCOM_INCS)
1568 TEMPLATE_VBOXQTGUIEXE_CXXFLAGS = \
1569 -pipe -Wall -W -frtti -fno-exceptions -Wno-non-virtual-dtor \
1570 -Wno-long-long -fshort-wchar -fno-strict-aliasing
1571 TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.linux = -pthread
1572 ## @todo no $(LIB_QTMAIN) here?
1573 TEMPLATE_VBOXQTGUIEXE_LIBS = \
1574 $(LIB_QT) \
1575 Xext \
1576 X11 \
1577 m \
1578 $(LIB_SDL) \
1579 $(LIB_PTHREAD) \
1580 $(PATH_LIB)/VBoxXPCOM$(VBOX_SUFF_LIB) \
1581 $(LIB_RUNTIME) \
1582 $(LIB_REM) \
1583 $(LIB_VMM) \
1584 $(PATH_BIN)/VBoxXPCOM.so \
1585 $(PATH_LIB)/VBoxXPCOMGlue$(VBOX_SUFF_LIB)
1586
1587 TEMPLATE_VBOXQTGUIEXE_LIBPATH = \
1588 $(VBOX_PATH_QT)/lib \
1589 /usr/X11R6/lib
1590
1591endif
1592
1593#
1594# Template for building Qt GUI components.
1595#
1596TEMPLATE_VBOXQTGUI = VBox Qt GUI Components
1597TEMPLATE_VBOXQTGUI_EXTENDS = VBOXQTGUIEXE
1598TEMPLATE_VBOXQTGUI_LIBS = $(filter-out $(QTMAIN) $(PATH_BIN)/VBoxXML.so,$(TEMPLATE_VBOXQTGUIEXE_LIBS))
1599ifeq ($(BUILD_TARGET_ARCH),amd64)
1600 ifneq ($(BUILD_TARGET),win)
1601 TEMPLATE_VBOXQTGUI_DEFS = PIC $(TEMPLATE_VBOXQTGUIEXE_DEFS)
1602 TEMPLATE_VBOXQTGUI_CFLAGS = -fPIC $(TEMPLATE_VBOXQTGUIEXE_CFLAGS)
1603 TEMPLATE_VBOXQTGUI_CXXFLAGS = -fPIC $(TEMPLATE_VBOXQTGUIEXE_CXXFLAGS)
1604 TEMPLATE_VBOXQTGUI_LDFLAGS = -fPIC $(TEMPLATE_VBOXQTGUIEXE_LDFLAGS)
1605 endif
1606endif
1607
1608
1609#
1610# Template for building build bldprogs.
1611#
1612TEMPLATE_VBOXBLDPROG = VBox Build Program
1613TEMPLATE_VBOXBLDPROG_DEFS = IN_RING3
1614ifeq ($(BUILD_PLATFORM),win)
1615 ifeq ($(BUILD_PLATFORM_ARCH),x86)
1616 ifdef VBOX_USE_VCC80
1617 TEMPLATE_VBOXBLDPROG_TOOL = VCC80X86
1618 else
1619 TEMPLATE_VBOXBLDPROG_TOOL = VCC70
1620 endif
1621 TEMPLATE_VBOXBLDPROG_SDKS = WIN32SDK
1622 else
1623 TEMPLATE_VBOXBLDPROG_TOOL = VCC80AMD64
1624 TEMPLATE_VBOXBLDPROG_SDKS = WIN64SDK
1625 endif
1626 ifneq ($(TEMPLATE_VBOXBLDPROG_TOOL),VCC70)
1627 TEMPLATE_VBOXBLDPROG_CXXFLAGS = -Zi -Zl -GR- -EHs-c- -GF- -MT -W3 -wd4996 -Zc:wchar_t-
1628 TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug = -RTCsu
1629 TEMPLATE_VBOXBLDPROG_CXXFLAGS.release = -O2 -Oy- -GS-
1630 else
1631 TEMPLATE_VBOXBLDPROG_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -MT -W3
1632 TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug = -GZ
1633 TEMPLATE_VBOXBLDPROG_CXXFLAGS.release = -Ogitb2 -Oy-
1634 endif
1635 TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
1636 TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
1637 TEMPLATE_VBOXBLDPROG_CFLAGS = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS)
1638 TEMPLATE_VBOXBLDPROG_CFLAGS.debug = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug)
1639 TEMPLATE_VBOXBLDPROG_CFLAGS.release = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
1640 TEMPLATE_VBOXBLDPROG_CFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile)
1641 TEMPLATE_VBOXBLDPROG_CFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile)
1642 TEMPLATE_VBOXBLDPROG_LDFLAGS = \
1643 /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE /DEBUG \
1644 /DISALLOWLIB:libcd.lib \
1645 /DISALLOWLIB:libcmtd.lib \
1646 /DISALLOWLIB:msvcrt.lib \
1647 /DISALLOWLIB:msvcrtd.lib \
1648 /DISALLOWLIB:msvcprt.lib \
1649 /DISALLOWLIB:msvcprtd.lib
1650 TEMPLATE_VBOXBLDPROG_LIBS = \
1651 $(PATH_TOOL_$(TEMPLATE_VBOXBLDPROG_TOOL)_LIB)/oldnames.lib \
1652 $(PATH_TOOL_$(TEMPLATE_VBOXBLDPROG_TOOL)_LIB)/libcmt.lib \
1653 $(PATH_TOOL_$(TEMPLATE_VBOXBLDPROG_TOOL)_LIB)/libcpmt.lib
1654
1655else
1656# (gcc of some kind )
1657TEMPLATE_VBOXBLDPROG_TOOL = GCC3
1658TEMPLATE_VBOXBLDPROG_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
1659TEMPLATE_VBOXBLDPROG_CFLAGS.debug = -fno-inline
1660TEMPLATE_VBOXBLDPROG_CFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing
1661TEMPLATE_VBOXBLDPROG_CFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile)
1662TEMPLATE_VBOXBLDPROG_CFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile)
1663TEMPLATE_VBOXBLDPROG_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe
1664TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug = -fno-inline
1665TEMPLATE_VBOXBLDPROG_CXXFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing
1666TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
1667TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
1668 ifeq ($(BUILD_PLATFORM),linux)
1669TEMPLATE_VBOXBLDPROG_LIBS = pthread m $(LIB_UUID) rt dl
1670 else ifeq ($(BUILD_PLATFORM),os2)
1671TEMPLATE_VBOXBLDPROG_TOOL = GCC3OMF
1672TEMPLATE_VBOXBLDPROG_LIBS = socket iconv
1673 else ifeq ($(BUILD_PLATFORM),darwin)
1674TEMPLATE_VBOXBLDPROG_TOOL = GCC4MACHO
1675TEMPLATE_VBOXBLDPROG_LIBS =
1676 else ifeq ($(filter-out freebsd netbsd openbsd,$(BUILD_PLATFORM)),)
1677TEMPLATE_VBOXBLDPROG_TOOL = GCC3
1678TEMPLATE_VBOXBLDPROG_LIBS =
1679 else ifeq ($(BUILD_PLATFORM),solaris)
1680$(warning Warning: VBOX Build: Target $(BUILD_PLATFORM) is not officially supported!)
1681TEMPLATE_VBOXBLDPROG_TOOL = GCC3PLAIN
1682TEMPLATE_VBOXBLDPROG_LIBS = rt
1683 else
1684$(warning Warning: VBOX Build: Target $(BUILD_PLATFORM) is not officially supported!)
1685 endif
1686
1687endif # !win
1688
1689
1690
1691#
1692# Template for building R3 win32 guest additions.
1693#
1694TEMPLATE_VBOXW32GUESTR3 = VBox Win32 Guest Program
1695TEMPLATE_VBOXW32GUESTR3_INST = $(INST_ADDITIONS)
1696TEMPLATE_VBOXW32GUESTR3_BLD_TRG = win
1697TEMPLATE_VBOXW32GUESTR3_BLD_TRG_ARCH = x86
1698TEMPLATE_VBOXW32GUESTR3_BLD_TRG_CPU = i386
1699TEMPLATE_VBOXW32GUESTR3_DEFS = IN_GUEST IN_GUEST_R3 IN_RT_R3 IN_RING3 __WIN32__ __WIN__
1700TEMPLATE_VBOXW32GUESTR3_RCDEFS = \
1701 VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
1702 VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
1703 VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
1704 VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
1705 VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
1706 VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD)
1707TEMPLATE_VBOXW32GUESTR3_ASTOOL = YASM
1708TEMPLATE_VBOXW32GUESTR3_ASFLAGS = -f win -DASM_FORMAT_PE -D__YASM__ -w+orphan-labels
1709TEMPLATE_VBOXW32GUESTR3_DLLSUFF = .dll
1710TEMPLATE_VBOXW32GUESTR3_EXESUFF = .exe
1711TEMPLATE_VBOXW32GUESTR3_LIBSUFF = .lib
1712TEMPLATE_VBOXW32GUESTR3_ARLIBSUFF = .lib
1713TEMPLATE_VBOXW32GUESTR3_SDKS = WIN32SDK W2K3DDKX86
1714ifdef VBOX_USE_VCC80
1715 TEMPLATE_VBOXW32GUESTR3_TOOL = VCC80X86
1716 TEMPLATE_VBOXW32GUESTR3_CXXFLAGS = -Zi -Zl -GR- -EHs-c- -GF- -MT -U__LINUX__ -U__OS2__ -W3 -wd4996 -Zc:wchar_t-
1717 TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.debug = -RTCsu
1718 TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release = -O2 -Oy- -GS-
1719else
1720 TEMPLATE_VBOXW32GUESTR3_TOOL = VCC70
1721 TEMPLATE_VBOXW32GUESTR3_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -MT -U__LINUX__ -U__OS2__ -W3
1722 TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.debug = -GZ
1723 TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release = -Ogitb2 -Oy-
1724endif
1725TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.profile = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release)
1726TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.kprofile = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release)
1727TEMPLATE_VBOXW32GUESTR3_CFLAGS = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS)
1728TEMPLATE_VBOXW32GUESTR3_CFLAGS.debug = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.debug)
1729TEMPLATE_VBOXW32GUESTR3_CFLAGS.release = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release)
1730TEMPLATE_VBOXW32GUESTR3_CFLAGS.profile = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.profile)
1731TEMPLATE_VBOXW32GUESTR3_CFLAGS.kprofile = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.kprofile)
1732TEMPLATE_VBOXW32GUESTR3_INCS = \
1733 $(PATH_BIN)/sdk/include
1734TEMPLATE_VBOXW32GUESTR3_LDFLAGS = \
1735 /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE \
1736 /DISALLOWLIB:libc.lib \
1737 /DISALLOWLIB:libcd.lib \
1738 /DISALLOWLIB:msvcrt.lib \
1739 /DISALLOWLIB:libcmtd.lib \
1740 /DISALLOWLIB:msvcrtd.lib
1741ifdef VBOX_USE_VCC80
1742 TEMPLATE_VBOXW32GUESTR3_LIBS = \
1743 $(PATH_TOOL_VCC80X86_LIB)/oldnames.lib \
1744 $(PATH_TOOL_VCC80X86_LIB)/libcmt.lib \
1745 $(PATH_SDK_W2K3DDKX86_LIB)/ntdll.lib
1746else
1747 TEMPLATE_VBOXW32GUESTR3_LIBS = \
1748 $(PATH_TOOL_VCC70_LIB)/oldnames.lib \
1749 $(PATH_TOOL_VCC70_LIB)/libcmt.lib \
1750 $(PATH_SDK_W2K3DDKX86_LIB)/ntdll.lib
1751endif
1752
1753#
1754# R3 win32 guest libraries
1755#
1756TEMPLATE_VBOXW32GUESTR3LIB = VBox Win32 Guest User Libraries
1757TEMPLATE_VBOXW32GUESTR3LIB_EXTENDS = VBOXW32GUESTR3
1758TEMPLATE_VBOXW32GUESTR3LIB_INST = $(INST_ADDITIONS_LIB)
1759
1760
1761#
1762# Template for building R0 win32 guest tools.
1763#
1764TEMPLATE_VBOXW32GUESTR0 = VBox Win32 Guest Driver
1765TEMPLATE_VBOXW32GUESTR0_INST = $(INST_ADDITIONS)
1766TEMPLATE_VBOXW32GUESTR0_BLD_TRG = win
1767TEMPLATE_VBOXW32GUESTR0_BLD_TRG_ARCH = x86
1768TEMPLATE_VBOXW32GUESTR0_BLD_TRG_CPU = i386
1769TEMPLATE_VBOXW32GUESTR0_DEFS = IN_RING0 _X86_ IN_GUEST_R0 IN_RT_R0 __WIN32__ __WIN__ HC_ARCH_BITS=32 GC_ARCH_BITS=32
1770TEMPLATE_VBOXW32GUESTR0_RCDEFS = \
1771 VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
1772 VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
1773 VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
1774 VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
1775 VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
1776 VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD)
1777TEMPLATE_VBOXW32GUESTR0_ASTOOL = YASM
1778TEMPLATE_VBOXW32GUESTR0_ASFLAGS = -f win32 -DASM_FORMAT_PE -D__YASM__ -w+orphan-labels
1779TEMPLATE_VBOXW32GUESTR0_SYSSUFF = .sys
1780ifdef VBOX_USE_VCC80
1781 TEMPLATE_VBOXW32GUESTR0_TOOL = VCC80X86
1782 TEMPLATE_VBOXW32GUESTR0_CXXFLAGS = -Zi -Zl -GR- -GS- -EHs-c- -GF- -Gz -U__LINUX__ -U__OS2__ -W3 -wd4996 -Zc:wchar_t-
1783 TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.debug = -GR- -EHs-c- -Zl
1784 TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release = -O2 -Oy-
1785else
1786 TEMPLATE_VBOXW32GUESTR0_TOOL = VCC70
1787 TEMPLATE_VBOXW32GUESTR0_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -Gz -U__LINUX__ -U__OS2__ -W3
1788 TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.debug = -GR- -GX- -Zl
1789 TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release = -Ogitb2 -Oy-
1790endif
1791TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.profile = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release)
1792TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.kprofile = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release)
1793TEMPLATE_VBOXW32GUESTR0_CFLAGS = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS)
1794TEMPLATE_VBOXW32GUESTR0_CFLAGS.debug = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.debug)
1795TEMPLATE_VBOXW32GUESTR0_CFLAGS.release = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release)
1796TEMPLATE_VBOXW32GUESTR0_CFLAGS.profile = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.profile)
1797TEMPLATE_VBOXW32GUESTR0_CFLAGS.kprofile = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.kprofile)
1798TEMPLATE_VBOXW32GUESTR0_LDFLAGS = \
1799 -Driver -Subsystem:NATIVE -Incremental:NO -Align:32 -MapInfo:Exports -NoD -Machine:X86 -Debug \
1800 /DISALLOWLIB:libcd.lib \
1801 /DISALLOWLIB:msvcrt.lib \
1802 /DISALLOWLIB:msvcrtd.lib \
1803 /DISALLOWLIB:libcmtd.lib
1804
1805#
1806# R0 win32 guest libraries
1807#
1808TEMPLATE_VBOXW32GUESTR0LIB = VBox Win32 Guest Driver
1809TEMPLATE_VBOXW32GUESTR0LIB_EXTENDS = VBOXW32GUESTR0
1810TEMPLATE_VBOXW32GUESTR0LIB_INST = $(INST_ADDITIONS_LIB)
1811
1812
1813#
1814# Windows rc workaround for crosscompiling.
1815# (Some (old) Wine versions fails loading msvcrt.dll from the VCC bin directory.)
1816#
1817ifneq ($(BUILD_PLATFORM),win)
1818 TOOL_VCC80X86_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
1819 TOOL_VCC80AMD64_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
1820 TOOL_VCC70_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
1821 WIN32_MC = $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/mc.exe
1822else
1823 WIN32_MC = $(EXEC_X86_WIN32) $(firstword $(wildcard \
1824 $(PATH_SDK_WINPSDK_BIN)/MC.Exe\
1825 $(PATH_SDK_WINPSDK)/Bin/MC.Exe\
1826 $(PATH_SDK_WIN32SDK_BIN)/MC.Exe\
1827 $(PATH_SDK_WIN64SDK_BIN)/MC.Exe\
1828 $(PATH_DEVTOOLS)/win.x86/bin/mc.exe\
1829 ) Sorry_Cannot_find_mc_in_the_PSDK)
1830endif
1831
1832
1833#
1834# Template for syntax checking the linux guest additions.
1835# Not properly realized yet.
1836#
1837
1838TEMPLATE_VBOXLNX32GUESTR0 = Template for *syntax checking* linux guest additions kernel modules
1839TEMPLATE_VBOXLNX32GUESTR0_TOOL = $(VBOX_GCC_TOOL)
1840TEMPLATE_VBOXLNX32GUESTR0_BLD_TRG = linux
1841TEMPLATE_VBOXLNX32GUESTR0_DEFS = __KERNEL__ MODULE IN_RING0 IN_RT_R0 IN_GUEST_R0
1842TEMPLATE_VBOXLNX32GUESTR0_INCS = \
1843 $(VBOX_LINUX_SRC)/include \
1844 $(VBOX_LINUX_SRC)/include/asm-i386/mach-default
1845TEMPLATE_VBOXLNX32GUESTR0_CFLAGS = -nostdinc -iwithprefix include \
1846 -O2 -Wall -Wstrict-prototypes -Wno-trigraphs $(VBOX_GCC_Wno-pointer-sign) \
1847 $(VBOX_GCC_fno-stack-protector) -fno-strict-aliasing -fno-common \
1848 -mpreferred-stack-boundary=2 -msoft-float
1849TEMPLATE_VBOXLNX32GUESTR0_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wno-pointer-sign,$(TEMPLATE_VBOXLNX32GUESTR0_CFLAGS)) -fno-exceptions -fno-rtti
1850ifndef VBOX_LINUX_VERSION_2_4
1851# 2.6
1852TEMPLATE_VBOXLNX32GUESTR0_SYSSUFF = .ko
1853TEMPLATE_VBOXLNX32GUESTR0_LDFLAGS = -m elf_i386 -r
1854else
1855# 2.4
1856TEMPLATE_VBOXLNX32GUESTR0_SYSSUFF = .o
1857TEMPLATE_VBOXLNX32GUESTR0_LDFLAGS = -r -s
1858endif
1859
1860TEMPLATE_VBOXLNX32GUESTR3EXE = Template for building 32-bit linux guest additions programs.
1861TEMPLATE_VBOXLNX32GUESTR3EXE_INST = $(INST_ADDITIONS)
1862TEMPLATE_VBOXLNX32GUESTR3EXE_BLD_TRG = linux
1863TEMPLATE_VBOXLNX32GUESTR3EXE_BLD_TRG_ARCH = x86
1864TEMPLATE_VBOXLNX32GUESTR3EXE_BLD_TRG_CPU = i386
1865TEMPLATE_VBOXLNX32GUESTR3EXE_TOOL = $(VBOX_GCC32_TOOL)
1866TEMPLATE_VBOXLNX32GUESTR3EXE_ASTOOL = YASM
1867TEMPLATE_VBOXLNX32GUESTR3EXE_ASFLAGS = -f elf32 -DASM_FORMAT_ELF -D__YASM__ -w+orphan-labels
1868TEMPLATE_VBOXLNX32GUESTR3EXE_DEFS = IN_RING3 IN_GUEST_R3
1869TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe $(VBOX_GCC_fno-stack-protector)
1870TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.debug = -fno-inline
1871TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing
1872TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.profile = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.release)
1873TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.kprofile = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.release)
1874TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS.release = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.release)
1875TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS.debug = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.debug)
1876TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS.profile = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.profile)
1877TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS.kprofile = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.kprofile)
1878TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations $(VBOX_GCC_fno-stack-protector)
1879TEMPLATE_VBOXLNX32GUESTR3EXE_LDFLAGS = # -static
1880TEMPLATE_VBOXLNX32GUESTR3EXE_LIBS = # pthread m $(LIB_UUID) rt dl
1881
1882TEMPLATE_VBOXLNX32GUESTR3LIB = Template for building 32-bit linux guest additions programs.
1883TEMPLATE_VBOXLNX32GUESTR3LIB_EXTENDS = VBOXLNX32GUESTR3EXE
1884TEMPLATE_VBOXLNX32GUESTR3LIB_INST = $(INST_ADDITION_LIB)
1885
1886TEMPLATE_VBOXLNX32GUESTR3 = Template for building 32-bit linux guest additions libraries.
1887TEMPLATE_VBOXLNX32GUESTR3_EXTENDS = VBOXLNX32GUESTR3EXE
1888TEMPLATE_VBOXLNX32GUESTR3_LDFLAGS = -static
1889TEMPLATE_VBOXLNX32GUESTR3_LIBS = pthread m $(LIB_UUID) rt dl
1890
1891
1892
1893##
1894## efence
1895##
1896#TEMPLATE_VBOXR3_CFLAGS += -include efence.h
1897#TEMPLATE_VBOXR3_CXXFLAGS += -include efence.h
1898#TEMPLATE_VBOXMAIN_CFLAGS += -include efence.h
1899#TEMPLATE_VBOXMAIN_CXXFLAGS += -include efence.h
1900#TEMPLATE_VBOXR3_LIBS += efence
1901#TEMPLATE_VBOXMAIN_LIBS += efence
1902
1903
1904#
1905# Two targets to coordinate version number changes properly. Note that the
1906# only way to get a really consistent build is to run 'kmk' in the top-level
1907# directory. If you don't run it there, you get a consistent sub-tree only.
1908#
1909VBOX_VERSION_STAMP = $(PATH_OUT)/version-stamp-$(VBOX_VERSION_MAJOR)-$(VBOX_VERSION_MINOR)-$(VBOX_VERSION_BUILD)
1910VBOX_VERSION_HEADER = $(PATH_OUT)/version-generated.h
1911VBOX_VERSION_MK = $(PATH_OUT)/version-generated.mk
1912
1913$(VBOX_VERSION_STAMP): | $(PATH_ROOT)/Config.kmk
1914 $(MKDIR) -p $(@D)
1915 $(RM) -f $(filter-out $@,$(wildcard $(PATH_OUT)/version-stamp-*))
1916 $(ECHO_EXT) > $@
1917
1918$(VBOX_VERSION_HEADER): $(VBOX_VERSION_STAMP)
1919 $(MKDIR) -p $(@D)
1920 $(RM) -f $@ $@.tmp
1921 $(APPEND) $@.tmp "#ifndef __version_generated_h__"
1922 $(APPEND) $@.tmp "#define __version_generated_h__"
1923 $(APPEND) $@.tmp ""
1924 $(APPEND) $@.tmp "#define VBOX_VERSION_MAJOR $(VBOX_VERSION_MAJOR)"
1925 $(APPEND) $@.tmp "#define VBOX_VERSION_MINOR $(VBOX_VERSION_MINOR)"
1926 $(APPEND) $@.tmp "#define VBOX_VERSION_BUILD $(VBOX_VERSION_BUILD)"
1927 $(APPEND) $@.tmp '#define VBOX_VERSION_STRING "$(VBOX_VERSION)"'
1928 $(APPEND) $@.tmp ""
1929 $(APPEND) $@.tmp "#endif"
1930 $(MV) -f $@.tmp $@
1931
1932#
1933# Used for external makefiles which cannot include Config.kmk
1934#
1935$(VBOX_VERSION_MK): $(VBOX_VERSION_STAMP)
1936 $(MKDIR) -p $(@D)
1937 $(RM) -f $@ $@.tmp
1938 $(APPEND) $@.tmp "VBOX_VERSION_MAJOR = $(VBOX_VERSION_MAJOR)"
1939 $(APPEND) $@.tmp "VBOX_VERSION_MINOR = $(VBOX_VERSION_MINOR)"
1940 $(APPEND) $@.tmp "VBOX_VERSION_BUILD = $(VBOX_VERSION_BUILD)"
1941 $(MV) -f $@.tmp $@
1942
1943
1944# Force building of the version header file as the first thing anywhere in
1945# the tree. This eliminates the need for manual dependencies on it.
1946Makefile.kmk: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK)
1947Makefile: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK)
1948makefile: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK)
1949
1950
1951#
1952# Legacy.
1953#
1954ifneq ($(LOCALCFG),)
1955 include $(LOCALCFG)
1956endif
1957
1958
1959#
1960# Some extra goals.
1961#
1962.PHONY: up update st stat status
1963up update::
1964 svn$(HOSTSUFF_EXE) up
1965
1966st stat status:
1967 svn$(HOSTSUFF_EXE) status
1968
1969quick:
1970 $(MAKE) VBOX_QUICK=1
1971
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette