VirtualBox

source: vbox/trunk/src/VBox/Main/Makefile.kmk@ 82708

Last change on this file since 82708 was 82681, checked in by vboxsync, 5 years ago

Network/DevVirtioNet_1_0.cpp: Ported skeletal framwork from VirtIO 0.9 to VirtIO 1.0 semantics. Builds but not working. See BugRef(8561) Comment #49 for details

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 61.0 KB
Line 
1# $Id: Makefile.kmk 82681 2020-01-09 04:31:04Z vboxsync $
2## @file
3# Makefile for the VBox Main module.
4#
5
6#
7# Copyright (C) 2004-2019 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17
18SUB_DEPTH = ../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21#
22# Make sure our Config.kmk is included.
23#
24ifndef VBOX_MAIN_CONFIG_KMK_INCLUDED
25 include $(PATH_SUB_CURRENT)/Config.kmk
26endif
27
28#
29# Include sub-makefile(s).
30#
31ifndef VBOX_ONLY_EXTPACKS
32 ifdef VBOX_WITH_WEBSERVICES
33 include $(PATH_SUB_CURRENT)/webservice/Makefile.kmk
34 endif
35 include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
36 include $(PATH_SUB_CURRENT)/cbinding/Makefile.kmk
37 include $(PATH_SUB_CURRENT)/UnattendedTemplates/Makefile.kmk
38 ifndef VBOX_ONLY_SDK
39 include $(PATH_SUB_CURRENT)/src-helper-apps/OpenGLTest/Makefile.kmk
40 endif
41endif
42
43
44#
45# Targets and globals (bit of a mess...)
46#
47VBOX_PATH_MAIN_SRC := $(PATH_SUB_CURRENT)
48
49ifdef VBOX_ONLY_SDK
50 # I'm Evil! Dr. Evil.
51 VBoxCOM_0_OUTDIR = $(PATH_TARGET)/VBoxCOM
52 BLDDIRS += $(VBoxCOM_0_OUTDIR) $(PATH_STAGE_BIN)/components
53 include $(KBUILD_PATH)/tools/$(VBOX_VCC_TOOL).kmk # For the idl /cpp statement.
54 include $(KBUILD_PATH)/sdks/$(VBOX_WINPSDK).kmk
55endif # !VBOX_ONLY_SDK
56
57
58## VBOX_MAIN_DEFS is used by VBoxC, VBoxClient-x86, VBoxSVC and VBoxSVCM, making
59# sure they all have the same set of features enabled.
60VBOX_MAIN_DEFS :=
61ifneq ($(KBUILD_TARGET),win)
62 ifndef VBOX_WITH_XPCOM
63$(error "VBox: VBOX_WITH_XPCOM isn't defined")
64 endif
65VBOX_MAIN_DEFS += VBOX_WITH_GENERIC_SESSION_WATCHER
66endif
67ifdef VBOX_WITH_AUDIO_ALSA
68VBOX_MAIN_DEFS += VBOX_WITH_AUDIO_ALSA
69endif
70ifdef VBOX_WITH_AUDIO_DEBUG
71VBOX_MAIN_DEFS += VBOX_WITH_AUDIO_DEBUG
72endif
73ifdef VBOX_WITH_AUDIO_OSS
74VBOX_MAIN_DEFS += VBOX_WITH_AUDIO_OSS
75endif
76ifdef VBOX_WITH_AUDIO_PULSE
77VBOX_MAIN_DEFS += VBOX_WITH_AUDIO_PULSE
78endif
79ifdef VBOX_WITH_AUDIO_VALIDATIONKIT
80VBOX_MAIN_DEFS += VBOX_WITH_AUDIO_VALIDATIONKIT
81endif
82ifdef VBOX_WITH_AUDIO_VRDE
83VBOX_MAIN_DEFS += VBOX_WITH_AUDIO_VRDE
84endif
85ifdef VBOX_WITH_COPYTOGUEST
86VBOX_MAIN_DEFS += VBOX_WITH_COPYTOGUEST
87endif
88ifdef VBOX_WITH_E1000
89VBOX_MAIN_DEFS += VBOX_WITH_E1000
90endif
91ifdef VBOX_WITH_EXTPACK
92VBOX_MAIN_DEFS += VBOX_WITH_EXTPACK
93endif
94ifdef VBOX_WITH_GUEST_CONTROL
95VBOX_MAIN_DEFS += VBOX_WITH_GUEST_CONTROL
96endif
97ifdef VBOX_WITH_GUEST_PROPS
98VBOX_MAIN_DEFS += VBOX_WITH_GUEST_PROPS
99 ifdef VBOX_WITH_GUEST_PROPS_RDONLY_GUEST
100VBOX_MAIN_DEFS += VBOX_WITH_GUEST_PROPS_RDONLY_GUEST
101 endif
102endif
103ifdef VBOX_WITH_HGCM
104VBOX_MAIN_DEFS += VBOX_WITH_HGCM
105endif
106ifdef VBOX_WITH_HOSTNETIF_API
107VBOX_MAIN_DEFS += VBOX_WITH_HOSTNETIF_API
108endif
109ifdef VBOX_WITH_DHCPD
110VBOX_MAIN_DEFS += VBOX_WITH_DHCPD
111endif
112ifdef VBOX_WITH_LIVE_MIGRATION
113VBOX_MAIN_DEFS += VBOX_WITH_LIVE_MIGRATION
114endif
115ifdef VBOX_WITH_MIDL_PROXY_STUB
116VBOX_MAIN_DEFS += VBOX_WITH_MIDL_PROXY_STUB
117endif
118ifdef VBOX_WITH_NETFLT
119VBOX_MAIN_DEFS += VBOX_WITH_NETFLT
120endif
121ifdef VBOX_WITH_CLOUD_NET
122VBOX_MAIN_DEFS += VBOX_WITH_CLOUD_NET
123endif
124ifdef VBOX_WITH_PCI_PASSTHROUGH
125VBOX_MAIN_DEFS += VBOX_WITH_PCI_PASSTHROUGH
126endif
127ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
128VBOX_MAIN_DEFS += VBOX_WITH_PDM_ASYNC_COMPLETION
129endif
130ifdef VBOX_WITH_SDS
131VBOX_MAIN_DEFS += VBOX_WITH_SDS
132endif
133ifdef VBOX_WITH_SHARED_CLIPBOARD
134VBOX_MAIN_DEFS += VBOX_WITH_SHARED_CLIPBOARD
135 ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
136 VBOX_MAIN_DEFS += VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
137 endif
138endif
139ifdef VBOX_WITH_USB_CARDREADER
140VBOX_MAIN_DEFS += VBOX_WITH_USB_CARDREADER
141endif
142ifdef VBOX_WITH_USB_CARDREADER_TEST
143VBOX_MAIN_DEFS += VBOX_WITH_USB_CARDREADER_TEST
144endif
145ifdef VBOX_WITH_VIRTIO
146VBOX_MAIN_DEFS += VBOX_WITH_VIRTIO
147endif
148ifdef VBOX_WITH_VIRTIO_1_0
149VBOX_MAIN_DEFS += VBOX_WITH_VIRTIO_1_0
150endif
151ifdef VBOX_WITH_VIRTIO_NET_1_0
152VBOX_MAIN_DEFS += VBOX_WITH_VIRTIO_NET_1_0
153endif
154ifdef VBOX_WITH_VMSVGA
155VBOX_MAIN_DEFS += VBOX_WITH_VMSVGA
156endif
157ifdef VBOX_WITH_VMSVGA3D
158VBOX_MAIN_DEFS += VBOX_WITH_VMSVGA3D
159endif
160ifdef VBOX_WITH_VUSB
161VBOX_MAIN_DEFS += VBOX_WITH_VUSB
162endif
163ifdef VBOX_WITH_EHCI
164 ifdef VBOX_WITH_USB
165 VBOX_MAIN_DEFS += VBOX_WITH_EHCI
166 endif
167endif
168ifdef VBOX_WITH_EFI_IN_DD2
169 VBOX_MAIN_DEFS += VBOX_WITH_EFI_IN_DD2
170endif
171# Unconditionally enable the new semaphore key generation code
172VBOX_MAIN_DEFS += VBOX_WITH_NEW_SYS_V_KEYGEN
173
174
175VBOX_IDL_FILE.MSCOM = $(VBOX_PATH_SDK)/bindings/mscom/idl/VirtualBox.idl
176VBOX_IDL_FILE.XPCOM = $(VBOX_PATH_SDK)/bindings/xpcom/idl/VirtualBox_XPCOM.idl
177
178VBOX_IDL_TYPELIB.XPCOM = $(PATH_STAGE_BIN)/components/VirtualBox_XPCOM.xpt
179VBOX_IDL_HEADER.XPCOM = $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
180
181# The MS COM specific stuff.
182if defined(VBOX_ONLY_SDK) || "$(KBUILD_TARGET)" == "win"
183 OTHERS += \
184 $(VBOX_IDL_FILE.MSCOM)
185 OTHER_CLEAN += \
186 $(VBOX_IDL_FILE.MSCOM)
187
188 INSTALLS += VBox-mscom-bindings-include VBox-mscom-bindings-lib
189 VBox-mscom-bindings-include_INST = $(INST_SDK)bindings/mscom/include/
190 VBox-mscom-bindings-include_MODE = a+r,u+w
191 VBox-mscom-bindings-include_SOURCES = $(VBoxCOM_0_OUTDIR)/VirtualBox.h
192 VBox-mscom-bindings-include_CLEAN = $(VBoxCOM_0_OUTDIR)/VirtualBox.h
193 VBox-mscom-bindings-lib_INST = $(INST_SDK)bindings/mscom/lib/
194 VBox-mscom-bindings-lib_MODE = a+r,u+w
195 VBox-mscom-bindings-lib_SOURCES = $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
196 $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
197 VBox-mscom-bindings-lib_CLEAN = $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
198 $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
199
200 BLDDIRS += $(VBOX_PATH_SDK)/bindings/mscom/idl
201endif
202
203# The XPCOM specific stuff.
204# if defined(VBOX_ONLY_SDK) || "$(KBUILD_TARGET)" != "win" -- does not build on Windows
205if "$(KBUILD_TARGET)" != "win"
206 OTHERS += $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM) $(VBOX_IDL_HEADER.XPCOM)
207 OTHER_CLEAN += \
208 $(VBOX_IDL_FILE.XPCOM) \
209 $(VBOX_IDL_HEADER.XPCOM) \
210 $(VBOX_IDL_TYPELIB.XPCOM)
211
212 INSTALLS += VBox-xpcom-bindings-lib
213 VBox-xpcom-bindings-lib_INST = $(INST_SDK)bindings/xpcom/lib/
214 VBox-xpcom-bindings-lib_MODE = a+r,u+w
215 VBox-xpcom-bindings-lib_SOURCES = $(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c=>VirtualBox_i.c
216 VBox-xpcom-bindings-lib_CLEAN = $(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c
217
218 VBOX_MAIN_PREREQS += $(VBOX_IDL_TYPELIB.XPCOM) $(VBOX_IDL_HEADER.XPCOM)
219 BLDDIRS += \
220 $(VBOX_PATH_SDK)/bindings/xpcom/idl \
221 $(VBOX_PATH_SDK)/bindings/xpcom/include
222 # disable VBoxSDS for XPCOM
223 override VBOX_WITH_SDS =
224endif # xpcom
225
226
227#
228# Strip documentation from source XIDL so that we don't get a full
229# recompile every time a comma in the documentation is changed.
230#
231$(call KB_FN_AUTO_CMD_DEPS,$(VBOX_XIDL_FILE).ts)
232$(VBOX_XIDL_FILE).ts +| $(VBOX_XIDL_FILE): \
233 $(VBOX_XIDL_FILE_SRC) \
234 $(VBOX_PATH_MAIN_SRC)/idl/docstrip.xsl \
235 | $$(dir $$@)
236 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
237 $(QUIET)$(VBOX_XSLTPROC) -o $(VBOX_XIDL_FILE).ts-tmp $(VBOX_PATH_MAIN_SRC)/idl/docstrip.xsl $(VBOX_XIDL_FILE_SRC)
238 $(QUIET)$(SED) -e 's/ *$(DOLLAR)//g' -e '/^$(DOLLAR)/d' --output $(VBOX_XIDL_FILE).ts $(VBOX_XIDL_FILE).ts-tmp
239 $(QUIET)$(RM) -- $(VBOX_XIDL_FILE).ts-tmp
240 $(QUIET)$(CP) --changed -fv -- $(VBOX_XIDL_FILE).ts $(VBOX_XIDL_FILE)
241
242OTHER_CLEAN += $(VBOX_XIDL_FILE) $(VBOX_XIDL_FILE).ts
243
244
245#
246# The Main API documentation
247#
248VBOX_MAIN_DOC_DIR = $(VBOX_PATH_SDK)/docs
249BLDDIRS += $(VBOX_MAIN_DOC_DIR)
250
251$(PATH_TARGET)/docs.Main: \
252 $(VBOX_PATH_MAIN_SRC)/Doxyfile.Main \
253 $(VBOX_PATH_MAIN_SRC)/idl/doxygen.xsl \
254 $(VBOX_XIDL_FILE_SRC) \
255 | $(PATH_TARGET)/ \
256 $(VBOX_MAIN_DOC_DIR)/
257 $(call MSG_TOOL,xsltproc,doxygen input,$<,$@)
258 $(QUIET)$(RM) -f $(wildcard $(VBOX_MAIN_DOC_DIR)/html/*) $(PATH_TARGET)/docs.Main
259 $(QUIET)$(VBOX_XSLTPROC) -o $(PATH_TARGET)/VirtualBox.idl $(VBOX_PATH_MAIN_SRC)/idl/doxygen.xsl $(VBOX_XIDL_FILE_SRC)
260 $(QUIET)$(REDIRECT) -E 'DOCDIR=$(VBOX_MAIN_DOC_DIR)' -E 'PATH_TARGET=$(PATH_TARGET)' -E 'PATH_CHM=$(subst /,\,$(VBOX_MAIN_DOC_DIR)/VirtualBoxAPI.chm)' \
261 -- doxygen $(VBOX_PATH_MAIN_SRC)/Doxyfile.Main
262 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) ">>>>>>>>>>>>>>>>>>>> Main.err: >>>>>>>>>>>>>>>>>>>>>>>>"
263 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(CAT) "$(PATH_TARGET)/Main.err"
264 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "<<<<<<<<<<<<<<<<<<<< Main.err <<<<<<<<<<<<<<<<<<<<<<<<<"
265 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> **************************************************"
266 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> Please fix above doxygen errors/warnings listed in"
267 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> $(PATH_TARGET)/Main.err"
268 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> **************************************************"
269 -$(EXEC_X86_WIN32) $(VBOX_PATH_HTML_HELP_WORKSHOP)/hhc.exe $(subst /,\\,$(VBOX_MAIN_DOC_DIR)/html/index.hhp)
270 $(APPEND) $(PATH_TARGET)/docs.Main
271# aliases
272docs.main docs.Main: $(PATH_TARGET)/docs.Main
273if !defined(VBOX_ONLY_DOCS) && defined(VBOX_WITH_ALL_DOXYGEN_TARGETS)
274docs: $(PATH_TARGET)/docs.Main
275else
276docs:
277endif
278
279
280ifndef VBOX_ONLY_SDK
281 #
282 # Generate library with API class wrappers from the XIDL file.
283 #
284 LIBRARIES += VBoxAPIWrap
285 VBoxAPIWrap_TEMPLATE = VBoxMainLib
286 ifeq ($(KBUILD_TARGET),win)
287 VBoxAPIWrap_USES = vccprecomp
288 VBoxAPIWrap_PCH_HDR := $(PATH_SUB_CURRENT)/src-all/win/VBoxAPIWrap-precomp_vcc.h
289 else if $(KBUILD_KMK_REVISION) >= 3256 && "$(KBUILD_TARGET)" != "darwin" && !defined(VBOX_WITHOUT_PRECOMPILED_HEADERS)
290 if $(VBOX_GCC_VERSION_CXX) >= 50000 # GCC 4.x runs into trouble compiling the header.
291VBoxAPIWrap_USES = gccprecomp
292VBoxAPIWrap_PCH_HDR := $(PATH_SUB_CURRENT)/src-all/xpcom/VBoxAPIWrap-precomp_gcc.h
293 endif
294 endif
295 VBoxAPIWrap_SOURCES = \
296 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d \
297 $(if-expr defined(VBOX_ONLY_EXTPACKS) \
298 , $(addprefix $(VBoxAPIWrap_0_OUTDIR)/,$(filter \
299 Cloud%\
300 %FormValueWrap.cpp\
301 %FormWrap.cpp\
302 StringArrayWrap.cpp\
303 , $(notdir $(VBOX_MAIN_APIWRAPPER_GEN_SRCS)))) \
304 , $(VBOX_MAIN_APIWRAPPER_GEN_SRCS))
305 VBoxAPIWrap_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
306 VBoxAPIWrap_DEFS.win.x86 += _WIN32_WINNT=0x0500
307 VBoxAPIWrap_DEFS.win.amd64 += _WIN32_WINNT=0x0510
308 VBoxAPIWrap_INCS += \
309 include
310 VBoxAPIWrap_CLEAN = \
311 $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp) \
312 $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.h) \
313 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts \
314 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d \
315 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers \
316 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-even \
317 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-odd
318
319 # Two VBox variables used here and/or in the rules generating wrappers.
320 VBoxAPIWrap_VBOX_XSLT = \
321 $(VBOX_PATH_MAIN_SRC)/idl/apiwrap-server.xsl
322
323
324 # This include file (generated at the bottom of this file), defines
325 # VBOX_MAIN_APIWRAPPER_GEN_SRCS and VBOX_MAIN_APIWRAPPER_GEN_HDRS.
326 VBoxAPIWrap_VBOX_KMK_FILE = $(PATH_OUT)/vboxapiwrap.kmk
327 include $(VBoxAPIWrap_VBOX_KMK_FILE)
328
329 ifdef VBOX_WITH_32_ON_64_MAIN_API
330 LIBRARIES += VBoxAPIWrap-x86
331 VBoxAPIWrap-x86_TEMPLATE = VBoxMainLib-x86
332 VBoxAPIWrap-x86_EXTENDS = VBoxAPIWrap
333 VBoxAPIWrap-x86_DTRACE_HDR_FLAGS = -32 # ugly, should be fixed in the tool in Config.kmk
334 ifeq ($(KBUILD_TARGET),win) ## @todo fix inheritance (fixed in r3253)
335 VBoxAPIWrap-x86_USES = vccprecomp
336 VBoxAPIWrap-x86_PCH_HDR := $(PATH_SUB_CURRENT)/src-all/win/VBoxAPIWrap-precomp_vcc.h
337 endif
338 endif
339
340endif # !VBOX_ONLY_SDK
341
342#
343# Some SDK bit.
344#
345INSTALLS += VBox-main-xidl
346VBox-main-xidl_INST = $(INST_SDK)bindings/
347VBox-main-xidl_MODE = a+r,u+w
348VBox-main-xidl_SOURCES = $(VBOX_XIDL_FILE_SRC)
349
350if defined(VBOX_WITH_PYTHON) && !defined(VBOX_ONLY_EXTPACKS)
351 INSTALLS += VBox-python-glue
352 VBox-python-glue_INST = $(INST_SDK)installer/vboxapi/
353 VBox-python-glue_MODE = a+r,u+w
354 VBox-python-glue_SOURCES = \
355 glue/vboxapi.py=>__init__.py \
356 $(VBox-python-glue_0_OUTDIR)/VirtualBox_constants.py
357 VBox-python-glue_CLEAN = \
358 $(VBox-python-glue_0_OUTDIR)/VirtualBox_constants.py \
359 $(VBox-python-glue_0_OUTDIR)/VirtualBox_constants_err_h_1.txt
360 $(call KB_FN_DO_PASS0_ON_TARGET,VBox-python-glue)
361 $(call KB_FN_AUTO_CMD_DEPS,$(VBox-python-glue_0_OUTDIR)/VirtualBox_constants.py)
362 $(VBox-python-glue_0_OUTDIR)/VirtualBox_constants.py \
363 + $(VBox-python-glue_0_OUTDIR)/VirtualBox_constants_err_h_1.txt: \
364 $(VBOX_PATH_MAIN_SRC)/glue/constants-python.xsl \
365 $(VBOX_PATH_MAIN_SRC)/glue/vbox-err-consts.sed \
366 $(PATH_ROOT)/include/iprt/err.h \
367 $(PATH_ROOT)/include/VBox/err.h \
368 $(VBOX_XIDL_FILE) \
369 | $$(dir $$@)
370 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
371 $(call MSG_TOOL,xsltproc,Python constants,$<,$@)
372 $(SED) -f $(VBOX_PATH_MAIN_SRC)/glue/vbox-err-consts.sed \
373 --output $(VBox-python-glue_0_OUTDIR)/VirtualBox_constants_err_h_1.txt \
374 $(PATH_ROOT)/include/iprt/err.h \
375 $(PATH_ROOT)/include/VBox/err.h
376 $(QUIET)$(VBOX_XSLTPROC) -o $@ \
377 --stringparam "g_sErrHFile" "$(VBox-python-glue_0_OUTDIR)/VirtualBox_constants_err_h_1.txt" \
378 $(VBOX_PATH_MAIN_SRC)/glue/constants-python.xsl $(VBOX_XIDL_FILE)
379endif # VBOX_WITH_PYTHON && !VBOX_ONLY_EXTPACKS
380
381if !defined(VBOX_ONLY_SDK) && !defined(VBOX_ONLY_EXTPACKS) # Note this goes on for *very* long
382
383#
384# Generate SchemaDefs.h and SchemaDefs.cpp from XML Schema
385# These two files are used by both VBoxC and VBoxSVC.
386#
387BLDDIRS += $(PATH_TARGET)/Main
388
389testschemadefs: $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
390
391
392#
393# VBoxSDS executable
394#
395if defined(VBOX_WITH_SDS) && "$(KBUILD_TARGET)" == "win"
396PROGRAMS.win += VBoxSDS
397VBoxSDS_TEMPLATE = VBOXMAINEXE
398VBoxSDS_DEFS += VBOX_COM_OUTOFPROC_MODULE _WIN32_WINNT=0x0600
399 ifdef VBOX_WITH_VBOXSDL
400VBoxSDS_DEFS += VBOX_WITH_VBOXSDL
401 endif
402 ifdef VBOX_WITH_HEADLESS
403VBoxSDS_DEFS += VBOX_WITH_HEADLESS
404 endif
405 ifdef VBOX_WITH_QTGUI
406VBoxSDS_DEFS += VBOX_WITH_QTGUI
407 endif
408VBoxSDS_INCS = \
409 include \
410 $(VBoxSDS_0_OUTDIR) \
411 $(VBoxCOM_0_OUTDIR)
412VBoxSDS_INTERMEDIATES = \
413 $(VBOX_MAIN_PREREQS)
414VBoxSDS_SOURCES = \
415 src-global/win/VBoxSDS.cpp \
416 src-global/win/VirtualBoxSDSImpl.cpp \
417 src-global/win/VBoxSDS.rc \
418 src-all/MachineLaunchVMCommonWorker.cpp
419$(call KB_FN_DO_PASS0_ON_TARGET,VBoxSDS) # Sets VBoxSDS_0_OUTDIR
420
421src-global/win/VBoxSDS.rc_INCS = $(VBoxSDS_0_OUTDIR)
422src-global/win/VBoxSDS.rc_DEPS = $(VBoxSDS_0_OUTDIR)/VBoxSDS-icon.rc #$(VBoxSDS_0_OUTDIR)/VBoxSDS.rgs
423src-global/win/VBoxSDS.rc_CLEAN = $(VBoxSDS_0_OUTDIR)/VBoxSDS-icon.rc #$(VBoxSDS_0_OUTDIR)/VBoxSDS.rgs
424
425$(call KB_FN_AUTO_CMD_DEPS,$(VBoxSDS_0_OUTDIR)/VBoxSDS-icon.rc)
426$(VBoxSDS_0_OUTDIR)/VBoxSDS-icon.rc: $(VBOX_WINDOWS_ICON_FILE) | $$(dir $$@)
427 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
428 $(APPEND) -t $@ '1 ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
429
430# $(call KB_FN_AUTO_CMD_DEPS,$(VBoxSDS_0_OUTDIR)/VBoxSDS.rgs)
431# $(VBoxSDS_0_OUTDIR)/VBoxSDS.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
432# $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
433# $(VBOX_XSLTPROC) \
434# --stringparam Application "VirtualBox System" \
435# --stringparam Module VBoxSDS \
436# -o $@ \
437# $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
438# $(VBOX_XIDL_FILE)
439#
440endif #if defined(VBOX_WITH_SDS) && "$(KBUILD_TARGET)" == "win"
441
442#
443# VBoxSVC executable
444#
445PROGRAMS += VBoxSVC
446VBoxSVC_TEMPLATE = VBOXMAINEXE
447if defined(VBOX_WITH_PRECOMPILED_HEADERS) && "$(KBUILD_TARGET)" == "win"
448 VBoxSVC_USES += vccprecomp
449 VBoxSVC_PCH_HDR := $(PATH_SUB_CURRENT)/src-server/win/precomp_vcc.h
450else if $(KBUILD_KMK_REVISION) >= 3256 && "$(KBUILD_TARGET)" != "darwin" && !defined(VBOX_WITHOUT_PRECOMPILED_HEADERS)
451 if $(VBOX_GCC_VERSION_CXX) >= 50000 # GCC 4.x runs into trouble compiling the header.
452VBoxSVC_USES += gccprecomp
453VBoxSVC_PCH_HDR := $(PATH_SUB_CURRENT)/src-server/xpcom/precomp_gcc.h
454 endif
455endif
456VBoxSVC_DEFS = \
457 IN_VBOXSVC \
458 VBOX_MAIN_SETTINGS_ADDONS \
459 IN_VMM_STATIC \
460 $(VBOX_MAIN_DEFS) \
461 $(if $(VBOX_WITH_VBOXSDL),VBOX_WITH_VBOXSDL,) \
462 $(if $(VBOX_WITH_HEADLESS),VBOX_WITH_HEADLESS,) \
463 $(if $(VBOX_WITH_QTGUI),VBOX_WITH_QTGUI,) \
464 $(if $(VBOX_WITH_AHCI),VBOX_WITH_AHCI,) \
465 $(if $(VBOX_WITH_LSILOGIC),VBOX_WITH_LSILOGIC,) \
466 $(if $(VBOX_WITH_LINUX_COMPILER_H),VBOX_WITH_LINUX_COMPILER_H,) \
467 $(if $(VBOX_WITH_RESOURCE_USAGE_API),VBOX_WITH_RESOURCE_USAGE_API,) \
468 $(if $(VBOX_WITH_UNATTENDED),VBOX_WITH_UNATTENDED,) \
469 $(if $(VBOX_WITH_DBUS),VBOX_WITH_DBUS,) \
470 $(if $(VBOX_WITH_DBUS),$(if $(VBOX_USB_WITH_DBUS),VBOX_USB_WITH_DBUS,),) \
471 $(if $(VBOX_USB_WITH_SYSFS),VBOX_USB_WITH_SYSFS,) \
472 $(if $(VBOX_USB_WITH_INOTIFY),VBOX_USB_WITH_INOTIFY,) \
473 $(if $(VBOX_WITH_NAT_SERVICE),VBOX_WITH_NAT_SERVICE,) \
474 $(if-expr defined(VBOX_WITH_SDS),VBOX_WITH_SDS,)
475ifdef VBOX_WITH_USB
476 VBoxSVC_DEFS += \
477 VBOX_WITH_USB \
478 $(if $(VBOX_WITH_EHCI),VBOX_WITH_EHCI,) \
479 $(if $(VBOX_WITH_NEW_USB_CODE_ON_DARWIN),VBOX_WITH_NEW_USB_CODE_ON_DARWIN,)
480endif
481VBoxSVC_DEFS.win += VBOX_COM_OUTOFPROC_MODULE _WIN32_WINNT=0x0600
482# Try to load and use libhal at runtime for probing removable media
483# VBoxSVC_DEFS.linux += VBOX_USE_LIBHAL
484VBoxSVC_DEFS.solaris += VBOX_USE_LIBHAL
485
486if $(KBUILD_TARGET) != "win" && $(VBOX_GCC_VERSION_CXX) >= 40900 # gcc 4.9.x (4.8.x is causing endless RT_ELEMENT trouble)
487 VBoxSVC_CXXFLAGS = -Wunused -Wconversion
488endif
489
490VBoxSVC_INCS = \
491 include \
492 $(VBoxSVC_0_OUTDIR) \
493 $(dir $(VBOX_XML_SCHEMADEFS_H)) \
494 $(VBOX_MAIN_APIWRAPPER_INCS) \
495 . \
496 $(VBOX_GRAPHICS_INCS)
497VBoxSVC_INCS.win = \
498 $(VBoxCOM_0_OUTDIR)
499ifdef VBOX_WITH_USB
500 VBoxSVC_INCS.os2 = \
501 $(PATH_ROOT)/src/VBox/HostDrivers/VBoxUSB/os2
502endif
503
504VBoxSVC_LIBS += \
505 $(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB) \
506 $(PATH_STAGE_LIB)/SSMStandalone$(VBOX_SUFF_LIB) \
507 $(LIB_DDU)
508
509VBoxSVC_SDKS = VBOX_LIBPNG VBOX_ZLIB
510VBoxSVC_LIBS.solaris = \
511 adm \
512 nsl \
513 devinfo \
514 socket \
515 $(LIB_VMM)
516
517VBoxSVC_LIBS.win += \
518 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/dnsapi.lib
519
520VBoxSVC_INTERMEDIATES = \
521 $(VBOX_MAIN_PREREQS) \
522 $(VBOX_XML_SCHEMADEFS_H) \
523 $(VBOX_AUTOGEN_EVENT_H) \
524 $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
525
526VBoxSVC_SOURCES = \
527 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d \
528 src-all/AuthLibrary.cpp \
529 src-all/DisplayPNGUtil.cpp \
530 src-all/DisplayResampleImage.cpp \
531 src-all/DisplayUtils.cpp \
532 src-all/EventImpl.cpp \
533 src-all/Global.cpp \
534 src-all/GlobalStatusConversion.cpp \
535 src-all/HashedPw.cpp \
536 src-all/Logging.cpp \
537 src-all/PCIDeviceAttachmentImpl.cpp \
538 src-all/ProgressImpl.cpp \
539 src-all/QMTranslatorImpl.cpp \
540 src-all/SecretKeyStore.cpp \
541 src-all/SharedFolderImpl.cpp \
542 src-all/AutoCaller.cpp \
543 src-all/ThreadTask.cpp \
544 src-all/VirtualBoxBase.cpp \
545 src-all/VirtualBoxErrorInfoImpl.cpp \
546 $(if $(VBOX_WITH_EXTPACK),src-all/ExtPackManagerImpl.cpp src-all/ExtPackUtil.cpp,) \
547 src-server/CertificateImpl.cpp \
548 src-server/ApplianceImpl.cpp \
549 src-server/ApplianceImplExport.cpp \
550 src-server/ApplianceImplImport.cpp \
551 src-server/AudioAdapterImpl.cpp \
552 src-server/BandwidthControlImpl.cpp \
553 src-server/BandwidthGroupImpl.cpp \
554 src-server/BIOSSettingsImpl.cpp \
555 src-server/RecordingSettingsImpl.cpp \
556 src-server/RecordingScreenSettingsImpl.cpp \
557 src-server/GraphicsAdapterImpl.cpp \
558 src-server/ClientWatcher.cpp \
559 src-server/ClientToken.cpp \
560 src-server/CloudProviderManagerImpl.cpp \
561 src-server/DataStreamImpl.cpp \
562 src-server/DHCPServerImpl.cpp \
563 src-server/DHCPConfigImpl.cpp \
564 ../NetworkServices/Dhcpd/DhcpOptions.cpp \
565 src-server/NetworkServiceRunner.cpp \
566 src-server/NATNetworkImpl.cpp \
567 $(if $(VBOX_WITH_CLOUD_NET), \
568 src-server/CloudGateway.cpp \
569 src-server/CloudNetworkImpl.cpp \
570 ,) \
571 src-server/GuestOSTypeImpl.cpp \
572 src-server/HostDnsService.cpp \
573 src-server/HostImpl.cpp \
574 src-server/HostNetworkInterfaceImpl.cpp \
575 src-server/HostPower.cpp \
576 src-server/HostVideoInputDeviceImpl.cpp \
577 src-server/MachineImpl.cpp \
578 src-all/MachineLaunchVMCommonWorker.cpp \
579 src-server/MachineImplCloneVM.cpp \
580 src-server/MachineImplMoveVM.cpp \
581 src-server/Matching.cpp \
582 src-server/MediumAttachmentImpl.cpp \
583 src-server/MediumFormatImpl.cpp \
584 src-server/MediumImpl.cpp \
585 src-server/MediumLock.cpp \
586 src-server/MediumIOImpl.cpp \
587 src-server/NATEngineImpl.cpp \
588 src-server/NetworkAdapterImpl.cpp \
589 src-server/ParallelPortImpl.cpp \
590 src-server/ProgressProxyImpl.cpp \
591 src-server/SerialPortImpl.cpp \
592 src-server/SnapshotImpl.cpp \
593 src-server/StorageControllerImpl.cpp \
594 src-server/SystemPropertiesImpl.cpp \
595 src-server/TokenImpl.cpp \
596 $(if $(VBOX_WITH_UNATTENDED), \
597 src-server/UnattendedImpl.cpp \
598 src-server/UnattendedInstaller.cpp \
599 src-server/UnattendedScript.cpp \
600 src-all/TextScript.cpp \
601 ,) \
602 src-server/USBControllerImpl.cpp \
603 src-server/USBDeviceFiltersImpl.cpp \
604 src-server/VFSExplorerImpl.cpp \
605 src-server/VirtualBoxImpl.cpp \
606 src-server/VRDEServerImpl.cpp \
607 src-server/generic/AutostartDb-generic.cpp \
608 xml/ovfreader.cpp \
609 xml/Settings.cpp \
610 $(VBOX_XML_SCHEMADEFS_CPP) \
611 $(VBOX_AUTOGEN_EVENT_CPP) \
612 $(if $(VBOX_WITH_XPCOM),src-server/xpcom/server.cpp,)
613
614src-server/ApplianceImplExport.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
615
616ifn1of ($(KBUILD_TARGET), win darwin)
617 VBoxSVC_SOURCES += $(PATH_ROOT)/src/VBox/Devices/Network/slirp/resolv_conf_parser.c
618# $(PATH_ROOT)/src/VBox/Devices/Network/slirp/resolv_conf_parser.c_DEFS += LOG_GROUP=LOG_GROUP_MAIN
619endif
620
621VBoxSVC_SOURCES.darwin = \
622 src-server/darwin/iokit.cpp \
623 src-server/darwin/HostPowerDarwin.cpp \
624 src-server/darwin/HostDnsServiceDarwin.cpp
625
626VBoxSVC_SOURCES.win = \
627 src-server/win/svcmain.cpp \
628 src-server/win/svchlp.cpp \
629 src-server/win/HostPowerWin.cpp \
630 src-server/win/VBoxSVC.rc \
631 src-server/win/HostDnsServiceWin.cpp
632
633VBoxSVC_SOURCES.linux = \
634 src-server/linux/HostHardwareLinux.cpp \
635 src-server/linux/HostDnsServiceLinux.cpp \
636 $(if $(VBOX_WITH_DBUS),src-server/linux/HostPowerLinux.cpp) \
637 src-server/HostDnsServiceResolvConf.cpp
638
639VBoxSVC_SOURCES.solaris = \
640 src-server/linux/vbox-libhal.cpp \
641 src-server/solaris/DynLoadLibSolaris.cpp \
642 src-server/HostDnsServiceResolvConf.cpp
643
644VBoxSVC_SOURCES.os2 = \
645 src-server/HostDnsServiceResolvConf.cpp
646
647VBoxSVC_SOURCES.freebsd = \
648 src-server/freebsd/HostHardwareFreeBSD.cpp \
649 src-server/HostDnsServiceResolvConf.cpp
650
651
652ifdef VBOX_WITH_USB
653 ifdef VBOX_WITH_SYSFS_BY_DEFAULT
654 src-server/linux/USBProxyBackendLinux.cpp_DEFS += VBOX_WITH_SYSFS_BY_DEFAULT
655 endif
656 VBoxSVC_SOURCES += \
657 src-server/USBDeviceFilterImpl.cpp \
658 src-server/USBProxyService.cpp \
659 src-server/USBProxyBackend.cpp \
660 src-server/generic/USBProxyBackendUsbIp.cpp \
661 src-server/HostUSBDeviceImpl.cpp
662 VBoxSVC_SOURCES.darwin += src-server/darwin/USBProxyBackendDarwin.cpp
663 VBoxSVC_SOURCES.linux += src-server/linux/USBProxyBackendLinux.cpp
664 VBoxSVC_SOURCES.linux += src-server/linux/USBGetDevices.cpp
665 VBoxSVC_SOURCES.os2 += src-server/os2/USBProxyBackendOs2.cpp
666 VBoxSVC_SOURCES.solaris += src-server/solaris/USBProxyBackendSolaris.cpp
667 VBoxSVC_SOURCES.win += src-server/win/USBProxyBackendWindows.cpp
668 VBoxSVC_SOURCES.freebsd += src-server/freebsd/USBProxyBackendFreeBSD.cpp
669endif
670
671ifdef VBOX_WITH_NETFLT
672 VBoxSVC_LIBS.win += \
673 $(PATH_STAGE_LIB)/WinNetConfig$(VBOX_SUFF_LIB) \
674 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
675 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/newdev.lib \
676 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
677 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
678endif
679VBoxSVC_LDFLAGS.darwin = -framework IOKit -framework SystemConfiguration
680
681ifdef VBOX_WITH_3D_ACCELERATION
682 VBoxSVC_LIBS += $(PATH_STAGE_LIB)/VBoxOGLTest$(VBOX_SUFF_LIB)
683 VBoxSVC_LDFLAGS.darwin += -framework OpenGL
684endif
685
686ifeq ($(KBUILD_TYPE),debug)
687 VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
688endif
689
690ifdef VBOX_WITH_RESOURCE_USAGE_API
691 VBoxSVC_SOURCES += \
692 src-server/PerformanceImpl.cpp \
693 src-server/Performance.cpp
694 VBoxSVC_SOURCES.darwin += src-server/darwin/PerformanceDarwin.cpp
695 VBoxSVC_SOURCES.freebsd += src-server/freebsd/PerformanceFreeBSD.cpp
696 VBoxSVC_SOURCES.linux += src-server/linux/PerformanceLinux.cpp
697 VBoxSVC_SOURCES.os2 += src-server/os2/PerformanceOs2.cpp
698 VBoxSVC_SOURCES.solaris += src-server/solaris/PerformanceSolaris.cpp
699 VBoxSVC_SOURCES.win += src-server/win/PerformanceWin.cpp
700 VBoxSVC_LDFLAGS.darwin += -lproc
701 VBoxSVC_LDFLAGS.solaris += -lkstat -lnvpair
702 VBoxSVC_LDFLAGS.win += psapi.lib powrprof.lib
703endif
704
705ifdef VBOX_WITH_HOSTNETIF_API
706 VBoxSVC_SOURCES.win += src-server/win/NetIf-win.cpp
707 VBoxSVC_SOURCES.linux += src-server/linux/NetIf-linux.cpp
708 VBoxSVC_SOURCES.os2 += src-server/os2/NetIf-os2.cpp
709 VBoxSVC_SOURCES.darwin += src-server/darwin/NetIf-darwin.cpp
710 VBoxSVC_SOURCES.solaris += src-server/solaris/NetIf-solaris.cpp
711 VBoxSVC_SOURCES.freebsd += src-server/freebsd/NetIf-freebsd.cpp
712 VBoxSVC_DEFS += VBOX_WITH_HOSTNETIF_API
713 if1of ($(KBUILD_TARGET), linux darwin solaris freebsd)
714 VBoxSVC_SOURCES += src-server/generic/NetIf-generic.cpp
715 endif
716endif
717
718ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
719 VBoxSVC_SOURCES += $(PATH_ROOT)/src/VBox/GuestHost/SharedClipboard/ClipboardArea.cpp
720endif
721
722$(call KB_FN_DO_PASS0_ON_TARGET,VBoxSVC) # Sets VBoxSVC_0_OUTDIR
723
724ifdef VBOX_WITH_MAIN_USB_ID_DATABASE # Generate a database of USB vendor IDs and device IDs.
725 VBoxSVC_DEFS += VBOX_WITH_MAIN_USB_ID_DATABASE
726 VBoxSVC_SOURCES += $(VBoxSVC_0_OUTDIR)/USBIdDatabase.cpp
727 VBoxSVC_CLEAN += $(VBoxSVC_0_OUTDIR)/USBIdDatabase.cpp
728
729 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxSVC_0_OUTDIR)/USBIdDatabase.cpp)
730 $(VBoxSVC_0_OUTDIR)/USBIdDatabase.cpp: $$(USBIdDatabaseGenerator_1_TARGET) \
731 $(PATH_SUB_CURRENT)/src-server/usb.ids $(PATH_SUB_CURRENT)/src-server/custom.ids | $$(dir $$@)
732 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
733 $(call MSG_GENERATE,USBIdDatabase,$@,$(USBIdDatabaseGenerator_1_TARGET))
734 $(QUIET)$(USBIdDatabaseGenerator_1_TARGET) -o "$@" $(filter %.ids,$^)
735
736 BLDPROGS += USBIdDatabaseGenerator
737 USBIdDatabaseGenerator_TEMPLATE = VBoxAdvBldProg
738 USBIdDatabaseGenerator_SOURCES = src-server/USBIdDatabaseGenerator.cpp
739else
740 VBoxSVC_SOURCES += src-server/USBIdDatabaseStub.cpp
741endif
742
743src-server/win/VBoxSVC.rc_INCS = $(VBoxSVC_0_OUTDIR)
744src-server/win/VBoxSVC.rc_DEPS = $(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc
745src-server/win/VBoxSVC.rc_CLEAN = $(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc
746$(call KB_FN_AUTO_CMD_DEPS,$(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc)
747$(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc: $(VBOX_WINDOWS_ICON_FILE) | $$(dir $$@)
748 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
749 $(APPEND) -t $@ '1 ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
750
751ifndef VBOX_WITH_MIDL_PROXY_STUB
752 src-server/win/VBoxSVC.rc_DEPS += $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs
753 src-server/win/VBoxSVC.rc_CLEAN += $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs
754 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs)
755 $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
756 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
757 $(VBOX_XSLTPROC) \
758 --stringparam Application VirtualBox \
759 --stringparam Module VBoxSVC \
760 -o $@ \
761 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
762 $(VBOX_XIDL_FILE)
763endif
764
765## @todo r=klaus unfortunately we don't have xmllint everywhere, would be
766# good to check the validity for every VirtualBox.xidl change.
767#$(VBOX_XIDL_FILE).validated.ts: $(VBOX_XIDL_FILE_SRC)
768# xmllint --dtdvalid $(VBOX_PATH_MAIN_SRC)/idl/VirtualBox.dtd --noout $<
769# $(QUIET)$(CP) --changed -fv $< $(VBOX_XIDL_FILE).validated.ts
770#
771#OTHERS += $(VBOX_XIDL_FILE).validated.ts
772#OTHER_CLEAN += $(VBOX_XIDL_FILE).validated.ts
773
774testvalidxidl: $(VBOX_XIDL_FILE_SRC)
775 xmllint --dtdvalid $(VBOX_PATH_MAIN_SRC)/idl/VirtualBox.dtd --noout $<
776
777
778#
779# Embed some constraints from XML Schema file into VBoxSVC
780#
781VBOX_XML_SCHEMA = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings.xsd
782
783$(VBOX_XML_SCHEMADEFS_H): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA) | $$(dir $$@)
784 $(call MSG_GENERATE,SchemaDefs,$@,$<)
785 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode declare -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA)
786
787$(VBOX_XML_SCHEMADEFS_CPP): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA) | $$(dir $$@)
788 $(call MSG_GENERATE,SchemaDefs,$@,$<)
789 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode define -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA)
790
791testvalidsettings: $(VBOX_XML_SCHEMA)
792 xmllint --schema $< --noout $(HOME)/.VirtualBox/VirtualBox.xml
793 xmllint --schema $< --noout $(HOME)/.VirtualBox/Machines/*/*.xml
794 xmllint --schema $< --noout $(HOME)/.VirtualBox/Machines/*/*.vbox
795 xmllint --schema $< --noout $(HOME)/VirtualBox\ VMs/*/*.vbox
796
797OTHER_CLEAN += $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
798
799
800#
801# Generate some event stuff for VBoxSVC and VBoxC.
802#
803$(VBOX_AUTOGEN_EVENT_H): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
804 $(call MSG_TOOL,xsltproc,autogen events,$<,$@)
805 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEventHeader -o $@ $< $(VBOX_XIDL_FILE)
806
807$(VBOX_AUTOGEN_EVENT_CPP): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
808 $(call MSG_TOOL,xsltproc,autogen events,$<,$@)
809 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEvent -o $@ $< $(VBOX_XIDL_FILE)
810
811OTHER_CLEAN += $(VBOX_AUTOGEN_EVENT_H) $(VBOX_AUTOGEN_EVENT_CPP)
812
813ifdef VBOX_WITH_XPCOM
814#
815# VBoxSVCM - VBoxSVC wrapper module
816#
817DLLS += VBoxSVCM
818VBoxSVCM_TEMPLATE = VBOXMAINCOMP
819VBoxSVCM_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
820 ifdef VBOX_WITH_HARDENING
821VBoxSVCM_DEFS += VBOX_WITH_HARDENING
822 endif
823VBoxSVCM_INCS = \
824 include \
825 $(VBoxC_0_OUTDIR) \
826 .
827VBoxSVCM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
828VBoxSVCM_SOURCES = \
829 src-server/xpcom/server_module.cpp
830VBoxSVCM_LDFLAGS.darwin = \
831 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxSVCM.dylib \
832 -exported_symbols_list $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
833 ifeq ($(KBUILD_TARGET),darwin)
834VBoxSVCM_ORDERDEPS += $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
835VBoxSVCM_CLEAN += $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
836$$(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def:
837 $(RM) -f $@
838 $(APPEND) $@ _NSGetModule
839 endif
840VBoxSVCM_INTERMEDIATES += $(VBOX_IDL_HEADER.XPCOM)
841
842 # 32-bit version of the module.
843 ifdef VBOX_WITH_32_ON_64_MAIN_API
844DLLS += VBoxSVCM-x86
845VBoxSVCM-x86_TEMPLATE = VBoxMainComp-x86
846VBoxSVCM-x86_EXTENDS = VBoxSVCM
847 endif
848
849endif # VBOX_WITH_XPCOM
850
851
852#
853# VBoxC module
854#
855DLLS += VBoxC
856VBoxC_TEMPLATE = VBOXMAINCOMP
857if defined(VBOX_WITH_PRECOMPILED_HEADERS) && "$(KBUILD_TARGET)" == "win"
858 VBoxC_USES = vccprecomp
859 VBoxC_PCH_HDR := $(PATH_SUB_CURRENT)/src-client/win/precomp_vcc.h
860else if $(KBUILD_KMK_REVISION) >= 3256 && "$(KBUILD_TARGET)" != "darwin" && !defined(VBOX_WITHOUT_PRECOMPILED_HEADERS)
861 if $(VBOX_GCC_VERSION_CXX) >= 50000 # GCC 4.x runs into trouble compiling the header.
862VBoxC_USES += gccprecomp
863VBoxC_PCH_HDR := $(PATH_SUB_CURRENT)/src-client/xpcom/precomp_gcc.h
864 endif
865endif
866VBoxC_DEFS = \
867 IN_RING3 \
868 $(VBOX_MAIN_DEFS) \
869 VBOX_COM_INPROC \
870 $(if $(VBOX_WITH_EFI),VBOX_WITH_EFI,) \
871 $(if $(VBOX_WITH_HGSMI),VBOX_WITH_HGSMI,) \
872 $(if $(VBOX_WITH_VIDEOHWACCEL),VBOX_WITH_VIDEOHWACCEL,) \
873 $(if $(VBOX_WITH_DRAG_AND_DROP),VBOX_WITH_DRAG_AND_DROP,) \
874 $(if $(VBOX_WITH_DRAG_AND_DROP_GH),VBOX_WITH_DRAG_AND_DROP_GH,) \
875 $(if $(VBOX_WITH_USB),VBOX_WITH_USB,) \
876 $(if $(VBOX_WITH_VRDEAUTH_IN_VBOXSVC),VBOX_WITH_VRDEAUTH_IN_VBOXSVC,)
877ifdef VBOX_WITH_NETSHAPER
878 VBoxC_DEFS += VBOX_WITH_NETSHAPER
879endif
880VBoxC_DEFS.darwin.x86 = VBOX_WITH_2X_4GB_ADDR_SPACE
881VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
882VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
883
884if $(KBUILD_TARGET) != "win" && $(VBOX_GCC_VERSION_CXX) >= 40900 # gcc 4.9.x (4.8.x is causing endless RT_ELEMENT trouble)
885# VBoxC_CXXFLAGS = -Wunused -Wconversion
886endif
887
888VBoxC_SDKS = VBOX_LIBPNG VBOX_ZLIB
889
890if defined(VBOX_WITH_RECORDING) && defined(VBOX_WITH_LIBVPX)
891VBoxC_SDKS += VBOX_VPX
892VBoxC_DEFS += VBOX_WITH_RECORDING VBOX_WITH_LIBVPX
893VBoxC_SOURCES += \
894 xml/Settings.cpp \
895 src-client/EBMLWriter.cpp \
896 src-client/WebMWriter.cpp \
897 src-client/Recording.cpp \
898 src-client/RecordingInternals.cpp \
899 src-client/RecordingStream.cpp \
900 src-client/RecordingUtils.cpp
901
902 if defined(VBOX_WITH_AUDIO_RECORDING) && defined(VBOX_WITH_LIBOPUS)
903VBoxC_SDKS += VBOX_OPUS
904VBoxC_DEFS += VBOX_WITH_AUDIO_RECORDING VBOX_WITH_LIBOPUS
905VBoxC_SOURCES += src-client/DrvAudioRec.cpp
906 endif
907endif # VBOX_WITH_RECORDING && VBOX_WITH_LIBVPX
908
909ifdef VBOX_WITH_OPENSSL_FIPS
910VBoxC_SDKS += VBOX_OPENSSL2
911endif
912
913VBoxC_INCS = \
914 include \
915 $(VBoxC_0_OUTDIR) \
916 $(VBOX_MAIN_APIWRAPPER_INCS) \
917 $(dir $(VBOX_XML_SCHEMADEFS_H)) \
918 $(VBOX_MAIN_APIWRAPPER_DIR)/dtrace \
919 $(VBOX_GRAPHICS_INCS)
920VBoxC_INCS.win = \
921 $(VBoxCOM_0_OUTDIR) \
922 .
923
924VBoxC_LDFLAGS.darwin = \
925 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxC.dylib \
926 -exported_symbols_list $(VBoxC_0_OUTDIR)/VBoxC.def \
927 -framework IOKit
928VBoxC_LDFLAGS.win += /MANIFEST \
929 /DELAYLOAD:user32.dll
930
931
932VBoxC_LIBS += \
933 $(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB) \
934 $(if-expr "$(LIB_VMM)" == "$(VBOX_LIB_VMM_LAZY)",$(LIB_REM),) \
935 $(VBOX_LIB_VMM_LAZY)
936VBoxC_LIBS.win += \
937 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/psapi.lib \
938 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
939ifdef VBOX_WITH_NETFLT
940 VBoxC_LIBS.win += \
941 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
942 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/newdev.lib \
943 $(PATH_STAGE_LIB)/WinNetConfig$(VBOX_SUFF_LIB) \
944 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
945 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
946 VBoxC_LDFLAGS.win += \
947 /DELAYLOAD:newdev.dll \
948 /DELAYLOAD:setupapi.dll \
949 /DELAYLOAD:iphlpapi.dll
950endif
951
952ifdef VBOX_WITH_3D_ACCELERATION
953 VBoxC_LIBS += $(PATH_STAGE_LIB)/VBoxOGLTest$(VBOX_SUFF_LIB)
954 VBoxC_LDFLAGS.darwin += -framework OpenGL
955endif
956
957ifdef VBOX_WITH_DRAG_AND_DROP
958 VBoxC_LIBS += $(PATH_STAGE_LIB)/VBoxDnDHostR3Lib$(VBOX_SUFF_LIB)
959endif
960
961VBoxC_INTERMEDIATES = \
962 $(VBOX_MAIN_PREREQS) \
963 $(VBOX_XML_SCHEMADEFS_H) \
964 $(VBOX_AUTOGEN_EVENT_H) \
965 $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
966
967VBoxC_SOURCES += \
968 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d \
969 src-all/DisplayPNGUtil.cpp \
970 src-all/DisplayResampleImage.cpp \
971 src-all/DisplayUtils.cpp \
972 src-all/EventImpl.cpp \
973 src-all/Global.cpp \
974 src-all/GlobalStatusConversion.cpp \
975 src-all/HashedPw.cpp \
976 src-all/Logging.cpp \
977 src-all/PCIDeviceAttachmentImpl.cpp \
978 src-all/ProgressImpl.cpp \
979 src-all/SecretKeyStore.cpp \
980 src-all/SharedFolderImpl.cpp \
981 src-all/AutoCaller.cpp \
982 src-all/ThreadTask.cpp \
983 src-all/VirtualBoxBase.cpp \
984 src-all/VirtualBoxErrorInfoImpl.cpp \
985 $(if $(VBOX_WITH_EXTPACK),src-all/ExtPackManagerImpl.cpp src-all/ExtPackUtil.cpp,) \
986 src-client/UsbWebcamInterface.cpp \
987 $(if $(VBOX_WITH_USB_CARDREADER),src-client/UsbCardReader.cpp,) \
988 src-client/AdditionsFacilityImpl.cpp \
989 src-client/BusAssignmentManager.cpp \
990 $(if $(VBOX_WITH_PCI_PASSTHROUGH),src-client/PCIRawDevImpl.cpp,) \
991 src-client/ClientTokenHolder.cpp \
992 src-client/ConsoleImpl.cpp \
993 src-client/ConsoleImpl2.cpp \
994 src-client/ConsoleImplTeleporter.cpp \
995 src-client/ConsoleVRDPServer.cpp \
996 src-client/DisplayImpl.cpp \
997 src-client/DisplayImplLegacy.cpp \
998 src-client/DisplaySourceBitmapImpl.cpp \
999 src-client/EmulatedUSBImpl.cpp \
1000 src-client/GuestImpl.cpp \
1001 src-client/GuestCtrlImpl.cpp \
1002 src-client/KeyboardImpl.cpp \
1003 src-client/MachineDebuggerImpl.cpp \
1004 src-client/MouseImpl.cpp \
1005 src-client/RemoteUSBDeviceImpl.cpp \
1006 src-client/SessionImpl.cpp \
1007 src-client/USBDeviceImpl.cpp \
1008 src-client/VBoxDriversRegister.cpp \
1009 src-client/VirtualBoxClientImpl.cpp \
1010 src-client/VMMDevInterface.cpp \
1011 $(VBOX_AUTOGEN_EVENT_CPP) \
1012 $(VBOX_XML_SCHEMADEFS_CPP)
1013
1014# Audio bits.
1015VBoxC_SOURCES += \
1016 ../Devices/Audio/AudioMixBuffer.cpp \
1017 ../Devices/Audio/DrvAudioCommon.cpp \
1018 src-client/AudioDriver.cpp \
1019 $(if $(VBOX_WITH_AUDIO_VRDE),src-client/DrvAudioVRDE.cpp,)
1020
1021VBoxC_SOURCES.win = \
1022 src-client/win/dllmain.cpp \
1023 src-client/win/VBoxC.def \
1024 src-client/win/VBoxC.rc
1025ifdef VBOX_WITH_GUEST_CONTROL
1026 VBoxC_SOURCES += \
1027 src-client/GuestSessionImplTasks.cpp \
1028 src-client/GuestCtrlPrivate.cpp \
1029 src-client/GuestDirectoryImpl.cpp \
1030 src-client/GuestFileImpl.cpp \
1031 src-client/GuestFsObjInfoImpl.cpp \
1032 src-client/GuestProcessImpl.cpp \
1033 src-client/GuestSessionImpl.cpp
1034endif
1035ifdef VBOX_WITH_DRAG_AND_DROP
1036 VBoxC_SOURCES += \
1037 src-client/GuestDnDPrivate.cpp \
1038 src-client/GuestDnDSourceImpl.cpp \
1039 src-client/GuestDnDTargetImpl.cpp
1040endif
1041ifdef VBOX_WITH_XPCOM
1042 VBoxC_SOURCES += \
1043 src-client/xpcom/module.cpp
1044endif
1045ifdef VBOX_WITH_HGCM
1046 VBoxC_SOURCES += \
1047 src-client/HGCMObjects.cpp \
1048 src-client/HGCMThread.cpp \
1049 src-client/HGCM.cpp
1050endif
1051ifdef VBOX_WITH_USB
1052 VBoxC_SOURCES += \
1053 src-client/RemoteUSBBackend.cpp
1054endif
1055ifndef VBOX_WITH_VRDEAUTH_IN_VBOXSVC
1056 VBoxC_SOURCES += \
1057 src-all/AuthLibrary.cpp
1058endif
1059
1060$(call KB_FN_DO_PASS0_ON_TARGET,VBoxC) # Sets VBoxC_0_OUTDIR
1061
1062ifeq ($(KBUILD_TARGET),darwin)
1063 VBoxC_ORDERDEPS += $(VBoxC_0_OUTDIR)/VBoxC.def
1064 VBoxC_CLEAN += $(VBoxC_0_OUTDIR)/VBoxC.def
1065 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxC_0_OUTDIR)/VBoxC.def)
1066 $(VBoxC_0_OUTDIR)/VBoxC.def:
1067 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1068 $(RM) -f $@
1069 $(APPEND) $@ _NSGetModule
1070 $(APPEND) $@ _VBoxDriversRegister
1071endif
1072
1073src-client/ConsoleImpl.cpp_DEFS = \
1074 $(if $(VBOX_WITH_OPENSSL_FIPS), VBOX_OPENSSL_FIPS,)
1075
1076
1077src-client/win/VBoxC.rc_DEPS = $(VBoxC_0_OUTDIR)/VBoxC.rgs $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
1078VBoxC_CLEAN.win += $(VBoxC_0_OUTDIR)/VBoxC.rgs
1079$(call KB_FN_AUTO_CMD_DEPS,$(VBoxC_0_OUTDIR)/VBoxC.rgs)
1080$(VBoxC_0_OUTDIR)/VBoxC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1081 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1082 $(VBOX_XSLTPROC) \
1083 --stringparam Application VirtualBox \
1084 --stringparam Module VBoxC \
1085 -o $@ \
1086 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
1087 $(VBOX_XIDL_FILE)
1088
1089ifdef VBOX_WITH_32_ON_64_MAIN_API
1090 #
1091 # 32-bit VBox API Client In-Process module.
1092 #
1093 # This is currently just a 32-bit version of VBoxC. It might be desirable to
1094 # split up VBoxC into a simple client and a VM client part later, in which
1095 # case this module will be a simple client.
1096 #
1097 # Note! One important thing is that the typelib for this DLL must be build
1098 # with the /env win32 switch and the VBoxC typelib with /env amd64, if
1099 # not they will overwrite each others typelib module entry.
1100 #
1101 DLLS += VBoxClient-x86
1102 VBoxClient-x86_TEMPLATE = VBoxMainComp-x86
1103 VBoxClient-x86_EXTENDS = VBoxC
1104if defined(VBOX_WITH_PRECOMPILED_HEADERS) && "$(KBUILD_TARGET)" == "win" ## @todo fix inheritance (fixed in r3253)
1105 VBoxClient-x86_USES = vccprecomp
1106 VBoxClient-x86_PCH_HDR := $(PATH_SUB_CURRENT)/src-client/win/precomp_vcc.h
1107endif
1108 VBoxClient-x86_SDKS = $(filter-out VBOX_OPUS VBOX_VPX,$(VBoxC_SDKS))
1109 VBoxClient-x86_DEFS = VBOX_COM_INPROC_API_CLIENT \
1110 $(filter-out VBOX_WITH_RECORDING VBOX_WITH_LIBVPX VBOX_WITH_AUDIO_RECORDING VBOX_WITH_LIBOPUS,$(VBoxC_DEFS))
1111 VBoxClient-x86_INCS.win = \
1112 $(VBoxClient-x86_0_OUTDIR) \
1113 $(VBoxCOM-x86_0_OUTDIR) \
1114 $(VBoxC_INCS.win)
1115 VBoxClient-x86_SOURCES = \
1116 src-all/EventImpl.cpp \
1117 src-all/Global.cpp \
1118 src-all/GlobalStatusConversion.cpp \
1119 src-all/AutoCaller.cpp \
1120 src-all/ThreadTask.cpp \
1121 src-all/VirtualBoxBase.cpp \
1122 src-all/VirtualBoxErrorInfoImpl.cpp \
1123 src-client/ClientTokenHolder.cpp \
1124 src-client/SessionImpl.cpp \
1125 src-client/VirtualBoxClientImpl.cpp \
1126 $(VBOX_AUTOGEN_EVENT_CPP) \
1127 $(VBOX_XML_SCHEMADEFS_CPP)
1128 VBoxClient-x86_SOURCES.win = \
1129 src-client/win/dllmain.cpp \
1130 src-client/win/VBoxClient-x86.def \
1131 src-client/win/VBoxClient-x86.rc
1132 ifdef VBOX_WITH_XPCOM
1133 VBoxClient-x86_SOURCES += \
1134 src-client/xpcom/module.cpp
1135 endif
1136 VBoxClient-x86_LIBS = \
1137 $(PATH_STAGE_LIB)/VBoxAPIWrap-x86$(VBOX_SUFF_LIB)
1138 VBoxClient-x86_LIBS.win = $(NO_SUCH_VARIABLE)
1139 VBoxClient-x86_LIBS.win.x86 += \
1140 $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)X86_LIB)/delayimp.lib \
1141 $(PATH_SDK_$(VBOX_WINPSDK)_LIB.x86)/WbemUuid.Lib
1142 VBoxClient-x86_CLEAN.win += $(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs
1143 $(call KB_FN_DO_PASS0_ON_TARGET,VBoxClient-x86) # Sets VBoxClient-x86_0_OUTDIR
1144
1145 src-client/win/VBoxClient-x86.rc_DEPS = \
1146 $(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs \
1147 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb
1148
1149 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs)
1150 $(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs: \
1151 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
1152 $(VBOX_XIDL_FILE) | $$(dir $$@)
1153 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1154 $(VBOX_XSLTPROC) \
1155 --stringparam Application VirtualBox \
1156 --stringparam Module VBoxC \
1157 -o $@ \
1158 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
1159 $(VBOX_XIDL_FILE)
1160endif
1161
1162#
1163# The VBoxExtPackHelperApp.
1164#
1165ifdef VBOX_WITH_EXTPACK
1166 PROGRAMS += VBoxExtPackHelperApp
1167 VBoxExtPackHelperApp_TEMPLATE = VBoxR3SetUidToRoot
1168 VBoxExtPackHelperApp_LDFLAGS.darwin = -framework Security
1169 VBoxExtPackHelperApp_LDFLAGS.win = /SUBSYSTEM:windows
1170 VBoxExtPackHelperApp_SOURCES = \
1171 src-helper-apps/VBoxExtPackHelperApp.cpp \
1172 src-all/ExtPackUtil.cpp
1173 VBoxExtPackHelperApp_SOURCES.win = \
1174 src-helper-apps/VBoxExtPackHelperApp.rc
1175 VBoxExtPackHelperApp_LIBS = \
1176 $(LIB_RUNTIME)
1177endif # VBOX_WITH_EXTPACK
1178
1179#
1180# VolInfo
1181#
1182ifdef VBOX_WITH_DEVMAPPER
1183 PROGRAMS.linux += VBoxVolInfo
1184 VBoxVolInfo_TEMPLATE = VBoxR3SetUidToRoot
1185 VBoxVolInfo_SOURCES = src-helper-apps/VBoxVolInfo.cpp
1186 VBoxVolInfo_LIBS = devmapper
1187endif
1188
1189
1190endif # !defined(VBOX_ONLY_SDK) && !defined(VBOX_ONLY_EXTPACKS) (the ifndef is far above)
1191ifndef VBOX_ONLY_SDK
1192
1193
1194#
1195# VBoxCOM - COM Abstraction Layer library
1196#
1197LIBRARIES += VBoxCOM
1198VBoxCOM_TEMPLATE = VBoxMainLib
1199VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS) \
1200 $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
1201VBoxCOM_SOURCES = \
1202 glue/com.cpp \
1203 glue/VBoxLogRelCreate.cpp \
1204 glue/GetVBoxUserHomeDirectory.cpp \
1205 glue/initterm.cpp \
1206 glue/string.cpp \
1207 glue/AutoLock.cpp \
1208 glue/EventQueue.cpp \
1209 glue/NativeEventQueue.cpp \
1210 glue/ErrorInfo.cpp \
1211 glue/errorprint.cpp
1212VBoxCOM_INCS += $(VBOX_MAIN_APIWRAPPER_INCS) \
1213 include
1214ifeq ($(KBUILD_TARGET),win)
1215 ifdef VBOX_WITH_MIDL_PROXY_STUB
1216 VBoxCOM_DEFS.win = VBOX_WITH_AUTO_COM_REG_UPDATE
1217 endif
1218 VBoxCOM_DEFS.x86 = _WIN32_WINNT=0x0500
1219 VBoxCOM_DEFS.amd64 = _WIN32_WINNT=0x0510
1220 VBoxCOM_SOURCES += \
1221 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c
1222 VBoxCOM_CLEAN = \
1223 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
1224 $(VBoxCOM_0_OUTDIR)/VirtualBox_p.c \
1225 $(VBoxCOM_0_OUTDIR)/dlldata.c \
1226 $(VBoxCOM_0_OUTDIR)/VirtualBox.h \
1227 $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
1228 VBoxCOM_CLEAN += \
1229 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c \
1230 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c \
1231 $(VBoxCOM_0_OUTDIR)/legacy/dlldata.c \
1232 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.h \
1233 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.tlb
1234 VBoxCOM_BLDDIRS = $(VBoxCOM_0_OUTDIR)/legacy/
1235else # !win
1236 VBoxCOM_SOURCES += \
1237 $(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c \
1238 glue/xpcom/helpers.cpp
1239endif # !win
1240
1241glue/VBoxLogRelCreate.cpp_DEFS = KBUILD_TYPE=\"$(KBUILD_TYPE)\"
1242
1243# 32-bit version of VBoxCOM.
1244if defined(VBOX_WITH_32_ON_64_MAIN_API) && !defined(VBOX_ONLY_EXTPACKS)
1245 LIBRARIES += VBoxCOM-x86
1246 VBoxCOM-x86_TEMPLATE = VBoxMainLib-x86
1247 VBoxCOM-x86_EXTENDS = VBoxCOM
1248 ifeq ($(KBUILD_TARGET),win)
1249 VBoxCOM-x86_CLEAN = \
1250 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \
1251 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c \
1252 $(VBoxCOM-x86_0_OUTDIR)/dlldata.c \
1253 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h \
1254 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox.tlb
1255 endif
1256endif
1257
1258# -MD version for the GUI in -MDd builds.
1259ifeq ($(KBUILD_TARGET).$(VBOX_VCC_CRT_TYPE),win.d)
1260 ifndef VBOX_ONLY_EXTPACKS
1261 LIBRARIES += VBoxCOM-GUI
1262 USES += qt5
1263 VBoxCOM-GUI_TEMPLATE = VBOXQTGUI$(if-expr defined(VBOX_WITH_HARDENING),,EXE)
1264 VBoxCOM-GUI_EXTENDS = VBoxCOM
1265 endif
1266endif
1267
1268endif # !VBOX_ONLY_SDK
1269
1270
1271#
1272# Installs com related thing(s) to bin.
1273#
1274INSTALLS.win += VBoxMain-com-inst
1275VBoxMain-com-inst_INST = $(INST_BIN)
1276VBoxMain-com-inst_MODE = a+r,u+w
1277VBoxMain-com-inst_SOURCES = src-all/win/comregister.cmd
1278
1279
1280if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "linux" && !defined(VBOX_ONLY_EXTPACKS)
1281 #
1282 # Installs linux/hardening related things to components.
1283 #
1284 INSTALLS.linux += VBoxMain-hardening-inst
1285 VBoxMain-hardening-inst_INST = $(INST_BIN)components/
1286 VBoxMain-hardening-inst_SYMLINKS = \
1287 VBoxDDU.so=>../VBoxDDU.so \
1288 VBoxREM.so=>../VBoxREM.so \
1289 VBoxRT.so=>../VBoxRT.so \
1290 VBoxVMM.so=>../VBoxVMM.so \
1291 VBoxXPCOM.so=>../VBoxXPCOM.so
1292endif
1293
1294
1295if defined(VBOX_WITH_MIDL_PROXY_STUB) && "$(KBUILD_TARGET)" == "win" && !defined(VBOX_ONLY_EXTPACKS)
1296 #
1297 # Experimental COM proxy + stub DLL w/ automatic registration updating.
1298 #
1299 # The Legacy stub is for older 64-bit windows versions (pre Windows 7) as we
1300 # were having various problems on windows server 2003 and 2008 with the code
1301 # MIDL generated. Also, in windows 7 there are some potentially interesting
1302 # changes in the generated code where it uses new helpers from OLE32.
1303 #
1304 DLLS += VBoxProxyStub
1305 VBoxProxyStub_TEMPLATE = VBOXMAINCOMP
1306 VBoxProxyStub_DEFS = REGISTER_PROXY_DLL PROXY_CLSID_IS="$(VBOX_MIDL_PROXY_CLSID_IS)" \
1307 $(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,)\
1308 $(if $(VBOX_WITH_SDS_CLIENT_WATCHER),VBOX_WITH_SDS_CLIENT_WATCHER,)
1309 VBoxProxyStub_DEFS.win.x86 = WIN32
1310 VBoxProxyStub_SDKS = VBOX_NTDLL
1311 VBoxProxyStub_DEFPATH = $(VBoxCOM_0_OUTDIR)/# Hack to workaround drive letter in $(VBoxCOM_0_OUTDIR)/ for CFLAGS hack below.
1312 VBoxProxyStub_INCS = $(VBoxCOM_0_OUTDIR)/
1313 VBoxProxyStub_SOURCES := \
1314 VirtualBox_p.c \
1315 VirtualBox_i.c \
1316 $(PATH_SUB_CURRENT)/src-all/win/VBoxProxyStub.def \
1317 $(PATH_SUB_CURRENT)/src-all/win/VBoxProxyStub.rc \
1318 $(PATH_SUB_CURRENT)/src-all/win/VBoxProxyStub.c
1319 src-all/win/VBoxProxyStub.rc_DEPS = $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
1320 VBoxProxyStub_VirtualBox_p.c_CFLAGS.x86 = /Gz # Workaround for incorrect ObjectStublessClient* prototypes in SDK v7.1.
1321
1322 DLLS += VBoxProxyStubLegacy
1323 VBoxProxyStubLegacy_TEMPLATE = VBOXMAINCOMP
1324 VBoxProxyStubLegacy_EXTENDS = VBoxProxyStub
1325 VBoxProxyStubLegacy_DEFS = $(VBoxProxyStub_DEFS) VBOX_IN_PROXY_STUB_LEGACY
1326 VBoxProxyStubLegacy_INCS = $(VBoxCOM_0_OUTDIR)/legacy/
1327 VBoxProxyStubLegacy_SOURCES = \
1328 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c \
1329 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c \
1330 src-all/win/VBoxProxyStub.def \
1331 src-all/win/VBoxProxyStubLegacy.rc \
1332 src-all/win/VBoxProxyStub.c
1333 src-all/win/VBoxProxyStubLegacy.rc_DEPS = $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.tlb
1334
1335 ifdef VBOX_WITH_32_ON_64_MAIN_API
1336 DLLS += VBoxProxyStub-x86
1337 VBoxProxyStub-x86_TEMPLATE = VBoxMainComp-x86
1338 VBoxProxyStub-x86_SDKS = VBOX_NTDLL
1339 VBoxProxyStub-x86_DEFS = $(VBoxProxyStub_DEFS) VBOX_PROXY_STUB_32_ON_64 WIN32
1340 VBoxProxyStub-x86_INCS = $(VBoxCOM-x86_0_OUTDIR)/
1341 VBoxProxyStub-x86_SOURCES = \
1342 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c \
1343 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \
1344 src-all/win/VBoxProxyStub.c \
1345 src-all/win/VBoxProxyStub-x86.rc \
1346 src-all/win/VBoxProxyStub.def
1347 src-all/win/VBoxProxyStub-x86.rc_DEPS = $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb
1348 endif
1349endif
1350
1351
1352
1353# generate rules
1354include $(FILE_KBUILD_SUB_FOOTER)
1355
1356
1357
1358#
1359# Additions rules.
1360#
1361
1362## @todo this hack ain't cutting it any longer. (the file name is abspath'ed since ages now.)
1363glue/xpcom/helpers.cpp: $(VBOX_IDL_TYPELIB.XPCOM)
1364
1365$(call KB_FN_AUTO_CMD_DEPS_EX,$(VBOX_IDL_FILE.XPCOM),$(PATH_OUT)/VBOX_IDL_FILE.XPCOM.vbox-dep)
1366$(VBOX_IDL_FILE.XPCOM): $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1367 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS_EX,$(PATH_OUT)/VBOX_IDL_FILE.XPCOM.vbox-dep)
1368 $(call MSG_TOOL,xsltproc,VBoxSVC,$(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl,$@)
1369 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE)
1370
1371$(call KB_FN_AUTO_CMD_DEPS_EX,$(VBOX_IDL_TYPELIB.XPCOM),$(PATH_OUT)/VBOX_IDL_TYPELIB.XPCOM.vbox-dep)
1372$(VBOX_IDL_TYPELIB.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
1373 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS_EX,$(PATH_OUT)/VBOX_IDL_TYPELIB.XPCOM.vbox-dep)
1374 $(call MSG_TOOL,xpidl,VBoxSVC,$(VBOX_IDL_FILE.XPCOM),$@)
1375 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $(VBOX_IDL_FILE.XPCOM)
1376 $(CHMOD) 0644 $@
1377## @todo ^^^^^^^^^^^^ fix horrible hack
1378
1379$(call KB_FN_AUTO_CMD_DEPS_EX,$(VBOX_IDL_HEADER.XPCOM),$(PATH_OUT)/VBOX_IDL_HEADER.XPCOM.vbox-dep)
1380$(VBOX_IDL_HEADER.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
1381 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS_EX,$(PATH_OUT)/VBOX_IDL_HEADER.XPCOM.vbox-dep)
1382 $(call MSG_TOOL,xpidl,VBoxSVC,$(VBOX_IDL_FILE.XPCOM),$@)
1383 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $(VBOX_IDL_FILE.XPCOM)
1384
1385$(call KB_FN_AUTO_CMD_DEPS_EX,$(VBOX_IDL_FILE.MSCOM),$(PATH_OUT)/VBOX_IDL_FILE.MSCOM.vbox-dep)
1386$(VBOX_IDL_FILE.MSCOM): $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1387 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS_EX,$(PATH_OUT)/VBOX_IDL_FILE.MSCOM.vbox-dep)
1388 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
1389 $(QUIET)$(VBOX_XSLTPROC) -o $@ \
1390 $(if $(VBOX_WITH_MIDL_PROXY_STUB),-stringparam g_fGenProxy yes,) \
1391 $(if $(VBOX_WITH_SDS),-stringparam g_fVBoxWithSDS yes,) \
1392 $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE)
1393
1394
1395# Aliases for testing purposes.
1396ifdef VBOX_WITH_XPCOM
1397testidl: $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM) $(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c
1398testidlhdr: $(VBOX_IDL_HEADER.XPCOM)
1399else
1400testidl: $(VBOX_IDL_FILE.MSCOM) $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
1401 $(if $(VBOX_WITH_32_ON_64_MAIN_API),$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c,)
1402endif
1403
1404
1405$(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c: $(VBOX_PATH_MAIN_SRC)/idl/xpidl_iid.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1406 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
1407 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
1408
1409##
1410# Edits $1 and adding #pragma directives for disabling warnings windows.h causes.
1411# @param 1 The name of the file to edit.
1412define def_VBoxMainDisableMscWarnings
1413 $(QUIET)$(MV) -f "$1" "$1.tmp"
1414 $(QUIET)$(APPEND) -nt "$1" \
1415 '#pragma warning(push) /* -Wall and windows.h */' \
1416 '#pragma warning(disable:4668 4255)' \
1417 '#if _MSC_VER >= 1800 /* RT_MSC_VER_VC120 */' \
1418 '# pragma warning(disable:4005)' \
1419 '#endif' \
1420 ''
1421 $(QUIET)$(CAT_EXT) "$1.tmp" >> "$1"
1422 $(QUIET)$(APPEND) -n "$1" \
1423 '' \
1424 '#pragma warning(pop)' \
1425 ''
1426 $(QUIET)$(RM) -f "$1.tmp"
1427
1428endef
1429
1430# Note! Because we've got a different proxy stub DLL for pre windows 7 64-bit hosts, we target windows 7 for AMD64.
1431# The output is different and hopefully more efficient, at least memory wise (using more helpers in OLE32).
1432# Note! We're checking for win.amd64 below when setting the target because of the SDK build which happens on linux.amd64
1433# but with a 32-bit Wine.
1434$(call KB_FN_AUTO_CMD_DEPS,$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c)
1435$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
1436$(if $(VBOX_WITH_MIDL_PROXY_STUB), + $(VBoxCOM_0_OUTDIR)/VirtualBox_p.c + $(VBoxCOM_0_OUTDIR)/dlldata.c,) \
1437+ $(VBoxCOM_0_OUTDIR)/VirtualBox.h \
1438+ $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
1439 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1440 $(VBOX_WIN_MIDL) /nologo /W4 \
1441 /env $(if-expr "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.amd64" ,amd64,win32) \
1442 /robust /protocol all /target $(if-expr defined(VBOX_WITH_MIDL_PROXY_STUB),NT61,NT51) \
1443 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM_0_OUTDIR)) \
1444 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
1445 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_$(VBOX_WINPSDK)_INC)) \
1446 /I idl \
1447 $(call VBOX_FN_MAKE_WIN_PATH,$(VBOX_IDL_FILE.MSCOM))
1448 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox.h)
1449 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c)
1450 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox_p.c)
1451
1452if defined(VBOX_WITH_MIDL_PROXY_STUB)
1453# -Windows Server 2003 AMD64 SP1 does not like the result when using '/protocol all' and '/target NT51'.
1454# -Vista AMD64 SP1 and Windows Server 2008 AMD64 seems to have some objections as well, but it seemed
1455# that using an older MIDL compiler (v7.00.0499 instead of v7.00.0555) helps. But the W2K3 fix also works.
1456# To avoid 32-bit vs. 64-bit differences, we do the same for 32-bit windows versions.
1457$(call KB_FN_AUTO_CMD_DEPS,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c)
1458$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c \
1459+ $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c\
1460+ $(VBoxCOM_0_OUTDIR)/legacy/dlldata.c \
1461+ $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.h \
1462+ $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
1463 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1464 $(VBOX_WIN_MIDL) /nologo /W4 \
1465 $(if-expr "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.amd64" \
1466 ,/env amd64 /x64 /target NT50 /robust \
1467 ,/env win32 /target NT51 /robust /protocol all ) \
1468 /out $(call VBOX_FN_MAKE_WIN_PATH,$(dir $@)) \
1469 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
1470 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_$(VBOX_WINPSDK)_INC)) \
1471 /I idl \
1472 $(call VBOX_FN_MAKE_WIN_PATH,$(VBOX_IDL_FILE.MSCOM))
1473 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.h)
1474 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c)
1475 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c)
1476endif
1477
1478# The XP targetted 32-bit proxy stub works with all versions of windows (the
1479# issues leading to the VBoxProxyStubLegacy.dll are only on 64-bit windows).
1480$(call KB_FN_AUTO_CMD_DEPS,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c)
1481$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \
1482$(if $(VBOX_WITH_MIDL_PROXY_STUB), + $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c + $(VBoxCOM-x86_0_OUTDIR)/dlldata.c,) \
1483+ $(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h \
1484+ $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
1485 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1486 $(VBOX_WIN_MIDL) /nologo /W4 \
1487 /env win32 /target NT51 /robust /protocol all \
1488 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM-x86_0_OUTDIR)) \
1489 /tlb $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb) \
1490 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL_STEM)X86_CC))) \
1491 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_$(VBOX_WINPSDK)_INC)) \
1492 /I idl \
1493 $(call VBOX_FN_MAKE_WIN_PATH,$(VBOX_IDL_FILE.MSCOM))
1494 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h)
1495 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c)
1496 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c)
1497
1498#
1499# Translation stuff
1500#
1501VBoxSVC_VBOX_HEADERS = \
1502 include/collection.h \
1503 include/MachineImpl.h
1504VBoxSVC_VBOX_TRANSLATIONS = \
1505 nls/VBoxSVC_de.ts
1506
1507VBoxC_VBOX_HEADERS = \
1508 include/ConsoleImpl.h
1509
1510VBoxC_VBOX_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
1511VBoxC_VBOX_HEADERS += $(VBOX_MAIN_APIWRAPPER_INCS)
1512
1513VBoxC_VBOX_TRANSLATIONS = \
1514 nls/VBoxC_de.ts
1515
1516ifdef VBOX_WITH_JMSCOM
1517
1518 #
1519 # Java glue JAR files
1520 #
1521 VBOX_JMSCOM_JAR = $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar
1522 VBOX_JMSCOM_TARGET := $(PATH_TARGET)/vboxjmscom-gen
1523 VBOX_JMSCOM_GEN = $(VBOX_JMSCOM_TARGET)/jmscomgen
1524 VBOX_JMSCOM_JDEST := $(VBOX_JMSCOM_TARGET)/jdest
1525 VBOX_GLUE_XSLT_DIR := $(PATH_ROOT)/src/VBox/Main/glue
1526 VBOX_JACOB_DIR := $(PATH_ROOT)/src/libs/jacob-1.17
1527
1528 INSTALLS += VBoxJMscom-inst-jar
1529 VBoxJMscom-inst-jar_INST = $(INST_SDK)bindings/mscom/java/
1530 VBoxJMscom-inst-jar_MODE = a+r,u+w
1531 VBoxJMscom-inst-jar_SOURCES = \
1532 $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar
1533 VBoxJMscom-inst-jar_CLEAN = \
1534 $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar \
1535 $(VBOX_JMSCOM_GEN)/jmscomglue.list \
1536 $(wildcard \
1537 $(VBOX_JMSCOM_GEN)/java/*.java \
1538 $(VBOX_JMSCOM_JDEST)/*.class \
1539 $(VBOX_JMSCOM_JDEST)/*/*.class \
1540 $(VBOX_JMSCOM_JDEST)/*/*/*.class \
1541 $(VBOX_JMSCOM_JDEST)/*/*/*/*.class \
1542 )
1543 VBoxJMscom-inst-jar_BLDDIRS += $(VBOX_JMSCOM_GEN)/java
1544 $(call KB_FN_DO_PASS0_ON_TARGET,VBoxJMscom-inst-jar) # Sets VBoxJMscom-inst-jar_0_OUTDIR
1545
1546 $(call KB_FN_AUTO_CMD_DEPS,$(VBOX_JMSCOM_GEN)/jmscomglue.list)
1547 $(VBOX_JMSCOM_GEN)/jmscomglue.list: \
1548 $(VBOX_XIDL_FILE) \
1549 $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl \
1550 $(VBOX_FILESPLIT) \
1551 | $(VBOX_JMSCOM_GEN)/java/
1552 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1553 $(call MSG_L1,Generating Java MSCOM glue files from XIDL)
1554 $(QUIET)$(RM) -f $(wildcard $(VBOX_JMSCOM_GEN)/java/*.java)
1555 $(QUIET)$(VBOX_XSLTPROC) \
1556 --stringparam filelistonly "" \
1557 --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \
1558 --stringparam G_vboxGlueStyle mscom \
1559 --stringparam G_vboxDirPrefix "" \
1560 -o $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $(VBOX_XIDL_FILE)
1561 $(QUIET)$(VBOX_FILESPLIT) $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_JMSCOM_GEN)/java
1562 $(QUIET)echo $(VBOX_JMSCOM_GEN)/java/*.java > $@
1563
1564 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar)
1565 $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar: $(VBOX_JMSCOM_GEN)/jmscomglue.list | $$(dir $$@)
1566 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1567 $(call MSG_TOOL,javac,$(notdir $@),jmscomglue.list,)
1568 $(QUIET)$(RM) -Rf $(VBOX_JMSCOM_JDEST)
1569 $(QUIET)$(MKDIR) -p $(VBOX_JMSCOM_JDEST)
1570 $(call MSG_TOOL,javac,$(notdir $@),...,)
1571 $(QUIET)$(VBOX_JAVAC) $(VBOX_JAVAC_OPTS) @$(VBOX_JMSCOM_GEN)/jmscomglue.list \
1572 -d $(VBOX_JMSCOM_JDEST) -classpath "$(VBOX_JMSCOM_JDEST)$(VBOX_SEP)$(VBOX_JACOB_DIR)/jacob.jar"
1573 $(call MSG_LINK,$(notdir $@),$@)
1574 $(QUIET)$(VBOX_JAR) cf $@ -C $(VBOX_JMSCOM_JDEST) .
1575
1576 ## @todo compile TestVBox.java (see below) to have sanity checking
1577endif # VBOX_WITH_JMSCOM
1578
1579#
1580# Install Java glue sample code.
1581#
1582INSTALLS += javagluesample
1583javagluesample_INST = $(INST_SDK)bindings/glue/java/
1584javagluesample_MODE = a+r,u+w
1585javagluesample_SOURCES = \
1586 $(VBOX_PATH_MAIN_SRC)/glue/tests/TestVBox.java=>TestVBox.java \
1587 $(VBOX_PATH_MAIN_SRC)/glue/tests/Makefile=>Makefile
1588
1589#
1590# Rules associated with VBoxAPIWrap (in typical invocation order).
1591# We keep them down here to simplify the use of VBoxAPIWrap_0_OUTDIR.
1592#
1593
1594# Generate a make include file which lists the wrapper header and source files.
1595$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_VBOX_KMK_FILE).ts)
1596$(VBoxAPIWrap_VBOX_KMK_FILE).ts \
1597+| $(VBoxAPIWrap_VBOX_KMK_FILE): \
1598 $(VBOX_XIDL_FILE) \
1599 $(VBOX_PATH_MAIN_SRC)/idl/apiwrap-server-filelist.xsl \
1600 $(VBOX_PATH_MAIN_SRC)/Makefile.kmk
1601 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1602 $(call MSG_GENERATE,,$(VBoxAPIWrap_VBOX_KMK_FILE))
1603 $(QUIET)$(RM) -f $@
1604 $(QUIET)$(MKDIR) -p $(@D)
1605 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1606 $(if $(VBOX_WITH_SDS),-stringparam g_fVBoxWithSDS yes,) \
1607 -o $@ $(VBOX_PATH_MAIN_SRC)/idl/apiwrap-server-filelist.xsl $(VBOX_XIDL_FILE)
1608 $(QUIET)$(CP) --changed -fv $@ $(VBoxAPIWrap_VBOX_KMK_FILE)
1609
1610# Generate the header files for the wrappers.
1611$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers)
1612$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers \
1613+| $(VBOX_MAIN_APIWRAPPER_GEN_HDRS): \
1614 $(VBOX_XIDL_FILE) \
1615 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1616 $(VBoxAPIWrap_VBOX_XSLT) \
1617 $(VBOX_FILESPLIT) \
1618 | $$(dir $$@)
1619 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1620 $(call MSG_L1,Generating C++ Server API wrapper header files from XIDL)
1621 $(QUIET)$(RM) -f -- $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_HDRS), $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.h))
1622 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1623 --stringparam generating "headers" \
1624 -o $@ $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_XIDL_FILE)
1625 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
1626
1627# Generate the DTrace probes for the wrappers and combine them with handcoded probes.
1628$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts)
1629$(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts \
1630+| $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d: \
1631 $(VBOX_XIDL_FILE) \
1632 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1633 $(VBoxAPIWrap_VBOX_XSLT) \
1634 $(VBOX_FILESPLIT) \
1635 | $$(dir $$@)
1636 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1637 $(call MSG_L1,Generating DTrace Provider for the VBox API (from XIDL))
1638 $(QUIET)$(RM) -f -- "$@" "[email protected]"
1639 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1640 --stringparam generating "dtrace-probes" \
1641 -o "$@" $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_XIDL_FILE)
1642 $(QUIET)$(SED) -e '' -o "[email protected]" \
1643 "$(VBOX_PATH_MAIN_SRC)/src-all/VBoxAPI-start$(if-expr "$(VBOX_HOST_DTRACE_VERSION)" == "dtrace: Sun D 1.6.2",-alternative,).d" \
1644 "$@" \
1645 "$(VBOX_PATH_MAIN_SRC)/src-all/VBoxAPI-end$(if-expr "$(VBOX_HOST_DTRACE_VERSION)" == "dtrace: Sun D 1.6.2",-alternative,).d"
1646 $(QUIET)$(MV) -- "[email protected]" "$@"
1647 $(QUIET)$(CP) --changed -fv -- "$@" "$(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d"
1648
1649# Generate the wrapper source files - split in two due to long processing time
1650$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-even)
1651$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-even \
1652+| $(VBOX_MAIN_APIWRAPPER_GEN_SRCS_EVEN): \
1653 $(VBOX_XIDL_FILE) \
1654 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1655 $(VBoxAPIWrap_VBOX_XSLT) \
1656 $(VBOX_FILESPLIT) \
1657 | $$(dir $$@)
1658 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1659 $(call MSG_L1,Generating C++ Server API wrapper files from XIDL - part 1)
1660 $(QUIET)$(RM) -f -- $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_SRCS), $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp))
1661 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1662 --stringparam generating "sources" \
1663 --param reminder 0 \
1664 -o $@ $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_XIDL_FILE)
1665 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
1666
1667$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-odd)
1668$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-odd \
1669+| $(VBOX_MAIN_APIWRAPPER_GEN_SRCS_ODD): \
1670 $(VBOX_XIDL_FILE) \
1671 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1672 $(VBoxAPIWrap_VBOX_XSLT) \
1673 $(VBOX_FILESPLIT) \
1674 | $$(dir $$@)
1675 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1676 $(call MSG_L1,Generating C++ Server API wrapper files from XIDL - part 2)
1677 $(QUIET)$(RM) -f -- $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_SRCS), $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp))
1678 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1679 --stringparam generating "sources" \
1680 --param reminder 1 \
1681 -o $@ $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_XIDL_FILE)
1682 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
1683
1684testapiwrappers:: \
1685 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers \
1686 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts \
1687 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-odd \
1688 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-even
1689
1690
1691#
1692# NLS stuff.
1693#
1694updatenls::
1695 $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_VBOX_HEADERS) -ts $(VBoxSVC_VBOX_TRANSLATIONS)
1696 $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_VBOX_HEADERS) -ts $(VBoxC_VBOX_TRANSLATIONS)
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