VirtualBox

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

Last change on this file since 79849 was 79761, checked in by vboxsync, 5 years ago

Main/DHCPServer,Dhcpd,VBoxManage: Added --log option to the DHCP server so we can start logging early. Added log rotation and limits. Put the config file next to the log and leases file. Validate DHCP options by reusing the parser code from the server, adding a bunch more DHCP options to the parser. Removed legacy and hardcoded configuration options from the dhcp server, it's all config file now. Fixed a bug in the option parsing of the VBoxManage dhcpserver add/modify commands. bugref:9288

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