VirtualBox

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

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

libs/xpcom: Remove unused code from nsprpub, bugref:10545 [fix]

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