VirtualBox

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

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

libs/xpcom: Get rid of prdtoa.{c,h} in nsprpub, bugref:10545

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