VirtualBox

source: vbox/trunk/src/libs/xpcom18a4/Makefile.kmk@ 103300

Last change on this file since 103300 was 103300, checked in by vboxsync, 10 months ago

libs/xpcom,Main: Disabled code to move VBoxXPCOMIPCD into VBoxSVC, bugref:10594

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 36.1 KB
Line 
1# $Id: Makefile.kmk 103300 2024-02-11 20:33:57Z vboxsync $
2## @file
3# Sub-Makefile for XPCOM.
4#
5
6#
7# Copyright (C) 2006-2023 Oracle and/or its affiliates.
8#
9# This file is part of VirtualBox base platform packages, as
10# available from https://www.virtualbox.org.
11#
12# This program is free software; you can redistribute it and/or
13# modify it under the terms of the GNU General Public License
14# as published by the Free Software Foundation, in version 3 of the
15# License.
16#
17# This program is distributed in the hope that it will be useful, but
18# WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20# General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, see <https://www.gnu.org/licenses>.
24#
25# SPDX-License-Identifier: GPL-3.0-only
26#
27
28SUB_DEPTH = ../../..
29include $(KBUILD_PATH)/subheader.kmk
30
31# Make sure our Config.kmk is included.
32ifndef VBOX_PATH_XPCOM_SRC
33 include $(PATH_SUB_CURRENT)/Config.kmk
34endif
35
36#
37# Globals
38#
39
40# File for filtering out C symbols from the XPCOM library. Used to avoid
41# symbol namespace pollution, causing trouble with system libraries.
42XPCOM_C_NAMESPACE_MAP = $(VBOX_PATH_XPCOM_SRC)/xpcom-namespace-cleanup.map
43ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
44 # At the moment, only Solaris uses the generated map file. GNU ld is smart
45 # enough to handle symbol wildcards itself.
46 if1of ($(KBUILD_TARGET), solaris)
47 XPCOM_C_NAMESPACE_MAP = $(PATH_TARGET)/xpcom-namespace-cleanup.map
48 OTHER_CLEAN += $(XPCOM_C_NAMESPACE_MAP)
49 endif
50endif
51
52# @todo check whether VBoxXPCOMIPCC.so or VBoxXPCOMIPCD contain undefined
53# symbols starting with NS_, PL_, PR_ or XPT. Would move the test time failure
54# when missing a symbol renaming to a build time failure. Likewise, there
55# should be a check whether VBoxXPCOM.so contains global C symbols (at least
56# where the whitelisting of symbols via the map file is not used).
57
58#
59# Header installs.
60#
61INSTALLS += \
62 NSPRPUB-HEADERS \
63 STRING-HEADERS \
64 XPCOM-HEADERS \
65 IPCD-HEADERS
66
67#
68# The IDL compiler, typelib linker and xpt files.
69#
70BLDPROGS += \
71 xpidl \
72 xpt_link
73
74BLDDIRS += \
75 $(PATH_TARGET)/VBox-xpcom-xpt-files/
76
77#
78# Always build the VBoxXPCOM import library.
79#
80IMPORT_LIBS += VBoxXPCOMImp
81
82#
83# We build several libraries so that any linker command line
84# length restrictions limit will be avoided. (Solaris, Mac?)
85#
86if !defined(VBOX_ONLY_SDK) && (!defined(VBOX_ONLY_EXTPACKS) || !defined(VBOX_ONLY_EXTPACKS_USE_IMPLIBS))
87
88 VBOX_XPCOM_LIBRARIES := \
89 VBox-xpcom-nspr \
90 VBox-xpcom-typelib \
91 VBox-xpcom-string \
92 VBox-xpcom-base \
93 VBox-xpcom-ds \
94 VBox-xpcom-io \
95 VBox-xpcom-components \
96 VBox-xpcom-threads \
97 VBox-xpcom-xptinfo \
98 VBox-xpcom-xptcall \
99 VBox-xpcom-proxy \
100 VBox-xpcom-ipcshared \
101 VBoxXPCOMGlue_s \
102 $(if $(VBOX_WITH_XPCOM_GLUE_WHICH_IS_UNUSED),VBoxXPCOMGlue,)
103 LIBRARIES += $(VBOX_XPCOM_LIBRARIES)
104
105 VBOX_XPCOM_DLLS := \
106 VBoxXPCOM \
107 VBoxXPCOMIPCC
108 ifdef VBOX_WITH_XPCOMIPCD_IN_VBOX_SVC
109 VBOX_XPCOM_DLLS += \
110 VBoxXPCOMIPCD
111 endif
112
113 DLLS += $(VBOX_XPCOM_DLLS)
114
115 ifdef VBOX_WITH_32_ON_64_MAIN_API
116 LIBRARIES += $(addsuffix -x86,$(VBOX_XPCOM_LIBRARIES))
117 DLLS += $(addsuffix -x86,$(VBOX_XPCOM_DLLS))
118 endif
119
120
121 ifdef VBOX_WITH_TESTCASES
122 PROGRAMS += \
123 tstnsIFileTest \
124 tstTestArray \
125 tstTestAutoLock \
126 tstTestCOMPtr \
127 tstTestCOMPtrEq \
128 tstTestCRT \
129 tstTestFactory \
130 tstTestHashtables \
131 tstTestID \
132 tstTestObserverService \
133 tstTestXPIDLString \
134 tstTestXPTCInvoke \
135 tstTestDeque \
136 tstTestAutoPtr \
137 tstTestMinStringAPI \
138 tstTestStrings \
139 tstPrimitiveTest
140 endif # VBOX_WITH_TESTCASES
141 ifndef VBOX_WITH_XPCOMIPCD_IN_VBOX_SVC
142 PROGRAMS += VBoxXPCOMIPCD
143 endif
144
145endif # !VBOX_ONLY_SDK && (!defined(VBOX_ONLY_EXTPACKS) || !defined(VBOX_ONLY_EXTPACKS_USE_IMPLIBS))
146
147
148
149
150#
151# SDK headers - lot's of files to install...
152#
153# Tip: If you are going to remove files here, you might
154# wish to do a `kmk uninstall' first to avoid have
155# obsoleted files in the $(INST_SDK) directory.
156#
157NSPRPUB-HEADERS_INST = $(INST_SDK)bindings/xpcom/include/nsprpub/
158NSPRPUB-HEADERS_IFFLAGS = -m 644
159NSPRPUB-HEADERS_SOURCES = \
160 nsprpub/pr/include/nspr.h \
161 nsprpub/lib/ds/plarena.h \
162 nsprpub/lib/ds/plarenas.h \
163 nsprpub/lib/ds/plhash.h \
164 nsprpub/pr/include/prbit.h \
165 nsprpub/pr/include/prlong.h \
166 nsprpub/pr/include/prmem.h \
167 nsprpub/pr/include/prmon.h \
168 nsprpub/pr/include/prtime.h \
169 nsprpub/pr/include/prtypes.h \
170 nsprpub/pr/include/md/_vbox.cfg=>prcpucfg.h
171
172STRING-HEADERS_INST = $(INST_SDK)bindings/xpcom/include/string/
173STRING-HEADERS_IFFLAGS = -m 644
174STRING-HEADERS_SOURCES = \
175 xpcom/string/public/nsAString.h \
176 xpcom/string/public/nsAlgorithm.h \
177 xpcom/string/public/nsCharTraits.h \
178 xpcom/string/public/nsDependentString.h \
179 xpcom/string/public/nsDependentSubstring.h \
180 xpcom/string/public/nsEmbedString.h \
181 xpcom/string/public/nsLiteralString.h \
182 xpcom/string/public/nsObsoleteAString.h \
183 xpcom/string/public/nsPrintfCString.h \
184 xpcom/string/public/nsPromiseFlatString.h \
185 xpcom/string/public/nsReadableUtils.h \
186 xpcom/string/public/nsString.h \
187 xpcom/string/public/nsStringAPI.h \
188 xpcom/string/public/nsStringFwd.h \
189 xpcom/string/public/nsStringIterator.h \
190 xpcom/string/public/nsSubstring.h \
191 xpcom/string/public/nsSubstringTuple.h \
192 xpcom/string/public/nsTAString.h \
193 xpcom/string/public/nsTDependentString.h \
194 xpcom/string/public/nsTDependentSubstring.h \
195 xpcom/string/public/nsTObsoleteAString.h \
196 xpcom/string/public/nsTPromiseFlatString.h \
197 xpcom/string/public/nsTString.h \
198 xpcom/string/public/nsTSubstring.h \
199 xpcom/string/public/nsTSubstringTuple.h \
200 xpcom/string/public/nsUTF8Utils.h \
201 xpcom/string/public/nsXPIDLString.h \
202 xpcom/string/public/string-template-def-char.h \
203 xpcom/string/public/string-template-def-unichar.h \
204 xpcom/string/public/string-template-undef.h
205
206XPCOM-HEADERS_INST = $(INST_SDK)bindings/xpcom/include/xpcom/
207XPCOM-HEADERS_IFFLAGS = -m 644
208XPCOM-HEADERS_SOURCES = \
209 xpcom/base/nsAgg.h \
210 xpcom/io/nsAppDirectoryServiceDefs.h \
211 xpcom/ds/nsArray.h \
212 xpcom/ds/nsArrayEnumerator.h \
213 xpcom/ds/nsAtomService.h \
214 xpcom/threads/nsAutoLock.h \
215 xpcom/base/nsAutoPtr.h \
216 xpcom/ds/nsBaseHashtable.h \
217 xpcom/ds/nsCOMArray.h \
218 xpcom/ds/nsCRT.h \
219 xpcom/components/nsCategoryManagerUtils.h \
220 xpcom/ds/nsClassHashtable.h \
221 xpcom/components/nsComponentManagerObsolete.h \
222 xpcom/components/nsComponentManagerUtils.h \
223 xpcom/ds/nsDataHashtable.h \
224 xpcom/base/nsDebugImpl.h \
225 xpcom/ds/nsDeque.h \
226 xpcom/io/nsDirectoryService.h \
227 xpcom/io/nsDirectoryServiceDefs.h \
228 xpcom/io/nsDirectoryServiceUtils.h \
229 xpcom/ds/nsDoubleHashtable.h \
230 xpcom/ds/nsEnumeratorUtils.h \
231 xpcom/base/nsError.h \
232 xpcom/threads/nsEventQueueUtils.h \
233 xpcom/ds/nsHashKeys.h \
234 xpcom/ds/nsHashSets.h \
235 xpcom/ds/nsHashtable.h \
236 xpcom/base/nsID.h \
237 xpcom/base/nsIID.h \
238 xpcom/components/nsIServiceManagerObsolete.h \
239 xpcom/components/nsIServiceManagerUtils.h \
240 xpcom/base/nsISupportsBase.h \
241 xpcom/ds/nsInt64.h \
242 xpcom/ds/nsInterfaceHashtable.h \
243 xpcom/io/nsLocalFile.h \
244 xpcom/io/nsLocalFileUnix.h \
245 xpcom/components/nsModule.h \
246 xpcom/io/nsNativeCharsetUtils.h \
247 xpcom/components/nsNativeComponentLoader.h \
248 xpcom/ds/nsObserverService.h \
249 xpcom/components/nsObsoleteModuleLoading.h \
250 xpcom/proxy/public/nsProxiedService.h \
251 xpcom/proxy/public/nsProxyEvent.h \
252 xpcom/proxy/public/nsProxyRelease.h \
253 xpcom/ds/nsRefPtrHashtable.h \
254 xpcom/ds/nsStaticAtom.h \
255 xpcom/components/nsStaticComponent.h \
256 xpcom/ds/nsStringEnumerator.h \
257 xpcom/io/nsStringIO.h \
258 xpcom/ds/nsSupportsArray.h \
259 xpcom/ds/nsSupportsPrimitives.h \
260 xpcom/ds/nsTHashtable.h \
261 xpcom/base/nsTraceRefcntImpl.h \
262 xpcom/ds/nsVariant.h \
263 xpcom/ds/nsVoidArray.h \
264 xpcom/base/nsWeakPtr.h \
265 xpcom/build/nsXPCOM.h \
266 xpcom/build/nsXPCOMCID.h \
267 xpcom/base/nscore.h \
268 xpcom/ds/pldhash.h \
269 xpcom/threads/plevent.h \
270 xpcom/components/xcDll.h \
271 xpcom/typelib/xpt/public/xpt_arena.h \
272 xpcom/typelib/xpt/public/xpt_struct.h \
273 xpcom/typelib/xpt/public/xpt_xdr.h \
274 xpcom/reflect/xptcall/public/xptcall.h \
275 xpcom/reflect/xptcall/public/xptcstubsdecl.inc \
276 xpcom/reflect/xptcall/public/xptcstubsdef.inc \
277 xpcom/reflect/xptinfo/public/xptinfo.h \
278 \
279 xpcom/glue/nsIInterfaceRequestorUtils.h \
280 xpcom/glue/nsISupportsImpl.h \
281 xpcom/glue/nsISupportsUtils.h \
282 xpcom/glue/nsIWeakReferenceUtils.h \
283 \
284 xpcom/glue/nsCOMPtr.h \
285 xpcom/glue/nsDebug.h \
286 xpcom/glue/nsGenericFactory.h \
287 xpcom/glue/nsIGenericFactory.h \
288 xpcom/glue/nsMemory.h \
289 xpcom/glue/nsTraceRefcnt.h \
290 xpcom/glue/nsWeakReference.h \
291 \
292 xpcom/glue/standalone/nsXPCOMGlue.h \
293 \
294 xpcom-config.h
295
296IPCD-HEADERS_INST = $(INST_SDK)bindings/xpcom/include/ipcd/
297IPCD-HEADERS_IFFLAGS = -m 644
298IPCD-HEADERS_SOURCES = \
299 ipc/ipcd/client/public/ipcCID.h \
300 ipc/ipcd/extensions/lock/public/ipcLockCID.h \
301 ipc/ipcd/util/public/ipcMessageReader.h \
302 ipc/ipcd/util/public/ipcMessageWriter.h \
303 ipc/ipcd/client/public/ipcdclient.h
304
305
306#
307# The IDL compiler.
308#
309# We build it statically because we cannot rely on additional .a files
310# like in the original build
311#
312xpidl_TEMPLATE = XPComBldProg
313xpidl_DEFS = EXPORT_XPT_API
314## @todo This assumes HOST == TARGET.
315xpidl_INST = $(INST_BIN)
316## Obsolete hack: MacPorts is 32-bit on 10.5 and 64-bit on 10.6. Set your KBUILD_HOST_ARCH env.vars. accordingly.
317#if "$(KBUILD_HOST).$(KBUILD_HOST_ARCH)" == "darwin.amd64" && defined(VBOX_MACOS_10_5_WORKAROUND)
318# xpidl_BLD_TRG_ARCH = x86
319# ## @todo kBuild ticket 84 workarounds:
320# xpidl_DEFS.x86 = $(TEMPLATE_XPComBldProg_DEFS.x86)
321# xpidl_CFLAGS.x86 = $(TEMPLATE_XPComBldProg_CFLAGS.x86)
322# xpidl_CXXFLAGS.x86 = $(TEMPLATE_XPComBldProg_CXXFLAGS.x86)
323# xpidl_LDFLAGS.x86 = $(TEMPLATE_XPComBldProg_LDFLAGS.x86)
324#endif
325ifdef VBOX_WITH_JAVA_SUPPORT_IN_XPIDL
326 xpidl_DEFS += VBOX_XPIDL_EMULATE_GENJIFACES VBOX_XPIDL_EMULATE_GENJIFACES_DIFF
327endif
328xpidl_SOURCES = \
329 xpcom/typelib/xpidl/xpidl.c \
330 xpcom/typelib/xpidl/xpidl_idl.c \
331 xpcom/typelib/xpidl/xpidl_util.c \
332 xpcom/typelib/xpidl/xpidl_header.c \
333 xpcom/typelib/xpidl/xpidl_typelib.c \
334 xpcom/typelib/xpidl/xpidl_doc.c \
335 xpcom/typelib/xpidl/xpidl_java.c \
336 xpcom/typelib/xpt/src/xpt_arena.c \
337 xpcom/typelib/xpt/src/xpt_struct.c \
338 xpcom/typelib/xpt/src/xpt_xdr.c
339
340# We do these ONCE.
341libIDL_config_cflags := $(shell $(VBOX_LIBIDL_CONFIG) --cflags)
342libIDL_config_libs := $(shell $(VBOX_LIBIDL_CONFIG) --libs)
343xpidl_CFLAGS = \
344 $(libIDL_config_cflags)
345if1of ($(KBUILD_HOST), linux solaris)
346 xpidl_LDFLAGS = \
347 $(filter-out -l%,$(libIDL_config_libs))
348 xpidl_LIBS.$(KBUILD_HOST) += \
349 $(subst -l,,$(filter -l%,$(libIDL_config_libs)))
350else
351 ifeq ($(KBUILD_HOST),darwin)
352 # Need to put the SDK /usr/lib before the libIDL path to make it pick the system iconv
353 xpidl_LDFLAGS = \
354 -L$(VBOX_PATH_MACOSX_SDK)/usr/lib \
355 $(libIDL_config_libs)
356 else
357 xpidl_LDFLAGS = \
358 $(libIDL_config_libs)
359 endif
360endif
361xpidl_LDFLAGS.linux = \
362 $(VBOX_LD_as_needed)
363
364#
365# The XPT linker.
366#
367xpt_link_TEMPLATE = XPComBldProg
368xpt_link_SOURCES = \
369 xpcom/typelib/xpt/tools/xpt_link.c \
370 xpcom/typelib/xpt/src/xpt_arena.c \
371 xpcom/typelib/xpt/src/xpt_struct.c \
372 xpcom/typelib/xpt/src/xpt_xdr.c
373
374
375#
376# The NSPR Library.
377#
378VBox-xpcom-nspr_TEMPLATE = XPComDll
379VBox-xpcom-nspr_INSTTYPE = none
380VBox-xpcom-nspr_DEFS = \
381 _NSPR_BUILD_
382VBox-xpcom-nspr_DEFS.linux = \
383 _POSIX_SOURCE=1 \
384 _BSD_SOURCE=1 \
385 _SVID_SOURCE=1 \
386 _DEFAULT_SOURCE \
387 _REENTRANT=1
388# _BSD_SOURCE is here to keep the Glibc header files happy and make them include the right things
389VBox-xpcom-nspr_INCS = \
390 $(VBox-xpcom-nspr_0_OUTDIR)
391VBox-xpcom-nspr_SOURCES = \
392 nsprpub/lib/ds/plarena.c \
393 nsprpub/lib/ds/plhash.c \
394 nsprpub/pr/src/pthreads/ptsynch.c
395
396$(call KB_FN_DO_PASS0_ON_TARGET,VBox-xpcom-nspr)
397
398$(evalcall2 VBOX_XPCOM_X86,VBox-xpcom-nspr)
399
400
401VBox-xpcom-typelib_TEMPLATE = XPComDll
402VBox-xpcom-typelib_INSTTYPE = none
403VBox-xpcom-typelib_SOURCES = \
404 xpcom/typelib/xpt/src/xpt_arena.c \
405 xpcom/typelib/xpt/src/xpt_struct.c \
406 xpcom/typelib/xpt/src/xpt_xdr.c
407$(evalcall VBOX_XPCOM_X86,VBox-xpcom-typelib)
408
409VBox-xpcom-string_TEMPLATE = XPComDll
410VBox-xpcom-string_INSTTYPE = none
411VBox-xpcom-string_SOURCES = \
412 xpcom/string/src/nsAString.cpp \
413 xpcom/string/src/nsDependentSubstring.cpp \
414 xpcom/string/src/nsObsoleteAStringThunk.cpp \
415 xpcom/string/src/nsPrintfCString.cpp \
416 xpcom/string/src/nsPromiseFlatString.cpp \
417 xpcom/string/src/nsReadableUtils.cpp \
418 xpcom/string/src/nsSubstring.cpp \
419 xpcom/string/src/nsSubstringTuple.cpp \
420 xpcom/string/src/nsString.cpp \
421 xpcom/string/src/nsStringComparator.cpp \
422 xpcom/string/src/nsStringObsolete.cpp
423$(evalcall VBOX_XPCOM_X86,VBox-xpcom-string)
424
425VBox-xpcom-base_TEMPLATE = XPComDll
426VBox-xpcom-base_INSTTYPE = none
427VBox-xpcom-base_DEFS = _IMPL_NS_COM
428VBox-xpcom-base_SOURCES = \
429 xpcom/base/nsDebugImpl.cpp \
430 xpcom/base/nsErrorService.cpp \
431 xpcom/base/nsExceptionService.cpp \
432 xpcom/base/nsID.cpp \
433 xpcom/base/nsTraceRefcntImpl.cpp
434$(evalcall VBOX_XPCOM_X86,VBox-xpcom-base)
435
436VBox-xpcom-ds_TEMPLATE = XPComDll
437VBox-xpcom-ds_INSTTYPE = none
438VBox-xpcom-ds_DEFS = _IMPL_NS_COM
439VBox-xpcom-ds_SOURCES = \
440 xpcom/ds/pldhash.c \
441 xpcom/ds/nsAtomTable.cpp \
442 xpcom/ds/nsAtomService.cpp \
443 xpcom/ds/nsCRT.cpp \
444 xpcom/ds/nsDeque.cpp \
445 xpcom/ds/nsEmptyEnumerator.cpp \
446 xpcom/ds/nsEnumeratorUtils.cpp \
447 xpcom/ds/nsHashSets.cpp \
448 xpcom/ds/nsHashtable.cpp \
449 xpcom/ds/nsObserverList.cpp \
450 xpcom/ds/nsObserverService.cpp \
451 xpcom/ds/nsProperties.cpp \
452 xpcom/ds/nsStringEnumerator.cpp \
453 xpcom/ds/nsSupportsArray.cpp \
454 xpcom/ds/nsSupportsArrayEnumerator.cpp \
455 xpcom/ds/nsSupportsPrimitives.cpp \
456 xpcom/ds/nsTHashtable.cpp \
457 xpcom/ds/nsVariant.cpp \
458 xpcom/ds/nsVoidArray.cpp \
459 xpcom/ds/nsCOMArray.cpp \
460 xpcom/ds/nsArray.cpp \
461 xpcom/ds/nsArrayEnumerator.cpp
462$(evalcall VBOX_XPCOM_X86,VBox-xpcom-ds)
463
464# @todo what about MOZ_USER_DIR?
465VBox-xpcom-io_TEMPLATE = XPComDll
466VBox-xpcom-io_INSTTYPE = none
467ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
468 VBox-xpcom-io_DEFS = _IMPL_NS_COM MOZ_USER_DIR=".mozilla"
469else
470 VBox-xpcom-io_DEFS = _IMPL_NS_COM MOZ_USER_DIR=\".mozilla\"
471endif
472if defined(VBOX_WITH_HARDENING) && defined(VBOX_PATH_APP_PRIVATE_ARCH)
473 ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
474 VBox-xpcom-io_DEFS += MOZ_DEFAULT_VBOX_XPCOM_HOME="$(VBOX_PATH_APP_PRIVATE_ARCH)"
475 else
476 VBox-xpcom-io_DEFS += MOZ_DEFAULT_VBOX_XPCOM_HOME=\"$(VBOX_PATH_APP_PRIVATE_ARCH)\"
477 endif
478endif
479VBox-xpcom-io_SOURCES = \
480 xpcom/io/nsAppFileLocationProvider.cpp \
481 xpcom/io/nsDirectoryService.cpp \
482 xpcom/io/nsLocalFileCommon.cpp \
483 xpcom/io/SpecialSystemDirectory.cpp \
484 xpcom/io/nsNativeCharsetUtils.cpp
485if1of ($(KBUILD_TARGET) $(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), freebsd linux netbsd openbsd solaris darwin.amd64 darwin.arm64)
486 VBox-xpcom-io_SOURCES += \
487 xpcom/io/nsLocalFileUnix.cpp
488endif
489$(evalcall VBOX_XPCOM_X86,VBox-xpcom-io)
490
491VBox-xpcom-components_TEMPLATE = XPComDll
492VBox-xpcom-components_INSTTYPE = none
493VBox-xpcom-components_DEFS = _IMPL_NS_COM EXPORT_XPTI_API
494VBox-xpcom-components_SOURCES = \
495 xpcom/components/nsCategoryManager.cpp \
496 xpcom/components/nsComponentManager.cpp \
497 xpcom/components/nsComponentManagerObsolete.cpp \
498 xpcom/components/nsNativeComponentLoader.cpp \
499 xpcom/components/nsServiceManagerObsolete.cpp \
500 xpcom/components/xcDll.cpp \
501 xpcom/components/nsStaticComponentLoader.cpp
502$(evalcall VBOX_XPCOM_X86,VBox-xpcom-components)
503
504VBox-xpcom-threads_TEMPLATE = XPComDll
505VBox-xpcom-threads_INSTTYPE = none
506VBox-xpcom-threads_DEFS = _IMPL_NS_COM
507VBox-xpcom-threads_SOURCES = \
508 xpcom/threads/plevent.c \
509 xpcom/threads/nsAutoLock.cpp \
510 xpcom/threads/nsEventQueue.cpp \
511 xpcom/threads/nsEventQueueService.cpp
512$(evalcall VBOX_XPCOM_X86,VBox-xpcom-threads)
513
514VBox-xpcom-xptinfo_TEMPLATE = XPComDll
515VBox-xpcom-xptinfo_INSTTYPE = none
516VBox-xpcom-xptinfo_DEFS = _IMPL_NS_COM _IMPL_NS_BASE EXPORT_XPTI_API EXPORT_XPT_API
517VBox-xpcom-xptinfo_SOURCES = \
518 xpcom/reflect/xptinfo/src/xptiFile.cpp \
519 xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp \
520 xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp \
521 xpcom/reflect/xptinfo/src/xptiManifest.cpp \
522 xpcom/reflect/xptinfo/src/xptiMisc.cpp \
523 xpcom/reflect/xptinfo/src/xptiTypelibGuts.cpp \
524 xpcom/reflect/xptinfo/src/xptiWorkingSet.cpp \
525 xpcom/reflect/xptinfo/src/xptiZipItem.cpp \
526 xpcom/reflect/xptinfo/src/xptiZipLoader.cpp
527$(evalcall VBOX_XPCOM_X86,VBox-xpcom-xptinfo)
528
529
530VBox-xpcom-xptcall_TEMPLATE = XPComDllYasm
531VBox-xpcom-xptcall_INSTTYPE = none
532VBox-xpcom-xptcall_DEFS = _IMPL_NS_COM _IMPL_NS_BASE EXPORT_XPTC_API
533VBox-xpcom-xptcall_DEFS.darwin = KEEP_STACK_16_BYTE_ALIGNED
534VBox-xpcom-xptcall_SOURCES = xpcom/reflect/xptcall/src/xptcall.cpp
535VBox-xpcom-xptcall_SOURCES.freebsd.x86 = xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp \
536 xpcom/reflect/xptcall/src/md/unix/xptcstubs_gcc_x86_unix.cpp
537VBox-xpcom-xptcall_SOURCES.linux.x86 = xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp \
538 xpcom/reflect/xptcall/src/md/unix/xptcstubs_gcc_x86_unix.cpp
539VBox-xpcom-xptcall_SOURCES.solaris.x86 = xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_solaris.cpp \
540 xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_solaris.cpp
541VBox-xpcom-xptcall_SOURCES.amd64 = xpcom/reflect/xptcall/src/md/unix/xptcinvoke_amd64_vbox.asm
542VBox-xpcom-xptcall_SOURCES.arm64 = xpcom/reflect/xptcall/src/md/unix/xptcinvoke_arm64_vbox.cpp \
543 xpcom/reflect/xptcall/src/md/unix/xptcstubs_arm64_vbox.cpp
544VBox-xpcom-xptcall_SOURCES.darwin.amd64 = xpcom/reflect/xptcall/src/md/unix/xptcstubs_amd64_darwin.cpp # Underscore prefix.
545VBox-xpcom-xptcall_SOURCES.freebsd.amd64 = xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp
546VBox-xpcom-xptcall_SOURCES.linux.amd64 = xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp
547ifndef VBOX_GCC_USING_SOLARIS_AS
548 VBox-xpcom-xptcall_SOURCES.solaris.amd64 = xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp
549else
550 VBox-xpcom-xptcall_SOURCES.solaris.amd64 = xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_solaris.cpp
551endif
552
553xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_solaris.cpp_CXXFLAGS = -O0
554# -O0 works fine, while -O1 doesn't. The gcc man page can't be listing all the -f*
555# stuff that -O1 enables, because when using the options without -O1, it's -fomit-frame-pointer
556# that triggers is, while -O1 -fno-omit-frame-pointer does not work. Anyway, it's probably a gcc/mozila
557# bug and it's not worth investigating as I'm not the maintainger of the solaris gcc port. [bird, 2007-09-17]
558
559$(evalcall VBOX_XPCOM_X86,VBox-xpcom-xptcall)
560
561
562VBox-xpcom-proxy_TEMPLATE = XPComDll
563VBox-xpcom-proxy_INSTTYPE = none
564VBox-xpcom-proxy_DEFS = _IMPL_NS_COM EXPORT_XPTC_API EXPORT_XPTI_API
565VBox-xpcom-proxy_SOURCES = \
566 xpcom/proxy/src/nsProxyEvent.cpp \
567 xpcom/proxy/src/nsProxyEventClass.cpp \
568 xpcom/proxy/src/nsProxyEventObject.cpp \
569 xpcom/proxy/src/nsProxyObjectManager.cpp \
570 xpcom/proxy/src/nsProxyRelease.cpp
571$(evalcall VBOX_XPCOM_X86,VBox-xpcom-proxy)
572
573
574#
575# The VBoxXPCOM Glue static libraries.
576#
577# This isn't the normal XPCOM glue (see the places in XPCOM where XPCOM_GLUE is
578# checked), VirtualBox has its own glue library and this means this isn't used
579# much (one reason is that we don't provide frozen APIs yet). All VBox XPCOM
580# client applications are dependent on the given version of both the VBox XPCOM
581# runtime (binary dependency) and VirtualBox component library (COM interface
582# dependency). For this reason, VBox client applications link to the VBox XPCOM
583# shared library directly (instead of linking to the standalone XPCOM glue
584# library that would dynamically search for and load the installed XPCOM
585# runtime). For the same reason, we link all parts of XPCOM into a single
586# shared XPCOM library below (as opposed to the original XPCOM where e.g. NSPR
587# lives in a separate DLL). Additionally there is VBox specific glue code to
588# make both the client and server side code build with both XPCOM and COM,
589# which should be made part of the SDK eventually, but this is a higher level
590# of abstraction than this XPCOM specific glue code.
591#
592VBoxXPCOMGlue_COMMON_SOURCES = \
593 xpcom/glue/nsCOMPtr.cpp \
594 xpcom/glue/nsComponentManagerUtils.cpp \
595 xpcom/glue/nsDebug.cpp \
596 xpcom/glue/nsGenericFactory.cpp \
597 xpcom/glue/nsIInterfaceRequestorUtils.cpp \
598 xpcom/glue/nsMemory.cpp \
599 xpcom/glue/nsTraceRefcnt.cpp \
600 xpcom/glue/nsWeakReference.cpp
601
602# dependent glue library which goes in to the VBoxXPCOM shared library
603VBoxXPCOMGlue_s_TEMPLATE = XPComDll
604VBoxXPCOMGlue_s_INSTTYPE = none
605VBoxXPCOMGlue_s_DEFS = _IMPL_NS_COM
606VBoxXPCOMGlue_s_SOURCES = $(VBoxXPCOMGlue_COMMON_SOURCES)
607$(evalcall VBOX_XPCOM_X86,VBoxXPCOMGlue_s)
608
609# standalone glue library which all third-party client apps (if any) will
610# link with (currently completely unused and nit built, to be part of the SDK)
611VBoxXPCOMGlue_TEMPLATE = XPComDll
612VBoxXPCOMGlue_SOURCES = $(VBoxXPCOMGlue_COMMON_SOURCES)
613#VBoxXPCOMGlue_INST = lib/ $(INST_SDK)lib/
614$(evalcall VBOX_XPCOM_X86,VBoxXPCOMGlue)
615
616
617#
618# The VBoxXPCOM Shared Object, assembling all lib files.
619#
620VBoxXPCOM_TEMPLATE = XPComDll
621VBoxXPCOM_NAME = $(basename $(notdir $(LIB_XPCOM)))
622VBoxXPCOM_DEFS = BUILD_DCONNECT=1 _IMPL_NS_COM
623ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
624 VBoxXPCOM_LDFLAGS.linux = -Wl,--version-script=$(XPCOM_C_NAMESPACE_MAP)
625 VBoxXPCOM_LNK_DEPS.linux += $(XPCOM_C_NAMESPACE_MAP)
626 VBoxXPCOM_LDFLAGS.solaris = -Wl,-M,$(XPCOM_C_NAMESPACE_MAP)
627 VBoxXPCOM_LNK_DEPS.solaris += $(XPCOM_C_NAMESPACE_MAP)
628endif
629VBoxXPCOM_SOURCES = \
630 xpcom/build/nsXPComInit.cpp \
631 xpcom/build/nsStringAPI.cpp
632VBoxXPCOM_SOURCES.darwin = \
633 vboxdeps.cpp
634VBoxXPCOM_SOURCES.solaris = \
635 vboxdeps.cpp
636VBoxXPCOM_LIBS = \
637 $(VBox-xpcom-typelib_1_TARGET) \
638 $(VBox-xpcom-string_1_TARGET) \
639 $(VBox-xpcom-base_1_TARGET) \
640 $(VBox-xpcom-ds_1_TARGET) \
641 $(VBox-xpcom-io_1_TARGET) \
642 $(VBox-xpcom-components_1_TARGET) \
643 $(VBox-xpcom-threads_1_TARGET) \
644 $(VBox-xpcom-xptinfo_1_TARGET) \
645 $(VBox-xpcom-xptcall_1_TARGET) \
646 $(VBox-xpcom-proxy_1_TARGET) \
647 $(VBox-xpcom-nspr_1_TARGET) \
648 $(VBoxXPCOMGlue_s_1_TARGET)
649VBoxXPCOM_LIBS.linux = \
650 pthread dl
651
652ifeq ($(filter-out freebsd linux netbsd openbsd,$(KBUILD_TARGET)),) # gnu ld.
653 VBoxXPCOM_LDFLAGS = -Wl,--whole-archive \
654 $(VBox-xpcom-typelib_1_TARGET) \
655 $(VBox-xpcom-string_1_TARGET) \
656 $(VBox-xpcom-base_1_TARGET) \
657 $(VBox-xpcom-ds_1_TARGET) \
658 $(VBox-xpcom-io_1_TARGET) \
659 $(VBox-xpcom-components_1_TARGET) \
660 $(VBox-xpcom-threads_1_TARGET) \
661 $(VBox-xpcom-xptinfo_1_TARGET) \
662 $(VBox-xpcom-xptcall_1_TARGET) \
663 $(VBox-xpcom-proxy_1_TARGET) \
664 $(VBox-xpcom-nspr_1_TARGET) \
665 $(VBoxXPCOMGlue_s_1_TARGET) \
666 -Wl,--no-whole-archive
667endif
668
669VBoxXPCOM_LDFLAGS.solaris += -Wl,-z,allextract \
670 $(VBox-xpcom-typelib_1_TARGET) \
671 $(VBox-xpcom-string_1_TARGET) \
672 $(VBox-xpcom-base_1_TARGET) \
673 $(VBox-xpcom-ds_1_TARGET) \
674 $(VBox-xpcom-io_1_TARGET) \
675 $(VBox-xpcom-components_1_TARGET) \
676 $(VBox-xpcom-threads_1_TARGET) \
677 $(VBox-xpcom-xptinfo_1_TARGET) \
678 $(VBox-xpcom-xptcall_1_TARGET) \
679 $(VBox-xpcom-proxy_1_TARGET) \
680 $(VBox-xpcom-nspr_1_TARGET) \
681 $(VBoxXPCOMGlue_s_1_TARGET) \
682 -Wl,-z,defaultextract
683
684# EF heap
685#VBoxXPCOM_LIBS += $(LIB_RUNTIME_EF)
686#VBoxXPCOM_LDFLAGS = -Wl,--whole-archive $(VBoxXPCOM_LIBS) -Wl,--no-whole-archive $(LIB_RUNTIME)
687VBoxXPCOM_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxXPCOM.dylib
688
689#
690# The 32-bit VBoxXPCOM Shared Object, assembling all lib files.
691#
692VBoxXPCOM-x86_TEMPLATE = XPComDll-x86
693VBoxXPCOM-x86_EXTENDS = VBoxXPCOM
694VBoxXPCOM-x86_NAME = VBoxXPCOM-x86
695VBoxXPCOM-x86_LIBS = \
696 $(VBox-xpcom-typelib-x86_1_TARGET) \
697 $(VBox-xpcom-string-x86_1_TARGET) \
698 $(VBox-xpcom-base-x86_1_TARGET) \
699 $(VBox-xpcom-ds-x86_1_TARGET) \
700 $(VBox-xpcom-io-x86_1_TARGET) \
701 $(VBox-xpcom-components-x86_1_TARGET) \
702 $(VBox-xpcom-threads-x86_1_TARGET) \
703 $(VBox-xpcom-xptinfo-x86_1_TARGET) \
704 $(VBox-xpcom-xptcall-x86_1_TARGET) \
705 $(VBox-xpcom-proxy-x86_1_TARGET) \
706 $(VBox-xpcom-nspr-x86_1_TARGET) \
707 $(VBoxXPCOMGlue_s-x86_1_TARGET)
708
709ifeq ($(filter-out freebsd linux netbsd openbsd,$(KBUILD_TARGET)),) # gnu ld.
710 VBoxXPCOM-x86_LDFLAGS = -Wl,--whole-archive \
711 $(VBox-xpcom-typelib-x86_1_TARGET) \
712 $(VBox-xpcom-string-x86_1_TARGET) \
713 $(VBox-xpcom-base-x86_1_TARGET) \
714 $(VBox-xpcom-ds-x86_1_TARGET) \
715 $(VBox-xpcom-io-x86_1_TARGET) \
716 $(VBox-xpcom-components-x86_1_TARGET) \
717 $(VBox-xpcom-threads-x86_1_TARGET) \
718 $(VBox-xpcom-xptinfo-x86_1_TARGET) \
719 $(VBox-xpcom-xptcall-x86_1_TARGET) \
720 $(VBox-xpcom-proxy-x86_1_TARGET) \
721 $(VBox-xpcom-nspr-x86_1_TARGET) \
722 $(VBoxXPCOMGlue_s-x86_1_TARGET) \
723 -Wl,--no-whole-archive
724endif
725
726VBoxXPCOM-x86_LDFLAGS.solaris += -Wl,-z,allextract \
727 $(VBox-xpcom-typelib-x86_1_TARGET) \
728 $(VBox-xpcom-string-x86_1_TARGET) \
729 $(VBox-xpcom-base-x86_1_TARGET) \
730 $(VBox-xpcom-ds-x86_1_TARGET) \
731 $(VBox-xpcom-io-x86_1_TARGET) \
732 $(VBox-xpcom-components-x86_1_TARGET) \
733 $(VBox-xpcom-threads-x86_1_TARGET) \
734 $(VBox-xpcom-xptinfo-x86_1_TARGET) \
735 $(VBox-xpcom-xptcall-x86_1_TARGET) \
736 $(VBox-xpcom-proxy-x86_1_TARGET) \
737 $(VBox-xpcom-nspr-x86_1_TARGET) \
738 $(VBoxXPCOMGlue_s-x86_1_TARGET) \
739 -Wl,-z,defaultextract
740
741
742#
743# VBoxXPCOMImp - Import library/hack.
744#
745ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
746 $(call VBOX_GENERATE_IMPORT_TARGET_FN,VBoxXPCOMImp,VBoxXPCOM,VBoxXPCOM-mangled.def)
747else
748 $(call VBOX_GENERATE_IMPORT_TARGET_FN,VBoxXPCOMImp,VBoxXPCOM,VBoxXPCOM.def)
749endif
750
751
752#
753# IPC templates.
754#
755ifdef VBOX_IPC_RELEASE_LOG
756 IPC_LOGGING = 1
757else ifneq ($(KBUILD_TYPE),release)
758 IPC_LOGGING = 1
759endif
760
761TEMPLATE_XPComIpcDll = XPCOM IPC libraries
762TEMPLATE_XPComIpcDll_EXTENDS = XPComDll
763TEMPLATE_XPComIpcDll_DEFS = \
764 $(TEMPLATE_XPComDll_DEFS) \
765 BUILD_DCONNECT=1 \
766 $(if $(VBOX_WITH_XPCOMIPCD_IN_VBOX_SVC),VBOX_WITH_XPCOMIPCD_IN_VBOX_SVC,)
767
768ifdef VBOX_WITH_XPCOMIPCD_IN_VBOX_SVC
769 ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
770 TEMPLATE_XPComIpcDll_DEFS += IPC_DAEMON_APP_NAME="VBoxSVC$(SUFF_EXE)"
771 else
772 TEMPLATE_XPComIpcDll_DEFS += IPC_DAEMON_APP_NAME=\"VBoxSVC$(SUFF_EXE)\"
773 endif
774else
775 ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
776 TEMPLATE_XPComIpcDll_DEFS += IPC_DAEMON_APP_NAME="VBoxXPCOMIPCD$(SUFF_EXE)"
777 else
778 TEMPLATE_XPComIpcDll_DEFS += IPC_DAEMON_APP_NAME=\"VBoxXPCOMIPCD$(SUFF_EXE)\"
779 endif
780endif
781ifdef IPC_LOGGING
782 TEMPLATE_XPComIpcDll_DEFS += IPC_LOGGING
783endif
784TEMPLATE_XPComIpcDll_LIBS = $(VBoxXPCOM_1_TARGET) $(TEMPLATE_XPComDll_LIBS)
785ifneq ($(KBUILD_TARGET),win)
786 ifeq ($(filter-out solaris.x86 %.amd64 %.sparc32 %.sparc64,$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)),) ## TODO: cleanup!
787 if defined(VBOX_WITH_RELATIVE_RUNPATH) && !defined(VBOX_WITH_HARDENING)
788 TEMPLATE_XPComIpcDll_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%',$(TEMPLATE_XPComDll_LDFLAGS)) '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/..'
789 endif
790 else ifndef VBOX_WITH_HARDENING
791 ifdef VBOX_WITH_RELATIVE_RUNPATH
792 TEMPLATE_XPComIpcDll_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%',$(TEMPLATE_XPComDll_LDFLAGS)) '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/..'
793 endif
794 endif
795endif
796
797TEMPLATE_XPComIpcDll-x86 = 32-bit XPCOM IPC libraries
798TEMPLATE_XPComIpcDll-x86_EXTENDS = XPComIpcDll
799TEMPLATE_XPComIpcDll-x86_BLD_TRG_ARCH = x86
800TEMPLATE_XPComIpcDll-x86_LIBS = $(VBoxXPCOM-x86_1_TARGET) $(TEMPLATE_XPComDll-x86_LIBS)
801
802TEMPLATE_XPComIpcExe = XPCOM IPC executables
803TEMPLATE_XPComIpcExe_EXTENDS = XPComExe
804TEMPLATE_XPComIpcExe_DEFS = $(TEMPLATE_XPComExe_DEFS) BUILD_DCONNECT=1
805ifdef IPC_LOGGING
806 TEMPLATE_XPComIpcExe_DEFS += IPC_LOGGING
807endif
808
809#
810# Shared IPC code. Used by the IPC component as well as the executables.
811#
812VBox-xpcom-ipcshared_TEMPLATE = XPComIpcDll
813VBox-xpcom-ipcshared_INSTTYPE = none
814VBox-xpcom-ipcshared_SOURCES = \
815 ipc/ipcd/shared/src/ipcConfig.cpp \
816 ipc/ipcd/shared/src/ipcMessage.cpp \
817 ipc/ipcd/shared/src/ipcMessagePrimitives.cpp \
818 ipc/ipcd/shared/src/ipcStringList.cpp \
819 ipc/ipcd/shared/src/ipcIDList.cpp \
820 ipc/ipcd/shared/src/ipcm.cpp
821$(evalcall VBOX_XPCOM_X86,VBox-xpcom-ipcshared)
822
823
824#
825# DCONNECT client shared object
826#
827VBoxXPCOMIPCC_TEMPLATE = XPComIpcDll
828VBoxXPCOMIPCC_INST = $(INST_BIN)components/
829VBoxXPCOMIPCC_SOURCES = \
830 ipc/ipcd/client/src/ipcdclient.cpp \
831 ipc/ipcd/client/src/ipcService.cpp \
832 ipc/ipcd/client/src/ipcModuleFactory.cpp \
833 ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp \
834 \
835 ipc/ipcd/util/src/ipcMessageReader.cpp \
836 ipc/ipcd/util/src/ipcMessageWriter.cpp \
837 \
838 ipc/ipcd/extensions/lock/src/ipcLockProtocol.cpp \
839 ipc/ipcd/extensions/lock/src/ipcLockService.cpp \
840 \
841 ipc/ipcd/extensions/transmngr/src/tmTransactionService.cpp \
842 \
843 ipc/ipcd/extensions/transmngr/common/tmTransaction.cpp \
844 ipc/ipcd/extensions/transmngr/common/tmVector.cpp \
845 ipc/ipcd/client/src/ipcConnectionUnix.cpp
846VBoxXPCOMIPCC_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxXPCOMIPCC.dylib
847VBoxXPCOMIPCC_LIBS = \
848 $(VBox-xpcom-ipcshared_1_TARGET)
849
850# 32-bit version of the component.
851$(evalcall VBOX_XPCOM_X86,VBoxXPCOMIPCC)
852VBoxXPCOMIPCC-x86_LIBS = \
853 $(VBox-xpcom-ipcshared-x86_1_TARGET)
854
855
856#
857# DCONNECT daemon executable
858#
859ifdef VBOX_WITH_XPCOMIPCD_IN_VBOX_SVC
860 VBoxXPCOMIPCD_TEMPLATE = XPComIpcDll
861 VBoxXPCOMIPCD_SOURCES = \
862 ipc/ipcd/daemon/src/ipcd.cpp \
863 ipc/ipcd/daemon/src/ipcClient.cpp \
864 ipc/ipcd/daemon/src/ipcCommandModule.cpp \
865 ipc/ipcd/daemon/src/ipcdUnix.cpp
866 VBoxXPCOMIPCD_LIBS = \
867 $(VBox-xpcom-ipcshared_1_TARGET) \
868 $(VBoxXPCOM_1_TARGET) \
869 $(TEMPLATE_XPComDll_LIBS)
870else
871 VBoxXPCOMIPCD_TEMPLATE = XPComIpcExe
872 VBoxXPCOMIPCD_SOURCES = \
873 ipc/ipcd/daemon/src/ipcd.cpp \
874 ipc/ipcd/daemon/src/ipcClient.cpp \
875 ipc/ipcd/daemon/src/ipcCommandModule.cpp \
876 ipc/ipcd/daemon/src/ipcdUnix.cpp
877endif
878
879
880#
881# Include sub-makefiles for the Python<->XPCOM and Java<->XPCOM bridges.
882#
883ifndef VBOX_ONLY_EXTPACKS
884 # Find the Python headers for the Python<->XPCOM bridge if enabled.
885 ifdef VBOX_WITH_PYTHON
886 include $(PATH_SUB_CURRENT)/python/Makefile.kmk
887 endif
888
889 ifdef VBOX_WITH_JXPCOM
890 include $(PATH_SUB_CURRENT)/java/Makefile.kmk
891 endif
892endif # !VBOX_ONLY_EXTPACKS
893
894
895#
896# testcases
897#
898tstnsIFileTest_TEMPLATE = XPComTstExe
899tstnsIFileTest_SOURCES = xpcom/tests/nsIFileTest.cpp
900tstTestArray_TEMPLATE = XPComTstExe
901tstTestArray_SOURCES = xpcom/tests/TestArray.cpp
902tstTestAtoms_TEMPLATE = XPComTstExe
903tstTestAtoms_SOURCES = xpcom/tests/TestAtoms.cpp
904tstTestAutoLock_TEMPLATE = XPComTstExe
905tstTestAutoLock_SOURCES = xpcom/tests/TestAutoLock.cpp
906tstTestCOMPtr_TEMPLATE = XPComTstExe
907tstTestCOMPtr_SOURCES = xpcom/tests/TestCOMPtr.cpp
908tstTestCOMPtrEq_TEMPLATE = XPComTstExe
909tstTestCOMPtrEq_SOURCES = xpcom/tests/TestCOMPtrEq.cpp
910tstTestCRT_TEMPLATE = XPComTstExe
911tstTestCRT_SOURCES = xpcom/tests/TestCRT.cpp
912tstTestFactory_TEMPLATE = XPComTstExe
913tstTestFactory_SOURCES = xpcom/tests/TestFactory.cpp
914tstTestHashtables_TEMPLATE = XPComTstExe
915tstTestHashtables_SOURCES = xpcom/tests/TestHashtables.cpp
916tstTestID_TEMPLATE = XPComTstExe
917tstTestID_SOURCES = xpcom/tests/TestID.cpp
918tstTestObserverService_TEMPLATE = XPComTstExe
919tstTestObserverService_SOURCES = xpcom/tests/TestObserverService.cpp
920tstTestXPIDLString_TEMPLATE = XPComTstExe
921tstTestXPIDLString_SOURCES = xpcom/tests/TestXPIDLString.cpp
922tstTestXPTCInvoke_TEMPLATE = XPComTstExe
923tstTestXPTCInvoke_SOURCES = xpcom/reflect/xptcall/tests/TestXPTCInvoke.cpp
924tstTestDeque_TEMPLATE = XPComTstExe
925tstTestDeque_SOURCES = xpcom/tests/TestDeque.cpp
926tstTestAutoPtr_TEMPLATE = XPComTstExe
927tstTestAutoPtr_SOURCES = xpcom/tests/TestAutoPtr.cpp
928tstTestMinStringAPI_TEMPLATE = XPComTstExe
929tstTestMinStringAPI_SOURCES = xpcom/tests/TestMinStringAPI.cpp
930tstTestStrings_TEMPLATE = XPComTstExe
931tstTestStrings_SOURCES = xpcom/tests/TestStrings.cpp
932tstPrimitiveTest_TEMPLATE = XPComTstExe
933tstPrimitiveTest_SOURCES = xpcom/typelib/xpt/tests/PrimitiveTest.c
934
935
936
937OTHER_CLEAN += \
938 $(PATH_TARGET)/VBox-xpcom-idl-timestamp \
939 $(addprefix $(VBOX_PATH_SDK)/bindings/xpcom/include,$(notdir $(subst .idl,.h,$(XPCOM_IDLFILES)))) \
940 $(addprefix $(VBOX_PATH_SDK)/bindings/xpcom/include,$(notdir $(subst .idl,.xpt,$(XPCOM_IDLFILES)))) \
941 $(addprefix $(VBOX_PATH_SDK)/bindings/xpcom/idl/,$(notdir $(XPCOM_IDLFILES))) \
942 $(addprefix $(PATH_TARGET)/VBox-xpcom-xpt-files/,$(notdir $(subst .idl,.xpt,$(XPCOM_IDLFILES))))
943
944
945#
946# Create and install VBoxXPCOMBase.xpt
947#
948INSTALLS += VBoxXPCOMBase-xpt-inst
949VBOX_XPTFILES = $(addprefix $(PATH_TARGET)/VBox-xpcom-xpt-files/, \
950 nsIErrorService.xpt \
951 nsIException.xpt \
952 nsIExceptionService.xpt \
953 nsIDebug.xpt \
954 nsIInterfaceRequestor.xpt \
955 nsIProgrammingLanguage.xpt \
956 nsISupports.xpt \
957 nsITraceRefcnt.xpt \
958 nsIWeakReference.xpt \
959 nsrootidl.xpt \
960 nsIAtom.xpt \
961 nsIAtomService.xpt \
962 nsICollection.xpt \
963 nsIEnumerator.xpt \
964 nsIVariant.xpt \
965 nsISerializable.xpt \
966 nsIStringEnumerator.xpt \
967 nsISupportsArray.xpt \
968 nsISupportsIterators.xpt \
969 nsIArray.xpt \
970 nsIObserverService.xpt \
971 nsIObserver.xpt \
972 nsIProperties.xpt \
973 nsISimpleEnumerator.xpt \
974 nsISupportsPrimitives.xpt \
975 nsIBinaryInputStream.xpt \
976 nsIBinaryOutputStream.xpt \
977 nsIObjectInputStream.xpt \
978 nsIObjectOutputStream.xpt \
979 nsIDirectoryService.xpt \
980 nsIFile.xpt \
981 nsILocalFile.xpt \
982 nsIInputStream.xpt \
983 nsIOutputStream.xpt \
984 nsIComponentLoader.xpt \
985 nsIComponentLoaderManager.xpt \
986 nsIComponentManagerObsolete.xpt \
987 nsINativeComponentLoader.xpt \
988 nsIClassInfo.xpt \
989 nsIComponentRegistrar.xpt \
990 nsIFactory.xpt \
991 nsIModule.xpt \
992 nsIServiceManager.xpt \
993 nsIComponentManager.xpt \
994 nsICategoryManager.xpt \
995 nsIRunnable.xpt \
996 nsIEventTarget.xpt \
997 nsIEventQueue.xpt \
998 nsIEventQueueService.xpt \
999 nsIInterfaceInfo.xpt \
1000 nsIInterfaceInfoManager.xpt \
1001 nsIXPTLoader.xpt)
1002
1003VBoxXPCOMBase-xpt-inst_INST = $(INST_BIN)components/
1004VBoxXPCOMBase-xpt-inst_MODE = 0644
1005VBoxXPCOMBase-xpt-inst_SOURCES = \
1006 $(PATH_TARGET)/VBox-xpcom-xpt-files/VBoxXPCOMBase.xpt
1007VBoxXPCOMBase-xpt-inst_CLEAN = \
1008 $(VBOX_XPTFILES) \
1009 $(PATH_TARGET)/VBox-xpcom-xpt-files/VBoxXPCOMBase.xpt
1010
1011# combined typelib library
1012$(PATH_TARGET)/VBox-xpcom-xpt-files/VBoxXPCOMBase.xpt: $$(VBOX_XPTFILES) | $$(xpt_link_1_TARGET) $(PATH_TARGET)/VBox-xpcom-xpt-files/
1013 $(call MSG_LINK,XPCOM_TYPELIB,$@)
1014 $(QUIET)$(MKDIR) -p -- $(PATH_STAGE_BIN)/components
1015 $(QUIET)$(xpt_link_1_TARGET) $@ $^
1016
1017
1018
1019# generate rules
1020include $(FILE_KBUILD_SUB_FOOTER)
1021
1022
1023
1024#
1025# Generate IDL rules.
1026#
1027
1028##
1029# Define for compiling one IDL into a header and a typelib
1030# @param idl The filename with everything.
1031define def_IDL
1032 $(VBOX_PATH_SDK)/bindings/xpcom/include/$(notdir $(subst .idl,.h,$(idl))) \
1033 + $(PATH_TARGET)/VBox-xpcom-xpt-files/$(notdir $(subst .idl,.xpt,$(idl))): \
1034 $(VBOX_PATH_XPCOM_SRC)/$(idl) \
1035 | $$$$(xpidl_1_TARGET) \
1036 $(PATH_TARGET)/VBox-xpcom-xpt-files/
1037 $$(call MSG_TOOL,xpidl,XPCOM,$$<,$$@)
1038 $$(QUIET)$(MKDIR) -p $(VBOX_PATH_SDK)/bindings/xpcom/include $(VBOX_PATH_SDK)/bindings/xpcom/idl
1039 $$(QUIET)$$(xpidl_1_TARGET) -m header $(XPIDL_INCS) -e $$@ $$<
1040 $$(QUIET)$$(xpidl_1_TARGET) -m typelib $(XPIDL_INCS) -e $(addprefix $(PATH_TARGET)/VBox-xpcom-xpt-files/,$(notdir $(subst .idl,.xpt,$(idl)))) $$<
1041 $$(QUIET)$(CP) $$< $$(VBOX_PATH_SDK)/bindings/xpcom/idl
1042endef
1043
1044$(foreach idl, $(XPCOM_IDLFILES), $(eval $(def_IDL)))
1045
1046# dummy target.
1047$(PATH_TARGET)/VBox-xpcom-idl-timestamp: $$(addprefix $$(VBOX_PATH_SDK)/bindings/xpcom/include/,$$(notdir $$(subst .idl,.h,$$(XPCOM_IDLFILES))))
1048 $(call MSG_L1,IDL processing completed.)
1049 $(QUIET)$(MKDIR) -p $(dir $@)
1050 $(QUIET)$(APPEND) -t $@
1051
1052#
1053# HACK ALERT! Make sure main doesn't start using xpidl before we're done
1054# with the idl files here. The trick here is that we're using TARGET_xpidl,
1055# i.e. the copy residing in obj/, while VBOX_XPIDL is pointing to
1056# xpidl_1_STAGE_TARGET which is the one in bin/.
1057#
1058$(VBOX_XPIDL): | $(PATH_TARGET)/VBox-xpcom-idl-timestamp
1059
1060
1061#
1062# Generate linker map file filtering out unwanted global symbols.
1063#
1064$(PATH_TARGET)/xpcom-namespace-cleanup.map foo.map: $$(VBoxXPCOM_LIBS) $$(VBoxXPCOM_2_OBJS)
1065 $(call MSG_L1, Creating linker map $@ for scrubbing the symbol namespace)
1066 $(QUIET)$(APPEND) -t $@ '{ local: *; global: '
1067 $(QUIET)$(VBOX_NM) -p -g $^ \
1068 | $(SED) -n \
1069 -e '/^$$/b' \
1070 -e '/:$$/b' \
1071 -e '/ U /b' \
1072 -e 's/^[^ ]* [A-Z] \(.*\)$$/\1/' \
1073 -e 's/\<_Z[^ ]*$$/&;/p' \
1074 -e 's/\<VBoxNs[^ ]*$$/&;/p' \
1075 -e 's/\<_edata$$/&;/p' \
1076 -e 's/\<_end$$/&;/p' \
1077 -e 's/\<_etext$$/&;/p'\
1078 -e 's/\<_fini$$/&;/p' \
1079 -e 's/\<_init$$/&;/p' \
1080 --append $@
1081 $(QUIET)$(APPEND) $@ '};'
1082#ifeq ($(KBUILD_TARGET),solaris)
1083# # Temporary gcc 4.5.2 hack on Solaris which emits unknown mangled symbols for ctors/dtors for certain objects. See @bugref{5838}.
1084# if $(VBOX_GCC_VERSION_CXX) == 40502
1085# $(QUIET)$(SED) -re '/^_Z.*[C-D]5E/d' $@ > $@-sedtmp
1086# $(QUIET)$(MV) $@-sedtmp $@
1087# endif
1088#endif
1089
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