VirtualBox

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

Last change on this file since 103562 was 103562, checked in by vboxsync, 9 months ago

libs/xpcom/ipc: Replace the old ipcMessageReader helper class with an inline version to avoid function calls in hot code paths, bugref:10597

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