1 | # $Id: Makefile.kmk 56301 2015-06-09 14:38:36Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for Python bindings
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2009-2015 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 |
|
---|
18 | SUB_DEPTH = ../../../..
|
---|
19 | include $(KBUILD_PATH)/subheader.kmk
|
---|
20 |
|
---|
21 | ifdef VBOX_WITH_MULTIVERSION_PYTHON
|
---|
22 | VBOX_MULTIPYTHON = 1
|
---|
23 | else
|
---|
24 | VBOX_MULTIPYTHON = 0
|
---|
25 | endif
|
---|
26 |
|
---|
27 | #
|
---|
28 | # List of supported Python versions, defining a number of
|
---|
29 | # VBOX_PYTHON[25|26|27|DEF]_[INC|LIB] variables which get picked up below.
|
---|
30 | #
|
---|
31 | ifeq ($(KBUILD_TARGET),darwin) # Relatively predictable, don't script.
|
---|
32 | ifeq ($(KBUILD_TARGET_ARCH),x86)
|
---|
33 | VBOX_PYTHON25_INC = $(VBOX_PATH_MACOSX_SDK)/usr/include/python2.5
|
---|
34 | VBOX_PYTHON25_LIB = $(VBOX_PATH_MACOSX_SDK)/usr/lib/libpython2.5.dylib
|
---|
35 | VBOX_PYTHON25_LIB_X86 = $(VBOX_PYTHON25_LIB)
|
---|
36 | endif
|
---|
37 | if !defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6) \
|
---|
38 | && ( !defined(VBOX_OSE) \
|
---|
39 | || "$(wildcard $(VBOX_PATH_MACOSX_SDK_10_6)/usr/lib/libpython2.6.dylib)" != "")
|
---|
40 | VBOX_PYTHON26_INC = $(VBOX_PATH_MACOSX_SDK_10_6)/usr/include/python2.6
|
---|
41 | VBOX_PYTHON26_LIB = $(VBOX_PATH_MACOSX_SDK_10_6)/usr/lib/libpython2.6.dylib
|
---|
42 | VBOX_PYTHON26_LIB_X86 = $(VBOX_PYTHON26_LIB)
|
---|
43 | endif
|
---|
44 | if !defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_7) \
|
---|
45 | && ( defined(VBOX_NOT_OSE_LATER_SOMETIME) \
|
---|
46 | || "$(wildcard $(VBOX_PATH_MACOSX_SDK_10_7)/usr/lib/libpython2.7.dylib)" != "")
|
---|
47 | VBOX_PYTHON27_INC = $(VBOX_PATH_MACOSX_SDK_10_7)/usr/include/python2.7
|
---|
48 | VBOX_PYTHON27_LIB = $(VBOX_PATH_MACOSX_SDK_10_7)/usr/lib/libpython2.7.dylib
|
---|
49 | VBOX_PYTHON27_LIB_X86 = $(VBOX_PYTHON27_LIB)
|
---|
50 | endif
|
---|
51 |
|
---|
52 | else
|
---|
53 | # Use the script.
|
---|
54 | $(eval $(subst |,$(NL),$(shell $(VBOX_BLD_PYTHON) \
|
---|
55 | $(PATH_SUB_CURRENT)/gen_python_deps.py \
|
---|
56 | $(KBUILD_TARGET) \
|
---|
57 | $(KBUILD_TARGET_ARCH) \
|
---|
58 | $(VBOX_MULTIPYTHON) )))
|
---|
59 | endif
|
---|
60 |
|
---|
61 | ifndef VBOX_ONLY_SDK
|
---|
62 |
|
---|
63 | #
|
---|
64 | # Base Python Client Module - the C++/XPCOM bits (not actually built).
|
---|
65 | #
|
---|
66 | VBoxPythonBase_TEMPLATE = XPCOM
|
---|
67 | VBoxPythonBase_CXXFLAGS = -Wno-write-strings
|
---|
68 | VBoxPythonBase_DLLSUFF.darwin = .so
|
---|
69 | VBoxPythonBase_DEFS = \
|
---|
70 | _IMPL_NS_COM \
|
---|
71 | _IMPL_NS_BASE \
|
---|
72 | EXPORT_XPTI_API \
|
---|
73 | EXPORT_XPT_API \
|
---|
74 | VBOX_PYXPCOM \
|
---|
75 | VBOX_WITH_XPCOM \
|
---|
76 | VBOX_PYXPCOM_VERSIONED
|
---|
77 | #VBoxPythonBase_DEFS.debug = \
|
---|
78 | # VBOX_DEBUG_LIFETIMES
|
---|
79 | VBoxPythonBase_INCS = \
|
---|
80 | src
|
---|
81 | VBoxPythonBase_SOURCES = \
|
---|
82 | src/module/_xpcom.cpp \
|
---|
83 | src/dllmain.cpp \
|
---|
84 | src/ErrorUtils.cpp \
|
---|
85 | src/PyGBase.cpp \
|
---|
86 | src/PyGInputStream.cpp \
|
---|
87 | src/PyGModule.cpp \
|
---|
88 | src/PyGStub.cpp \
|
---|
89 | src/PyGWeakReference.cpp \
|
---|
90 | src/PyIClassInfo.cpp \
|
---|
91 | src/PyIComponentManager.cpp \
|
---|
92 | src/PyIComponentManagerObsolete.cpp \
|
---|
93 | src/PyIEnumerator.cpp \
|
---|
94 | src/PyIID.cpp \
|
---|
95 | src/PyIInputStream.cpp \
|
---|
96 | src/PyIInterfaceInfo.cpp \
|
---|
97 | src/PyIInterfaceInfoManager.cpp \
|
---|
98 | src/PyISimpleEnumerator.cpp \
|
---|
99 | src/PyISupports.cpp \
|
---|
100 | src/PyIVariant.cpp \
|
---|
101 | src/Pyxpt_info.cpp \
|
---|
102 | src/TypeObject.cpp \
|
---|
103 | src/VariantUtils.cpp
|
---|
104 | VBoxPythonBase_LIBS = \
|
---|
105 | $(PATH_STAGE_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \
|
---|
106 | $(PATH_STAGE_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL)
|
---|
107 |
|
---|
108 | # 32-bit base.
|
---|
109 | VBoxPythonBase_x86_TEMPLATE = XPCOM-x86
|
---|
110 | VBoxPythonBase_x86_EXTENDS = VBoxPythonBase
|
---|
111 | VBoxPythonBase_x86_DEFS = MODULE_NAME_SUFFIX=_x86 $(VBoxPythonBase_DEFS)
|
---|
112 | VBoxPythonBase_x86_LIBS = \
|
---|
113 | $(PATH_STAGE_LIB)/VBoxCOM-x86$(VBOX_SUFF_LIB) \
|
---|
114 | $(PATH_STAGE_BIN)/VBoxXPCOM-x86$(VBOX_SUFF_DLL)
|
---|
115 |
|
---|
116 |
|
---|
117 | ifdef VBOX_PYTHON23_INC
|
---|
118 | #
|
---|
119 | # Python 2.3 version
|
---|
120 | #
|
---|
121 | DLLS += VBoxPython2_3
|
---|
122 | VBoxPython2_3_EXTENDS = VBoxPythonBase
|
---|
123 | VBoxPython2_3_EXTENDS_BY = appending
|
---|
124 | VBoxPython2_3_TEMPLATE = XPCOM$(if-expr "$(KBUILD_TARGET)" == "darwin",OSX104,)
|
---|
125 | VBoxPython2_3_INCS = $(VBOX_PYTHON23_INC)
|
---|
126 | VBoxPython2_3_LIBS = $(VBOX_PYTHON23_LIB)
|
---|
127 |
|
---|
128 | ifdef VBOX_WITH_32_ON_64_MAIN_API
|
---|
129 | DLLS += VBoxPython2_3_x86
|
---|
130 | VBoxPython2_3_x86_EXTENDS = VBoxPythonBase_x86
|
---|
131 | VBoxPython2_3_x86_EXTENDS_BY = appending
|
---|
132 | VBoxPython2_3_x86_TEMPLATE = XPCOM$(if-expr "$(KBUILD_TARGET)" == "darwin",OSX104,-x86)
|
---|
133 | VBoxPython2_3_x86_INCS = $(VBOX_PYTHON23_INC)
|
---|
134 | VBoxPython2_3_x86_LIBS = $(VBOX_PYTHON23_LIB_X86)
|
---|
135 | endif
|
---|
136 | endif
|
---|
137 |
|
---|
138 | ifdef VBOX_PYTHON24_INC
|
---|
139 | #
|
---|
140 | # Python 2.4 version
|
---|
141 | #
|
---|
142 | DLLS += VBoxPython2_4
|
---|
143 | VBoxPython2_4_EXTENDS = VBoxPythonBase
|
---|
144 | VBoxPython2_4_EXTENDS_BY = appending
|
---|
145 | VBoxPython2_4_INCS = $(VBOX_PYTHON24_INC)
|
---|
146 | VBoxPython2_4_LIBS = $(VBOX_PYTHON24_LIB)
|
---|
147 |
|
---|
148 | ifdef VBOX_WITH_32_ON_64_MAIN_API
|
---|
149 | DLLS += VBoxPython2_4_x86
|
---|
150 | VBoxPython2_4_x86_EXTENDS = VBoxPythonBase_x86
|
---|
151 | VBoxPython2_4_x86_EXTENDS_BY = appending
|
---|
152 | VBoxPython2_4_x86_INCS = $(VBOX_PYTHON24_INC)
|
---|
153 | VBoxPython2_4_x86_LIBS = $(VBOX_PYTHON24_LIB_X86)
|
---|
154 | endif
|
---|
155 | endif
|
---|
156 |
|
---|
157 | ifdef VBOX_PYTHON25_INC
|
---|
158 | #
|
---|
159 | # Python 2.5 version
|
---|
160 | #
|
---|
161 | DLLS += VBoxPython2_5
|
---|
162 | VBoxPython2_5_EXTENDS = VBoxPythonBase
|
---|
163 | VBoxPython2_5_EXTENDS_BY = appending
|
---|
164 | VBoxPython2_5_INCS = $(VBOX_PYTHON25_INC)
|
---|
165 | VBoxPython2_5_LIBS = $(VBOX_PYTHON25_LIB)
|
---|
166 |
|
---|
167 | ifdef VBOX_WITH_32_ON_64_MAIN_API
|
---|
168 | DLLS += VBoxPython2_5_x86
|
---|
169 | VBoxPython2_5_x86_EXTENDS = VBoxPythonBase_x86
|
---|
170 | VBoxPython2_5_x86_EXTENDS_BY = appending
|
---|
171 | VBoxPython2_5_x86_INCS = $(VBOX_PYTHON25_INC)
|
---|
172 | VBoxPython2_5_x86_LIBS = $(VBOX_PYTHON25_LIB_X86)
|
---|
173 | endif
|
---|
174 | endif
|
---|
175 |
|
---|
176 | ifdef VBOX_PYTHON26_INC
|
---|
177 | #
|
---|
178 | # Python 2.6 version
|
---|
179 | #
|
---|
180 | DLLS += VBoxPython2_6
|
---|
181 | VBoxPython2_6_EXTENDS = VBoxPythonBase
|
---|
182 | VBoxPython2_6_EXTENDS_BY = appending
|
---|
183 | VBoxPython2_6_TEMPLATE = XPCOM$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" <= "10.6",OSX106,)
|
---|
184 | VBoxPython2_6_INCS = $(VBOX_PYTHON26_INC)
|
---|
185 | VBoxPython2_6_LIBS = $(VBOX_PYTHON26_LIB)
|
---|
186 |
|
---|
187 | ifdef VBOX_WITH_32_ON_64_MAIN_API
|
---|
188 | DLLS += VBoxPython2_6_x86
|
---|
189 | VBoxPython2_6_x86_EXTENDS = VBoxPythonBase_x86
|
---|
190 | VBoxPython2_6_x86_EXTENDS_BY = appending
|
---|
191 | VBoxPython2_6_x86_TEMPLATE = XPCOM$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" <= "10.6",OSX106,-x86)
|
---|
192 | VBoxPython2_6_x86_INCS = $(VBOX_PYTHON26_INC)
|
---|
193 | VBoxPython2_6_x86_LIBS = $(VBOX_PYTHON26_LIB_X86)
|
---|
194 | endif
|
---|
195 | endif
|
---|
196 |
|
---|
197 | ifdef VBOX_PYTHON27_INC
|
---|
198 | #
|
---|
199 | # Python 2.7 version
|
---|
200 | #
|
---|
201 | DLLS += VBoxPython2_7
|
---|
202 | VBoxPython2_7_EXTENDS = VBoxPythonBase
|
---|
203 | VBoxPython2_7_EXTENDS_BY = appending
|
---|
204 | VBoxPython2_7_TEMPLATE = XPCOM$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" <= "10.7",OSX107,)
|
---|
205 | VBoxPython2_7_INCS = $(VBOX_PYTHON27_INC)
|
---|
206 | VBoxPython2_7_LIBS = $(VBOX_PYTHON27_LIB)
|
---|
207 |
|
---|
208 | ifdef VBOX_WITH_32_ON_64_MAIN_API
|
---|
209 | DLLS += VBoxPython2_7_x86
|
---|
210 | VBoxPython2_7_x86_EXTENDS = VBoxPythonBase_x86
|
---|
211 | VBoxPython2_7_x86_EXTENDS_BY = appending
|
---|
212 | VBoxPython2_7_x86_TEMPLATE = XPCOM$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" <= "10.7",OSX107,-x86)
|
---|
213 | VBoxPython2_7_x86_INCS = $(VBOX_PYTHON27_INC)
|
---|
214 | VBoxPython2_7_x86_LIBS = $(VBOX_PYTHON27_LIB_X86)
|
---|
215 | endif
|
---|
216 | endif
|
---|
217 |
|
---|
218 | ifdef VBOX_PYTHONDEF_INC
|
---|
219 | #
|
---|
220 | # Python without versioning
|
---|
221 | #
|
---|
222 | DLLS += VBoxPython
|
---|
223 | VBoxPython_EXTENDS = VBoxPythonBase
|
---|
224 | VBoxPython_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_DEFS))
|
---|
225 | VBoxPython_INCS = $(VBoxPythonBase_INCS) $(VBOX_PYTHONDEF_INC)
|
---|
226 | if "$(KBUILD_TARGET)" == "linux"
|
---|
227 | VBoxPython_LIBS = $(VBoxPythonBase_LIBS)
|
---|
228 | else
|
---|
229 | VBoxPython_LIBS = $(VBoxPythonBase_LIBS) $(VBOX_PYTHONDEF_LIB)
|
---|
230 | endif
|
---|
231 |
|
---|
232 | ifdef VBOX_WITH_32_ON_64_MAIN_API
|
---|
233 | VBoxPython_x86_EXTENDS = VBoxPythonBase_x86
|
---|
234 | VBoxPython_x86_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_x86_DEFS))
|
---|
235 | VBoxPython_x86_INCS = $(VBoxPythonBase_x86_INCS) $(VBOX_PYTHONDEF_INC)
|
---|
236 | if "$(KBUILD_TARGET)" == "linux"
|
---|
237 | VBoxPython_x86_LIBS = $(VBoxPythonBase_x86_LIBS)
|
---|
238 | else
|
---|
239 | VBoxPython_x86_LIBS = $(VBoxPythonBase_x86_LIBS) $(VBOX_PYTHONDEF_LIB_X86)
|
---|
240 | endif
|
---|
241 | endif
|
---|
242 | endif
|
---|
243 |
|
---|
244 | endif # VBOX_ONLY_SDK
|
---|
245 |
|
---|
246 | #
|
---|
247 | # Install the python modules.
|
---|
248 | #
|
---|
249 | INSTALLS += VBoxPython-inst-py-xpcom
|
---|
250 | VBoxPython-inst-py-xpcom_INST = $(INST_SDK)bindings/xpcom/python/xpcom/
|
---|
251 | VBoxPython-inst-py-xpcom_MODE = a+r,u+w
|
---|
252 | VBoxPython-inst-py-xpcom_SOURCES = \
|
---|
253 | vboxxpcom.py \
|
---|
254 | components.py \
|
---|
255 | file.py \
|
---|
256 | __init__.py \
|
---|
257 | nsError.py \
|
---|
258 | primitives.py \
|
---|
259 | xpcom_consts.py \
|
---|
260 | xpt.py \
|
---|
261 | client/__init__.py=>client/__init__.py \
|
---|
262 | server/__init__.py=>server/__init__.py \
|
---|
263 | server/enumerator.py=>server/enumerator.py \
|
---|
264 | server/factory.py=>server/factory.py \
|
---|
265 | server/loader.py=>server/loader.py \
|
---|
266 | server/module.py=>server/module.py \
|
---|
267 | server/policy.py=>server/policy.py
|
---|
268 |
|
---|
269 |
|
---|
270 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
271 |
|
---|