VirtualBox

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

Last change on this file since 100947 was 100110, checked in by vboxsync, 21 months ago

libs/xpcom18a4/python: No python 2.7 available starting with the 12.0 SDK (from what I can tell)

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