VirtualBox

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

Last change on this file since 102176 was 102176, checked in by vboxsync, 17 months ago

libs/xpcom: Remove unused code, bugref:10545

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

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette