VirtualBox

source: vbox/trunk/Config.kmk@ 543

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

freebsd needs pthread.

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