VirtualBox

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

Last change on this file since 86646 was 86646, checked in by vboxsync, 4 years ago

xpcom/python: No NEEDED entries for VBoxPython2.so in linux builds. bugref:9840

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