VirtualBox

source: vbox/trunk/Config.kmk@ 729

Last change on this file since 729 was 687, checked in by vboxsync, 18 years ago

win64 -> win.amd64

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 73.9 KB
Line 
1# $Id: Config.kmk 687 2007-02-06 05:11:42Z 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
134ifeq ($(filter win.amd64,$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),) # 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 ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.amd64)
423 VBOX_USE_VCC80 ?= 1 # Enforce VCC80 when targetting AMD64.
424 endif
425 ifdef VBOX_USE_VCC80
426 ifeq ($(BUILD_TARGET_ARCH),x86)
427 VBOX_VCC_TOOL := VCC80X86
428 else
429 VBOX_VCC_TOOL := VCC80AMD64
430 endif
431 else
432 VBOX_VCC_TOOL := VCC70
433 endif
434endif
435
436#
437# The kBuild tools and SDKs are using PATH_DEVTOOLS, PATH_DEVTOOLS_BLD
438# and PATH_DEVTOOLS_TRG to find things if we give them specific locations.
439#
440PATH_DEVTOOLS ?= $(PATH_ROOT)/tools
441PATH_DEVTOOLS := $(abspath $(PATH_DEVTOOLS))
442PATH_DEVTOOLS_BLD ?= $(PATH_DEVTOOLS)/$(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)
443PATH_DEVTOOLS_TRG ?= $(PATH_DEVTOOLS)/$(BUILD_TARGET).$(BUILD_TARGET_ARCH)
444
445## @todo Remove the default tool crap here!
446TOOL = $(VBOX_GCC_TOOL)
447ifdef VBOX_USE_VCC80
448 TOOL.win.x86 = VCC80X86
449 TOOL.win.amd64 = VCC80AMD64
450else
451 TOOL.win = VCC70
452endif
453ASTOOL = $(VBOX_ASTOOL)
454
455#
456# L4.
457#
458ifdef L4_DIR
459 # default CPU type
460 ifeq ($(L4_CPU),)
461 L4_CPU = 586
462 endif
463 ifeq ($(L4_API),)
464 L4_API = l4v2
465 endif
466 L4_OBJ := $(L4_DIR)/build-x86-$(L4_CPU)-$(L4_API)
467 ifeq ($(BUILD_TARGET),l4)
468 L4_INCDIR := \
469 $(L4_OBJ)/include/uclibc++ \
470 $(L4_OBJ)/include/x86/uclibc \
471 $(L4_OBJ)/include/uclibc \
472 $(L4LINUX26_DIR)/include \
473 $(L4LINUX26_DIR)/include/asm-l4/i386-arch \
474 $(L4_OBJ)/include/x86/$(L4_API) \
475 $(L4_OBJ)/include/x86 \
476 $(L4_OBJ)/include \
477 $(L4_DIR)/tool/dice/include
478 L4_LIBDIR := \
479 $(L4_DIR)/build-x86-$(L4_CPU)-$(L4_API)/lib/x86_$(L4_CPU)/$(L4_API)
480 endif # BUILD_TARGET == l4
481endif # L4_DIR
482
483# Produce debugging information that the Fiasco kernel debugger can read.
484ifeq ($(BUILD_TARGET).$(BUILD_TYPE),l4.debug)
485 DEBUG_L4 = -gstabs+
486endif
487
488#
489# Setup the global defines and includes.
490#
491## @todo PATH_CURRENT has to go, fix the places where we rely on it.
492INCS += $(PATH_ROOT)/include $(PATH_CURRENT) $(PATH_OUT)
493DEFS += VBOX
494DEFS.debug := DEBUG DEBUG_$(subst $(subst _, ,_),_,$(USERNAME)) DEBUG_USERNAME=$(subst $(subst _, ,_),_,$(USERNAME))
495DEFS.profile = VBOX_WITH_STATISTICS
496DEFS.x86 = __X86__
497DEFS.amd64 = __AMD64__
498DEFS.darwin = __DARWIN__
499DEFS.freebsd = __FREEBSD__
500DEFS.l4 = __L4__ __L4ENV__ L4API_l4v2 __NO_CTYPE _FILE_OFFSET_BITS=64
501ifeq ($(L4_API),l4v2onv4)
502 DEFS.l4 += L4API_l4v2onv4 STATIC_L4_INLINE
503endif
504DEFS.linux = __LINUX__ _FILE_OFFSET_BITS=64
505DEFS.netbsd = __NETBSD__
506DEFS.openbsd = __OPENBSD__
507DEFS.os2 = __OS2__
508DEFS.solaris = __SOLARIS__
509DEFS.win = __WIN__
510DEFS.win.x86 = __WIN32__
511DEFS.win.amd64 = __WIN64__
512# optional defines (use environment or make commandline)
513ifdef VBOX_WITH_DEBUGGER
514 DEFS += VBOX_WITH_DEBUGGER
515endif
516ifdef VBOX_WITH_DEBUGGER_GUI
517 DEFS += VBOX_WITH_DEBUGGER_GUI
518endif
519ifdef VBOX_WITH_STATISTICS
520 DEFS += VBOX_WITH_STATISTICS
521endif
522ifdef VBOX_STRICT
523 DEFS += VBOX_STRICT
524endif
525ifdef VBOX_WITHOUT_IDT_PATCHING
526 DEFS += VBOX_WITHOUT_IDT_PATCHING
527endif
528ifdef LOG_ENABLED
529 DEFS += LOG_ENABLED
530endif
531ifdef VBOX_OSE
532 DEFS += VBOX_OSE
533endif
534
535#
536# Compiler optimization flags.
537#
538ifeq ($(BUILD_TYPE),debug)
539 VBOX_GCC_FP ?= -fno-omit-frame-pointer
540 VBOX_GCC_OPT ?= -O0
541 VBOX_VCC_FP ?= -Oy-
542 VBOX_VCC_OPT ?=
543 VBOX_GCC_GC_FP ?= -fno-omit-frame-pointer
544 VBOX_GCC_GC_OPT ?= -O0
545 VBOX_VCC_GC_FP ?= -Oy-
546 VBOX_VCC_GC_OPT ?=
547else
548 # We should use -fomit-frame-pointer for GCC / -Oy for VCC.
549 # -funwind-tables provides support for backtraces in gdb then.
550 VBOX_GCC_FP ?= -fno-omit-frame-pointer
551 VBOX_GCC_OPT ?= -O2
552 VBOX_VCC_FP ?= -Oy-
553 ifdef VBOX_USE_VCC80
554 VBOX_VCC_OPT ?= -O2 -GS-
555 else
556 VBOX_VCC_OPT ?= -Ogitb2
557 endif
558 VBOX_GCC_GC_FP ?= -fno-omit-frame-pointer
559 VBOX_GCC_GC_OPT ?= -O2
560 VBOX_VCC_GC_FP ?= -Oy-
561 ifdef VBOX_USE_VCC80
562 VBOX_VCC_GC_OPT ?= -O2
563 else
564 VBOX_VCC_GC_OPT ?= -Ogitb2
565 endif
566endif
567
568#
569# ARCH_BITS_DEFS.
570#
571ifeq ($(BUILD_TARGET_ARCH),amd64)
572 ARCH_BITS_DEFS := HC_ARCH_BITS=64 GC_ARCH_BITS=32
573else ifeq ($(BUILD_TARGET_ARCH),x86)
574 ARCH_BITS_DEFS := HC_ARCH_BITS=32 GC_ARCH_BITS=32
575else
576 error BUILD_TARGET_ARCH=$(BUILD_TARGET_ARCH)
577endif
578
579#
580# Add the output dir(s) to the dynamic loader search path.
581#
582ifeq ($(filter-out linux l4 freebsd netbsd openbsd solaris,$(BUILD_TARGET)),)
583 export LD_LIBRARY_PATH:=$(PATH_BIN):$(PATH_LIB):$(LD_LIBRARY_PATH)
584endif
585ifeq ($(BUILD_TARGET),os2)
586 #fixme! export BEGINLIBPATH:=$(PATH_BIN);$(PATH_LIB);$(BEGINLIBPATH)
587endif
588ifeq ($(BUILD_TARGET),win)
589 export PATH:=$(PATH_BIN);$(PATH_LIB);$(PATH)
590endif
591
592#
593# Common libraries and tools.
594#
595ifeq ($(BUILD_TARGET),darwin)
596 LIB_RUNTIME = $(PATH_BIN)/VBoxRT.dylib
597 LIB_RUNTIME_EF = #$(PATH_LIB)/RuntimeEFCPP.a
598 LIB_KPROFILE = $(PATH_BIN)/kPrf2.dylib
599 LIB_VMM = $(PATH_BIN)/VBoxVMM.dylib
600 LIB_VMMGC = $(PATH_BIN)/VMMGC.gc
601 LIB_REM = $(PATH_BIN)/VBoxREMImp.dylib
602endif
603ifeq ($(BUILD_TARGET),l4)
604 LIB_RUNTIME = $(PATH_BIN)/VBoxRT.s.so
605 LIB_RUNTIME_EF = #$(PATH_LIB)/RuntimeEFCPP.a
606 LIB_KPROFILE = $(PATH_BIN)/kPrf2.s.so
607 LIB_VMM = $(PATH_BIN)/VBoxVMM.s.so
608 LIB_VMMGC = $(PATH_BIN)/VMMGC.gc
609 LIB_REM = $(PATH_BIN)/VBoxREMImp.s.so
610endif
611ifeq ($(filter-out linux freebsd netbsd openbsd solaris,$(BUILD_TARGET)),)
612 LIB_RUNTIME = $(PATH_BIN)/VBoxRT.so
613 LIB_RUNTIME_EF = $(PATH_LIB)/RuntimeEFCPP.a
614 LIB_KPROFILE = $(PATH_BIN)/kPrf2.so
615 LIB_VMM = $(PATH_BIN)/VBoxVMM.so
616 LIB_VMMGC = $(PATH_BIN)/VMMGC.gc
617 LIB_REM = $(PATH_BIN)/VBoxREMImp.so
618endif
619ifeq ($(BUILD_TARGET),os2)
620 LIB_RUNTIME = $(PATH_BIN)/VBoxRT.dll
621 LIB_RUNTIME_EF = #$(PATH_LIB)/RuntimeEFCPP.a
622 LIB_KPROFILE = $(PATH_BIN)/kPrf2.dll
623 LIB_VMM = $(PATH_BIN)/VBoxVMM.dll
624 LIB_VMMGC = $(PATH_LIB)/VMMGCImp.lib
625 LIB_REM = $(PATH_LIB)/VBoxREMImp.lib
626 OBJ_SYS0 = $(PATH_OBJ)/src/VBox/Runtime/RuntimeR0/os2/sys0.obj
627endif
628ifeq ($(BUILD_TARGET),win)
629 LIB_RUNTIME = $(PATH_LIB)/VBoxRT.lib
630 LIB_RUNTIME_EF = #$(PATH_LIB)/RuntimeEFCPP.lib
631 LIB_KPROFILE = $(PATH_LIB)/kPrf2.lib
632 LIB_VMM = $(PATH_LIB)/VBoxVMM.lib
633 LIB_VMMGC = $(PATH_OUT)/obj/src/VBox/VMM/VMMGC/VMMGC.lib
634 LIB_REM = $(PATH_LIB)/VBoxREMImp.lib
635endif
636
637# The kprofile build automagically links with kProfile.
638ifeq ($(BUILD_TYPE),kprofile)
639 LIB_RUNTIME += $(LIB_KPROFILE)
640endif
641
642# Overridable libraries (unix).
643LIB_UUID ?= uuid
644LIB_PTHREAD ?= pthread
645LIB_XCURSOR ?= Xcursor
646
647## Enable C++ electric fence heap.
648#LIB_RUNTIME += $(LIB_RUNTIME_EF) $(LIB_RUNTIME)
649
650# Intel ASL compiler for ACPI
651VBOX_IASLCMD ?= $(firstword $(wildcard $(PATH_DEVTOOLS_BLD)/bin/iasl$(HOSTSUFF_EXE)) iasl$(HOSTSUFF_EXE))
652
653# Bruce's C compile is a C-compiler for BIOS-related 8086 code
654VBOX_BCC ?= $(PATH_DEVTOOLS_BLD)/bin/bcc$(HOSTSUFF_EXE) -B $(PATH_DEVTOOLS_BLD)/bin/
655
656# Assembler for BIOS-related 8086 code
657VBOX_AS86 ?= $(PATH_DEVTOOLS_BLD)/bin/as86$(HOSTSUFF_EXE)
658
659# libxslt XSLT processor. (see PATH_TOOL_YASM for explanation why it's temporarily located in bin.)
660ifeq ($(BUILD_PLATFORM),win)
661# VBOX_XSLTPROC ?= $(PATH_DEVTOOLS)/win.x86/libxslt/10114/xsltproc.exe
662 VBOX_XSLTPROC ?= $(PATH_DEVTOOLS)/win.x86/bin/xsltproc.exe
663else
664 VBOX_XSLTPROC ?= xsltproc$(HOSTSUFF_EXE)
665endif
666
667# bin2c (convert binary files into C arrays)
668VBOX_BIN2C ?= $(PATH_OBJ)/src/bldprogs/bin2c/bin2c$(HOSTSUFF_EXE)
669
670# mkisofs
671ifeq ($(BUILD_PLATFORM),win)
672 VBOX_MKISOFS ?= $(PATH_DEVTOOLS_BLD)/bin/mkisofs.exe
673else
674 VBOX_MKISOFS ?= mkisofs
675endif
676
677# Makeself for the linux installers.
678VBOX_MAKESELF ?= $(PATH_DEVTOOLS)/common/makeself/v2.1.4_1/makeself.sh
679
680# Microsoft HTML Help Workshop.
681VBOX_PATH_HTML_HELP_WORKSHOP ?= $(PATH_DEVTOOLS)/win.x86/HTML_Help_Workshop/v1.3/
682
683# Path to the null soft installer.
684VBOX_PATH_NSIS ?= $(PATH_DEVTOOLS)/win.x86/nsis/v2.22
685
686# Windows install tools...
687VBOX_PATH_WIX ?= $(PATH_DEVTOOLS)/win.x86/wix/v2.0.4611.0
688VBOX_PATH_DIFX ?= $(PATH_DEVTOOLS)/win.x86/DIFx/v2.1
689
690# We need to export YASM for OSE, but since it was converted to .zip we need to
691# allow for the location used by the zip to be properly cleaned up first.
692ifeq ($(filter-out win.x86 linux.x86, $(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)),)
693 PATH_TOOL_YASM ?= $(PATH_DEVTOOLS_BLD)/bin
694endif
695
696# XPCOM setup for all but win32.
697ifneq ($(BUILD_TARGET),win)
698 VBOX_WITH_XPCOM = 1
699 VBOX_XPIDL ?= $(PATH_OBJ)/src/libs/xpcom18a4/xpidl/xpidl$(HOSTSUFF_EXE)
700 VBOX_PATH_XPCOM_IDL ?= $(PATH_BIN)/sdk/idl
701 VBOX_XPCOM_INCS ?= \
702 $(PATH_BIN)/sdk/include \
703 $(PATH_BIN)/sdk/include/xpcom \
704 $(PATH_BIN)/sdk/include/xpcom/nsprpub \
705 $(PATH_BIN)/sdk/include/xpcom/string \
706 $(PATH_BIN)/sdk/include/xpcom/xpcom \
707 $(PATH_BIN)/sdk/include/xpcom/ipcd
708endif
709
710#
711# GCC stuff properties.
712#
713# These will be resolved on the first kmk invocation and passed on to recursive
714# instances in the environment.
715#q
716# Note. If we add much more to here, we should seriously consider moving this to a
717# gcc configure script which we invoke automatically.
718#
719include $(PATH_KBUILD)/tools/$(VBOX_GCC_TOOL).kmk
720
721ifndef VBOX_GCC_LIBGCC
722 export VBOX_GCC_LIBGCC := $(shell $(TOOL_$(VBOX_GCC_TOOL)_CC) -print-libgcc-file-name)
723endif
724
725# HC compiler switch detction.
726VBOX_GCC_CHECK_CC = $(shell \
727 if $(TOOL_$(VBOX_GCC_TOOL)_CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
728 then echo "$(1)"; \
729 else echo "$(2)"; fi; )
730VBOX_GCC_CHECK_CXX = $(shell \
731 if $(TOOL_$(VBOX_GCC_TOOL)_CXX) $(1) -S -o /dev/null -xc++ /dev/null > /dev/null 2>&1; \
732 then echo "$(1)"; \
733 else echo "$(2)"; fi; )
734ifeq ($(origin VBOX_GCC_Wno-pointer-sign),undefined)
735 export VBOX_GCC_Wno-pointer-sign := $(call VBOX_GCC_CHECK_CC,-Wno-pointer-sign,)
736endif
737ifeq ($(origin VBOX_GCC_Wno-variadic-macros),undefined)
738 export VBOX_GCC_Wno-variadic-macros := $(call VBOX_GCC_CHECK_CXX,-Wno-variadic-macros,)
739endif
740ifeq ($(origin VBOX_GCC_Wno-invalid-offsetof),undefined)
741 export VBOX_GCC_Wno-invalid-offsetof := $(call VBOX_GCC_CHECK_CXX,-Wno-invalid-offsetof,)
742endif
743ifeq ($(origin VBOX_GCC_fno-stack-protector),undefined)
744 export VBOX_GCC_fno-stack-protector := $(call VBOX_GCC_CHECK_CC,-fno-stack-protector,)
745endif
746
747# 32-bit (GC) compiler switch detection.
748VBOX_GCC32_CHECK_CXX = $(shell \
749 if $(TOOL_$(VBOX_GCC32_TOOL)_CXX) $(1) -S -o /dev/null -xc++ /dev/null > /dev/null 2>&1; \
750 then echo "$(1)"; \
751 else echo "$(2)"; fi; )
752ifneq ($(VBOX_GCC_TOOL),$(VBOX_GCC32_TOOL))
753 include $(PATH_KBUILD)/tools/$(VBOX_GCC32_TOOL).kmk
754 ifeq ($(origin VBOX_GCC32_Wno-variadic-macros),undefined)
755 export VBOX_GCC32_Wno-variadic-macros := $(call VBOX_GCC32_CHECK_CXX,-Wno-variadic-macros,)
756 endif
757 ifndef VBOX_GCC32_LIBGCC
758 export VBOX_GCC32_LIBGCC := $(shell $(TOOL_$(VBOX_GCC32_TOOL)_CC) -print-libgcc-file-name)
759 endif
760else
761 VBOX_GCC32_Wno-variadic-macros ?= $(VBOX_GCC_Wno-variadic-macros)
762 VBOX_GCC32_LIBGCC ?= $(VBOX_GCC_LIBGCC)
763endif
764
765# Find the compiler defines (for IPRT no-crt).
766ifndef VBOX_PATH_GCC_INCS
767 export VBOX_PATH_GCC_INCS := $(abspath $(dir $(shell LC_ALL=C $(TOOL_$(VBOX_GCC_TOOL)_CC) -print-libgcc-file-name)))/include
768endif
769
770# L4
771ifeq ($(BUILD_TARGET),l4)
772 ifndef VBOX_PATH_L4_GCC3_INSTALL
773 export VBOX_PATH_L4_GCC3_INSTALL := $(shell LANG=C $(TOOL_$(VBOX_GCC_TOOL)_CC) -print-search-dirs|sed -ne 's+^install: \(.*[^/][^/]*\)/\?+\1+p')
774 endif
775 VBOX_L4_GCC3_INCS := $(VBOX_PATH_L4_GCC3_INSTALL)/include
776 # L4_GPP3_INCS := \
777 # $(VBOX_PATH_L4_GCC3_INSTALL)/include/g++-v3/ \
778 # $(VBOX_PATH_L4_GCC3_INSTALL)/include/g++-v3/i386-pc-linux-gnu/
779endif
780
781#
782# Default prefixes and suffixes.
783#
784VBOX_PREF_LIB =
785ifeq ($(filter-out win os2,$(BUILD_TARGET)),)
786VBOX_SUFF_LIB = .lib
787else
788VBOX_SUFF_LIB = .a
789endif
790VBOX_SUFF_DLL = $(SUFF_DLL)
791VBOXW32GUEST_SUFF_LIB = .lib
792VBOXLNX32GUEST_SUFF_LIB = .a
793
794#
795# SDKs for external libraries.
796#
797SDK_VBOX_XERCES = .
798SDK_VBOX_XERCES_INCS ?= $(PATH_ROOT)/src/libs/xerces-2.6.0/src
799SDK_VBOX_XERCES_LIBS ?= $(PATH_LIB)/VBox-xerces$(VBOX_SUFF_LIB)
800
801SDK_VBOX_XALAN = .
802SDK_VBOX_XALAN_INCS ?= $(PATH_ROOT)/src/libs/xalan-1.10.0
803SDK_VBOX_XALAN_LIBS ?= $(PATH_LIB)/VBox-xalan$(VBOX_SUFF_LIB)
804
805SDK_VBOX_LIBPNG = .
806SDK_VBOX_LIBPNG_INCS ?= $(PATH_ROOT)/src/libs/libpng-1.2.8
807SDK_VBOX_LIBPNG_LIBS ?= $(PATH_LIB)/VBox-libpng$(VBOX_SUFF_LIB)
808
809SDK_VBOX_ZLIB = .
810ifeq ($(filter-out win os2,$(BUILD_TARGET)),)
811 SDK_VBOX_ZLIB_INCS ?= $(PATH_ROOT)/src/libs/zlib-1.2.1
812 SDK_VBOX_ZLIB_LIBS ?= $(PATH_LIB)/VBox-zlib$(VBOX_SUFF_LIB)
813else
814 SDK_VBOX_ZLIB_INCS ?=
815 SDK_VBOX_ZLIB_LIBS ?= z
816endif
817
818SDK_VBOX_OPENSSL = .
819SDK_VBOX_OPENSSL_INCS?= $(PATH_ROOT)/src/libs/openssl-0.9.7e/include
820SDK_VBOX_OPENSSL_LIBS?= $(PATH_LIB)/VBox-libcrypto$(VBOX_SUFF_LIB)
821
822SDK_VBOX_FFMPEG = .
823ifeq ($(filter-out win os2,$(BUILD_TARGET)),)
824 SDK_VBOX_FFMPEG_INCS ?= \
825 $(PATH_ROOT)/src/libs/ffmpeg-20060710/libavutil \
826 $(PATH_ROOT)/src/libs/ffmpeg-20060710/libavcodec \
827 $(PATH_ROOT)/src/libs/ffmpeg-20060710/libavformat
828 ifeq ($(BUILD_TARGET),win)
829 ## Michael! Where is $(PATH_LIB)/VBoxFFmpegImp$(VBOX_SUFF_LIB) supposed to come from?
830 SDK_VBOX_FFMPEG_LIBS ?= $(PATH_LIB)/VBoxFFmpeg.a
831 else
832 SDK_VBOX_FFMPEG_LIBS ?= $(PATH_BIN)/VBoxFFmpeg$(SUFF_DLL)
833 endif
834else
835 SDK_VBOX_FFMPEG_INCS ?=
836 SDK_VBOX_FFMPEG_LIBS ?= avutil avcodec avformat
837endif
838
839#
840# Special SDK for the problematic NTDLL.LIB.
841#
842SDK_VBOX_NTDLL = Requires W2K3DDK
843SDK_VBOX_NTDLL_LIBS ?= $(PATH_SDK_W2K3DDK_LIB)/ntdll.lib
844
845
846#
847# Qt build tools, for Linux we require it to be present on the system
848#
849## @todo convert this into SDK and integrate the Qt stuff into kBuild.
850ifeq ($(BUILD_TARGET),win)
851 ifeq ($(BUILD_TARGET_ARCH),x86)
852 VBOX_PATH_QT ?= $(PATH_DEVTOOLS_TRG)/qt/v3.3.3
853 LIB_QT ?= $(VBOX_PATH_QT)/lib/dynamic/qt-mt333.lib
854 else
855 VBOX_PATH_QT ?= $(PATH_DEVTOOLS_TRG)/qt/v3.3.6
856 LIB_QT ?= $(VBOX_PATH_QT)/lib/dynamic/qt-mt336.lib
857 endif
858 LIB_QTMAIN ?= $(VBOX_PATH_QT)/lib/dynamic/qtmain.lib
859 ifndef QTDIR
860 QTDIR := $(sort $(wildcard $(PATH_DEVTOOLS_BLD)/v*))
861 QTDIR := $(call lastword,$(QTDIR))
862 endif
863endif
864ifndef VBOX_PATH_QT
865 VBOX_PATH_QT ?= $(QTDIR)
866 LIB_QT ?= qt-mt
867endif
868ifeq ($(BUILD_PLATFORM),$(BUILD_TARGET))
869 VBOX_PATH_QT_HOST ?= $(VBOX_PATH_QT)
870else
871 VBOX_PATH_QT_HOST ?= $(QTDIR)
872endif
873VBOX_UIC ?= $(VBOX_PATH_QT_HOST)/bin/uic$(HOSTSUFF_EXE)
874VBOX_MOC ?= $(VBOX_PATH_QT_HOST)/bin/moc$(HOSTSUFF_EXE)
875VBOX_LUPDATE ?= $(VBOX_PATH_QT_HOST)/bin/lupdate$(HOSTSUFF_EXE)
876VBOX_LRELEASE ?= $(VBOX_PATH_QT_HOST)/bin/lrelease$(HOSTSUFF_EXE)
877
878#
879# The linux kernel headers(/sources).
880#
881ifneq ($(filter linux l4,$(BUILD_TARGET)),)
882 ifeq ($(origin VBOX_LINUX_SRC),undefined)
883 ifneq ($(wildcard /lib/modules/$(shell uname -r)/build/include/linux/autoconf.h),)
884 export VBOX_LINUX_SRC := /lib/modules/$(shell uname -r)/build
885 else
886 export VBOX_LINUX_SRC := /usr/src/linux
887 endif
888 endif
889endif
890
891
892#
893# Template for building GC things.
894#
895TEMPLATE_VBOXGC = VBox GC
896TEMPLATE_VBOXGC_ASTOOL = $(VBOX_ASTOOL)
897TEMPLATE_VBOXGC_ASFLAGS = $(VBOX_ASFLAGS32)
898TEMPLATE_VBOXGC_DEFS = IN_GC $(ARCH_BITS_DEFS)
899TEMPLATE_VBOXGC_SYSSUFF = .gc
900TEMPLATE_VBOXGC_BLD_TRG_ARCH = x86
901
902ifeq ($(VBOX_LDR_FMT32),pe)
903ifdef VBOX_USE_VCC80
904 TEMPLATE_VBOXGC_TOOL = VCC80X86
905 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)
906else
907 TEMPLATE_VBOXGC_TOOL = VCC70
908 TEMPLATE_VBOXGC_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -W3 -wd4244 $(VBOX_VCC_GC_OPT) $(VBOX_VCC_GC_FP)
909endif
910TEMPLATE_VBOXGC_CFLAGS = $(TEMPLATE_VBOXGC_CXXFLAGS)
911TEMPLATE_VBOXGC_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:32 -MapInfo:Lines -MapInfo:Exports -NoD
912ifdef VBOX_USE_VCC80
913 include $(PATH_KBUILD)/sdks/W2K3DDKX86.kmk
914 TEMPLATE_VBOXGC_LIBS = \
915 $(PATH_SDK_W2K3DDKX86_LIB)/int64.lib
916else
917 TEMPLATE_VBOXGC_LIBS = \
918 $(PATH_TOOL_VCC70_LIB)/libcmt.lib # for 64-bit int
919endif
920endif
921
922ifeq ($(VBOX_LDR_FMT32),elf)
923TEMPLATE_VBOXGC_TOOL = $(VBOX_GCC32_TOOL)
924TEMPLATE_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)
925TEMPLATE_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)
926TEMPLATE_VBOXGC_LDFLAGS = -nostdlib -Bsymbolic
927# temporarily, must fix the loader.
928TEMPLATE_VBOXGC_LDFLAGS += -S
929TEMPLATE_VBOXGC_LDFLAGS.release = -S
930TEMPLATE_VBOXGC_LIBS = \
931 $(VBOX_GCC32_LIBGCC) # instricts
932endif
933
934ifeq ($(VBOX_LDR_FMT32),macho)
935TEMPLATE_VBOXGC_TOOL = GCC4MACHO
936TEMPLATE_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
937TEMPLATE_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
938TEMPLATE_VBOXGC_LDFLAGS = -dynamic -nostdlib
939#TEMPLATE_VBOXGC_LDFLAGS.release = -Wl,-S ???
940TEMPLATE_VBOXGC_LIBS = \
941 $(VBOX_GCC32_LIBGCC) # instricts
942endif
943
944ifeq ($(VBOX_LDR_FMT32),lx)
945TEMPLATE_VBOXGC_TOOL = GCC3OMF
946TEMPLATE_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
947TEMPLATE_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
948TEMPLATE_VBOXGC_LDFLAGS = -Zdll -nostdlib
949TEMPLATE_VBOXGC_LIBS = \
950 $(VBOX_GCC32_LIBGCC) \
951 $(OBJ_SYS0) \
952 end
953endif
954
955
956#
957# Template for building a GC ring-3 testcase (tstVMStructGC, tstDevStructGC).
958#
959TEMPLATE_VBOXGCEXE = VBox GC as ring-3 testcase
960TEMPLATE_VBOXGCEXE_EXTENDS = VBOXGC
961
962ifeq ($(VBOX_LDR_FMT32),pe)
963 TEMPLATE_VBOXGCEXE_LDFLAGS = -Incremental:NO -MapInfo:Exports -NoD -Debug
964 TEMPLATE_VBOXGCEXE_SDKS = WIN32SDK
965 ifdef VBOX_USE_VCC80
966 TEMPLATE_VBOXGCEXE_LIBS = \
967 $(PATH_TOOL_VCC80X86_LIB)/libcmt.lib \
968 $(PATH_TOOL_VCC80X86_LIB)/oldnames.lib
969 else
970 TEMPLATE_VBOXGCEXE_LIBS = \
971 $(PATH_TOOL_VCC70_LIB)/libcmt.lib \
972 $(PATH_TOOL_VCC70_LIB)/oldnames.lib
973 endif
974endif
975
976ifeq ($(VBOX_LDR_FMT32),elf)
977 TEMPLATE_VBOXGCEXE_LDFLAGS := -g
978 TEMPLATE_VBOXGCEXE_LDFLAGS.release := -g
979endif
980
981ifeq ($(VBOX_LDR_FMT32),macho)
982 TEMPLATE_VBOXGCEXE_LDFLAGS := -g
983endif
984
985ifeq ($(VBOX_LDR_FMT32),lx)
986 TEMPLATE_VBOXGCEXE_LDFLAGS := -g
987 TEMPLATE_VBOXGCEXE_LIBS := $(NO_SUCH_VARIABLE)
988endif
989
990
991#
992# Template for building R0 things.
993#
994TEMPLATE_VBOXR0 = VBox Ring 0
995TEMPLATE_VBOXR0_ASTOOL = $(VBOX_ASTOOL)
996TEMPLATE_VBOXR0_ASFLAGS = $(VBOX_ASFLAGS)
997TEMPLATE_VBOXR0_DEFS = IN_RING0 $(ARCH_BITS_DEFS)
998
999ifeq ($(VBOX_LDR_FMT),pe)
1000TEMPLATE_VBOXR0_TOOL = $(VBOX_VCC_TOOL)
1001ifdef VBOX_USE_VCC80
1002 TEMPLATE_VBOXR0_CXXFLAGS = -Zi -Zl -GR- -GS- -EHs-c- -GF- -W3 -wd4244 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1003else
1004 TEMPLATE_VBOXR0_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -W3 -wd4244 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1005endif
1006TEMPLATE_VBOXR0_CFLAGS = $(TEMPLATE_VBOXR0_CXXFLAGS)
1007TEMPLATE_VBOXR0_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:32 -MapInfo:Exports -NoD
1008ifdef VBOX_USE_VCC80
1009 TEMPLATE_VBOXR0_LIBS.x86 = \
1010 $(PATH_SDK_W2K3DDKX86_LIB)/int64.lib
1011else
1012 TEMPLATE_VBOXR0_LIBS.x86 = \
1013 $(PATH_TOOL_VCC70_LIB)/libcmt.lib # for 64-bit int
1014endif
1015endif # pe
1016
1017ifeq ($(VBOX_LDR_FMT),elf)
1018TEMPLATE_VBOXR0_TOOL = $(VBOX_GCC_TOOL)
1019TEMPLATE_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)
1020TEMPLATE_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)
1021TEMPLATE_VBOXR0_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables -ffreestanding
1022TEMPLATE_VBOXR0_CXXFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables
1023TEMPLATE_VBOXR0_LDFLAGS = -nostdlib -Bsymbolic
1024# temporarily, must fix the loader.
1025TEMPLATE_VBOXR0_LDFLAGS += -S
1026TEMPLATE_VBOXR0_LDFLAGS.release = -S
1027TEMPLATE_VBOXR0_LIBS = \
1028 $(VBOX_GCC_LIBGCC) # instricts
1029endif
1030
1031ifeq ($(VBOX_LDR_FMT),macho)
1032TEMPLATE_VBOXR0_TOOL = GCC4MACHO
1033TEMPLATE_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
1034TEMPLATE_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
1035TEMPLATE_VBOXR0_LDFLAGS = -dynamic -nostdlib
1036#TEMPLATE_VBOXR0_LDFLAGS.release = -Wl,-S ???
1037TEMPLATE_VBOXR0_LIBS = \
1038 $(VBOX_GCC_LIBGCC) # instricts
1039endif
1040
1041ifeq ($(VBOX_LDR_FMT),lx)
1042TEMPLATE_VBOXR0_TOOL = GCC3OMF
1043TEMPLATE_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
1044TEMPLATE_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
1045TEMPLATE_VBOXR0_LDFLAGS = -Zdll -nostdlib
1046TEMPLATE_VBOXR0_LIBS = \
1047 $(VBOX_GCC_LIBGCC) \
1048 $(OBJ_SYS0) \
1049 end
1050endif
1051
1052
1053#
1054# Template for building SUPDRV R0 things.
1055#
1056TEMPLATE_VBOXR0DRV = VBox SUPDRV Ring 0
1057TEMPLATE_VBOXR0DRV_ASTOOL = $(VBOX_ASTOOL)
1058TEMPLATE_VBOXR0DRV_ASFLAGS = $(VBOX_ASFLAGS)
1059TEMPLATE_VBOXR0DRV_DEFS = IN_RING0 IN_RT_R0 $(ARCH_BITS_DEFS)
1060
1061ifeq ($(BUILD_TARGET),win)
1062 TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_VCC_TOOL)
1063 TEMPLATE_VBOXR0DRV_RCDEFS = \
1064 VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
1065 VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
1066 VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
1067 VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
1068 VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
1069 VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD)
1070 TEMPLATE_VBOXR0DRV_DEFS.x86 = _X86_
1071 TEMPLATE_VBOXR0DRV_DEFS.amd64 = _AMD64_
1072 ifdef VBOX_USE_VCC80
1073 TEMPLATE_VBOXR0DRV_CXXFLAGS = -Zi -Zl -GR- -GS- -EHs-c- -GF- -Gz -W3 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1074 else
1075 TEMPLATE_VBOXR0DRV_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -Gz -W3 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1076 endif
1077 TEMPLATE_VBOXR0DRV_CFLAGS = $(TEMPLATE_VBOXR0DRV_CXXFLAGS)
1078 TEMPLATE_VBOXR0DRV_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:32 -MapInfo:Exports -NoD -Debug
1079endif
1080
1081ifeq ($(BUILD_TARGET),linux)
1082TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_GCC_TOOL)
1083TEMPLATE_VBOXR0DRV_DEFS = __KERNEL__ MODULE IN_RING0 IN_RT_R0
1084TEMPLATE_VBOXR0DRV_INCS.x86 = \
1085 $(VBOX_LINUX_SRC)/include \
1086 $(VBOX_LINUX_SRC)/include/asm-i386/mach-default
1087TEMPLATE_VBOXR0DRV_INCS.amd64 = \
1088 $(VBOX_LINUX_SRC)/include
1089TEMPLATE_VBOXR0DRV_CFLAGS = -nostdinc -iwithprefix include \
1090 -Wall -Wstrict-prototypes -Wno-trigraphs $(VBOX_GCC_Wno-pointer-sign) \
1091 $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing -fno-common
1092TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -mpreferred-stack-boundary=2 -msoft-float
1093TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow \
1094 -fno-reorder-blocks -ffreestanding -fno-asynchronous-unwind-tables -funit-at-a-time \
1095 -Wno-sign-compare -Wdeclaration-after-statement
1096TEMPLATE_VBOXR0DRV_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wno-pointer-sign,$(TEMPLATE_VBOXR0DRV_CFLAGS)) -fno-exceptions -fno-rtti
1097 ifndef VBOX_LINUX_VERSION_2_4
1098# 2.6
1099TEMPLATE_VBOXR0DRV_SYSSUFF = .ko
1100TEMPLATE_VBOXR0DRV_LDFLAGS.x86 = -m elf_i386 -r
1101TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -m elf_x86_64 -r
1102 else
1103# 2.4
1104TEMPLATE_VBOXR0DRV_SYSSUFF = .o
1105TEMPLATE_VBOXR0DRV_LDFLAGS = -r -s
1106 endif
1107endif
1108
1109ifeq ($(BUILD_TARGET),os2)
1110TEMPLATE_VBOXR0DRV_TOOL = GCC3OMF
1111TEMPLATE_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
1112TEMPLATE_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
1113endif
1114
1115ifeq ($(BUILD_TARGET),darwin)
1116TEMPLATE_VBOXR0DRV_TOOL = GCC4MACHO
1117TEMPLATE_VBOXR0DRV_DEFS += KERNEL KERNEL_PRIVATE DRIVER_PRIVATE APPLE NeXT
1118TEMPLATE_VBOXR0DRV_INCS += \
1119 /System/Library/Frameworks/Kernel.framework/PrivateHeaders \
1120 /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Kernel.framework/Headers
1121TEMPLATE_VBOXR0DRV_CXXFLAGS = \
1122 -g -Wall -Wno-long-long -Wno-trigraphs -pipe -fno-common -nostdinc -fno-builtin -finline \
1123 -fno-keep-inline-functions -force_cpusubtype_ALL -fno-exceptions -msoft-float -static \
1124 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
1125 -fapple-kext -fno-rtti -fcheck-new
1126TEMPLATE_VBOXR0DRV_CXXFLAGS.release = $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing -fasm-blocks
1127TEMPLATE_VBOXR0DRV_CXXFLAGS.profile = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.release)
1128TEMPLATE_VBOXR0DRV_CXXFLAGS.kprofile = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.release)
1129TEMPLATE_VBOXR0DRV_CFLAGS = \
1130 -g -Wall -Wno-long-long -Wno-trigraphs -pipe -fno-common -nostdinc -fno-builtin -finline \
1131 -fno-keep-inline-functions -force_cpusubtype_ALL -fno-exceptions -msoft-float -static \
1132 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
1133 -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
1134TEMPLATE_VBOXR0DRV_CFLAGS.release = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.release)
1135TEMPLATE_VBOXR0DRV_CFLAGS.profile = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.profile)
1136TEMPLATE_VBOXR0DRV_CFLAGS.kprofile = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.kprofile)
1137TEMPLATE_VBOXR0DRV_LDFLAGS = -static -nostdlib -r -Wl,-Y,1455 \
1138 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
1139TEMPLATE_VBOXR0DRV_LIBS = kmodc++ kmod cc_kext cpp_kext $(VBOX_GCC_LIBGCC)
1140endif
1141
1142ifeq ($(filter-out freebsd netbsd openbsd,$(BUILD_TARGET)),) # pure guess work just to avoid the warning below
1143TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_GCC_TOOL)
1144TEMPLATE_VBOXR0DRV_DEFS = __KERNEL__ IN_RING0 IN_RT_R0
1145TEMPLATE_VBOXR0DRV_CFLAGS = \
1146 -Wall -Wstrict-prototypes -Wno-trigraphs $(VBOX_GCC_Wno-pointer-sign) \
1147 $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing -fno-common
1148TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -msoft-float
1149TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow \
1150 -fno-reorder-blocks -ffreestanding -fno-asynchronous-unwind-tables -funit-at-a-time \
1151 -Wno-sign-compare -Wdeclaration-after-statement
1152TEMPLATE_VBOXR0DRV_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wno-pointer-sign,$(TEMPLATE_VBOXR0DRV_CFLAGS)) -fno-exceptions -fno-rtti
1153TEMPLATE_VBOXR0DRV_SYSSUFF = .ko
1154TEMPLATE_VBOXR0DRV_LDFLAGS.x86 = -m elf_i386 -r
1155TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -m elf_x86_64 -r
1156endif
1157
1158ifdef VBOX_WITH_VBOXDRV
1159 ifndef TEMPLATE_VBOXR0DRV_TOOL
1160 $(warning Warning: VBox Build: Target $(BUILD_PLATFORM) is not officially supported!)
1161 endif
1162endif
1163
1164
1165
1166#
1167# Template for building R3 executables and static libraries which are linked into executables.
1168#
1169TEMPLATE_VBOXR3EXE = VBox Ring 3 Exe
1170TEMPLATE_VBOXR3EXE_ASTOOL = $(VBOX_ASTOOL)
1171TEMPLATE_VBOXR3EXE_ASFLAGS = $(VBOX_ASFLAGS)
1172TEMPLATE_VBOXR3EXE_DEFS = IN_RING3 $(ARCH_BITS_DEFS)
1173TEMPLATE_VBOXR3EXE_LIBS.kprofile = $(LIB_KPROFILE)
1174ifeq ($(BUILD_TARGET),win)
1175 TEMPLATE_VBOXR3EXE_TOOL = $(VBOX_VCC_TOOL)
1176 TEMPLATE_VBOXR3EXE_RCDEFS = \
1177 VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
1178 VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
1179 VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
1180 VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
1181 VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
1182 VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD)
1183 TEMPLATE_VBOXR3EXE_SDKS = WINPSDK
1184 ifdef VBOX_USE_VCC80
1185 TEMPLATE_VBOXR3EXE_CXXFLAGS = -Zi -Zl -GR- -EHs-c- -GF- -MD -W3 -wd4065 -wd4244 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1186 TEMPLATE_VBOXR3EXE_CXXFLAGS.debug = -RTCsu
1187 else
1188 TEMPLATE_VBOXR3EXE_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -MD -W3 -wd4065 -wd4244 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1189 TEMPLATE_VBOXR3EXE_CXXFLAGS.debug = -GZ
1190 endif
1191 TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = -Gh -GH
1192 TEMPLATE_VBOXR3EXE_CFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS)
1193 TEMPLATE_VBOXR3EXE_CFLAGS.debug = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.debug)
1194 TEMPLATE_VBOXR3EXE_CFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile)
1195 TEMPLATE_VBOXR3EXE_LDFLAGS = \
1196 /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE /DEBUG \
1197 /DISALLOWLIB:libc.lib \
1198 /DISALLOWLIB:libcd.lib \
1199 /DISALLOWLIB:libcmt.lib \
1200 /DISALLOWLIB:libcmtd.lib \
1201 /DISALLOWLIB:msvcrtd.lib
1202 TEMPLATE_VBOXR3EXE_LIBS = \
1203 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
1204 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
1205 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib
1206
1207else # the gcc guys
1208TEMPLATE_VBOXR3EXE_TOOL = $(VBOX_GCC_TOOL)
1209TEMPLATE_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
1210# L4 currently can't handle exception handling.
1211TEMPLATE_VBOXR3EXE_CXXFLAGS.l4 = -fno-exceptions -nostdinc \
1212 $(addprefix -I,$(VBOX_L4_GCC3_INCS) $(L4_INCDIR) $(FILE_TOOL_GPP3_INCDIR)) \
1213 $(DEBUG_L4)
1214TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = -finstrument-functions
1215TEMPLATE_VBOXR3EXE_CFLAGS.debug = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.debug)
1216TEMPLATE_VBOXR3EXE_CFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile)
1217TEMPLATE_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
1218TEMPLATE_VBOXR3EXE_CFLAGS.darwin = -fno-common
1219TEMPLATE_VBOXR3EXE_CFLAGS.l4 = -nostdinc \
1220 $(addprefix -I,$(VBOX_L4_GCC3_INCS) $(L4_INCDIR)) $(DEBUG_L4)
1221TEMPLATE_VBOXR3EXE_DEFS.l4 = L4_THREAD_SAFE
1222TEMPLATE_VBOXR3EXE_LDFLAGS.l4 = \
1223 $(L4_LIBDIR)/../crt0.o \
1224 -T$(L4_LIBDIR)/../main_dyn.ld -nostdlib \
1225 -Wl,--export-dynamic,--dynamic-linker=libld-l4.s.so \
1226 -Wl,--rpath-link,$(L4_LIBDIR)
1227 ifeq ($(BUILD_TARGET),linux)
1228TEMPLATE_VBOXR3EXE_LIBS = pthread m $(LIB_UUID) rt dl
1229 else ifeq ($(BUILD_TARGET),l4)
1230TEMPLATE_VBOXR3EXE_LIBS = \
1231 $(L4_LIBDIR)/libvboxserver.s.so \
1232 $(L4_LIBDIR)/libuc++.0.s.so \
1233 supc++ gcc_eh gcc \
1234 $(L4_LIBDIR)/libdl.s.so \
1235 $(L4_LIBDIR)/libuc.0.s.so
1236 else ifeq ($(BUILD_TARGET),os2)
1237TEMPLATE_VBOXR3EXE_TOOL = GCC3OMF
1238TEMPLATE_VBOXR3EXE_LIBS = socket iconv
1239 else ifeq ($(BUILD_TARGET),darwin)
1240TEMPLATE_VBOXR3EXE_TOOL = GCC4MACHO
1241TEMPLATE_VBOXR3EXE_LIBS =
1242TEMPLATE_VBOXR3EXE_LDFLAGS = -read_only_relocs suppress
1243 else ifeq ($(filter-out freebsd netbsd openbsd,$(BUILD_TARGET)),)
1244TEMPLATE_VBOXR3EXE_TOOL = GCC3
1245TEMPLATE_VBOXR3EXE_LIBS = pthread
1246 else ifeq ($(BUILD_TARGET),solaris)
1247$(warning Warning: VBOX Build: Target $(BUILD_TARGET) is not officially supported!)
1248TEMPLATE_VBOXR3EXE_TOOL = GCC3PLAIN
1249TEMPLATE_VBOXR3EXE_LIBS = rt
1250 else
1251$(warning Warning: VBOX Build: Target $(BUILD_TARGET) is not officially supported!)
1252TEMPLATE_VBOXR3EXE_CXXFLAGS.profile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.release)
1253TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.krelease)
1254 endif
1255endif
1256
1257#
1258# Template for building R3 shared objects / DLLs.
1259# This is mostly identical to the VBOXR3EXE template. (Avoid PIC if possible!)
1260#
1261TEMPLATE_VBOXR3 = VBox Ring 3 SO/DLLs
1262TEMPLATE_VBOXR3_EXTENDS = VBOXR3EXE
1263TEMPLATE_VBOXR3_LDFLAGS.l4 = $(L4_LIBDIR)/../crt0.s.o -T$(L4_LIBDIR)/../main_rel.ld -nostdlib
1264TEMPLATE_VBOXR3_DEFS.darwin = $(TEMPLATE_VBOXR3EXE_DEFS.darwin) PIC
1265ifeq ($(BUILD_TARGET_ARCH),amd64)
1266 ifneq ($(BUILD_TARGET),win)
1267 TEMPLATE_VBOXR3_DEFS = $(TEMPLATE_VBOXR3EXE_DEFS) PIC
1268 TEMPLATE_VBOXR3_CFLAGS = $(TEMPLATE_VBOXR3EXE_CFLAGS) -fPIC
1269 TEMPLATE_VBOXR3_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) -fPIC
1270 TEMPLATE_VBOXR3_LDFLAGS = $(TEMPLATE_VBOXR3EXE_LDFLAGS) -fPIC
1271 endif
1272endif
1273
1274#
1275# Ring-3 testcase.
1276# This is the VBOXR3EXE template only with a different install dir.
1277#
1278TEMPLATE_VBOXR3TSTEXE = VBox Ring 3 Testcase Exe
1279TEMPLATE_VBOXR3TSTEXE_EXTENDS = VBOXR3EXE
1280TEMPLATE_VBOXR3TSTEXE_INST = $(INST_TESTCASE)
1281TEMPLATE_VBOXR3TSTEXE_LIBS = $(LIB_RUNTIME) $(TEMPLATE_VBOXR3EXE_LIBS)
1282
1283#
1284# Template for building bad C/C++ style R3 executables (no -pedantic).
1285#
1286TEMPLATE_VBOXR3NPEXE = VBox Ring 3 Non-pedantic
1287TEMPLATE_VBOXR3NPEXE_EXTENDS = VBOXR3EXE
1288ifneq ($(BUILD_TARGET),win)
1289 # (only gcc)
1290 TEMPLATE_VBOXR3NPEXE_TOOL = $(VBOX_GCC_TOOL)
1291 TEMPLATE_VBOXR3NPEXE_CXXFLAGS = $(filter-out -pedantic,$(TEMPLATE_VBOXR3EXE_CXXFLAGS))
1292 TEMPLATE_VBOXR3NPEXE_CFLAGS = $(filter-out -pedantic -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations ,$(TEMPLATE_VBOXR3EXE_CXXFLAGS))
1293endif
1294
1295#
1296# Template for building bad C/C++ style R3 shared libraries / Dlls (no -pedantic).
1297# This is mostly identical to the VBOXR3NPEXE template.
1298#
1299TEMPLATE_VBOXR3NP= VBox Ring 3 Non-pedantic
1300TEMPLATE_VBOXR3NP_EXTENDS = VBOXR3NPEXE
1301TEMPLATE_VBOXR3NP_LDFLAGS.l4 = \
1302 $(L4_LIBDIR)/../crt0.s.o \
1303 -T$(L4_LIBDIR)/../main_rel.ld \
1304 -nostdlib
1305ifeq ($(BUILD_TARGET_ARCH),amd64)
1306 ifneq ($(BUILD_TARGET),win)
1307 TEMPLATE_VBOXR3NP_DEFS = $(TEMPLATE_VBOXR3NPEXE_DEFS) PIC
1308 TEMPLATE_VBOXR3NP_CFLAGS = $(TEMPLATE_VBOXR3NPEXE_CFLAGS) -fPIC
1309 TEMPLATE_VBOXR3NP_CXXFLAGS = $(TEMPLATE_VBOXR3NPEXE_CXXFLAGS) -fPIC
1310 TEMPLATE_VBOXR3NP_LDFLAGS = $(TEMPLATE_VBOXR3NPEXE_LDFLAGS) -fPIC
1311 endif
1312endif
1313
1314
1315#
1316# Template for building libraries, shared libraries / modules
1317# which only depends on IPRT for crt.
1318#
1319TEMPLATE_VBOXNOCRTGCC = VBox no-crt GCC libraries and modules, yasm/nasm.
1320TEMPLATE_VBOXNOCRTGCC_DEFS = IN_RING3 IPRT_NO_CRT $(ARCH_BITS_DEFS)
1321TEMPLATE_VBOXNOCRTGCC_ASDEFS = ASM_CALL64_GCC
1322## @todo C++
1323TEMPLATE_VBOXNOCRTGCC_CFLAGS = -nostdinc -fno-strict-aliasing -fno-math-errno -Wall
1324TEMPLATE_VBOXNOCRTGCC_CFLAGS.amd64 = -mcmodel=medium -fno-common
1325#TEMPLATE_VBOXNOCRTGCC_CFLAGS.release = -O0 -fno-math-errno -fno-peephole2 -fno-strict-aliasing - for win64.
1326TEMPLATE_VBOXNOCRTGCC_CFLAGS.release = -O2 -fno-strict-aliasing
1327TEMPLATE_VBOXNOCRTGCC_CFLAGS.profile = $(TEMPLATE_VBOXNOCRTGCC_CFLAGS.release)
1328TEMPLATE_VBOXNOCRTGCC_CFLAGS.kprofile = $(TEMPLATE_VBOXNOCRTGCC_CFLAGS.release)
1329TEMPLATE_VBOXNOCRTGCC_CFLAGS.darwin = -mdynamic-no-pic
1330TEMPLATE_VBOXNOCRTGCC_INCS = $(PATH_ROOT)/include/iprt/nocrt
1331
1332ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.amd64)
1333 # cross compile to 64-bit ELF (linux).
1334 TEMPLATE_VBOXNOCRTGCC_TOOL = XGCCAMD64LINUX
1335 TEMPLATE_VBOXNOCRTGCC_ASTOOL = YASM
1336 TEMPLATE_VBOXNOCRTGCC_ASFLAGS = -f elf64 -DASM_FORMAT_ELF -D__YASM__ -w+orphan-labels -g dwarf2
1337 TEMPLATE_VBOXNOCRTGCC_LIBS = $(PATH_DEVTOOLS)/win.x86/x86_64-unknown-linux-gnu/20060701/lib/gcc/x86_64-unknown-linux-gnu/3.4.6/libgcc.a
1338 TEMPLATE_VBOXNOCRTGCC_LDFLAGS = -nostdlib
1339
1340else ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.x86)
1341 # Use the default GCC (MinGW) with the Microsoft linker.
1342 # (Drop all '-g' options as we're unable to strip the debug info.)
1343 TEMPLATE_VBOXNOCRTGCC_TOOL = $(VBOX_GCC_TOOL)
1344 TEMPLATE_VBOXNOCRTGCC_ASTOOL = $(VBOX_ASTOOL)
1345 TEMPLATE_VBOXNOCRTGCC_ASFLAGS = $(VBOX_ASFLAGS)
1346 TEMPLATE_VBOXNOCRTGCC_LDTOOL = $(VBOX_VCC_TOOL)
1347 TEMPLATE_VBOXNOCRTGCC_LDFLAGS = -Incremental:NO -MapInfo:Exports -NoD
1348 TEMPLATE_VBOXNOCRTGCC_LIBS = $(VBOX_GCC_LIBGCC)
1349 TEMPLATE_VBOXNOCRTGCC_CFLAGS := $(filter-out -g,$(TEMPLATE_VBOXNOCRTGCC_CFLAGS)) -s
1350
1351else
1352 # Use the default GCC.
1353 # The use of --exclude-libs ALL is to avoid confusing the linux ld.so.
1354 TEMPLATE_VBOXNOCRTGCC_TOOL = $(VBOX_GCC_TOOL)
1355 TEMPLATE_VBOXNOCRTGCC_ASTOOL = $(VBOX_ASTOOL)
1356 TEMPLATE_VBOXNOCRTGCC_ASFLAGS = $(VBOX_ASFLAGS)
1357 TEMPLATE_VBOXNOCRTGCC_LDFLAGS = -nostdlib
1358 ifneq ($(filter-out os2 darwin solaris,$(BUILD_TARGET)),)
1359 ifneq ($(BUILD_TARGET_ARCH),amd64)
1360 TEMPLATE_VBOXNOCRTGCC_LDFLAGS += -Wl,--no-undefined
1361 endif
1362 endif
1363 ifneq ($(filter-out freebsd,$(BUILD_TARGET)),)
1364 TEMPLATE_VBOXNOCRTGCC_LIBS = # FIXME - has unwind mess.
1365 else
1366 TEMPLATE_VBOXNOCRTGCC_LIBS = $(VBOX_GCC_LIBGCC)
1367 endif
1368endif
1369
1370
1371#
1372# Same as VBOXNOCRTGCC only it uses GAS as the assembler instead of yasm/nasm.
1373#
1374TEMPLATE_VBOXNOCRTGAS = VBox no-crt GCC libraries and modules, gas.
1375TEMPLATE_VBOXNOCRTGAS_EXTENDS = VBOXNOCRTGCC
1376TEMPLATE_VBOXNOCRTGAS_ASTOOL = $(TEMPLATE_VBOXNOCRTGCC_TOOL)
1377ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.x86)
1378 TEMPLATE_VBOXNOCRTGAS_ASFLAGS = -s
1379else
1380 TEMPLATE_VBOXNOCRTGAS_ASFLAGS = -g
1381endif
1382
1383
1384#
1385# Template for building executables that is part of the VBox MAIN component.
1386#
1387TEMPLATE_VBOXMAINEXE = VBox Main Executables
1388TEMPLATE_VBOXMAINEXE_ASTOOL = $(VBOX_ASTOOL)
1389TEMPLATE_VBOXMAINEXE_ASFLAGS = $(VBOX_ASFLAGS)
1390TEMPLATE_VBOXMAINEXE_DEFS = IN_RING3 UNICODE
1391TEMPLATE_VBOXMAINEXE_LIBS.kprofile = $(LIB_KPROFILE)
1392
1393ifeq ($(BUILD_TARGET),win)
1394 TEMPLATE_VBOXMAINEXE_SDKS = WINPSDK W2K3DDK
1395 ifdef VBOX_USE_VCC80
1396 TEMPLATE_VBOXMAINEXE_TOOL = $(VBOX_VCC_TOOL)
1397 TEMPLATE_VBOXMAINEXE_CXXFLAGS = -Zi -Zl -GR -GF- -MD -EHsc -W3 -wd4065 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1398 TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug = -RTCsu
1399 else
1400 TEMPLATE_VBOXMAINEXE_TOOL = VCC70
1401 TEMPLATE_VBOXMAINEXE_CXXFLAGS = -Zi -Zl -GR -GX- -GF- -MD -EHsc -W3 -wd4065 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1402 TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug = -GZ
1403 endif
1404 TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile = -Gh -GH
1405 TEMPLATE_VBOXMAINEXE_CFLAGS = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS)
1406 TEMPLATE_VBOXMAINEXE_CFLAGS.debug = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug)
1407 TEMPLATE_VBOXMAINEXE_CFLAGS.kprofile = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile)
1408 TEMPLATE_VBOXMAINEXE_INCS = \
1409 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC)
1410 TEMPLATE_VBOXMAINEXE_LDFLAGS = \
1411 /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE /DEBUG\
1412 /DISALLOWLIB:libc.lib \
1413 /DISALLOWLIB:libcd.lib \
1414 /DISALLOWLIB:msvcrt.lib \
1415 /DISALLOWLIB:msvcrtd.lib \
1416 /DISALLOWLIB:libcmtd.lib \
1417 /DISALLOWLIB:libcmt.lib
1418 TEMPLATE_VBOXMAINEXE_LIBS = \
1419 $(LIB_RUNTIME) \
1420 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
1421 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
1422 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \
1423 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib
1424
1425else # the GCC guys:
1426
1427TEMPLATE_VBOXMAINEXE_DEFS += VBOX_WITH_XPCOM
1428TEMPLATE_VBOXMAINEXE_TOOL = $(VBOX_GCC_TOOL)
1429TEMPLATE_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
1430TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug = -fno-inline
1431TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile = -finstrument-functions
1432TEMPLATE_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
1433TEMPLATE_VBOXMAINEXE_CFLAGS.debug = -fno-inline
1434TEMPLATE_VBOXMAINEXE_CFLAGS.kprofile = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile)
1435 ifeq ($(BUILD_TARGET),linux)
1436TEMPLATE_VBOXMAINEXE_LIBS = pthread m $(LIB_UUID) rt
1437 else ifeq ($(BUILD_TARGET),l4)
1438TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME)
1439# no libs as yet in l4 target - must be added later
1440 else ifeq ($(BUILD_TARGET),os2)
1441TEMPLATE_VBOXMAINEXE_TOOL = GCC3OMF
1442TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME)
1443 else ifeq ($(BUILD_TARGET),darwin)
1444TEMPLATE_VBOXMAINEXE_TOOL = GCC4MACHO
1445TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME)
1446TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin = -bind_at_load -framework Carbon
1447 else ifeq ($(filter-out freebsd netbsd openbsd,$(BUILD_TARGET)),)
1448TEMPLATE_VBOXMAINEXE_TOOL = GCC3
1449TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME)
1450 else ifeq ($(BUILD_TARGET),solaris)
1451$(warning Warning: VBOX Build: Target $(BUILD_TARGET) is not officially supported!)
1452TEMPLATE_VBOXMAINEXE_TOOL = GCC3PLAIN
1453TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) rt
1454 else
1455$(warning Warning: VBOX Build: Target $(BUILD_TARGET) is not officially supported!)
1456TEMPLATE_VBOXMAINEXE_LIBS =
1457 endif
1458
1459endif # !win
1460
1461#
1462# Template for building the Main (+GUI) components
1463# This differ from VBOXMAINEXE only in PIC handling and similar DLL stuff.
1464#
1465TEMPLATE_VBOXMAIN = VBox MAIN
1466TEMPLATE_VBOXMAIN_EXTENDS = VBOXMAINEXE
1467ifeq ($(BUILD_TARGET_ARCH),amd64)
1468 ifneq ($(BUILD_TARGET),win)
1469 TEMPLATE_VBOXMAIN_DEFS = PIC $(TEMPLATE_VBOXMAINEXE_DEFS)
1470 TEMPLATE_VBOXMAIN_CFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_CFLAGS)
1471 TEMPLATE_VBOXMAIN_CXXFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_CXXFLAGS)
1472 TEMPLATE_VBOXMAIN_LDFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_LDFLAGS)
1473 endif
1474endif
1475TEMPLATE_VBOXMAIN_LDFLAGS.darwin = $(filter-out -bind_at_load,$(TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin))
1476
1477#
1478# Template for building executables that is part of the VBox MAIN component.
1479# This is (pretty much) identical to VBOXMAIN except for PIC handling (which will be fixed later).
1480#
1481TEMPLATE_VBOXMAIN = VBox Main
1482TEMPLATE_VBOXMAIN_EXTENDS = VBOXMAINEXE
1483
1484
1485#
1486# Template for building executables that use the VBox MAIN component (COM stuff etc.)
1487#
1488TEMPLATE_VBOXMAINCLIENT = VBox MAIN Client
1489TEMPLATE_VBOXMAINCLIENT_EXTENDS = VBOXMAINEXE
1490TEMPLATE_VBOXMAINCLIENT_INCS = $(TEMPLATE_VBOXMAINEXE_INCS) \
1491 $(PATH_BIN)/sdk/include
1492ifdef VBOX_WITH_XPCOM
1493TEMPLATE_VBOXMAINCLIENT_INCS += \
1494 $(VBOX_XPCOM_INCS)
1495endif
1496TEMPLATE_VBOXMAINCLIENT_LIBS = $(TEMPLATE_VBOXMAINEXE_LIBS) \
1497 $(LIB_RUNTIME)
1498ifeq ($(BUILD_TARGET),win)
1499 TEMPLATE_VBOXMAINCLIENT_LIBS.win = $(TEMPLATE_VBOXMAINEXE_LIBS.win) \
1500 $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \
1501 $(PATH_SDK_WINPSDK_LIB)/User32.Lib \
1502 $(PATH_SDK_WINPSDK_LIB)/Shell32.Lib \
1503 $(PATH_SDK_WINPSDK_LIB)/ShLwApi.Lib \
1504 $(PATH_SDK_WINPSDK_LIB)/Ole32.Lib \
1505 $(PATH_SDK_WINPSDK_LIB)/OleAut32.Lib \
1506 $(PATH_SDK_WINPSDK_LIB)/Uuid.Lib
1507else
1508 TEMPLATE_VBOXMAINCLIENT_LIBS = $(TEMPLATE_VBOXMAINEXE_LIBS) \
1509 $(PATH_LIB)/VBoxXPCOM$(VBOX_SUFF_LIB) \
1510 $(PATH_LIB)/VBoxXPCOMGlue$(VBOX_SUFF_LIB) \
1511 $(PATH_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL) \
1512 $(LIB_RUNTIME)
1513
1514 TEMPLATE_VBOXMAINCLIENT_DEFS = $(TEMPLATE_VBOXMAINEXE_DEFS) \
1515 NDEBUG TRIMMED
1516 ## Wonder why we compile main with defaults for these two and then drops it in the client executables...
1517 TEMPLATE_VBOXMAINCLIENT_CXXFLAGS = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS) \
1518 -fno-rtti -fno-exceptions
1519 TEMPLATE_VBOXMAINCLIENT_CXXFLAGS.linux = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.linux) \
1520 -pthread
1521 TEMPLATE_VBOXMAINCLIENT_LDFLAGS.darwin = $(TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin) \
1522 -bind_at_load -framework Carbon
1523endif
1524
1525
1526#
1527# Template for building Qt GUI executables.
1528#
1529TEMPLATE_VBOXQTGUIEXE = VBox Qt GUI Executable
1530TEMPLATE_VBOXQTGUIEXE_DEFS = IN_RING3 QT_NO_DEBUG QT_THREAD_SUPPORT $(ARCH_BITS_DEFS)
1531TEMPLATE_VBOXQTGUIEXE_INCS = \
1532 $(PATH_BIN)/sdk/include \
1533 $(VBOX_PATH_QT)/include
1534
1535ifeq ($(BUILD_TARGET),win)
1536 TEMPLATE_VBOXQTGUIEXE_TOOL = $(VBOX_VCC_TOOL)
1537 TEMPLATE_VBOXQTGUIEXE_DEFS += _WIN32_WINNT=0x0500 UNICODE QT_DLL _CRT_SECURE_NO_DEPRECATE
1538 ## @todo VCC70 flags?
1539 ifdef VBOX_USE_VCC80
1540 TEMPLATE_VBOXQTGUIEXE_CXXFLAGS = \
1541 -nologo -Zm200 -W3 -MD -EHsc -Zc:wchar_t-
1542 TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.debug = -RTCsu
1543 else
1544 TEMPLATE_VBOXQTGUIEXE_CXXFLAGS = \
1545 -nologo -Zm200 -W3 -MD -GX
1546 TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.debug = -GZ
1547 endif
1548 TEMPLATE_VBOXQTGUIEXE_INCS += \
1549 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC)
1550 TEMPLATE_VBOXQTGUIEXE_LDFLAGS = \
1551 /NOD /NOLOGO /INCREMENTAL:NO /MAPINFO:EXPORTS /DEBUG \
1552 /DELAYLOAD:oleaut32.dll
1553 TEMPLATE_VBOXQTGUIEXE_SDKS = WINPSDK
1554 TEMPLATE_VBOXQTGUIEXE_LIBS = \
1555 $(LIB_QT) \
1556 $(LIB_QTMAIN) \
1557 $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \
1558 $(LIB_RUNTIME) \
1559 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
1560 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
1561 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \
1562 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib \
1563 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib
1564
1565else # the gcc guys:
1566 TEMPLATE_VBOXQTGUIEXE_TOOL = $(VBOX_GCC_TOOL)
1567 TEMPLATE_VBOXQTGUIEXE_DEFS += VBOX_WITH_XPCOM
1568 TEMPLATE_VBOXQTGUIEXE_DEFS.linux = _REENTRANT
1569
1570 TEMPLATE_VBOXQTGUIEXE_INCS += \
1571 $(LIB_SDL_INC) \
1572 $(VBOX_XPCOM_INCS)
1573 TEMPLATE_VBOXQTGUIEXE_CXXFLAGS = \
1574 -pipe -Wall -W -frtti -fno-exceptions -Wno-non-virtual-dtor \
1575 -Wno-long-long -fshort-wchar -fno-strict-aliasing
1576 TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.linux = -pthread
1577 ## @todo no $(LIB_QTMAIN) here?
1578 TEMPLATE_VBOXQTGUIEXE_LIBS = \
1579 $(LIB_QT) \
1580 Xext \
1581 X11 \
1582 m \
1583 $(LIB_SDL) \
1584 $(LIB_PTHREAD) \
1585 $(PATH_LIB)/VBoxXPCOM$(VBOX_SUFF_LIB) \
1586 $(LIB_RUNTIME) \
1587 $(LIB_REM) \
1588 $(LIB_VMM) \
1589 $(PATH_BIN)/VBoxXPCOM.so \
1590 $(PATH_LIB)/VBoxXPCOMGlue$(VBOX_SUFF_LIB)
1591
1592 TEMPLATE_VBOXQTGUIEXE_LIBPATH = \
1593 $(VBOX_PATH_QT)/lib \
1594 /usr/X11R6/lib
1595
1596endif
1597
1598#
1599# Template for building Qt GUI components.
1600#
1601TEMPLATE_VBOXQTGUI = VBox Qt GUI Components
1602TEMPLATE_VBOXQTGUI_EXTENDS = VBOXQTGUIEXE
1603TEMPLATE_VBOXQTGUI_LIBS = $(filter-out $(QTMAIN) $(PATH_BIN)/VBoxXML.so,$(TEMPLATE_VBOXQTGUIEXE_LIBS))
1604ifeq ($(BUILD_TARGET_ARCH),amd64)
1605 ifneq ($(BUILD_TARGET),win)
1606 TEMPLATE_VBOXQTGUI_DEFS = PIC $(TEMPLATE_VBOXQTGUIEXE_DEFS)
1607 TEMPLATE_VBOXQTGUI_CFLAGS = -fPIC $(TEMPLATE_VBOXQTGUIEXE_CFLAGS)
1608 TEMPLATE_VBOXQTGUI_CXXFLAGS = -fPIC $(TEMPLATE_VBOXQTGUIEXE_CXXFLAGS)
1609 TEMPLATE_VBOXQTGUI_LDFLAGS = -fPIC $(TEMPLATE_VBOXQTGUIEXE_LDFLAGS)
1610 endif
1611endif
1612
1613
1614#
1615# Template for building build bldprogs.
1616#
1617TEMPLATE_VBOXBLDPROG = VBox Build Program
1618TEMPLATE_VBOXBLDPROG_DEFS = IN_RING3
1619ifeq ($(BUILD_PLATFORM),win)
1620 ifeq ($(BUILD_PLATFORM_ARCH),x86)
1621 ifdef VBOX_USE_VCC80
1622 TEMPLATE_VBOXBLDPROG_TOOL = VCC80X86
1623 else
1624 TEMPLATE_VBOXBLDPROG_TOOL = VCC70
1625 endif
1626 TEMPLATE_VBOXBLDPROG_SDKS = WIN32SDK
1627 else
1628 TEMPLATE_VBOXBLDPROG_TOOL = VCC80AMD64
1629 TEMPLATE_VBOXBLDPROG_SDKS = WIN64SDK
1630 endif
1631 ifneq ($(TEMPLATE_VBOXBLDPROG_TOOL),VCC70)
1632 TEMPLATE_VBOXBLDPROG_CXXFLAGS = -Zi -Zl -GR- -EHs-c- -GF- -MT -W3 -wd4996 -Zc:wchar_t-
1633 TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug = -RTCsu
1634 TEMPLATE_VBOXBLDPROG_CXXFLAGS.release = -O2 -Oy- -GS-
1635 else
1636 TEMPLATE_VBOXBLDPROG_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -MT -W3
1637 TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug = -GZ
1638 TEMPLATE_VBOXBLDPROG_CXXFLAGS.release = -Ogitb2 -Oy-
1639 endif
1640 TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
1641 TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
1642 TEMPLATE_VBOXBLDPROG_CFLAGS = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS)
1643 TEMPLATE_VBOXBLDPROG_CFLAGS.debug = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug)
1644 TEMPLATE_VBOXBLDPROG_CFLAGS.release = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
1645 TEMPLATE_VBOXBLDPROG_CFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile)
1646 TEMPLATE_VBOXBLDPROG_CFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile)
1647 TEMPLATE_VBOXBLDPROG_LDFLAGS = \
1648 /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE /DEBUG \
1649 /DISALLOWLIB:libcd.lib \
1650 /DISALLOWLIB:libcmtd.lib \
1651 /DISALLOWLIB:msvcrt.lib \
1652 /DISALLOWLIB:msvcrtd.lib \
1653 /DISALLOWLIB:msvcprt.lib \
1654 /DISALLOWLIB:msvcprtd.lib
1655 TEMPLATE_VBOXBLDPROG_LIBS = \
1656 $(PATH_TOOL_$(TEMPLATE_VBOXBLDPROG_TOOL)_LIB)/oldnames.lib \
1657 $(PATH_TOOL_$(TEMPLATE_VBOXBLDPROG_TOOL)_LIB)/libcmt.lib \
1658 $(PATH_TOOL_$(TEMPLATE_VBOXBLDPROG_TOOL)_LIB)/libcpmt.lib
1659
1660else
1661# (gcc of some kind )
1662TEMPLATE_VBOXBLDPROG_TOOL = GCC3
1663TEMPLATE_VBOXBLDPROG_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
1664TEMPLATE_VBOXBLDPROG_CFLAGS.debug = -fno-inline
1665TEMPLATE_VBOXBLDPROG_CFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing
1666TEMPLATE_VBOXBLDPROG_CFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile)
1667TEMPLATE_VBOXBLDPROG_CFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile)
1668TEMPLATE_VBOXBLDPROG_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe
1669TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug = -fno-inline
1670TEMPLATE_VBOXBLDPROG_CXXFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing
1671TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
1672TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
1673 ifeq ($(BUILD_PLATFORM),linux)
1674TEMPLATE_VBOXBLDPROG_LIBS = pthread m $(LIB_UUID) rt dl
1675 else ifeq ($(BUILD_PLATFORM),os2)
1676TEMPLATE_VBOXBLDPROG_TOOL = GCC3OMF
1677TEMPLATE_VBOXBLDPROG_LIBS = socket iconv
1678 else ifeq ($(BUILD_PLATFORM),darwin)
1679TEMPLATE_VBOXBLDPROG_TOOL = GCC4MACHO
1680TEMPLATE_VBOXBLDPROG_LIBS =
1681 else ifeq ($(filter-out freebsd netbsd openbsd,$(BUILD_PLATFORM)),)
1682TEMPLATE_VBOXBLDPROG_TOOL = GCC3
1683TEMPLATE_VBOXBLDPROG_LIBS =
1684 else ifeq ($(BUILD_PLATFORM),solaris)
1685$(warning Warning: VBOX Build: Target $(BUILD_PLATFORM) is not officially supported!)
1686TEMPLATE_VBOXBLDPROG_TOOL = GCC3PLAIN
1687TEMPLATE_VBOXBLDPROG_LIBS = rt
1688 else
1689$(warning Warning: VBOX Build: Target $(BUILD_PLATFORM) is not officially supported!)
1690 endif
1691
1692endif # !win
1693
1694
1695
1696#
1697# Template for building R3 win32 guest additions.
1698#
1699TEMPLATE_VBOXW32GUESTR3 = VBox Win32 Guest Program
1700TEMPLATE_VBOXW32GUESTR3_INST = $(INST_ADDITIONS)
1701TEMPLATE_VBOXW32GUESTR3_BLD_TRG = win
1702TEMPLATE_VBOXW32GUESTR3_BLD_TRG_ARCH = x86
1703TEMPLATE_VBOXW32GUESTR3_BLD_TRG_CPU = i386
1704TEMPLATE_VBOXW32GUESTR3_DEFS = IN_GUEST IN_GUEST_R3 IN_RT_R3 IN_RING3 __WIN32__ __WIN__ HC_ARCH_BITS=32 GC_ARCH_BITS=32
1705TEMPLATE_VBOXW32GUESTR3_RCDEFS = \
1706 VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
1707 VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
1708 VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
1709 VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
1710 VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
1711 VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD)
1712TEMPLATE_VBOXW32GUESTR3_ASTOOL = YASM
1713TEMPLATE_VBOXW32GUESTR3_ASFLAGS = -f win -DASM_FORMAT_PE -D__YASM__ -w+orphan-labels
1714TEMPLATE_VBOXW32GUESTR3_DLLSUFF = .dll
1715TEMPLATE_VBOXW32GUESTR3_EXESUFF = .exe
1716TEMPLATE_VBOXW32GUESTR3_LIBSUFF = .lib
1717TEMPLATE_VBOXW32GUESTR3_ARLIBSUFF = .lib
1718TEMPLATE_VBOXW32GUESTR3_SDKS = WIN32SDK W2K3DDKX86
1719ifdef VBOX_USE_VCC80
1720 TEMPLATE_VBOXW32GUESTR3_TOOL = VCC80X86
1721 TEMPLATE_VBOXW32GUESTR3_CXXFLAGS = -Zi -Zl -GR- -EHs-c- -GF- -MT -U__LINUX__ -U__OS2__ -W3 -wd4996 -Zc:wchar_t-
1722 TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.debug = -RTCsu
1723 TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release = -O2 -Oy- -GS-
1724else
1725 TEMPLATE_VBOXW32GUESTR3_TOOL = VCC70
1726 TEMPLATE_VBOXW32GUESTR3_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -MT -U__LINUX__ -U__OS2__ -W3
1727 TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.debug = -GZ
1728 TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release = -Ogitb2 -Oy-
1729endif
1730TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.profile = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release)
1731TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.kprofile = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release)
1732TEMPLATE_VBOXW32GUESTR3_CFLAGS = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS)
1733TEMPLATE_VBOXW32GUESTR3_CFLAGS.debug = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.debug)
1734TEMPLATE_VBOXW32GUESTR3_CFLAGS.release = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release)
1735TEMPLATE_VBOXW32GUESTR3_CFLAGS.profile = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.profile)
1736TEMPLATE_VBOXW32GUESTR3_CFLAGS.kprofile = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.kprofile)
1737TEMPLATE_VBOXW32GUESTR3_INCS = \
1738 $(PATH_BIN)/sdk/include
1739TEMPLATE_VBOXW32GUESTR3_LDFLAGS = \
1740 /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE \
1741 /DISALLOWLIB:libc.lib \
1742 /DISALLOWLIB:libcd.lib \
1743 /DISALLOWLIB:msvcrt.lib \
1744 /DISALLOWLIB:libcmtd.lib \
1745 /DISALLOWLIB:msvcrtd.lib
1746ifdef VBOX_USE_VCC80
1747 TEMPLATE_VBOXW32GUESTR3_LIBS = \
1748 $(PATH_TOOL_VCC80X86_LIB)/oldnames.lib \
1749 $(PATH_TOOL_VCC80X86_LIB)/libcmt.lib \
1750 $(PATH_SDK_W2K3DDKX86_LIB)/ntdll.lib
1751else
1752 TEMPLATE_VBOXW32GUESTR3_LIBS = \
1753 $(PATH_TOOL_VCC70_LIB)/oldnames.lib \
1754 $(PATH_TOOL_VCC70_LIB)/libcmt.lib \
1755 $(PATH_SDK_W2K3DDKX86_LIB)/ntdll.lib
1756endif
1757
1758#
1759# R3 win32 guest libraries
1760#
1761TEMPLATE_VBOXW32GUESTR3LIB = VBox Win32 Guest User Libraries
1762TEMPLATE_VBOXW32GUESTR3LIB_EXTENDS = VBOXW32GUESTR3
1763TEMPLATE_VBOXW32GUESTR3LIB_INST = $(INST_ADDITIONS_LIB)
1764
1765
1766#
1767# Template for building R0 win32 guest tools.
1768#
1769TEMPLATE_VBOXW32GUESTR0 = VBox Win32 Guest Driver
1770TEMPLATE_VBOXW32GUESTR0_INST = $(INST_ADDITIONS)
1771TEMPLATE_VBOXW32GUESTR0_BLD_TRG = win
1772TEMPLATE_VBOXW32GUESTR0_BLD_TRG_ARCH = x86
1773TEMPLATE_VBOXW32GUESTR0_BLD_TRG_CPU = i386
1774TEMPLATE_VBOXW32GUESTR0_DEFS = IN_RING0 _X86_ IN_GUEST_R0 IN_RT_R0 __WIN32__ __WIN__ HC_ARCH_BITS=32 GC_ARCH_BITS=32
1775TEMPLATE_VBOXW32GUESTR0_RCDEFS = \
1776 VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
1777 VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
1778 VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
1779 VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
1780 VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
1781 VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD)
1782TEMPLATE_VBOXW32GUESTR0_ASTOOL = YASM
1783TEMPLATE_VBOXW32GUESTR0_ASFLAGS = -f win32 -DASM_FORMAT_PE -D__YASM__ -w+orphan-labels
1784TEMPLATE_VBOXW32GUESTR0_SYSSUFF = .sys
1785ifdef VBOX_USE_VCC80
1786 TEMPLATE_VBOXW32GUESTR0_TOOL = VCC80X86
1787 TEMPLATE_VBOXW32GUESTR0_CXXFLAGS = -Zi -Zl -GR- -GS- -EHs-c- -GF- -Gz -U__LINUX__ -U__OS2__ -W3 -wd4996 -Zc:wchar_t-
1788 TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.debug = -GR- -EHs-c- -Zl
1789 TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release = -O2 -Oy-
1790else
1791 TEMPLATE_VBOXW32GUESTR0_TOOL = VCC70
1792 TEMPLATE_VBOXW32GUESTR0_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -Gz -U__LINUX__ -U__OS2__ -W3
1793 TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.debug = -GR- -GX- -Zl
1794 TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release = -Ogitb2 -Oy-
1795endif
1796TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.profile = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release)
1797TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.kprofile = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release)
1798TEMPLATE_VBOXW32GUESTR0_CFLAGS = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS)
1799TEMPLATE_VBOXW32GUESTR0_CFLAGS.debug = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.debug)
1800TEMPLATE_VBOXW32GUESTR0_CFLAGS.release = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release)
1801TEMPLATE_VBOXW32GUESTR0_CFLAGS.profile = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.profile)
1802TEMPLATE_VBOXW32GUESTR0_CFLAGS.kprofile = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.kprofile)
1803TEMPLATE_VBOXW32GUESTR0_LDFLAGS = \
1804 -Driver -Subsystem:NATIVE -Incremental:NO -Align:32 -MapInfo:Exports -NoD -Machine:X86 -Debug \
1805 /DISALLOWLIB:libcd.lib \
1806 /DISALLOWLIB:msvcrt.lib \
1807 /DISALLOWLIB:msvcrtd.lib \
1808 /DISALLOWLIB:libcmtd.lib
1809
1810#
1811# R0 win32 guest libraries
1812#
1813TEMPLATE_VBOXW32GUESTR0LIB = VBox Win32 Guest Driver
1814TEMPLATE_VBOXW32GUESTR0LIB_EXTENDS = VBOXW32GUESTR0
1815TEMPLATE_VBOXW32GUESTR0LIB_INST = $(INST_ADDITIONS_LIB)
1816
1817
1818#
1819# Windows rc workaround for crosscompiling.
1820# (Some (old) Wine versions fails loading msvcrt.dll from the VCC bin directory.)
1821#
1822ifneq ($(BUILD_PLATFORM),win)
1823 TOOL_VCC80X86_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
1824 TOOL_VCC80AMD64_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
1825 TOOL_VCC70_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
1826 WIN32_MC = $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/mc.exe
1827else
1828 WIN32_MC = $(EXEC_X86_WIN32) $(firstword $(wildcard \
1829 $(PATH_SDK_WINPSDK_BIN)/MC.Exe\
1830 $(PATH_SDK_WINPSDK)/Bin/MC.Exe\
1831 $(PATH_SDK_WIN32SDK_BIN)/MC.Exe\
1832 $(PATH_SDK_WIN64SDK_BIN)/MC.Exe\
1833 $(PATH_DEVTOOLS)/win.x86/bin/mc.exe\
1834 ) Sorry_Cannot_find_mc_in_the_PSDK)
1835endif
1836
1837
1838#
1839# Template for syntax checking the linux guest additions.
1840# Not properly realized yet.
1841#
1842
1843TEMPLATE_VBOXLNX32GUESTR0 = Template for *syntax checking* linux guest additions kernel modules
1844TEMPLATE_VBOXLNX32GUESTR0_TOOL = $(VBOX_GCC_TOOL)
1845TEMPLATE_VBOXLNX32GUESTR0_BLD_TRG = linux
1846TEMPLATE_VBOXLNX32GUESTR0_DEFS = __KERNEL__ MODULE IN_RING0 IN_RT_R0 IN_GUEST_R0
1847TEMPLATE_VBOXLNX32GUESTR0_INCS = \
1848 $(VBOX_LINUX_SRC)/include \
1849 $(VBOX_LINUX_SRC)/include/asm-i386/mach-default
1850TEMPLATE_VBOXLNX32GUESTR0_CFLAGS = -nostdinc -iwithprefix include \
1851 -O2 -Wall -Wstrict-prototypes -Wno-trigraphs $(VBOX_GCC_Wno-pointer-sign) \
1852 $(VBOX_GCC_fno-stack-protector) -fno-strict-aliasing -fno-common \
1853 -mpreferred-stack-boundary=2 -msoft-float
1854TEMPLATE_VBOXLNX32GUESTR0_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wno-pointer-sign,$(TEMPLATE_VBOXLNX32GUESTR0_CFLAGS)) -fno-exceptions -fno-rtti
1855ifndef VBOX_LINUX_VERSION_2_4
1856# 2.6
1857TEMPLATE_VBOXLNX32GUESTR0_SYSSUFF = .ko
1858TEMPLATE_VBOXLNX32GUESTR0_LDFLAGS = -m elf_i386 -r
1859else
1860# 2.4
1861TEMPLATE_VBOXLNX32GUESTR0_SYSSUFF = .o
1862TEMPLATE_VBOXLNX32GUESTR0_LDFLAGS = -r -s
1863endif
1864
1865TEMPLATE_VBOXLNX32GUESTR3EXE = Template for building 32-bit linux guest additions programs.
1866TEMPLATE_VBOXLNX32GUESTR3EXE_INST = $(INST_ADDITIONS)
1867TEMPLATE_VBOXLNX32GUESTR3EXE_BLD_TRG = linux
1868TEMPLATE_VBOXLNX32GUESTR3EXE_BLD_TRG_ARCH = x86
1869TEMPLATE_VBOXLNX32GUESTR3EXE_BLD_TRG_CPU = i386
1870TEMPLATE_VBOXLNX32GUESTR3EXE_TOOL = $(VBOX_GCC32_TOOL)
1871TEMPLATE_VBOXLNX32GUESTR3EXE_ASTOOL = YASM
1872TEMPLATE_VBOXLNX32GUESTR3EXE_ASFLAGS = -f elf32 -DASM_FORMAT_ELF -D__YASM__ -w+orphan-labels
1873TEMPLATE_VBOXLNX32GUESTR3EXE_DEFS = IN_RING3 IN_GUEST_R3
1874TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe $(VBOX_GCC_fno-stack-protector)
1875TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.debug = -fno-inline
1876TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing
1877TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.profile = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.release)
1878TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.kprofile = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.release)
1879TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS.release = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.release)
1880TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS.debug = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.debug)
1881TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS.profile = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.profile)
1882TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS.kprofile = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.kprofile)
1883TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations $(VBOX_GCC_fno-stack-protector)
1884TEMPLATE_VBOXLNX32GUESTR3EXE_LDFLAGS = # -static
1885TEMPLATE_VBOXLNX32GUESTR3EXE_LIBS = # pthread m $(LIB_UUID) rt dl
1886
1887TEMPLATE_VBOXLNX32GUESTR3LIB = Template for building 32-bit linux guest additions programs.
1888TEMPLATE_VBOXLNX32GUESTR3LIB_EXTENDS = VBOXLNX32GUESTR3EXE
1889TEMPLATE_VBOXLNX32GUESTR3LIB_INST = $(INST_ADDITION_LIB)
1890
1891TEMPLATE_VBOXLNX32GUESTR3 = Template for building 32-bit linux guest additions libraries.
1892TEMPLATE_VBOXLNX32GUESTR3_EXTENDS = VBOXLNX32GUESTR3EXE
1893TEMPLATE_VBOXLNX32GUESTR3_LDFLAGS = -static
1894TEMPLATE_VBOXLNX32GUESTR3_LIBS = pthread m $(LIB_UUID) rt dl
1895
1896
1897
1898##
1899## efence
1900##
1901#TEMPLATE_VBOXR3_CFLAGS += -include efence.h
1902#TEMPLATE_VBOXR3_CXXFLAGS += -include efence.h
1903#TEMPLATE_VBOXMAIN_CFLAGS += -include efence.h
1904#TEMPLATE_VBOXMAIN_CXXFLAGS += -include efence.h
1905#TEMPLATE_VBOXR3_LIBS += efence
1906#TEMPLATE_VBOXMAIN_LIBS += efence
1907
1908
1909#
1910# Two targets to coordinate version number changes properly. Note that the
1911# only way to get a really consistent build is to run 'kmk' in the top-level
1912# directory. If you don't run it there, you get a consistent sub-tree only.
1913#
1914VBOX_VERSION_STAMP = $(PATH_OUT)/version-stamp-$(VBOX_VERSION_MAJOR)-$(VBOX_VERSION_MINOR)-$(VBOX_VERSION_BUILD)
1915VBOX_VERSION_HEADER = $(PATH_OUT)/version-generated.h
1916VBOX_VERSION_MK = $(PATH_OUT)/version-generated.mk
1917
1918$(VBOX_VERSION_STAMP): | $(PATH_ROOT)/Config.kmk
1919 $(MKDIR) -p $(@D)
1920 $(RM) -f $(filter-out $@,$(wildcard $(PATH_OUT)/version-stamp-*))
1921 $(ECHO_EXT) > $@
1922
1923$(VBOX_VERSION_HEADER): $(VBOX_VERSION_STAMP)
1924 $(MKDIR) -p $(@D)
1925 $(RM) -f $@ $@.tmp
1926 $(APPEND) $@.tmp "#ifndef __version_generated_h__"
1927 $(APPEND) $@.tmp "#define __version_generated_h__"
1928 $(APPEND) $@.tmp ""
1929 $(APPEND) $@.tmp "#define VBOX_VERSION_MAJOR $(VBOX_VERSION_MAJOR)"
1930 $(APPEND) $@.tmp "#define VBOX_VERSION_MINOR $(VBOX_VERSION_MINOR)"
1931 $(APPEND) $@.tmp "#define VBOX_VERSION_BUILD $(VBOX_VERSION_BUILD)"
1932 $(APPEND) $@.tmp '#define VBOX_VERSION_STRING "$(VBOX_VERSION)"'
1933 $(APPEND) $@.tmp ""
1934 $(APPEND) $@.tmp "#endif"
1935 $(MV) -f $@.tmp $@
1936
1937#
1938# Used for external makefiles which cannot include Config.kmk
1939#
1940$(VBOX_VERSION_MK): $(VBOX_VERSION_STAMP)
1941 $(MKDIR) -p $(@D)
1942 $(RM) -f $@ $@.tmp
1943 $(APPEND) $@.tmp "VBOX_VERSION_MAJOR = $(VBOX_VERSION_MAJOR)"
1944 $(APPEND) $@.tmp "VBOX_VERSION_MINOR = $(VBOX_VERSION_MINOR)"
1945 $(APPEND) $@.tmp "VBOX_VERSION_BUILD = $(VBOX_VERSION_BUILD)"
1946 $(MV) -f $@.tmp $@
1947
1948
1949# Force building of the version header file as the first thing anywhere in
1950# the tree. This eliminates the need for manual dependencies on it.
1951Makefile.kmk: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK)
1952Makefile: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK)
1953makefile: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK)
1954
1955
1956#
1957# Legacy.
1958#
1959ifneq ($(LOCALCFG),)
1960 include $(LOCALCFG)
1961endif
1962
1963
1964#
1965# Some extra goals.
1966#
1967.PHONY: up update st stat status
1968up update::
1969 svn$(HOSTSUFF_EXE) up
1970
1971st stat status:
1972 svn$(HOSTSUFF_EXE) status
1973
1974quick:
1975 $(MAKE) VBOX_QUICK=1
1976
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