VirtualBox

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

Last change on this file was 103126, checked in by vboxsync, 4 months ago

libs/xpcom/python: Add forgotten Python 3.7 check, needed for oldish Apple command line dev tools (version 11, coming with SDK 10.15).

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

© 2023 Oracle
ContactPrivacy policyTerms of Use