VirtualBox

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

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

libs/xpcom: Remove code for unused platforms from nsprpub, bugref:10545

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