VirtualBox

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

Last change on this file since 101931 was 101931, checked in by vboxsync, 15 months ago

libs/xpcom: Remove an unused header in nsprpub, bugref:10545

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