VirtualBox

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

Last change on this file since 98676 was 98394, checked in by vboxsync, 2 years ago

libs/xpcom18a4: *.kmk automatic scm cleanups. bugref:10348

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 24.8 KB
Line 
1# $Id: Makefile.kmk 98394 2023-02-01 14:35:25Z vboxsync $
2## @file
3# Sub-Makefile for Python bindings
4#
5
6#
7# Copyright (C) 2009-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#
32# List of supported Python versions, defining a number of
33# VBOX_PYTHON[26|27|31|32|32M|33|33M|34|34M|35|35M|36|36M|37|37M|38|38M|39|39M|310|310M|DEF]_[INC|LIB] variables
34# which get picked up below.
35#
36ifeq ($(KBUILD_TARGET),darwin) # Relatively predictable, don't script.
37 ifn1of ($(VBOX_DEF_MACOSX_VERSION_MIN), 10.10 10.9 10.8 10.7 10.6 10.5 10.4) ## @todo @bugref{9790}: if $(VBOX_DEF_MACOSX_VERSION_MIN) vge 10.11
38 VBOX_PYTHON_SUFFTBD := .tbd
39 else
40 VBOX_PYTHON_SUFFTBD :=
41 endif
42 ifndef VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6
43 if1of ($(VBOX_DEF_MACOSX_VERSION_MIN), 10.5 10.4)
44 VBOX_PYTHON26_INC = $(VBOX_PATH_MACOSX_SDK_10_6)/usr/include/python2.6
45 VBOX_PYTHON26_LIB = $(VBOX_PATH_MACOSX_SDK_10_6)/usr/lib/libpython2.6.dylib
46 else if "$(VBOX_DEF_MACOSX_VERSION_MIN)" == "10.9" && "$(VBOX_XCODE_VERSION)" == "6.2" # 'effing 10.9 SDK in Xcode 6.2 is missing python. Stupid, stupid Apple!!
47 VBOX_PYTHON26_INC = $(VBOX_PATH_MACOSX_SDK)/../MacOSX10.10.sdk/System/Library/Frameworks/Python.framework/Versions/2.6/Headers
48 VBOX_PYTHON26_LIB = $(VBOX_PATH_MACOSX_SDK)/../MacOSX10.10.sdk/System/Library/Frameworks/Python.framework/Versions/2.6/Python
49 else if "$(VBOX_DEF_MACOSX_VERSION_MIN)" vlt "10.13"
50 VBOX_PYTHON26_INC = $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/Python.framework/Versions/2.6/Headers
51 VBOX_PYTHON26_LIB = $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/Python.framework/Versions/2.6/Python$(VBOX_PYTHON_SUFFTBD)
52 endif
53 if !defined(VBOX_OSE) || "$(wildcard $(VBOX_PYTHON26_LIB))" != ""
54 VBOX_PYTHON26_LIB_X86 = $(VBOX_PYTHON26_LIB)
55 else
56 VBOX_PYTHON26_INC =
57 VBOX_PYTHON26_LIB =
58 endif
59 endif
60 ifndef VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_7
61 if1of ($(VBOX_DEF_MACOSX_VERSION_MIN), 10.6 10.5 10.4)
62 VBOX_PYTHON27_INC = $(VBOX_PATH_MACOSX_SDK_10_7)/usr/include/python2.7
63 VBOX_PYTHON27_LIB = $(VBOX_PATH_MACOSX_SDK_10_7)/usr/lib/libpython2.7.dylib
64 else if "$(VBOX_DEF_MACOSX_VERSION_MIN)" == "10.9" && "$(VBOX_XCODE_VERSION)" == "6.2" # 'effing 10.9 SDK in Xcode 6.2 is missing python. Stupid, stupid Apple!!
65 VBOX_PYTHON27_INC = $(VBOX_PATH_MACOSX_SDK)/../MacOSX10.10.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/Headers
66 VBOX_PYTHON27_LIB = $(VBOX_PATH_MACOSX_SDK)/../MacOSX10.10.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/Python
67 else
68 VBOX_PYTHON27_INC = $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/Python.framework/Versions/2.7/Headers
69 VBOX_PYTHON27_LIB = $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/Python.framework/Versions/2.7/Python$(VBOX_PYTHON_SUFFTBD)
70 endif
71 if !defined(VBOX_OSE) || "$(wildcard $(VBOX_PYTHON27_LIB))" != ""
72 VBOX_PYTHON27_LIB_X86 = $(VBOX_PYTHON27_LIB)
73 else
74 VBOX_PYTHON27_INC =
75 VBOX_PYTHON27_LIB =
76 endif
77 endif
78 # No Python 3.x yet as part of OSX versions including El Capitan, 10.11.
79
80else
81 # Use the script.
82 $(eval $(subst |,$(NL),$(shell $(VBOX_BLD_PYTHON) \
83 $(PATH_SUB_CURRENT)/gen_python_deps.py \
84 $(KBUILD_TARGET) \
85 $(KBUILD_TARGET_ARCH) \
86 $(if-expr defined(VBOX_WITH_MULTIVERSION_PYTHON),1,0))))
87endif
88
89ifndef VBOX_ONLY_SDK
90
91 #
92 # Base Python Client Module - the C++/XPCOM bits (not actually built).
93 #
94 VBoxPythonBase_TEMPLATE = XPComDll
95 VBoxPythonBase_CXXFLAGS = -Wno-write-strings
96 VBoxPythonBase_CXXFLAGS.solaris = $(VBOX_GCC_Wno-unknown-pragmas) # /usr/include/python[23].[75]*/ceval.h:67: warning: ignoring #pragma no_inline(PyEval_EvalFrameEx)
97 VBoxPythonBase_DLLSUFF.darwin = .so
98 VBoxPythonBase_DEFS = \
99 _IMPL_NS_COM \
100 _IMPL_NS_BASE \
101 EXPORT_XPTI_API \
102 EXPORT_XPT_API \
103 VBOX_PYXPCOM \
104 VBOX_WITH_XPCOM \
105 VBOX_PYXPCOM_VERSIONED
106 #VBoxPythonBase_DEFS.debug = \
107 # VBOX_DEBUG_LIFETIMES
108 VBoxPythonBase_INCS = \
109 src
110 VBoxPythonBase_SOURCES = \
111 src/module/_xpcom.cpp \
112 src/dllmain.cpp \
113 src/ErrorUtils.cpp \
114 src/PyGBase.cpp \
115 src/PyGInputStream.cpp \
116 src/PyGModule.cpp \
117 src/PyGStub.cpp \
118 src/PyGWeakReference.cpp \
119 src/PyIClassInfo.cpp \
120 src/PyIComponentManager.cpp \
121 src/PyIComponentManagerObsolete.cpp \
122 src/PyIEnumerator.cpp \
123 src/PyIID.cpp \
124 src/PyIInputStream.cpp \
125 src/PyIInterfaceInfo.cpp \
126 src/PyIInterfaceInfoManager.cpp \
127 src/PyISimpleEnumerator.cpp \
128 src/PyISupports.cpp \
129 src/PyIVariant.cpp \
130 src/Pyxpt_info.cpp \
131 src/TypeObject.cpp \
132 src/VariantUtils.cpp
133 VBoxPythonBase_LIBS = \
134 $(PATH_STAGE_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \
135 $(PATH_STAGE_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL)
136
137 # pymalloc abi variant.
138 VBoxPythonBase_m_EXTENDS = VBoxPythonBase
139 VBoxPythonBase_m_DEFS = MODULE_NAME_SUFFIX=m $(VBoxPythonBase_DEFS)
140
141 # 32-bit base.
142 VBoxPythonBase_x86_TEMPLATE = XPComDll-x86
143 VBoxPythonBase_x86_EXTENDS = VBoxPythonBase
144 VBoxPythonBase_x86_DEFS = MODULE_NAME_SUFFIX=_x86 $(VBoxPythonBase_DEFS)
145 VBoxPythonBase_x86_LIBS = \
146 $(PATH_STAGE_LIB)/VBoxCOM-x86$(VBOX_SUFF_LIB) \
147 $(PATH_STAGE_BIN)/VBoxXPCOM-x86$(VBOX_SUFF_DLL)
148
149 # 32-bit pymalloc abi variant.
150 VBoxPythonBase_x86_m_EXTENDS = VBoxPythonBase_x86
151 VBoxPythonBase_x86_m_DEFS = MODULE_NAME_SUFFIX=_x86m $(VBoxPythonBase_DEFS)
152
153
154 ifdef VBOX_PYTHON26_INC
155 #
156 # Python 2.6 version
157 #
158 DLLS += VBoxPython2_6
159 VBoxPython2_6_EXTENDS = VBoxPythonBase
160 VBoxPython2_6_EXTENDS_BY = appending
161 ifdef KMK_WITH_VERSION_COMPARE
162 VBoxPython2_6_TEMPLATE = XPComDll$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" vle "10.6",OSX106,)
163 else
164 VBoxPython2_6_TEMPLATE = XPComDll$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" <= "10.6",OSX106,)
165 endif
166 VBoxPython2_6_INCS = $(VBOX_PYTHON26_INC)
167 VBoxPython2_6_LIBS = $(VBOX_PYTHON26_LIB)
168
169 ifdef VBOX_WITH_32_ON_64_MAIN_API
170 ifdef VBOX_PYTHON26_LIB_X86
171 DLLS += VBoxPython2_6_x86
172 VBoxPython2_6_x86_EXTENDS = VBoxPythonBase_x86
173 VBoxPython2_6_x86_EXTENDS_BY = appending
174 ifdef KMK_WITH_VERSION_COMPARE
175 VBoxPython2_6_x86_TEMPLATE = XPComDll$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" vle "10.6",OSX106,-x86)
176 else
177 VBoxPython2_6_x86_TEMPLATE = XPComDll$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" <= "10.6",OSX106,-x86)
178 endif
179 VBoxPython2_6_x86_INCS = $(VBOX_PYTHON26_INC)
180 VBoxPython2_6_x86_LIBS = $(VBOX_PYTHON26_LIB_X86)
181 endif
182 endif
183 endif
184
185 ifdef VBOX_PYTHON27_INC
186 #
187 # Python 2.7 version
188 #
189 DLLS += VBoxPython2_7
190 VBoxPython2_7_EXTENDS = VBoxPythonBase
191 VBoxPython2_7_EXTENDS_BY = appending
192 ifdef KMK_WITH_VERSION_COMPARE
193 VBoxPython2_7_TEMPLATE = XPComDll$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" vle "10.7",OSX107,)
194 else
195 VBoxPython2_7_TEMPLATE = XPComDll$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" <= "10.7" && "$(length-var VBOX_DEF_MACOSX_VERSION_MIN)" == "4",OSX107,)
196 endif
197 VBoxPython2_7_INCS = $(VBOX_PYTHON27_INC)
198 VBoxPython2_7_LIBS = $(VBOX_PYTHON27_LIB)
199
200 ifdef VBOX_WITH_32_ON_64_MAIN_API
201 ifdef VBOX_PYTHON27_LIB_X86
202 DLLS += VBoxPython2_7_x86
203 VBoxPython2_7_x86_EXTENDS = VBoxPythonBase_x86
204 VBoxPython2_7_x86_EXTENDS_BY = appending
205 ifdef KMK_WITH_VERSION_COMPARE
206 VBoxPython2_7_x86_TEMPLATE = XPComDll$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" vle "10.7",OSX107,-x86)
207 else
208 VBoxPython2_7_x86_TEMPLATE = XPComDll$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" <= "10.7" && "$(length-var VBOX_DEF_MACOSX_VERSION_MIN)" == "4",OSX107,-x86)
209 endif
210 VBoxPython2_7_x86_INCS = $(VBOX_PYTHON27_INC)
211 VBoxPython2_7_x86_LIBS = $(VBOX_PYTHON27_LIB_X86)
212 endif
213 endif
214 endif
215
216 #
217 # Unversioned Python 2.x.
218 #
219 if defined(VBOX_PYTHON27_INC) || defined(VBOX_PYTHON26_INC)
220 DLLS += VBoxPython2
221 VBoxPython2_EXTENDS = VBoxPythonBase
222 VBoxPython2_EXTENDS_BY = appending
223 VBoxPython2_DEFS = VBOX_PYXPCOM_MAJOR_VERSIONED
224 ifdef KMK_WITH_VERSION_COMPARE
225 VBoxPython2_TEMPLATE = XPComDll$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" vle "10.7",OSX107,)
226 else
227 VBoxPython2_TEMPLATE = XPComDll$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" <= "10.7" && "$(length-var VBOX_DEF_MACOSX_VERSION_MIN)" == "4",OSX107,)
228 endif
229 if defined(VBOX_PYTHON26_INC)
230 VBoxPython2_INCS = $(VBOX_PYTHON26_INC)
231 ifn1of ($(KBUILD_TARGET), linux)
232 VBoxPython2_LIBS = $(VBOX_PYTHON26_LIB)
233 endif
234 else
235 VBoxPython2_INCS = $(VBOX_PYTHON27_INC)
236 ifn1of ($(KBUILD_TARGET), linux)
237 VBoxPython2_LIBS = $(VBOX_PYTHON27_LIB)
238 endif
239 endif
240 endif
241
242 if defined(VBOX_WITH_32_ON_64_MAIN_API) && (defined(VBOX_PYTHON27_LIB_X86) || defined(VBOX_PYTHON26_INC_X86))
243 DLLS += VBoxPython2_x86
244 VBoxPython2_x86_EXTENDS = VBoxPythonBase_x86
245 VBoxPython2_x86_EXTENDS_BY = appending
246 VBoxPython2_x86_DEFS = VBOX_PYXPCOM_MAJOR_VERSIONED $(VBoxPythonBase_x86_DEFS)
247 ifdef KMK_WITH_VERSION_COMPARE
248 VBoxPython2_x86_TEMPLATE = XPComDll$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" vle "10.7",OSX107,-x86)
249 else
250 VBoxPython2_x86_TEMPLATE = XPComDll$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" <= "10.7" && "$(length-var VBOX_DEF_MACOSX_VERSION_MIN)" == "4",OSX107,-x86)
251 endif
252 if defined(VBOX_PYTHON26LIB_X86)
253 VBoxPython2_x86_INCS = $(VBOX_PYTHON26_INC)
254 ifn1of ($(KBUILD_TARGET), linux)
255 VBoxPython2_x86_LIBS = $(VBOX_PYTHON26_LIB_X86)
256 endif
257 else
258 VBoxPython2_x86_INCS = $(VBOX_PYTHON27_INC)
259 ifn1of ($(KBUILD_TARGET), linux)
260 VBoxPython2_x86_LIBS = $(VBOX_PYTHON27_LIB_X86)
261 endif
262 endif
263 endif
264
265
266 ifdef VBOX_PYTHON31_INC
267 #
268 # Python 3.1 version
269 #
270 DLLS += VBoxPython3_1
271 VBoxPython3_1_EXTENDS = VBoxPythonBase
272 VBoxPython3_1_EXTENDS_BY = appending
273 VBoxPython3_1_INCS = $(VBOX_PYTHON31_INC)
274 VBoxPython3_1_LIBS = $(VBOX_PYTHON31_LIB)
275
276 ifdef VBOX_WITH_32_ON_64_MAIN_API
277 ifdef VBOX_PYTHON31_LIB_X86
278 DLLS += VBoxPython3_1_x86
279 VBoxPython3_1_x86_EXTENDS = VBoxPythonBase_x86
280 VBoxPython3_1_x86_EXTENDS_BY = appending
281 VBoxPython3_1_x86_INCS = $(VBOX_PYTHON31_INC)
282 VBoxPython3_1_x86_LIBS = $(VBOX_PYTHON31_LIB_X86)
283 endif
284 endif
285 endif
286
287 ifdef VBOX_PYTHON32_INC
288 #
289 # Python 3.2 version
290 #
291 DLLS += VBoxPython3_2
292 VBoxPython3_2_EXTENDS = VBoxPythonBase
293 VBoxPython3_2_EXTENDS_BY = appending
294 VBoxPython3_2_INCS = $(VBOX_PYTHON32_INC)
295 VBoxPython3_2_LIBS = $(VBOX_PYTHON32_LIB)
296
297 ifdef VBOX_WITH_32_ON_64_MAIN_API
298 ifdef VBOX_PYTHON32_LIB_X86
299 DLLS += VBoxPython3_2_x86
300 VBoxPython3_2_x86_EXTENDS = VBoxPythonBase_x86
301 VBoxPython3_2_x86_EXTENDS_BY = appending
302 VBoxPython3_2_x86_INCS = $(VBOX_PYTHON32_INC)
303 VBoxPython3_2_x86_LIBS = $(VBOX_PYTHON32_LIB_X86)
304 endif
305 endif
306 endif
307
308 ifdef VBOX_PYTHON32M_INC
309 #
310 # Python 3.2 version with pymalloc
311 #
312 DLLS += VBoxPython3_2m
313 VBoxPython3_2m_EXTENDS = VBoxPythonBase_m
314 VBoxPython3_2m_EXTENDS_BY = appending
315 VBoxPython3_2m_INCS = $(VBOX_PYTHON32M_INC)
316 VBoxPython3_2m_LIBS = $(VBOX_PYTHON32M_LIB)
317 VBoxPython3_2m_DEFS = MODULE_NAME_SUFFIX
318
319 ifdef VBOX_WITH_32_ON_64_MAIN_API
320 ifdef VBOX_PYTHON32M_LIB_X86
321 DLLS += VBoxPython3_2m_x86
322 VBoxPython3_2m_x86_EXTENDS = VBoxPythonBase_x86_m
323 VBoxPython3_2m_x86_EXTENDS_BY = appending
324 VBoxPython3_2m_x86_INCS = $(VBOX_PYTHON32M_INC)
325 VBoxPython3_2m_x86_LIBS = $(VBOX_PYTHON32M_LIB_X86)
326 endif
327 endif
328 endif
329
330 ifndef VBOX_WITH_ONLY_PYTHON_LIMITED_API
331
332 ifdef VBOX_PYTHON33_INC
333 #
334 # Python 3.3 version
335 #
336 DLLS += VBoxPython3_3
337 VBoxPython3_3_EXTENDS = VBoxPythonBase
338 VBoxPython3_3_EXTENDS_BY = appending
339 VBoxPython3_3_INCS = $(VBOX_PYTHON33_INC)
340 VBoxPython3_3_LIBS = $(VBOX_PYTHON33_LIB)
341
342 ifdef VBOX_WITH_32_ON_64_MAIN_API
343 ifdef VBOX_PYTHON33_LIB_X86
344 DLLS += VBoxPython3_3_x86
345 VBoxPython3_3_x86_EXTENDS = VBoxPythonBase_x86
346 VBoxPython3_3_x86_EXTENDS_BY = appending
347 VBoxPython3_3_x86_INCS = $(VBOX_PYTHON33_INC)
348 VBoxPython3_3_x86_LIBS = $(VBOX_PYTHON33_LIB_X86)
349 endif
350 endif
351 endif
352
353 ifdef VBOX_PYTHON33M_INC
354 #
355 # Python 3.3 version with pymalloc
356 #
357 DLLS += VBoxPython3_3m
358 VBoxPython3_3m_EXTENDS = VBoxPythonBase_m
359 VBoxPython3_3m_EXTENDS_BY = appending
360 VBoxPython3_3m_INCS = $(VBOX_PYTHON33M_INC)
361 VBoxPython3_3m_LIBS = $(VBOX_PYTHON33M_LIB)
362
363 ifdef VBOX_WITH_32_ON_64_MAIN_API
364 ifdef VBOX_PYTHON33M_LIB_X86
365 DLLS += VBoxPython3_3m_x86
366 VBoxPython3_3m_x86_EXTENDS = VBoxPythonBase_x86_m
367 VBoxPython3_3m_x86_EXTENDS_BY = appending
368 VBoxPython3_3m_x86_INCS = $(VBOX_PYTHON33M_INC)
369 VBoxPython3_3m_x86_LIBS = $(VBOX_PYTHON33M_LIB_X86)
370 endif
371 endif
372 endif
373
374 ifdef VBOX_PYTHON34_INC
375 #
376 # Python 3.4 version
377 #
378 DLLS += VBoxPython3_4
379 VBoxPython3_4_EXTENDS = VBoxPythonBase
380 VBoxPython3_4_EXTENDS_BY = appending
381 VBoxPython3_4_INCS = $(VBOX_PYTHON34_INC)
382 VBoxPython3_4_LIBS = $(VBOX_PYTHON34_LIB)
383
384 ifdef VBOX_WITH_32_ON_64_MAIN_API
385 ifdef VBOX_PYTHON34_LIB_X86
386 DLLS += VBoxPython3_4_x86
387 VBoxPython3_4_x86_EXTENDS = VBoxPythonBase_x86
388 VBoxPython3_4_x86_EXTENDS_BY = appending
389 VBoxPython3_4_x86_INCS = $(VBOX_PYTHON34_INC)
390 VBoxPython3_4_x86_LIBS = $(VBOX_PYTHON34_LIB_X86)
391 endif
392 endif
393 endif
394
395 ifdef VBOX_PYTHON34M_INC
396 #
397 # Python 3.4 version with pymalloc
398 #
399 DLLS += VBoxPython3_4m
400 VBoxPython3_4m_EXTENDS = VBoxPythonBase_m
401 VBoxPython3_4m_EXTENDS_BY = appending
402 VBoxPython3_4m_INCS = $(VBOX_PYTHON34M_INC)
403 VBoxPython3_4m_LIBS = $(VBOX_PYTHON34M_LIB)
404
405 ifdef VBOX_WITH_32_ON_64_MAIN_API
406 ifdef VBOX_PYTHON34M_LIB_X86
407 DLLS += VBoxPython3_4m_x86
408 VBoxPython3_4m_x86_EXTENDS = VBoxPythonBase_x86_m
409 VBoxPython3_4m_x86_EXTENDS_BY = appending
410 VBoxPython3_4m_x86_INCS = $(VBOX_PYTHON34M_INC)
411 VBoxPython3_4m_x86_LIBS = $(VBOX_PYTHON34M_LIB_X86)
412 endif
413 endif
414 endif
415
416 ifdef VBOX_PYTHON35_INC
417 #
418 # Python 3.5 version
419 #
420 DLLS += VBoxPython3_5
421 VBoxPython3_5_EXTENDS = VBoxPythonBase
422 VBoxPython3_5_EXTENDS_BY = appending
423 VBoxPython3_5_INCS = $(VBOX_PYTHON35_INC)
424 VBoxPython3_5_LIBS = $(VBOX_PYTHON35_LIB)
425
426 ifdef VBOX_WITH_32_ON_64_MAIN_API
427 ifdef VBOX_PYTHON35_LIB_X86
428 DLLS += VBoxPython3_5_x86
429 VBoxPython3_5_x86_EXTENDS = VBoxPythonBase_x86
430 VBoxPython3_5_x86_EXTENDS_BY = appending
431 VBoxPython3_5_x86_INCS = $(VBOX_PYTHON35_INC)
432 VBoxPython3_5_x86_LIBS = $(VBOX_PYTHON35_LIB_X86)
433 endif
434 endif
435 endif
436
437 ifdef VBOX_PYTHON35M_INC
438 #
439 # Python 3.5 version with pymalloc
440 #
441 DLLS += VBoxPython3_5m
442 VBoxPython3_5m_EXTENDS = VBoxPythonBase_m
443 VBoxPython3_5m_EXTENDS_BY = appending
444 VBoxPython3_5m_INCS = $(VBOX_PYTHON35M_INC)
445 VBoxPython3_5m_LIBS = $(VBOX_PYTHON35M_LIB)
446
447 ifdef VBOX_WITH_32_ON_64_MAIN_API
448 ifdef VBOX_PYTHON35M_LIB_X86
449 DLLS += VBoxPython3_5m_x86
450 VBoxPython3_5m_x86_EXTENDS = VBoxPythonBase_x86_m
451 VBoxPython3_5m_x86_EXTENDS_BY = appending
452 VBoxPython3_5m_x86_INCS = $(VBOX_PYTHON35M_INC)
453 VBoxPython3_5m_x86_LIBS = $(VBOX_PYTHON35M_LIB_X86)
454 endif
455 endif
456 endif
457
458 ifdef VBOX_PYTHON36_INC
459 #
460 # Python 3.6 version
461 #
462 DLLS += VBoxPython3_6
463 VBoxPython3_6_EXTENDS = VBoxPythonBase
464 VBoxPython3_6_EXTENDS_BY = appending
465 VBoxPython3_6_INCS = $(VBOX_PYTHON36_INC)
466 VBoxPython3_6_LIBS = $(VBOX_PYTHON36_LIB)
467
468 ifdef VBOX_WITH_32_ON_64_MAIN_API
469 ifdef VBOX_PYTHON36_LIB_X86
470 DLLS += VBoxPython3_6_x86
471 VBoxPython3_6_x86_EXTENDS = VBoxPythonBase_x86
472 VBoxPython3_6_x86_EXTENDS_BY = appending
473 VBoxPython3_6_x86_INCS = $(VBOX_PYTHON36_INC)
474 VBoxPython3_6_x86_LIBS = $(VBOX_PYTHON36_LIB_X86)
475 endif
476 endif
477 endif
478
479 ifdef VBOX_PYTHON36M_INC
480 #
481 # Python 3.6 version with pymalloc
482 #
483 DLLS += VBoxPython3_6m
484 VBoxPython3_6m_EXTENDS = VBoxPythonBase_m
485 VBoxPython3_6m_EXTENDS_BY = appending
486 VBoxPython3_6m_INCS = $(VBOX_PYTHON36M_INC)
487 VBoxPython3_6m_LIBS = $(VBOX_PYTHON36M_LIB)
488
489 ifdef VBOX_WITH_32_ON_64_MAIN_API
490 ifdef VBOX_PYTHON36M_LIB_X86
491 DLLS += VBoxPython3_6m_x86
492 VBoxPython3_6m_x86_EXTENDS = VBoxPythonBase_x86_m
493 VBoxPython3_6m_x86_EXTENDS_BY = appending
494 VBoxPython3_6m_x86_INCS = $(VBOX_PYTHON36M_INC)
495 VBoxPython3_6m_x86_LIBS = $(VBOX_PYTHON36M_LIB_X86)
496 endif
497 endif
498 endif
499
500 ifdef VBOX_PYTHON37_INC
501 #
502 # Python 3.7 version
503 #
504 DLLS += VBoxPython3_7
505 VBoxPython3_7_EXTENDS = VBoxPythonBase
506 VBoxPython3_7_EXTENDS_BY = appending
507 VBoxPython3_7_INCS = $(VBOX_PYTHON37_INC)
508 VBoxPython3_7_LIBS = $(VBOX_PYTHON37_LIB)
509
510 ifdef VBOX_WITH_32_ON_64_MAIN_API
511 ifdef VBOX_PYTHON37_LIB_X86
512 DLLS += VBoxPython3_7_x86
513 VBoxPython3_7_x86_EXTENDS = VBoxPythonBase_x86
514 VBoxPython3_7_x86_EXTENDS_BY = appending
515 VBoxPython3_7_x86_INCS = $(VBOX_PYTHON37_INC)
516 VBoxPython3_7_x86_LIBS = $(VBOX_PYTHON37_LIB_X86)
517 endif
518 endif
519 endif
520
521 ifdef VBOX_PYTHON37M_INC
522 #
523 # Python 3.7 version with pymalloc
524 #
525 DLLS += VBoxPython3_7m
526 VBoxPython3_7m_EXTENDS = VBoxPythonBase_m
527 VBoxPython3_7m_EXTENDS_BY = appending
528 VBoxPython3_7m_INCS = $(VBOX_PYTHON37M_INC)
529 VBoxPython3_7m_LIBS = $(VBOX_PYTHON37M_LIB)
530
531 ifdef VBOX_WITH_32_ON_64_MAIN_API
532 ifdef VBOX_PYTHON37M_LIB_X86
533 DLLS += VBoxPython3_7m_x86
534 VBoxPython3_7m_x86_EXTENDS = VBoxPythonBase_x86_m
535 VBoxPython3_7m_x86_EXTENDS_BY = appending
536 VBoxPython3_7m_x86_INCS = $(VBOX_PYTHON37M_INC)
537 VBoxPython3_7m_x86_LIBS = $(VBOX_PYTHON37M_LIB_X86)
538 endif
539 endif
540 endif
541
542 ifdef VBOX_PYTHON38_INC
543 #
544 # Python 3.8 version
545 #
546 DLLS += VBoxPython3_8
547 VBoxPython3_8_EXTENDS = VBoxPythonBase
548 VBoxPython3_8_EXTENDS_BY = appending
549 VBoxPython3_8_INCS = $(VBOX_PYTHON38_INC)
550 VBoxPython3_8_LIBS = $(VBOX_PYTHON38_LIB)
551
552 ifdef VBOX_WITH_32_ON_64_MAIN_API
553 ifdef VBOX_PYTHON38_LIB_X86
554 DLLS += VBoxPython3_8_x86
555 VBoxPython3_8_x86_EXTENDS = VBoxPythonBase_x86
556 VBoxPython3_8_x86_EXTENDS_BY = appending
557 VBoxPython3_8_x86_INCS = $(VBOX_PYTHON38_INC)
558 VBoxPython3_8_x86_LIBS = $(VBOX_PYTHON38_LIB_X86)
559 endif
560 endif
561 endif
562
563 ifdef VBOX_PYTHON38M_INC
564 #
565 # Python 3.8 version with pymalloc
566 #
567 DLLS += VBoxPython3_8m
568 VBoxPython3_8m_EXTENDS = VBoxPythonBase_m
569 VBoxPython3_8m_EXTENDS_BY = appending
570 VBoxPython3_8m_INCS = $(VBOX_PYTHON38M_INC)
571 VBoxPython3_8m_LIBS = $(VBOX_PYTHON38M_LIB)
572
573 ifdef VBOX_WITH_32_ON_64_MAIN_API
574 ifdef VBOX_PYTHON38M_LIB_X86
575 DLLS += VBoxPython3_8m_x86
576 VBoxPython3_8m_x86_EXTENDS = VBoxPythonBase_x86_m
577 VBoxPython3_8m_x86_EXTENDS_BY = appending
578 VBoxPython3_8m_x86_INCS = $(VBOX_PYTHON38M_INC)
579 VBoxPython3_8m_x86_LIBS = $(VBOX_PYTHON38M_LIB_X86)
580 endif
581 endif
582 endif
583
584 ifdef VBOX_PYTHON39_INC
585 #
586 # Python 3.9 version
587 #
588 DLLS += VBoxPython3_9
589 VBoxPython3_9_EXTENDS = VBoxPythonBase
590 VBoxPython3_9_EXTENDS_BY = appending
591 VBoxPython3_9_INCS = $(VBOX_PYTHON39_INC)
592 VBoxPython3_9_LIBS = $(VBOX_PYTHON39_LIB)
593
594 ifdef VBOX_WITH_32_ON_64_MAIN_API
595 ifdef VBOX_PYTHON39_LIB_X86
596 DLLS += VBoxPython3_9_x86
597 VBoxPython3_9_x86_EXTENDS = VBoxPythonBase_x86
598 VBoxPython3_9_x86_EXTENDS_BY = appending
599 VBoxPython3_9_x86_INCS = $(VBOX_PYTHON39_INC)
600 VBoxPython3_9_x86_LIBS = $(VBOX_PYTHON39_LIB_X86)
601 endif
602 endif
603 endif
604
605 ifdef VBOX_PYTHON39M_INC
606 #
607 # Python 3.9 version with pymalloc
608 #
609 DLLS += VBoxPython3_9m
610 VBoxPython3_9m_EXTENDS = VBoxPythonBase_m
611 VBoxPython3_9m_EXTENDS_BY = appending
612 VBoxPython3_9m_INCS = $(VBOX_PYTHON39M_INC)
613 VBoxPython3_9m_LIBS = $(VBOX_PYTHON39M_LIB)
614
615 ifdef VBOX_WITH_32_ON_64_MAIN_API
616 ifdef VBOX_PYTHON39M_LIB_X86
617 DLLS += VBoxPython3_9m_x86
618 VBoxPython3_9m_x86_EXTENDS = VBoxPythonBase_x86_m
619 VBoxPython3_9m_x86_EXTENDS_BY = appending
620 VBoxPython3_9m_x86_INCS = $(VBOX_PYTHON39M_INC)
621 VBoxPython3_9m_x86_LIBS = $(VBOX_PYTHON39M_LIB_X86)
622 endif
623 endif
624 endif
625
626 ifdef VBOX_PYTHON310_INC
627 #
628 # Python 3.10 version
629 #
630 DLLS += VBoxPython3_10
631 VBoxPython3_10_EXTENDS = VBoxPythonBase
632 VBoxPython3_10_EXTENDS_BY = appending
633 VBoxPython3_10_INCS = $(VBOX_PYTHON310_INC)
634 VBoxPython3_10_LIBS = $(VBOX_PYTHON310_LIB)
635
636 ifdef VBOX_WITH_32_ON_64_MAIN_API
637 ifdef VBOX_PYTHON310_LIB_X86
638 DLLS += VBoxPython3_10_x86
639 VBoxPython3_10_x86_EXTENDS = VBoxPythonBase_x86
640 VBoxPython3_10_x86_EXTENDS_BY = appending
641 VBoxPython3_10_x86_INCS = $(VBOX_PYTHON310_INC)
642 VBoxPython3_10_x86_LIBS = $(VBOX_PYTHON310_LIB_X86)
643 endif
644 endif
645 endif
646
647 ifdef VBOX_PYTHON310M_INC
648 #
649 # Python 3.10 version with pymalloc
650 #
651 DLLS += VBoxPython3_10m
652 VBoxPython3_10m_EXTENDS = VBoxPythonBase_m
653 VBoxPython3_10m_EXTENDS_BY = appending
654 VBoxPython3_10m_INCS = $(VBOX_PYTHON310M_INC)
655 VBoxPython3_10m_LIBS = $(VBOX_PYTHON310M_LIB)
656
657 ifdef VBOX_WITH_32_ON_64_MAIN_API
658 ifdef VBOX_PYTHON310M_LIB_X86
659 DLLS += VBoxPython3_10m_x86
660 VBoxPython3_10m_x86_EXTENDS = VBoxPythonBase_x86_m
661 VBoxPython3_10m_x86_EXTENDS_BY = appending
662 VBoxPython3_10m_x86_INCS = $(VBOX_PYTHON310M_INC)
663 VBoxPython3_10m_x86_LIBS = $(VBOX_PYTHON310M_LIB_X86)
664 endif
665 endif
666 endif
667
668 ifdef VBOX_PYTHONDEF_INC
669 #
670 # Python without versioning
671 #
672 DLLS += VBoxPython
673 VBoxPython_EXTENDS = VBoxPythonBase
674 VBoxPython_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_DEFS))
675 VBoxPython_INCS = $(VBoxPythonBase_INCS) $(VBOX_PYTHONDEF_INC)
676 if "$(KBUILD_TARGET)" == "linux"
677 VBoxPython_LIBS = $(VBoxPythonBase_LIBS)
678 else
679 VBoxPython_LIBS = $(VBoxPythonBase_LIBS) $(VBOX_PYTHONDEF_LIB)
680 endif
681
682 ifdef VBOX_WITH_32_ON_64_MAIN_API
683 ifdef VBOX_PYTHONDEF_LIB_X86
684 VBoxPython_x86_EXTENDS = VBoxPythonBase_x86
685 VBoxPython_x86_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_x86_DEFS))
686 VBoxPython_x86_INCS = $(VBoxPythonBase_x86_INCS) $(VBOX_PYTHONDEF_INC)
687 if "$(KBUILD_TARGET)" == "linux"
688 VBoxPython_x86_LIBS = $(VBoxPythonBase_x86_LIBS)
689 else
690 VBoxPython_x86_LIBS = $(VBoxPythonBase_x86_LIBS) $(VBOX_PYTHONDEF_LIB_X86)
691 endif
692 endif
693 endif
694 endif
695
696 endif # !VBOX_WITH_ONLY_PYTHON_LIMITED_API
697
698 ifndef VBOX_WITHOUT_PYTHON_LIMITED_API
699 #
700 # If there is python 3.3 or later present, we can build a generic
701 # 3.x extension. Since 3.3 and 3.4 are rather old, we will pick
702 # those headers last.
703 #
704 # Note! No library dependencies are needed here (at least that's
705 # how the xxlimited.so demo extension is done on linux and darwin).
706 # Note! The 'm' ABI suffix was discontinued in 3.8.
707 # TODO: ASSUMING that we don't need a different headers for pymalloc
708 # ('m' builds < 3.8) and CRT malloc.
709 #
710 VBOX_PYTHON_LIMITED_API_VER := $(firstword $(foreach ver, 35 36 38 39 310 34 33 \
711 ,$(if-expr defined(VBOX_PYTHON$(ver)_INC),$(ver),)$(if-expr defined(VBOX_PYTHON$(ver)M_INC),$(ver)M,)))
712 ifneq ($(VBOX_PYTHON_LIMITED_API_VER),)
713 DLLS += VBoxPython3
714 VBoxPython3_EXTENDS = VBoxPythonBase
715 VBoxPython3_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_DEFS)) Py_LIMITED_API=0x03030000
716 VBoxPython3_INCS = $(VBoxPythonBase_INCS) $(VBOX_PYTHON$(VBOX_PYTHON_LIMITED_API_VER)_INC)
717
718 DLLS += VBoxPython3m
719 VBoxPython3m_EXTENDS = VBoxPythonBase_m
720 VBoxPython3m_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_m_DEFS)) Py_LIMITED_API=0x03030000
721 VBoxPython3m_INCS = $(VBoxPythonBase_m_INCS) $(VBOX_PYTHON$(VBOX_PYTHON_LIMITED_API_VER)_INC)
722 endif
723 endif # VBOX_WITH_PYTHON_LIMITED_API
724
725endif # VBOX_ONLY_SDK
726
727#
728# Install the python modules.
729#
730INSTALLS += VBoxPython-inst-py-xpcom
731VBoxPython-inst-py-xpcom_INST = $(INST_SDK)bindings/xpcom/python/xpcom/
732VBoxPython-inst-py-xpcom_MODE = a+r,u+w
733VBoxPython-inst-py-xpcom_SOURCES = \
734 vboxxpcom.py \
735 components.py \
736 file.py \
737 __init__.py \
738 nsError.py \
739 primitives.py \
740 xpcom_consts.py \
741 xpt.py \
742 client/__init__.py=>client/__init__.py \
743 server/__init__.py=>server/__init__.py \
744 server/enumerator.py=>server/enumerator.py \
745 server/factory.py=>server/factory.py \
746 server/loader.py=>server/loader.py \
747 server/module.py=>server/module.py \
748 server/policy.py=>server/policy.py
749
750
751include $(FILE_KBUILD_SUB_FOOTER)
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