VirtualBox

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

Last change on this file since 91312 was 91312, checked in by vboxsync, 3 years ago

Main: bugref:1909: Prepared the API translation engine to using in ExtPacks and VBoxManage. Added using API translation engine in ExtPacks. Allowed VBox compilation with NLS enabled and GUI disabled. Allowed ExtPacks only compilation with NLS translation enabled.

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