VirtualBox

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

Last change on this file since 106580 was 106535, checked in by vboxsync, 6 weeks ago

libs/xpcom18a4: We only have one assembly file now, which is yasm/nasm style, so drop the messing with ASTOOL and ASFLAGS and the extra Yasm template variants. jiraref:VBP-1171

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 14.4 KB
Line 
1# $Id: Config.kmk 106535 2024-10-21 00:11:59Z 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.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
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
73ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
74 TEMPLATE_XPComDll_DEFS += \
75 XPCOM_DLL_BASE="$(basename $(notdir $(LIB_XPCOM)))" \
76 MOZ_DLL_SUFFIX="$(suffix $(LIB_XPCOM))"
77else
78 TEMPLATE_XPComDll_DEFS += \
79 XPCOM_DLL_BASE=\"$(basename $(notdir $(LIB_XPCOM)))\" \
80 MOZ_DLL_SUFFIX=\"$(suffix $(LIB_XPCOM))\"
81endif
82
83ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
84 TEMPLATE_XPComDll_DEFS += VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
85endif
86TEMPLATE_XPComDll_DEFS.x86 = i386=1
87ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
88 TEMPLATE_XPComDll_DEFS.amd64 = HAVE_VA_LIST_AS_ARRAY HAVE_VA_COPY VA_COPY(a,b)=__builtin_va_copy(a,b)
89else
90 TEMPLATE_XPComDll_DEFS.amd64 = HAVE_VA_LIST_AS_ARRAY HAVE_VA_COPY VA_COPY\(a\,b\)=__builtin_va_copy\(a\,b\)
91endif
92ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
93 TEMPLATE_XPComDll_DEFS.arm64 = HAVE_VA_LIST_AS_ARRAY HAVE_VA_COPY VA_COPY(a,b)=__builtin_va_copy(a,b)
94else
95 TEMPLATE_XPComDll_DEFS.arm64 = HAVE_VA_LIST_AS_ARRAY HAVE_VA_COPY VA_COPY\(a\,b\)=__builtin_va_copy\(a\,b\)
96endif
97ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
98 TEMPLATE_XPComDll_DEFS.darwin = XP_UNIX=1 XP_MACOSX=1 TARGET_CARBON=1 HAVE_VISIBILITY_ATTRIBUTE=1 $(TEMPLATE_VBoxR3DllNonPedantic_DEFS.darwin)
99else
100 TEMPLATE_XPComDll_DEFS.darwin = XP_UNIX=1 XP_MACOSX=1 TARGET_CARBON=1 HAVE_VISIBILITY_ATTRIBUTE=1 $(TEMPLATE_VBoxR3DllNonPedantic_DEFS.darwin)
101endif
102ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
103 TEMPLATE_XPComDll_DEFS.freebsd = XP_UNIX=1 HAVE_VISIBILITY_ATTRIBUTE=1
104else
105 TEMPLATE_XPComDll_DEFS.freebsd = XP_UNIX=1 HAVE_VISIBILITY_ATTRIBUTE=1
106endif
107ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
108 TEMPLATE_XPComDll_DEFS.linux = XP_UNIX=1 _GNU_SOURCE HAVE_VISIBILITY_ATTRIBUTE=1
109else
110 TEMPLATE_XPComDll_DEFS.linux = XP_UNIX=1 _GNU_SOURCE HAVE_VISIBILITY_ATTRIBUTE=1
111endif
112ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
113 TEMPLATE_XPComDll_DEFS.solaris = XP_UNIX=1 HAVE_LIBDL=1 HAVE_SENDFILEV=1 _REENTRANT
114else
115 TEMPLATE_XPComDll_DEFS.solaris = XP_UNIX=1 HAVE_LIBDL=1 HAVE_SENDFILEV=1 _REENTRANT
116endif
117TEMPLATE_XPComDll_LDFLAGS = $(TEMPLATE_VBoxR3DllNonPedantic_LDFLAGS)
118ifdef VBOX_WITH_RUNPATH
119 TEMPLATE_XPComDll_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)'
120else ifdef VBOX_WITH_RELATIVE_RUNPATH
121 TEMPLATE_XPComDll_LDFLAGS += '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)'
122endif
123TEMPLATE_XPComDll_LDFLAGS.x86 = -m32
124TEMPLATE_XPComDll_LDFLAGS.amd64 = -m64
125TEMPLATE_XPComDll_LDFLAGS.darwin = $(TEMPLATE_VBoxR3DllNonPedantic_LDFLAGS.darwin) \
126 -fshort-wchar -fno-rtti -fno-exceptions -fpascal-strings \
127 -current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
128 -compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
129 -framework CoreServices \
130 -framework CoreFoundation \
131 -framework Foundation \
132 -framework AppKit \
133 -framework Carbon
134## @todo why is -fno-exceptions here.
135ifn1of ($(KBUILD_TARGET), os2 win)
136 TEMPLATE_XPComDll_CXXFLAGS += -fPIC
137 TEMPLATE_XPComDll_CFLAGS += -fPIC
138 TEMPLATE_XPComDll_LDFLAGS += -fPIC
139 TEMPLATE_XPComDll_DEFS += MOZ_PRESERVE_PIC
140endif
141TEMPLATE_XPComDll_INCS = $(VBOX_PATH_XPCOM_SRC)/xpcom/build \
142 $(VBOX_PATH_XPCOM_SRC)/xpcom/ds \
143 $(VBOX_PATH_XPCOM_SRC)/xpcom/io \
144 $(VBOX_PATH_XPCOM_SRC)/xpcom/base \
145 $(VBOX_PATH_XPCOM_SRC)/xpcom/components \
146 $(VBOX_PATH_XPCOM_SRC)/xpcom/threads \
147 $(VBOX_PATH_XPCOM_SRC)/xpcom/proxy/src \
148 $(VBOX_PATH_XPCOM_SRC)/xpcom/reflect/xptcall/src \
149 $(VBOX_PATH_XPCOM_SRC)/ipc/ipcd/client/src \
150 $(VBOX_PATH_XPCOM_SRC)/ipc/ipcd/shared/src \
151 $(VBOX_PATH_SDK)/bindings/xpcom/include \
152 $(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \
153 $(VBOX_PATH_SDK)/bindings/xpcom/include/string \
154 $(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
155 $(VBOX_PATH_SDK)/bindings/xpcom/include/ipcd \
156 .
157TEMPLATE_XPComDll_DEFS.darwin += VBOX_WITH_NEWER_OSX_SDK
158TEMPLATE_XPComDll_INCS.darwin = \
159 $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/CoreFoundation.framework/Versions/A/Headers/ \
160 $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers/ \
161 $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/Headers/
162
163TEMPLATE_XPComDll_ORDERDEPS = $(foreach hdrinst, $(filter %-HEADERS, $(INSTALLS)), $($(hdrinst)_1_TARGET)) \
164 $(PATH_TARGET)/VBox-xpcom-idl-timestamp
165
166# When using IPRT in NSRP or/and using IPRT for logging, link with IPRT.
167TEMPLATE_XPComDll_LIBS += $(LIB_RUNTIME)
168
169
170#
171# Template for building the XPCOM executables.
172# Used as a base template by XPComTstExe and XPComIpcExe.
173#
174TEMPLATE_XPComExe := XPCOM executable files
175TEMPLATE_XPComExe_EXTENDS := XPComDll
176## @todo undo -fPIC.
177TEMPLATE_XPComExe_INCS = ipc/ipcd/shared/src \
178 $(VBOX_PATH_SDK)/bindings/xpcom/include \
179 $(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \
180 $(VBOX_PATH_SDK)/bindings/xpcom/include/string \
181 $(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
182 $(VBOX_PATH_SDK)/bindings/xpcom/include/ipcd \
183 .
184TEMPLATE_XPComExe_LIBS = \
185 $(VBox-xpcom-ipcshared_1_TARGET) \
186 $(VBoxXPCOM_1_TARGET) \
187 $(TEMPLATE_XPComDll_LIBS)
188TEMPLATE_XPComExe_LIBS.freebsd = $(LIB_PTHREAD)
189TEMPLATE_XPComExe_LIBS.linux = dl $(LIB_PTHREAD)
190TEMPLATE_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))
191
192
193#
194# Template for building the XPCOM testcase executables
195#
196TEMPLATE_XPComTstExe = XPCOM executable files (testcases)
197TEMPLATE_XPComTstExe_EXTENDS = XPComExe
198TEMPLATE_XPComTstExe_CXXFLAGS = $(TEMPLATE_XPComExe_CXXFLAGS) -Wno-format
199TEMPLATE_XPComTstExe_CFLAGS = $(TEMPLATE_XPComExe_CFLAGS) -Wno-format
200TEMPLATE_XPComTstExe_INST = $(INST_TESTCASE)
201ifdef VBOX_WITH_RUNPATH
202 TEMPLATE_XPComTstExe_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RUNPATH)' $(TEMPLATE_XPComExe_LDFLAGS)
203else ifdef VBOX_WITH_RELATIVE_RUNPATH
204 TEMPLATE_XPComTstExe_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$(VBOX_WITH_RELATIVE_RUNPATH)/..' $(TEMPLATE_XPComExe_LDFLAGS)
205endif
206if "$(KBUILD_TARGET)" == "win" && defined(VBOX_SIGNING_MODE)
207 TEMPLATE_XPComTstExe_POST_CMDS =
208endif
209
210
211#
212# Template for building XPCOM executables for running at build time.
213#
214# It extends the BLDPROG template in config.kmk but overrides CFLAGS
215# and CXXFLAGS completely at the moment.
216#
217TEMPLATE_XPComBldProg = XPCOM Build programs executables
218TEMPLATE_XPComBldProg_EXTENDS = VBoxAdvBldProg
219TEMPLATE_XPComBldProg_DEFS.$(KBUILD_HOST) = $(TEMPLATE_VBoxAdvBldProg_DEFS.$(KBUILD_HOST)) $(TEMPLATE_XPComExe_DEFS.$(KBUILD_HOST))
220TEMPLATE_XPComBldProg_DEFS.x86 = $(TEMPLATE_VBoxAdvBldProg_DEFS.x86) $(TEMPLATE_XPComExe_DEFS.x86)
221TEMPLATE_XPComBldProg_DEFS.amd64 = $(TEMPLATE_VBoxAdvBldProg_DEFS.amd64) $(TEMPLATE_XPComExe_DEFS.amd64)
222TEMPLATE_XPComBldProg_DEFS.arm64 = $(TEMPLATE_VBoxAdvBldProg_DEFS.arm64) $(TEMPLATE_XPComExe_DEFS.arm64)
223TEMPLATE_XPComBldProg_INCS = \
224 $(VBOX_PATH_SDK)/bindings/xpcom/include \
225 $(VBOX_PATH_SDK)/bindings/xpcom/include/nsprpub \
226 $(VBOX_PATH_SDK)/bindings/xpcom/include/string \
227 $(VBOX_PATH_SDK)/bindings/xpcom/include/xpcom \
228 $(VBOX_PATH_SDK)/bindings/xpcom/include/ipcd
229TEMPLATE_XPComBldProg_CFLAGS = $(filter-out $(VBOX_GCC_PEDANTIC_C), $(TEMPLATE_VBoxAdvBldProg_CFLAGS)) \
230 $(VBOX_GCC_Wno-int-to-pointer-cast) $(VBOX_GCC_Wno-pointer-to-int-cast) $(VBOX_GCC_NON_PEDANTIC_C)
231TEMPLATE_XPComBldProg_CXXFLAGS.darwin = $(TEMPLATE_VBoxAdvBldProg_CXXFLAGS.darwin) -fpascal-strings -fshort-wchar -fno-common -fno-rtti
232TEMPLATE_XPComBldProg_CXXFLAGS.solaris = $(TEMPLATE_VBoxAdvBldProg_CXXFLAGS.solaris) -fno-omit-frame-pointer # for now anyway.
233TEMPLATE_XPComBldProg_LDFLAGS.darwin = $(TEMPLATE_VBoxAdvBldProg_LDFLAGS.darwin) -fpascal-strings -fshort-wchar -fno-rtti -fno-exceptions
234TEMPLATE_XPComBldProg_ORDERDEPS = $(foreach hdrinst, $(filter %-HEADERS, $(INSTALLS)), $($(hdrinst)_1_TARGET))
235TEMPLATE_XPComBldProg_LIBS.darwin = \
236 iconv
237
238#
239# Creates a x86 target for an XPCOM target if so desired.
240# The target is specified as the first argument: $(evalcall VBOX_XPCOM_X86,target).
241#
242ifdef VBOX_WITH_32_ON_64_MAIN_API
243 define VBOX_XPCOM_X86
244 $(1)-x86_TEMPLATE := $(strip $($(1)_TEMPLATE))-x86
245 $(1)-x86_EXTENDS := $(1)
246 endef
247else
248 define VBOX_XPCOM_X86
249 endef
250endif
251
252# Corresponding 32-bit template(s).
253TEMPLATE_XPComDll-x86 = 32-bit XPCOM libraries (shared)
254TEMPLATE_XPComDll-x86_EXTENDS = XPComDll
255TEMPLATE_XPComDll-x86_BLD_TRG_ARCH = x86
256TEMPLATE_XPComDll-x86_DEFS = $(TEMPLATE_XPComDll_DEFS) VBOX_IN_32_ON_64_MAIN_API
257TEMPLATE_XPComDll-x86_LIBS = $(subst $(LIB_RUNTIME),$(VBOX_LIB_RUNTIME_X86),$(TEMPLATE_XPComDll_LIBS))
258
259
260#
261# The list of XPCOM's IDL files.
262# This is used by the java bindings as well as the XPCOM build.
263#
264XPCOM_IDLFILES = \
265 xpcom/base/nsIDebug.idl \
266 xpcom/base/nsIInterfaceRequestor.idl \
267 xpcom/base/nsIProgrammingLanguage.idl \
268 xpcom/base/nsISupports.idl \
269 xpcom/base/nsITraceRefcnt.idl \
270 xpcom/base/nsIWeakReference.idl \
271 xpcom/base/nsIErrorService.idl \
272 xpcom/base/nsIException.idl \
273 xpcom/base/nsIExceptionService.idl \
274 xpcom/base/nsrootidl.idl \
275 xpcom/components/nsIClassInfo.idl \
276 xpcom/components/nsIComponentRegistrar.idl \
277 xpcom/components/nsIFactory.idl \
278 xpcom/components/nsIModule.idl \
279 xpcom/components/nsIServiceManager.idl \
280 xpcom/components/nsIComponentManager.idl \
281 xpcom/components/nsICategoryManager.idl \
282 xpcom/components/nsIComponentLoader.idl \
283 xpcom/components/nsINativeComponentLoader.idl \
284 xpcom/components/nsIComponentManagerObsolete.idl \
285 xpcom/components/nsIComponentLoaderManager.idl \
286 xpcom/ds/nsISupportsArray.idl \
287 xpcom/ds/nsICollection.idl \
288 xpcom/ds/nsISerializable.idl \
289 xpcom/ds/nsIEnumerator.idl \
290 xpcom/ds/nsISimpleEnumerator.idl \
291 xpcom/ds/nsIObserverService.idl \
292 xpcom/ds/nsIObserver.idl \
293 xpcom/ds/nsIAtom.idl \
294 xpcom/ds/nsIAtomService.idl \
295 xpcom/ds/nsIProperties.idl \
296 xpcom/ds/nsIStringEnumerator.idl \
297 xpcom/ds/nsISupportsPrimitives.idl \
298 xpcom/ds/nsISupportsIterators.idl \
299 xpcom/ds/nsIVariant.idl \
300 xpcom/ds/nsIArray.idl \
301 xpcom/ds/nsIHashable.idl \
302 xpcom/io/nsIDirectoryService.idl \
303 xpcom/io/nsIDirectoryEnumerator.idl \
304 xpcom/io/nsIFile.idl \
305 xpcom/io/nsILocalFile.idl \
306 xpcom/io/nsILocalFileMac.idl \
307 xpcom/io/nsIInputStream.idl \
308 xpcom/io/nsIObjectInputStream.idl \
309 xpcom/io/nsIBinaryInputStream.idl \
310 xpcom/io/nsIObjectOutputStream.idl \
311 xpcom/io/nsIBinaryOutputStream.idl \
312 xpcom/io/nsIOutputStream.idl \
313 xpcom/proxy/public/nsIProxyObjectManager.idl \
314 xpcom/threads/nsIEventQueueService.idl \
315 xpcom/threads/nsIEventQueue.idl \
316 xpcom/threads/nsIEventTarget.idl \
317 xpcom/threads/nsIRunnable.idl \
318 xpcom/reflect/xptinfo/public/nsIInterfaceInfo.idl \
319 xpcom/reflect/xptinfo/public/nsIInterfaceInfoManager.idl \
320 xpcom/reflect/xptinfo/public/nsIXPTLoader.idl \
321 ipc/ipcd/client/public/ipcIService.idl \
322 ipc/ipcd/client/public/ipcIMessageObserver.idl \
323 ipc/ipcd/client/public/ipcIClientObserver.idl \
324 ipc/ipcd/client/public/ipcIDConnectService.idl
325
326#
327# The include path for the XPCOM IDL files above.
328#
329XPIDL_INCS = \
330 -I $(VBOX_PATH_XPCOM_SRC)/xpcom/base/ \
331 -I $(VBOX_PATH_XPCOM_SRC)/xpcom/ds/ \
332 -I $(VBOX_PATH_XPCOM_SRC)/xpcom/components/ \
333 -I $(VBOX_PATH_XPCOM_SRC)/xpcom/io/ \
334 -I $(VBOX_PATH_XPCOM_SRC)/xpcom/threads/ \
335 -I $(VBOX_PATH_XPCOM_SRC)/xpcom/reflect/xptinfo/public/
336
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