VirtualBox

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

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

libs/xpcom: Get rid of the now unused PR_Atomic* API, bugref:10545

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