VirtualBox

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

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

libs/xpcom: Get rid of now unused PR_GetEnv/PR_SetEnv API, bugref:10545

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