VirtualBox

source: vbox/trunk/src/libs/xpcom18a4/Config.kmk

Last change on this file was 109065, checked in by vboxsync, 2 weeks ago

VBox/log.h,libs/xpcom: Added an XPCOM logging group and fixed missing newlines (++) in the logging in xpcom.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 13.8 KB
Line 
1# $Id: Config.kmk 109065 2025-04-24 08:14:18Z vboxsync $
2## @file
3# XPCOM kBuild Configuration file.
4#
5
6#
7# Copyright (C) 2006-2024 Oracle and/or its affiliates.
8#
9# This file is part of VirtualBox base platform packages, as
10# available from https://www.215389.xyz.
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
28# Include the top-level configure file.
29ifndef VBOX_ROOT_CONFIG_KMK_INCLUDED
30 include $(PATH_ROOT)/Config.kmk
31endif
32
33#
34# Globals.
35#
36VBOX_PATH_XPCOM_SRC := $(PATH_ROOT)/src/libs/xpcom18a4
37
38
39#
40# Template for building the XPCOM libraries (shared).
41#
42TEMPLATE_XPComDll = XPCOM libraries (shared)
43TEMPLATE_XPComDll_EXTENDS = VBoxR3DllNonPedantic
44TEMPLATE_XPComDll_CXXFLAGS = -g -pipe -ansi -Wall -Wno-unused -Wno-non-virtual-dtor \
45 $(VBOX_GCC_Wno-invalid-offsetof) -Wno-sign-compare -Wno-unused -Wno-ctor-dtor-privacy \
46 $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) \
47 $(VBOX_GCC_Wno-delete-non-virtual-dtor) $(VBOX_GCC_Wno-multistatement-macros) $(VBOX_GCC_fdiagnostics-show-option) \
48 $(VBOX_GCC_SANITIZER_FLAGS) $(VBOX_GCC_OPT) $(VBOX_GCC_FP)
49#if !defined(VBOX_GCC_Wno-delete-non-virtual-dtor) && defined(VBOX_GCC_Wno-non-virtual-dtor)
50ifndef VBOX_GCC_Wno-delete-non-virtual-dtor
51 ifdef VBOX_GCC_Wno-non-virtual-dtor
52 TEMPLATE_XPComDll_CXXFLAGS += $(VBOX_GCC_Wno-non-virtual-dtor)
53 endif
54endif
55TEMPLATE_XPComDll_CXXFLAGS.x86 = -m32
56TEMPLATE_XPComDll_CXXFLAGS.amd64 = -m64
57TEMPLATE_XPComDll_CXXFLAGS.darwin = -fpascal-strings -fshort-wchar -fno-common -fno-rtti $(VBOX_DARWIN_DEF_SDK_CXXFLAGS)
58TEMPLATE_XPComDll_CXXFLAGS.freebsd = -pthread
59TEMPLATE_XPComDll_CXXFLAGS.linux = -pthread
60TEMPLATE_XPComDll_CXXFLAGS.solaris = -fno-omit-frame-pointer # for now anyway.
61TEMPLATE_XPComDll_CFLAGS = -g -pipe -Wall -Wno-unused -Wno-parentheses -Wno-uninitialized $(VBOX_GCC_fvisibility-hidden) \
62 $(VBOX_GCC_Wno-multistatement-macros) $(VBOX_GCC_fdiagnostics-show-option) $(VBOX_GCC_SANITIZER_FLAGS) $(VBOX_GCC_OPT) $(VBOX_GCC_FP)
63TEMPLATE_XPComDll_CFLAGS.x86 = -m32
64TEMPLATE_XPComDll_CFLAGS.amd64 = -m64
65TEMPLATE_XPComDll_CFLAGS.freebsd = -pthread
66TEMPLATE_XPComDll_CFLAGS.linux = -pthread -ansi
67TEMPLATE_XPComDll_CFLAGS.solaris = -fno-omit-frame-pointer # for now anyway.
68TEMPLATE_XPComDll_DEFS = \
69 MOZILLA_CLIENT=1 \
70 NDEBUG=1 \
71 _IMPL_NS_COM \
72 IN_RING3 \
73 LOG_GROUP=LOG_GROUP_XPCOM
74ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
75 TEMPLATE_XPComDll_DEFS += \
76 XPCOM_DLL_BASE="$(basename $(notdir $(LIB_XPCOM)))" \
77 MOZ_DLL_SUFFIX="$(suffix $(LIB_XPCOM))"
78else
79 TEMPLATE_XPComDll_DEFS += \
80 XPCOM_DLL_BASE=\"$(basename $(notdir $(LIB_XPCOM)))\" \
81 MOZ_DLL_SUFFIX=\"$(suffix $(LIB_XPCOM))\"
82endif
83
84ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
85 TEMPLATE_XPComDll_DEFS += VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
86endif
87TEMPLATE_XPComDll_DEFS.x86 = i386=1
88ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
89 TEMPLATE_XPComDll_DEFS.amd64 = HAVE_VA_LIST_AS_ARRAY HAVE_VA_COPY VA_COPY(a,b)=__builtin_va_copy(a,b)
90else
91 TEMPLATE_XPComDll_DEFS.amd64 = HAVE_VA_LIST_AS_ARRAY HAVE_VA_COPY VA_COPY\(a\,b\)=__builtin_va_copy\(a\,b\)
92endif
93ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
94 TEMPLATE_XPComDll_DEFS.arm64 = HAVE_VA_LIST_AS_ARRAY HAVE_VA_COPY VA_COPY(a,b)=__builtin_va_copy(a,b)
95else
96 TEMPLATE_XPComDll_DEFS.arm64 = HAVE_VA_LIST_AS_ARRAY HAVE_VA_COPY VA_COPY\(a\,b\)=__builtin_va_copy\(a\,b\)
97endif
98ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
99 TEMPLATE_XPComDll_DEFS.darwin = XP_UNIX=1 XP_MACOSX=1 TARGET_CARBON=1 HAVE_VISIBILITY_ATTRIBUTE=1 $(TEMPLATE_VBoxR3DllNonPedantic_DEFS.darwin)
100else
101 TEMPLATE_XPComDll_DEFS.darwin = XP_UNIX=1 XP_MACOSX=1 TARGET_CARBON=1 HAVE_VISIBILITY_ATTRIBUTE=1 $(TEMPLATE_VBoxR3DllNonPedantic_DEFS.darwin)
102endif
103ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
104 TEMPLATE_XPComDll_DEFS.freebsd = XP_UNIX=1 HAVE_VISIBILITY_ATTRIBUTE=1
105else
106 TEMPLATE_XPComDll_DEFS.freebsd = XP_UNIX=1 HAVE_VISIBILITY_ATTRIBUTE=1
107endif
108ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
109 TEMPLATE_XPComDll_DEFS.linux = XP_UNIX=1 _GNU_SOURCE HAVE_VISIBILITY_ATTRIBUTE=1
110else
111 TEMPLATE_XPComDll_DEFS.linux = XP_UNIX=1 _GNU_SOURCE HAVE_VISIBILITY_ATTRIBUTE=1
112endif
113ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
114 TEMPLATE_XPComDll_DEFS.solaris = XP_UNIX=1 HAVE_LIBDL=1 HAVE_SENDFILEV=1 _REENTRANT
115else
116 TEMPLATE_XPComDll_DEFS.solaris = XP_UNIX=1 HAVE_LIBDL=1 HAVE_SENDFILEV=1 _REENTRANT
117endif
118TEMPLATE_XPComDll_LDFLAGS = $(TEMPLATE_VBoxR3DllNonPedantic_LDFLAGS)
119ifdef VBOX_WITH_RUNPATH
120 TEMPLATE_XPComDll_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)'
121else ifdef VBOX_WITH_RELATIVE_RUNPATH
122 TEMPLATE_XPComDll_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)'
123endif
124TEMPLATE_XPComDll_LDFLAGS.x86 = -m32
125TEMPLATE_XPComDll_LDFLAGS.amd64 = -m64
126TEMPLATE_XPComDll_LDFLAGS.darwin = $(TEMPLATE_VBoxR3DllNonPedantic_LDFLAGS.darwin) \
127 -fshort-wchar -fno-rtti -fno-exceptions -fpascal-strings \
128 -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
129 -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
130 -framework CoreServices \
131 -framework CoreFoundation \
132 -framework Foundation \
133 -framework AppKit \
134 -framework Carbon
135## @todo why is -fno-exceptions here.
136ifn1of ($(KBUILD_TARGET), os2 win)
137 TEMPLATE_XPComDll_CXXFLAGS += -fPIC
138 TEMPLATE_XPComDll_CFLAGS += -fPIC
139 TEMPLATE_XPComDll_LDFLAGS += -fPIC
140 TEMPLATE_XPComDll_DEFS += MOZ_PRESERVE_PIC
141endif
142TEMPLATE_XPComDll_INCS = $(VBOX_PATH_XPCOM_SRC)/xpcom/build \
143 $(VBOX_PATH_XPCOM_SRC)/xpcom/ds \
144 $(VBOX_PATH_XPCOM_SRC)/xpcom/io \
145 $(VBOX_PATH_XPCOM_SRC)/xpcom/base \
146 $(VBOX_PATH_XPCOM_SRC)/xpcom/components \
147 $(VBOX_PATH_XPCOM_SRC)/xpcom/threads \
148 $(VBOX_PATH_XPCOM_SRC)/xpcom/proxy/src \
149 $(VBOX_PATH_XPCOM_SRC)/xpcom/reflect/xptcall/src \
150 $(VBOX_PATH_XPCOM_SRC)/ipc/ipcd/client/src \
151 $(VBOX_PATH_XPCOM_SRC)/ipc/ipcd/shared/src \
152 $(VBOX_PATH_SDK)/bindings/xpcom/include \
153 $(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \
154 $(VBOX_PATH_SDK)/bindings/xpcom/include/string \
155 $(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
156 $(VBOX_PATH_SDK)/bindings/xpcom/include/ipcd \
157 .
158TEMPLATE_XPComDll_DEFS.darwin += VBOX_WITH_NEWER_OSX_SDK
159TEMPLATE_XPComDll_INCS.darwin = \
160 $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/CoreFoundation.framework/Versions/A/Headers/ \
161 $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers/ \
162 $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/Headers/
163
164TEMPLATE_XPComDll_ORDERDEPS = $(foreach hdrinst, $(filter %-HEADERS, $(INSTALLS)), $($(hdrinst)_1_TARGET)) \
165 $(PATH_TARGET)/VBox-xpcom-idl-timestamp
166
167# When using IPRT in NSRP or/and using IPRT for logging, link with IPRT.
168TEMPLATE_XPComDll_LATE_LIBS += $(LIB_RUNTIME)
169
170
171#
172# Template for building the XPCOM executables.
173# Used as a base template by XPComTstExe and XPComIpcExe.
174#
175TEMPLATE_XPComExe := XPCOM executable files
176TEMPLATE_XPComExe_EXTENDS := XPComDll
177## @todo undo -fPIC.
178TEMPLATE_XPComExe_INCS = ipc/ipcd/shared/src \
179 $(VBOX_PATH_SDK)/bindings/xpcom/include \
180 $(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \
181 $(VBOX_PATH_SDK)/bindings/xpcom/include/string \
182 $(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
183 $(VBOX_PATH_SDK)/bindings/xpcom/include/ipcd \
184 .
185TEMPLATE_XPComExe_LATE_LIBS = \
186 $(VBox-xpcom-ipcshared_1_TARGET) \
187 $(VBoxXPCOM_1_TARGET) \
188 $(TEMPLATE_XPComDll_LATE_LIBS)
189TEMPLATE_XPComExe_LATE_LIBS.freebsd = $(LIB_PTHREAD)
190TEMPLATE_XPComExe_LATE_LIBS.linux = dl $(LIB_PTHREAD)
191TEMPLATE_XPComExe_LDFLAGS.darwin = -bind_at_load $(filter-out -current_version -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD),$(TEMPLATE_XPComDll_LDFLAGS.darwin))
192
193
194#
195# Template for building the XPCOM testcase executables
196#
197TEMPLATE_XPComTstExe = XPCOM executable files (testcases)
198TEMPLATE_XPComTstExe_EXTENDS = XPComExe
199TEMPLATE_XPComTstExe_CXXFLAGS = $(TEMPLATE_XPComExe_CXXFLAGS) -Wno-format
200TEMPLATE_XPComTstExe_CFLAGS = $(TEMPLATE_XPComExe_CFLAGS) -Wno-format
201TEMPLATE_XPComTstExe_INST = $(INST_TESTCASE)
202ifdef VBOX_WITH_RUNPATH
203 TEMPLATE_XPComTstExe_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' $(TEMPLATE_XPComExe_LDFLAGS)
204else ifdef VBOX_WITH_RELATIVE_RUNPATH
205 TEMPLATE_XPComTstExe_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/..' $(TEMPLATE_XPComExe_LDFLAGS)
206endif
207if "$(KBUILD_TARGET)" == "win" && defined(VBOX_SIGNING_MODE)
208 TEMPLATE_XPComTstExe_POST_CMDS =
209endif
210
211
212#
213# Template for building XPCOM executables for running at build time.
214#
215TEMPLATE_XPComBldProg = XPCOM Build programs executables
216TEMPLATE_XPComBldProg_EXTENDS = VBoxAdvBldProg
217TEMPLATE_XPComBldProg_DEFS.$(KBUILD_HOST) = $(TEMPLATE_VBoxAdvBldProg_DEFS.$(KBUILD_HOST)) $(TEMPLATE_XPComExe_DEFS.$(KBUILD_HOST))
218TEMPLATE_XPComBldProg_DEFS.x86 = $(TEMPLATE_VBoxAdvBldProg_DEFS.x86) $(TEMPLATE_XPComExe_DEFS.x86)
219TEMPLATE_XPComBldProg_DEFS.amd64 = $(TEMPLATE_VBoxAdvBldProg_DEFS.amd64) $(TEMPLATE_XPComExe_DEFS.amd64)
220TEMPLATE_XPComBldProg_DEFS.arm64 = $(TEMPLATE_VBoxAdvBldProg_DEFS.arm64) $(TEMPLATE_XPComExe_DEFS.arm64)
221TEMPLATE_XPComBldProg_CFLAGS += -std=c99
222TEMPLATE_XPComBldProg_INCS = \
223 $(VBOX_PATH_SDK)/bindings/xpcom/include \
224 $(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \
225 $(VBOX_PATH_SDK)/bindings/xpcom/include/string \
226 $(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
227 $(VBOX_PATH_SDK)/bindings/xpcom/include/ipcd
228TEMPLATE_XPComBldProg_ORDERDEPS = $(foreach hdrinst, $(filter %-HEADERS, $(INSTALLS)), $($(hdrinst)_1_TARGET))
229TEMPLATE_XPComBldProg_LATE_LIBS.darwin = \
230 iconv
231
232#
233# Creates a x86 target for an XPCOM target if so desired.
234# The target is specified as the first argument: $(evalcall VBOX_XPCOM_X86,target).
235#
236ifdef VBOX_WITH_32_ON_64_MAIN_API
237 define VBOX_XPCOM_X86
238 $(1)-x86_TEMPLATE := $(strip $($(1)_TEMPLATE))-x86
239 $(1)-x86_EXTENDS := $(1)
240 endef
241else
242 define VBOX_XPCOM_X86
243 endef
244endif
245
246# Corresponding 32-bit template(s).
247TEMPLATE_XPComDll-x86 = 32-bit XPCOM libraries (shared)
248TEMPLATE_XPComDll-x86_EXTENDS = XPComDll
249TEMPLATE_XPComDll-x86_BLD_TRG_ARCH = x86
250TEMPLATE_XPComDll-x86_DEFS = $(TEMPLATE_XPComDll_DEFS) VBOX_IN_32_ON_64_MAIN_API
251TEMPLATE_XPComDll-x86_LATE_LIBS = $(subst $(LIB_RUNTIME),$(VBOX_LIB_RUNTIME_X86),$(TEMPLATE_XPComDll_LATE_LIBS))
252
253
254#
255# The list of XPCOM's IDL files.
256# This is used by the java bindings as well as the XPCOM build.
257#
258XPCOM_IDLFILES = \
259 xpcom/base/nsIDebug.idl \
260 xpcom/base/nsIInterfaceRequestor.idl \
261 xpcom/base/nsIProgrammingLanguage.idl \
262 xpcom/base/nsISupports.idl \
263 xpcom/base/nsITraceRefcnt.idl \
264 xpcom/base/nsIWeakReference.idl \
265 xpcom/base/nsIErrorService.idl \
266 xpcom/base/nsIException.idl \
267 xpcom/base/nsIExceptionService.idl \
268 xpcom/base/nsrootidl.idl \
269 xpcom/components/nsIClassInfo.idl \
270 xpcom/components/nsIComponentRegistrar.idl \
271 xpcom/components/nsIFactory.idl \
272 xpcom/components/nsIModule.idl \
273 xpcom/components/nsIServiceManager.idl \
274 xpcom/components/nsIComponentManager.idl \
275 xpcom/components/nsICategoryManager.idl \
276 xpcom/components/nsIComponentLoader.idl \
277 xpcom/components/nsINativeComponentLoader.idl \
278 xpcom/components/nsIComponentManagerObsolete.idl \
279 xpcom/components/nsIComponentLoaderManager.idl \
280 xpcom/ds/nsISupportsArray.idl \
281 xpcom/ds/nsICollection.idl \
282 xpcom/ds/nsISerializable.idl \
283 xpcom/ds/nsIEnumerator.idl \
284 xpcom/ds/nsISimpleEnumerator.idl \
285 xpcom/ds/nsIObserverService.idl \
286 xpcom/ds/nsIObserver.idl \
287 xpcom/ds/nsIAtom.idl \
288 xpcom/ds/nsIAtomService.idl \
289 xpcom/ds/nsIProperties.idl \
290 xpcom/ds/nsIStringEnumerator.idl \
291 xpcom/ds/nsISupportsPrimitives.idl \
292 xpcom/ds/nsISupportsIterators.idl \
293 xpcom/ds/nsIVariant.idl \
294 xpcom/ds/nsIArray.idl \
295 xpcom/ds/nsIHashable.idl \
296 xpcom/io/nsIDirectoryService.idl \
297 xpcom/io/nsIDirectoryEnumerator.idl \
298 xpcom/io/nsIFile.idl \
299 xpcom/io/nsILocalFile.idl \
300 xpcom/io/nsILocalFileMac.idl \
301 xpcom/io/nsIInputStream.idl \
302 xpcom/io/nsIObjectInputStream.idl \
303 xpcom/io/nsIBinaryInputStream.idl \
304 xpcom/io/nsIObjectOutputStream.idl \
305 xpcom/io/nsIBinaryOutputStream.idl \
306 xpcom/io/nsIOutputStream.idl \
307 xpcom/proxy/public/nsIProxyObjectManager.idl \
308 xpcom/threads/nsIEventQueueService.idl \
309 xpcom/threads/nsIEventQueue.idl \
310 xpcom/threads/nsIEventTarget.idl \
311 xpcom/threads/nsIRunnable.idl \
312 xpcom/reflect/xptinfo/public/nsIInterfaceInfo.idl \
313 xpcom/reflect/xptinfo/public/nsIInterfaceInfoManager.idl \
314 xpcom/reflect/xptinfo/public/nsIXPTLoader.idl \
315 ipc/ipcd/client/public/ipcIService.idl \
316 ipc/ipcd/client/public/ipcIMessageObserver.idl \
317 ipc/ipcd/client/public/ipcIClientObserver.idl \
318 ipc/ipcd/client/public/ipcIDConnectService.idl
319
320#
321# The include path for the XPCOM IDL files above.
322#
323XPIDL_INCS = \
324 -I $(VBOX_PATH_XPCOM_SRC)/xpcom/base/ \
325 -I $(VBOX_PATH_XPCOM_SRC)/xpcom/ds/ \
326 -I $(VBOX_PATH_XPCOM_SRC)/xpcom/components/ \
327 -I $(VBOX_PATH_XPCOM_SRC)/xpcom/io/ \
328 -I $(VBOX_PATH_XPCOM_SRC)/xpcom/threads/ \
329 -I $(VBOX_PATH_XPCOM_SRC)/xpcom/reflect/xptinfo/public/
330
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette