VirtualBox

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

Last change on this file since 61577 was 60975, checked in by vboxsync, 9 years ago

Attempt at mac build fix; cleanups.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 10.7 KB
Line 
1# $Id: Makefile.kmk 60975 2016-05-13 11:05:22Z vboxsync $
2## @file
3# Sub-Makefile for Python bindings
4#
5
6#
7# Copyright (C) 2009-2016 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
21ifdef VBOX_WITH_MULTIVERSION_PYTHON
22 VBOX_MULTIPYTHON = 1
23else
24 VBOX_MULTIPYTHON = 0
25endif
26
27#
28# List of supported Python versions, defining a number of
29# VBOX_PYTHON[26|27|31|32|33|34|35|DEF]_[INC|LIB] variables
30# which get picked up below.
31#
32ifeq ($(KBUILD_TARGET),darwin) # Relatively predictable, don't script.
33 ifndef VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6
34 if1of ($(VBOX_DEF_MACOSX_VERSION_MIN), 10.5 10.4)
35 VBOX_PYTHON26_INC = $(VBOX_PATH_MACOSX_SDK_10_6)/usr/include/python2.6
36 VBOX_PYTHON26_LIB = $(VBOX_PATH_MACOSX_SDK_10_6)/usr/lib/libpython2.6.dylib
37 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!!
38 VBOX_PYTHON26_INC = $(VBOX_PATH_MACOSX_SDK)/../MacOSX10.10.sdk/System/Library/Frameworks/Python.framework/Versions/2.6/Headers
39 VBOX_PYTHON26_LIB = $(VBOX_PATH_MACOSX_SDK)/../MacOSX10.10.sdk/System/Library/Frameworks/Python.framework/Versions/2.6/Python
40 else
41 VBOX_PYTHON26_INC = $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/Python.framework/Versions/2.6/Headers
42 VBOX_PYTHON26_LIB = $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/Python.framework/Versions/2.6/Python
43 endif
44 if !defined(VBOX_OSE) || "$(wildcard $(VBOX_PYTHON26_LIB))" != ""
45 VBOX_PYTHON26_LIB_X86 = $(VBOX_PYTHON26_LIB)
46 else
47 VBOX_PYTHON26_INC =
48 VBOX_PYTHON26_LIB =
49 endif
50 endif
51 ifndef VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_7
52 if1of ($(VBOX_DEF_MACOSX_VERSION_MIN), 10.6 10.5 10.4)
53 VBOX_PYTHON27_INC = $(VBOX_PATH_MACOSX_SDK_10_7)/usr/include/python2.7
54 VBOX_PYTHON27_LIB = $(VBOX_PATH_MACOSX_SDK_10_7)/usr/lib/libpython2.7.dylib
55 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!!
56 VBOX_PYTHON27_INC = $(VBOX_PATH_MACOSX_SDK)/../MacOSX10.10.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/Headers
57 VBOX_PYTHON27_LIB = $(VBOX_PATH_MACOSX_SDK)/../MacOSX10.10.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/Python
58 else
59 VBOX_PYTHON27_INC = $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/Python.framework/Versions/2.7/Headers
60 VBOX_PYTHON27_LIB = $(VBOX_PATH_MACOSX_SDK)/System/Library/Frameworks/Python.framework/Versions/2.7/Python
61 endif
62 if !defined(VBOX_OSE) || "$(wildcard $(VBOX_PYTHON27_LIB))" != ""
63 VBOX_PYTHON27_LIB_X86 = $(VBOX_PYTHON27_LIB)
64 else
65 VBOX_PYTHON27_INC =
66 VBOX_PYTHON27_LIB =
67 endif
68 endif
69 # No Python 3.x yet as part of OSX versions including El Capitan, 10.11.
70
71else
72 # Use the script.
73 $(eval $(subst |,$(NL),$(shell $(VBOX_BLD_PYTHON) \
74 $(PATH_SUB_CURRENT)/gen_python_deps.py \
75 $(KBUILD_TARGET) \
76 $(KBUILD_TARGET_ARCH) \
77 $(VBOX_MULTIPYTHON) )))
78endif
79
80ifndef VBOX_ONLY_SDK
81
82#
83# Base Python Client Module - the C++/XPCOM bits (not actually built).
84#
85VBoxPythonBase_TEMPLATE = XPCOM
86VBoxPythonBase_CXXFLAGS = -Wno-write-strings
87VBoxPythonBase_DLLSUFF.darwin = .so
88VBoxPythonBase_DEFS = \
89 _IMPL_NS_COM \
90 _IMPL_NS_BASE \
91 EXPORT_XPTI_API \
92 EXPORT_XPT_API \
93 VBOX_PYXPCOM \
94 VBOX_WITH_XPCOM \
95 VBOX_PYXPCOM_VERSIONED
96#VBoxPythonBase_DEFS.debug = \
97# VBOX_DEBUG_LIFETIMES
98VBoxPythonBase_INCS = \
99 src
100VBoxPythonBase_SOURCES = \
101 src/module/_xpcom.cpp \
102 src/dllmain.cpp \
103 src/ErrorUtils.cpp \
104 src/PyGBase.cpp \
105 src/PyGInputStream.cpp \
106 src/PyGModule.cpp \
107 src/PyGStub.cpp \
108 src/PyGWeakReference.cpp \
109 src/PyIClassInfo.cpp \
110 src/PyIComponentManager.cpp \
111 src/PyIComponentManagerObsolete.cpp \
112 src/PyIEnumerator.cpp \
113 src/PyIID.cpp \
114 src/PyIInputStream.cpp \
115 src/PyIInterfaceInfo.cpp \
116 src/PyIInterfaceInfoManager.cpp \
117 src/PyISimpleEnumerator.cpp \
118 src/PyISupports.cpp \
119 src/PyIVariant.cpp \
120 src/Pyxpt_info.cpp \
121 src/TypeObject.cpp \
122 src/VariantUtils.cpp
123VBoxPythonBase_LIBS = \
124 $(PATH_STAGE_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \
125 $(PATH_STAGE_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL)
126
127# 32-bit base.
128VBoxPythonBase_x86_TEMPLATE = XPCOM-x86
129VBoxPythonBase_x86_EXTENDS = VBoxPythonBase
130VBoxPythonBase_x86_DEFS = MODULE_NAME_SUFFIX=_x86 $(VBoxPythonBase_DEFS)
131VBoxPythonBase_x86_LIBS = \
132 $(PATH_STAGE_LIB)/VBoxCOM-x86$(VBOX_SUFF_LIB) \
133 $(PATH_STAGE_BIN)/VBoxXPCOM-x86$(VBOX_SUFF_DLL)
134
135
136ifdef VBOX_PYTHON26_INC
137#
138# Python 2.6 version
139#
140DLLS += VBoxPython2_6
141VBoxPython2_6_EXTENDS = VBoxPythonBase
142VBoxPython2_6_EXTENDS_BY = appending
143VBoxPython2_6_TEMPLATE = XPCOM$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" <= "10.6",OSX106,)
144VBoxPython2_6_INCS = $(VBOX_PYTHON26_INC)
145VBoxPython2_6_LIBS = $(VBOX_PYTHON26_LIB)
146
147 ifdef VBOX_WITH_32_ON_64_MAIN_API
148DLLS += VBoxPython2_6_x86
149VBoxPython2_6_x86_EXTENDS = VBoxPythonBase_x86
150VBoxPython2_6_x86_EXTENDS_BY = appending
151VBoxPython2_6_x86_TEMPLATE = XPCOM$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" <= "10.6",OSX106,-x86)
152VBoxPython2_6_x86_INCS = $(VBOX_PYTHON26_INC)
153VBoxPython2_6_x86_LIBS = $(VBOX_PYTHON26_LIB_X86)
154 endif
155endif
156
157ifdef VBOX_PYTHON27_INC
158#
159# Python 2.7 version
160#
161DLLS += VBoxPython2_7
162VBoxPython2_7_EXTENDS = VBoxPythonBase
163VBoxPython2_7_EXTENDS_BY = appending
164VBoxPython2_7_TEMPLATE = XPCOM$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" <= "10.7",OSX107,)
165VBoxPython2_7_INCS = $(VBOX_PYTHON27_INC)
166VBoxPython2_7_LIBS = $(VBOX_PYTHON27_LIB)
167
168 ifdef VBOX_WITH_32_ON_64_MAIN_API
169DLLS += VBoxPython2_7_x86
170VBoxPython2_7_x86_EXTENDS = VBoxPythonBase_x86
171VBoxPython2_7_x86_EXTENDS_BY = appending
172VBoxPython2_7_x86_TEMPLATE = XPCOM$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" <= "10.7",OSX107,-x86)
173VBoxPython2_7_x86_INCS = $(VBOX_PYTHON27_INC)
174VBoxPython2_7_x86_LIBS = $(VBOX_PYTHON27_LIB_X86)
175 endif
176endif
177
178ifdef VBOX_PYTHON31_INC
179#
180# Python 3.1 version
181#
182DLLS += VBoxPython3_1
183VBoxPython3_1_EXTENDS = VBoxPythonBase
184VBoxPython3_1_EXTENDS_BY = appending
185VBoxPython3_1_TEMPLATE = XPCOM
186VBoxPython3_1_INCS = $(VBOX_PYTHON31_INC)
187VBoxPython3_1_LIBS = $(VBOX_PYTHON31_LIB)
188
189 ifdef VBOX_WITH_32_ON_64_MAIN_API
190DLLS += VBoxPython3_1_x86
191VBoxPython3_1_x86_EXTENDS = VBoxPythonBase_x86
192VBoxPython3_1_x86_EXTENDS_BY = appending
193VBoxPython3_1_x86_TEMPLATE = XPCOM
194VBoxPython3_1_x86_INCS = $(VBOX_PYTHON31_INC)
195VBoxPython3_1_x86_LIBS = $(VBOX_PYTHON31_LIB_X86)
196 endif
197endif
198
199ifdef VBOX_PYTHON32_INC
200#
201# Python 3.2 version
202#
203DLLS += VBoxPython3_2
204VBoxPython3_2_EXTENDS = VBoxPythonBase
205VBoxPython3_2_EXTENDS_BY = appending
206VBoxPython3_2_TEMPLATE = XPCOM
207VBoxPython3_2_INCS = $(VBOX_PYTHON32_INC)
208VBoxPython3_2_LIBS = $(VBOX_PYTHON32_LIB)
209
210 ifdef VBOX_WITH_32_ON_64_MAIN_API
211DLLS += VBoxPython3_2_x86
212VBoxPython3_2_x86_EXTENDS = VBoxPythonBase_x86
213VBoxPython3_2_x86_EXTENDS_BY = appending
214VBoxPython3_2_x86_TEMPLATE = XPCOM
215VBoxPython3_2_x86_INCS = $(VBOX_PYTHON32_INC)
216VBoxPython3_2_x86_LIBS = $(VBOX_PYTHON32_LIB_X86)
217 endif
218endif
219
220ifdef VBOX_PYTHON33_INC
221#
222# Python 3.3 version
223#
224DLLS += VBoxPython3_3
225VBoxPython3_3_EXTENDS = VBoxPythonBase
226VBoxPython3_3_EXTENDS_BY = appending
227VBoxPython3_3_TEMPLATE = XPCOM
228VBoxPython3_3_INCS = $(VBOX_PYTHON33_INC)
229VBoxPython3_3_LIBS = $(VBOX_PYTHON33_LIB)
230
231 ifdef VBOX_WITH_32_ON_64_MAIN_API
232DLLS += VBoxPython3_3_x86
233VBoxPython3_3_x86_EXTENDS = VBoxPythonBase_x86
234VBoxPython3_3_x86_EXTENDS_BY = appending
235VBoxPython3_3_x86_TEMPLATE = XPCOM
236VBoxPython3_3_x86_INCS = $(VBOX_PYTHON33_INC)
237VBoxPython3_3_x86_LIBS = $(VBOX_PYTHON33_LIB_X86)
238 endif
239endif
240
241ifdef VBOX_PYTHON34_INC
242#
243# Python 3.4 version
244#
245DLLS += VBoxPython3_4
246VBoxPython3_4_EXTENDS = VBoxPythonBase
247VBoxPython3_4_EXTENDS_BY = appending
248VBoxPython3_4_TEMPLATE = XPCOM
249VBoxPython3_4_INCS = $(VBOX_PYTHON34_INC)
250VBoxPython3_4_LIBS = $(VBOX_PYTHON34_LIB)
251
252 ifdef VBOX_WITH_32_ON_64_MAIN_API
253DLLS += VBoxPython3_4_x86
254VBoxPython3_4_x86_EXTENDS = VBoxPythonBase_x86
255VBoxPython3_4_x86_EXTENDS_BY = appending
256VBoxPython3_4_x86_TEMPLATE = XPCOM
257VBoxPython3_4_x86_INCS = $(VBOX_PYTHON34_INC)
258VBoxPython3_4_x86_LIBS = $(VBOX_PYTHON34_LIB_X86)
259 endif
260endif
261
262ifdef VBOX_PYTHON35_INC
263#
264# Python 3.5 version
265#
266DLLS += VBoxPython3_5
267VBoxPython3_5_EXTENDS = VBoxPythonBase
268VBoxPython3_5_EXTENDS_BY = appending
269VBoxPython3_5_TEMPLATE = XPCOM
270VBoxPython3_5_INCS = $(VBOX_PYTHON35_INC)
271VBoxPython3_5_LIBS = $(VBOX_PYTHON35_LIB)
272
273 ifdef VBOX_WITH_32_ON_64_MAIN_API
274DLLS += VBoxPython3_5_x86
275VBoxPython3_5_x86_EXTENDS = VBoxPythonBase_x86
276VBoxPython3_5_x86_EXTENDS_BY = appending
277VBoxPython3_5_x86_TEMPLATE = XPCOM
278VBoxPython3_5_x86_INCS = $(VBOX_PYTHON35_INC)
279VBoxPython3_5_x86_LIBS = $(VBOX_PYTHON35_LIB_X86)
280 endif
281endif
282
283ifdef VBOX_PYTHONDEF_INC
284#
285# Python without versioning
286#
287DLLS += VBoxPython
288VBoxPython_EXTENDS = VBoxPythonBase
289VBoxPython_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_DEFS))
290VBoxPython_INCS = $(VBoxPythonBase_INCS) $(VBOX_PYTHONDEF_INC)
291if "$(KBUILD_TARGET)" == "linux"
292 VBoxPython_LIBS = $(VBoxPythonBase_LIBS)
293else
294 VBoxPython_LIBS = $(VBoxPythonBase_LIBS) $(VBOX_PYTHONDEF_LIB)
295endif
296
297 ifdef VBOX_WITH_32_ON_64_MAIN_API
298VBoxPython_x86_EXTENDS = VBoxPythonBase_x86
299VBoxPython_x86_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_x86_DEFS))
300VBoxPython_x86_INCS = $(VBoxPythonBase_x86_INCS) $(VBOX_PYTHONDEF_INC)
301if "$(KBUILD_TARGET)" == "linux"
302 VBoxPython_x86_LIBS = $(VBoxPythonBase_x86_LIBS)
303else
304 VBoxPython_x86_LIBS = $(VBoxPythonBase_x86_LIBS) $(VBOX_PYTHONDEF_LIB_X86)
305endif
306 endif
307endif
308
309endif # VBOX_ONLY_SDK
310
311#
312# Install the python modules.
313#
314INSTALLS += VBoxPython-inst-py-xpcom
315VBoxPython-inst-py-xpcom_INST = $(INST_SDK)bindings/xpcom/python/xpcom/
316VBoxPython-inst-py-xpcom_MODE = a+r,u+w
317VBoxPython-inst-py-xpcom_SOURCES = \
318 vboxxpcom.py \
319 components.py \
320 file.py \
321 __init__.py \
322 nsError.py \
323 primitives.py \
324 xpcom_consts.py \
325 xpt.py \
326 client/__init__.py=>client/__init__.py \
327 server/__init__.py=>server/__init__.py \
328 server/enumerator.py=>server/enumerator.py \
329 server/factory.py=>server/factory.py \
330 server/loader.py=>server/loader.py \
331 server/module.py=>server/module.py \
332 server/policy.py=>server/policy.py
333
334
335include $(FILE_KBUILD_SUB_FOOTER)
336
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