VirtualBox

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

最後變更 在這個檔案從98229是 98225,由 vboxsync 提交於 2 年 前

libs/xpcom18a4/python: Removed unnecessary _TEMPLATE properties on the VBoxPython3* targets. (Necessary on VBoxPython2* because of different OSX target versions.) bugref:10348

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 23.9 KB
 
1# $Id: Makefile.kmk 98225 2023-01-23 01:27:45Z 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.alldomusa.eu.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#
94VBoxPythonBase_TEMPLATE = XPComDll
95VBoxPythonBase_CXXFLAGS = -Wno-write-strings
96VBoxPythonBase_CXXFLAGS.solaris = $(VBOX_GCC_Wno-unknown-pragmas) # /usr/include/python[23].[75]*/ceval.h:67: warning: ignoring #pragma no_inline(PyEval_EvalFrameEx)
97VBoxPythonBase_DLLSUFF.darwin = .so
98VBoxPythonBase_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
108VBoxPythonBase_INCS = \
109 src
110VBoxPythonBase_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
133VBoxPythonBase_LIBS = \
134 $(PATH_STAGE_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \
135 $(PATH_STAGE_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL)
136
137# pymalloc abi variant.
138VBoxPythonBase_m_EXTENDS = VBoxPythonBase
139VBoxPythonBase_m_DEFS = MODULE_NAME_SUFFIX=m $(VBoxPythonBase_DEFS)
140
141# 32-bit base.
142VBoxPythonBase_x86_TEMPLATE = XPComDll-x86
143VBoxPythonBase_x86_EXTENDS = VBoxPythonBase
144VBoxPythonBase_x86_DEFS = MODULE_NAME_SUFFIX=_x86 $(VBoxPythonBase_DEFS)
145VBoxPythonBase_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.
150VBoxPythonBase_x86_m_EXTENDS = VBoxPythonBase_x86
151VBoxPythonBase_x86_m_DEFS = MODULE_NAME_SUFFIX=_x86m $(VBoxPythonBase_DEFS)
152
153
154ifdef VBOX_PYTHON26_INC
155#
156# Python 2.6 version
157#
158DLLS += VBoxPython2_6
159VBoxPython2_6_EXTENDS = VBoxPythonBase
160VBoxPython2_6_EXTENDS_BY = appending
161 ifdef KMK_WITH_VERSION_COMPARE
162VBoxPython2_6_TEMPLATE = XPComDll$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" vle "10.6",OSX106,)
163 else
164VBoxPython2_6_TEMPLATE = XPComDll$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" <= "10.6",OSX106,)
165 endif
166VBoxPython2_6_INCS = $(VBOX_PYTHON26_INC)
167VBoxPython2_6_LIBS = $(VBOX_PYTHON26_LIB)
168
169 ifdef VBOX_WITH_32_ON_64_MAIN_API
170 ifdef VBOX_PYTHON26_LIB_X86
171DLLS += VBoxPython2_6_x86
172VBoxPython2_6_x86_EXTENDS = VBoxPythonBase_x86
173VBoxPython2_6_x86_EXTENDS_BY = appending
174 ifdef KMK_WITH_VERSION_COMPARE
175VBoxPython2_6_x86_TEMPLATE = XPComDll$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" vle "10.6",OSX106,-x86)
176 else
177VBoxPython2_6_x86_TEMPLATE = XPComDll$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" <= "10.6",OSX106,-x86)
178 endif
179VBoxPython2_6_x86_INCS = $(VBOX_PYTHON26_INC)
180VBoxPython2_6_x86_LIBS = $(VBOX_PYTHON26_LIB_X86)
181 endif
182 endif
183endif
184
185ifdef VBOX_PYTHON27_INC
186#
187# Python 2.7 version
188#
189DLLS += VBoxPython2_7
190VBoxPython2_7_EXTENDS = VBoxPythonBase
191VBoxPython2_7_EXTENDS_BY = appending
192 ifdef KMK_WITH_VERSION_COMPARE
193VBoxPython2_7_TEMPLATE = XPComDll$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" vle "10.7",OSX107,)
194 else
195VBoxPython2_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
197VBoxPython2_7_INCS = $(VBOX_PYTHON27_INC)
198VBoxPython2_7_LIBS = $(VBOX_PYTHON27_LIB)
199
200 ifdef VBOX_WITH_32_ON_64_MAIN_API
201 ifdef VBOX_PYTHON27_LIB_X86
202DLLS += VBoxPython2_7_x86
203VBoxPython2_7_x86_EXTENDS = VBoxPythonBase_x86
204VBoxPython2_7_x86_EXTENDS_BY = appending
205 ifdef KMK_WITH_VERSION_COMPARE
206VBoxPython2_7_x86_TEMPLATE = XPComDll$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" vle "10.7",OSX107,-x86)
207 else
208VBoxPython2_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
210VBoxPython2_7_x86_INCS = $(VBOX_PYTHON27_INC)
211VBoxPython2_7_x86_LIBS = $(VBOX_PYTHON27_LIB_X86)
212 endif
213 endif
214endif
215
216#
217# Unversioned Python 2.x.
218#
219 if defined(VBOX_PYTHON27_INC) || defined(VBOX_PYTHON26_INC)
220DLLS += VBoxPython2
221VBoxPython2_EXTENDS = VBoxPythonBase
222VBoxPython2_EXTENDS_BY = appending
223VBoxPython2_DEFS = VBOX_PYXPCOM_MAJOR_VERSIONED
224 ifdef KMK_WITH_VERSION_COMPARE
225VBoxPython2_TEMPLATE = XPComDll$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" vle "10.7",OSX107,)
226 else
227VBoxPython2_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)
230VBoxPython2_INCS = $(VBOX_PYTHON26_INC)
231 ifn1of ($(KBUILD_TARGET), linux)
232VBoxPython2_LIBS = $(VBOX_PYTHON26_LIB)
233 endif
234 else
235VBoxPython2_INCS = $(VBOX_PYTHON27_INC)
236 ifn1of ($(KBUILD_TARGET), linux)
237VBoxPython2_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))
243DLLS += VBoxPython2_x86
244VBoxPython2_x86_EXTENDS = VBoxPythonBase_x86
245VBoxPython2_x86_EXTENDS_BY = appending
246VBoxPython2_x86_DEFS = VBOX_PYXPCOM_MAJOR_VERSIONED $(VBoxPythonBase_x86_DEFS)
247 ifdef KMK_WITH_VERSION_COMPARE
248VBoxPython2_x86_TEMPLATE = XPComDll$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" vle "10.7",OSX107,-x86)
249 else
250VBoxPython2_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)
253VBoxPython2_x86_INCS = $(VBOX_PYTHON26_INC)
254 ifn1of ($(KBUILD_TARGET), linux)
255VBoxPython2_x86_LIBS = $(VBOX_PYTHON26_LIB_X86)
256 endif
257 else
258VBoxPython2_x86_INCS = $(VBOX_PYTHON27_INC)
259 ifn1of ($(KBUILD_TARGET), linux)
260VBoxPython2_x86_LIBS = $(VBOX_PYTHON27_LIB_X86)
261 endif
262 endif
263 endif
264
265
266ifdef VBOX_PYTHON31_INC
267#
268# Python 3.1 version
269#
270DLLS += VBoxPython3_1
271VBoxPython3_1_EXTENDS = VBoxPythonBase
272VBoxPython3_1_EXTENDS_BY = appending
273VBoxPython3_1_INCS = $(VBOX_PYTHON31_INC)
274VBoxPython3_1_LIBS = $(VBOX_PYTHON31_LIB)
275
276 ifdef VBOX_WITH_32_ON_64_MAIN_API
277 ifdef VBOX_PYTHON31_LIB_X86
278DLLS += VBoxPython3_1_x86
279VBoxPython3_1_x86_EXTENDS = VBoxPythonBase_x86
280VBoxPython3_1_x86_EXTENDS_BY = appending
281VBoxPython3_1_x86_INCS = $(VBOX_PYTHON31_INC)
282VBoxPython3_1_x86_LIBS = $(VBOX_PYTHON31_LIB_X86)
283 endif
284 endif
285endif
286
287ifdef VBOX_PYTHON32_INC
288#
289# Python 3.2 version
290#
291DLLS += VBoxPython3_2
292VBoxPython3_2_EXTENDS = VBoxPythonBase
293VBoxPython3_2_EXTENDS_BY = appending
294VBoxPython3_2_INCS = $(VBOX_PYTHON32_INC)
295VBoxPython3_2_LIBS = $(VBOX_PYTHON32_LIB)
296
297 ifdef VBOX_WITH_32_ON_64_MAIN_API
298 ifdef VBOX_PYTHON32_LIB_X86
299DLLS += VBoxPython3_2_x86
300VBoxPython3_2_x86_EXTENDS = VBoxPythonBase_x86
301VBoxPython3_2_x86_EXTENDS_BY = appending
302VBoxPython3_2_x86_INCS = $(VBOX_PYTHON32_INC)
303VBoxPython3_2_x86_LIBS = $(VBOX_PYTHON32_LIB_X86)
304 endif
305 endif
306endif
307
308ifdef VBOX_PYTHON32M_INC
309#
310# Python 3.2 version with pymalloc
311#
312DLLS += VBoxPython3_2m
313VBoxPython3_2m_EXTENDS = VBoxPythonBase_m
314VBoxPython3_2m_EXTENDS_BY = appending
315VBoxPython3_2m_INCS = $(VBOX_PYTHON32M_INC)
316VBoxPython3_2m_LIBS = $(VBOX_PYTHON32M_LIB)
317VBoxPython3_2m_DEFS = MODULE_NAME_SUFFIX
318
319 ifdef VBOX_WITH_32_ON_64_MAIN_API
320 ifdef VBOX_PYTHON32M_LIB_X86
321DLLS += VBoxPython3_2m_x86
322VBoxPython3_2m_x86_EXTENDS = VBoxPythonBase_x86_m
323VBoxPython3_2m_x86_EXTENDS_BY = appending
324VBoxPython3_2m_x86_INCS = $(VBOX_PYTHON32M_INC)
325VBoxPython3_2m_x86_LIBS = $(VBOX_PYTHON32M_LIB_X86)
326 endif
327 endif
328endif
329
330 ifndef VBOX_WITH_ONLY_PYTHON_LIMITED_API
331
332ifdef VBOX_PYTHON33_INC
333#
334# Python 3.3 version
335#
336DLLS += VBoxPython3_3
337VBoxPython3_3_EXTENDS = VBoxPythonBase
338VBoxPython3_3_EXTENDS_BY = appending
339VBoxPython3_3_INCS = $(VBOX_PYTHON33_INC)
340VBoxPython3_3_LIBS = $(VBOX_PYTHON33_LIB)
341
342 ifdef VBOX_WITH_32_ON_64_MAIN_API
343 ifdef VBOX_PYTHON33_LIB_X86
344DLLS += VBoxPython3_3_x86
345VBoxPython3_3_x86_EXTENDS = VBoxPythonBase_x86
346VBoxPython3_3_x86_EXTENDS_BY = appending
347VBoxPython3_3_x86_INCS = $(VBOX_PYTHON33_INC)
348VBoxPython3_3_x86_LIBS = $(VBOX_PYTHON33_LIB_X86)
349 endif
350 endif
351endif
352
353ifdef VBOX_PYTHON33M_INC
354#
355# Python 3.3 version with pymalloc
356#
357DLLS += VBoxPython3_3m
358VBoxPython3_3m_EXTENDS = VBoxPythonBase_m
359VBoxPython3_3m_EXTENDS_BY = appending
360VBoxPython3_3m_INCS = $(VBOX_PYTHON33M_INC)
361VBoxPython3_3m_LIBS = $(VBOX_PYTHON33M_LIB)
362
363 ifdef VBOX_WITH_32_ON_64_MAIN_API
364 ifdef VBOX_PYTHON33M_LIB_X86
365DLLS += VBoxPython3_3m_x86
366VBoxPython3_3m_x86_EXTENDS = VBoxPythonBase_x86_m
367VBoxPython3_3m_x86_EXTENDS_BY = appending
368VBoxPython3_3m_x86_INCS = $(VBOX_PYTHON33M_INC)
369VBoxPython3_3m_x86_LIBS = $(VBOX_PYTHON33M_LIB_X86)
370 endif
371 endif
372endif
373
374ifdef VBOX_PYTHON34_INC
375#
376# Python 3.4 version
377#
378DLLS += VBoxPython3_4
379VBoxPython3_4_EXTENDS = VBoxPythonBase
380VBoxPython3_4_EXTENDS_BY = appending
381VBoxPython3_4_INCS = $(VBOX_PYTHON34_INC)
382VBoxPython3_4_LIBS = $(VBOX_PYTHON34_LIB)
383
384 ifdef VBOX_WITH_32_ON_64_MAIN_API
385 ifdef VBOX_PYTHON34_LIB_X86
386DLLS += VBoxPython3_4_x86
387VBoxPython3_4_x86_EXTENDS = VBoxPythonBase_x86
388VBoxPython3_4_x86_EXTENDS_BY = appending
389VBoxPython3_4_x86_INCS = $(VBOX_PYTHON34_INC)
390VBoxPython3_4_x86_LIBS = $(VBOX_PYTHON34_LIB_X86)
391 endif
392 endif
393endif
394
395ifdef VBOX_PYTHON34M_INC
396#
397# Python 3.4 version with pymalloc
398#
399DLLS += VBoxPython3_4m
400VBoxPython3_4m_EXTENDS = VBoxPythonBase_m
401VBoxPython3_4m_EXTENDS_BY = appending
402VBoxPython3_4m_INCS = $(VBOX_PYTHON34M_INC)
403VBoxPython3_4m_LIBS = $(VBOX_PYTHON34M_LIB)
404
405 ifdef VBOX_WITH_32_ON_64_MAIN_API
406 ifdef VBOX_PYTHON34M_LIB_X86
407DLLS += VBoxPython3_4m_x86
408VBoxPython3_4m_x86_EXTENDS = VBoxPythonBase_x86_m
409VBoxPython3_4m_x86_EXTENDS_BY = appending
410VBoxPython3_4m_x86_INCS = $(VBOX_PYTHON34M_INC)
411VBoxPython3_4m_x86_LIBS = $(VBOX_PYTHON34M_LIB_X86)
412 endif
413 endif
414endif
415
416ifdef VBOX_PYTHON35_INC
417#
418# Python 3.5 version
419#
420DLLS += VBoxPython3_5
421VBoxPython3_5_EXTENDS = VBoxPythonBase
422VBoxPython3_5_EXTENDS_BY = appending
423VBoxPython3_5_INCS = $(VBOX_PYTHON35_INC)
424VBoxPython3_5_LIBS = $(VBOX_PYTHON35_LIB)
425
426 ifdef VBOX_WITH_32_ON_64_MAIN_API
427 ifdef VBOX_PYTHON35_LIB_X86
428DLLS += VBoxPython3_5_x86
429VBoxPython3_5_x86_EXTENDS = VBoxPythonBase_x86
430VBoxPython3_5_x86_EXTENDS_BY = appending
431VBoxPython3_5_x86_INCS = $(VBOX_PYTHON35_INC)
432VBoxPython3_5_x86_LIBS = $(VBOX_PYTHON35_LIB_X86)
433 endif
434 endif
435endif
436
437ifdef VBOX_PYTHON35M_INC
438#
439# Python 3.5 version with pymalloc
440#
441DLLS += VBoxPython3_5m
442VBoxPython3_5m_EXTENDS = VBoxPythonBase_m
443VBoxPython3_5m_EXTENDS_BY = appending
444VBoxPython3_5m_INCS = $(VBOX_PYTHON35M_INC)
445VBoxPython3_5m_LIBS = $(VBOX_PYTHON35M_LIB)
446
447 ifdef VBOX_WITH_32_ON_64_MAIN_API
448 ifdef VBOX_PYTHON35M_LIB_X86
449DLLS += VBoxPython3_5m_x86
450VBoxPython3_5m_x86_EXTENDS = VBoxPythonBase_x86_m
451VBoxPython3_5m_x86_EXTENDS_BY = appending
452VBoxPython3_5m_x86_INCS = $(VBOX_PYTHON35M_INC)
453VBoxPython3_5m_x86_LIBS = $(VBOX_PYTHON35M_LIB_X86)
454 endif
455 endif
456endif
457
458ifdef VBOX_PYTHON36_INC
459#
460# Python 3.6 version
461#
462DLLS += VBoxPython3_6
463VBoxPython3_6_EXTENDS = VBoxPythonBase
464VBoxPython3_6_EXTENDS_BY = appending
465VBoxPython3_6_INCS = $(VBOX_PYTHON36_INC)
466VBoxPython3_6_LIBS = $(VBOX_PYTHON36_LIB)
467
468 ifdef VBOX_WITH_32_ON_64_MAIN_API
469 ifdef VBOX_PYTHON36_LIB_X86
470DLLS += VBoxPython3_6_x86
471VBoxPython3_6_x86_EXTENDS = VBoxPythonBase_x86
472VBoxPython3_6_x86_EXTENDS_BY = appending
473VBoxPython3_6_x86_INCS = $(VBOX_PYTHON36_INC)
474VBoxPython3_6_x86_LIBS = $(VBOX_PYTHON36_LIB_X86)
475 endif
476 endif
477endif
478
479ifdef VBOX_PYTHON36M_INC
480#
481# Python 3.6 version with pymalloc
482#
483DLLS += VBoxPython3_6m
484VBoxPython3_6m_EXTENDS = VBoxPythonBase_m
485VBoxPython3_6m_EXTENDS_BY = appending
486VBoxPython3_6m_INCS = $(VBOX_PYTHON36M_INC)
487VBoxPython3_6m_LIBS = $(VBOX_PYTHON36M_LIB)
488
489 ifdef VBOX_WITH_32_ON_64_MAIN_API
490 ifdef VBOX_PYTHON36M_LIB_X86
491DLLS += VBoxPython3_6m_x86
492VBoxPython3_6m_x86_EXTENDS = VBoxPythonBase_x86_m
493VBoxPython3_6m_x86_EXTENDS_BY = appending
494VBoxPython3_6m_x86_INCS = $(VBOX_PYTHON36M_INC)
495VBoxPython3_6m_x86_LIBS = $(VBOX_PYTHON36M_LIB_X86)
496 endif
497 endif
498endif
499
500ifdef VBOX_PYTHON37_INC
501#
502# Python 3.7 version
503#
504DLLS += VBoxPython3_7
505VBoxPython3_7_EXTENDS = VBoxPythonBase
506VBoxPython3_7_EXTENDS_BY = appending
507VBoxPython3_7_INCS = $(VBOX_PYTHON37_INC)
508VBoxPython3_7_LIBS = $(VBOX_PYTHON37_LIB)
509
510 ifdef VBOX_WITH_32_ON_64_MAIN_API
511 ifdef VBOX_PYTHON37_LIB_X86
512DLLS += VBoxPython3_7_x86
513VBoxPython3_7_x86_EXTENDS = VBoxPythonBase_x86
514VBoxPython3_7_x86_EXTENDS_BY = appending
515VBoxPython3_7_x86_INCS = $(VBOX_PYTHON37_INC)
516VBoxPython3_7_x86_LIBS = $(VBOX_PYTHON37_LIB_X86)
517 endif
518 endif
519endif
520
521ifdef VBOX_PYTHON37M_INC
522#
523# Python 3.7 version with pymalloc
524#
525DLLS += VBoxPython3_7m
526VBoxPython3_7m_EXTENDS = VBoxPythonBase_m
527VBoxPython3_7m_EXTENDS_BY = appending
528VBoxPython3_7m_INCS = $(VBOX_PYTHON37M_INC)
529VBoxPython3_7m_LIBS = $(VBOX_PYTHON37M_LIB)
530
531 ifdef VBOX_WITH_32_ON_64_MAIN_API
532 ifdef VBOX_PYTHON37M_LIB_X86
533DLLS += VBoxPython3_7m_x86
534VBoxPython3_7m_x86_EXTENDS = VBoxPythonBase_x86_m
535VBoxPython3_7m_x86_EXTENDS_BY = appending
536VBoxPython3_7m_x86_INCS = $(VBOX_PYTHON37M_INC)
537VBoxPython3_7m_x86_LIBS = $(VBOX_PYTHON37M_LIB_X86)
538 endif
539 endif
540endif
541
542ifdef VBOX_PYTHON38_INC
543#
544# Python 3.8 version
545#
546DLLS += VBoxPython3_8
547VBoxPython3_8_EXTENDS = VBoxPythonBase
548VBoxPython3_8_EXTENDS_BY = appending
549VBoxPython3_8_INCS = $(VBOX_PYTHON38_INC)
550VBoxPython3_8_LIBS = $(VBOX_PYTHON38_LIB)
551
552 ifdef VBOX_WITH_32_ON_64_MAIN_API
553 ifdef VBOX_PYTHON38_LIB_X86
554DLLS += VBoxPython3_8_x86
555VBoxPython3_8_x86_EXTENDS = VBoxPythonBase_x86
556VBoxPython3_8_x86_EXTENDS_BY = appending
557VBoxPython3_8_x86_INCS = $(VBOX_PYTHON38_INC)
558VBoxPython3_8_x86_LIBS = $(VBOX_PYTHON38_LIB_X86)
559 endif
560 endif
561endif
562
563ifdef VBOX_PYTHON38M_INC
564#
565# Python 3.8 version with pymalloc
566#
567DLLS += VBoxPython3_8m
568VBoxPython3_8m_EXTENDS = VBoxPythonBase_m
569VBoxPython3_8m_EXTENDS_BY = appending
570VBoxPython3_8m_INCS = $(VBOX_PYTHON38M_INC)
571VBoxPython3_8m_LIBS = $(VBOX_PYTHON38M_LIB)
572
573 ifdef VBOX_WITH_32_ON_64_MAIN_API
574 ifdef VBOX_PYTHON38M_LIB_X86
575DLLS += VBoxPython3_8m_x86
576VBoxPython3_8m_x86_EXTENDS = VBoxPythonBase_x86_m
577VBoxPython3_8m_x86_EXTENDS_BY = appending
578VBoxPython3_8m_x86_INCS = $(VBOX_PYTHON38M_INC)
579VBoxPython3_8m_x86_LIBS = $(VBOX_PYTHON38M_LIB_X86)
580 endif
581 endif
582endif
583
584ifdef VBOX_PYTHON39_INC
585#
586# Python 3.9 version
587#
588DLLS += VBoxPython3_9
589VBoxPython3_9_EXTENDS = VBoxPythonBase
590VBoxPython3_9_EXTENDS_BY = appending
591VBoxPython3_9_INCS = $(VBOX_PYTHON39_INC)
592VBoxPython3_9_LIBS = $(VBOX_PYTHON39_LIB)
593
594 ifdef VBOX_WITH_32_ON_64_MAIN_API
595 ifdef VBOX_PYTHON39_LIB_X86
596DLLS += VBoxPython3_9_x86
597VBoxPython3_9_x86_EXTENDS = VBoxPythonBase_x86
598VBoxPython3_9_x86_EXTENDS_BY = appending
599VBoxPython3_9_x86_INCS = $(VBOX_PYTHON39_INC)
600VBoxPython3_9_x86_LIBS = $(VBOX_PYTHON39_LIB_X86)
601 endif
602 endif
603endif
604
605ifdef VBOX_PYTHON39M_INC
606#
607# Python 3.9 version with pymalloc
608#
609DLLS += VBoxPython3_9m
610VBoxPython3_9m_EXTENDS = VBoxPythonBase_m
611VBoxPython3_9m_EXTENDS_BY = appending
612VBoxPython3_9m_INCS = $(VBOX_PYTHON39M_INC)
613VBoxPython3_9m_LIBS = $(VBOX_PYTHON39M_LIB)
614
615 ifdef VBOX_WITH_32_ON_64_MAIN_API
616 ifdef VBOX_PYTHON39M_LIB_X86
617DLLS += VBoxPython3_9m_x86
618VBoxPython3_9m_x86_EXTENDS = VBoxPythonBase_x86_m
619VBoxPython3_9m_x86_EXTENDS_BY = appending
620VBoxPython3_9m_x86_INCS = $(VBOX_PYTHON39M_INC)
621VBoxPython3_9m_x86_LIBS = $(VBOX_PYTHON39M_LIB_X86)
622 endif
623 endif
624endif
625
626ifdef VBOX_PYTHON310_INC
627#
628# Python 3.10 version
629#
630DLLS += VBoxPython3_10
631VBoxPython3_10_EXTENDS = VBoxPythonBase
632VBoxPython3_10_EXTENDS_BY = appending
633VBoxPython3_10_INCS = $(VBOX_PYTHON310_INC)
634VBoxPython3_10_LIBS = $(VBOX_PYTHON310_LIB)
635
636 ifdef VBOX_WITH_32_ON_64_MAIN_API
637 ifdef VBOX_PYTHON310_LIB_X86
638DLLS += VBoxPython3_10_x86
639VBoxPython3_10_x86_EXTENDS = VBoxPythonBase_x86
640VBoxPython3_10_x86_EXTENDS_BY = appending
641VBoxPython3_10_x86_INCS = $(VBOX_PYTHON310_INC)
642VBoxPython3_10_x86_LIBS = $(VBOX_PYTHON310_LIB_X86)
643 endif
644 endif
645endif
646
647ifdef VBOX_PYTHON310M_INC
648#
649# Python 3.10 version with pymalloc
650#
651DLLS += VBoxPython3_10m
652VBoxPython3_10m_EXTENDS = VBoxPythonBase_m
653VBoxPython3_10m_EXTENDS_BY = appending
654VBoxPython3_10m_INCS = $(VBOX_PYTHON310M_INC)
655VBoxPython3_10m_LIBS = $(VBOX_PYTHON310M_LIB)
656
657 ifdef VBOX_WITH_32_ON_64_MAIN_API
658 ifdef VBOX_PYTHON310M_LIB_X86
659DLLS += VBoxPython3_10m_x86
660VBoxPython3_10m_x86_EXTENDS = VBoxPythonBase_x86_m
661VBoxPython3_10m_x86_EXTENDS_BY = appending
662VBoxPython3_10m_x86_INCS = $(VBOX_PYTHON310M_INC)
663VBoxPython3_10m_x86_LIBS = $(VBOX_PYTHON310M_LIB_X86)
664 endif
665 endif
666endif
667
668ifdef VBOX_PYTHONDEF_INC
669#
670# Python without versioning
671#
672DLLS += VBoxPython
673VBoxPython_EXTENDS = VBoxPythonBase
674VBoxPython_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_DEFS))
675VBoxPython_INCS = $(VBoxPythonBase_INCS) $(VBOX_PYTHONDEF_INC)
676if "$(KBUILD_TARGET)" == "linux"
677 VBoxPython_LIBS = $(VBoxPythonBase_LIBS)
678else
679 VBoxPython_LIBS = $(VBoxPythonBase_LIBS) $(VBOX_PYTHONDEF_LIB)
680endif
681
682 ifdef VBOX_WITH_32_ON_64_MAIN_API
683 ifdef VBOX_PYTHONDEF_LIB_X86
684VBoxPython_x86_EXTENDS = VBoxPythonBase_x86
685VBoxPython_x86_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_x86_DEFS))
686VBoxPython_x86_INCS = $(VBoxPythonBase_x86_INCS) $(VBOX_PYTHONDEF_INC)
687if "$(KBUILD_TARGET)" == "linux"
688 VBoxPython_x86_LIBS = $(VBoxPythonBase_x86_LIBS)
689else
690 VBoxPython_x86_LIBS = $(VBoxPythonBase_x86_LIBS) $(VBOX_PYTHONDEF_LIB_X86)
691endif
692 endif
693 endif
694endif
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#
710VBOX_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),)
713DLLS += VBoxPython3
714VBoxPython3_EXTENDS = VBoxPythonBase
715VBoxPython3_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_DEFS)) Py_LIMITED_API=0x03030000
716VBoxPython3_INCS = $(VBoxPythonBase_INCS) $(VBOX_PYTHON$(VBOX_PYTHON_LIMITED_API_VER)_INC)
717
718DLLS += VBoxPython3m
719VBoxPython3m_EXTENDS = VBoxPythonBase_m
720VBoxPython3m_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_m_DEFS)) Py_LIMITED_API=0x03030000
721VBoxPython3m_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)
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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