VirtualBox

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

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

libs/xpcom: Get rid of unused nsTimer functionality, bugref:10545

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