Changeset 63775 in vbox for trunk/src/libs
- Timestamp:
- Sep 9, 2016 9:54:19 AM (8 years ago)
- Location:
- trunk/src/libs/xpcom18a4/python
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/python/Makefile.kmk
r60975 r63775 27 27 # 28 28 # List of supported Python versions, defining a number of 29 # VBOX_PYTHON[26|27|31|32|3 3|34|35|DEF]_[INC|LIB] variables29 # VBOX_PYTHON[26|27|31|32|32M|33|33M|34|34M|35|35M|DEF]_[INC|LIB] variables 30 30 # which get picked up below. 31 31 # … … 146 146 147 147 ifdef VBOX_WITH_32_ON_64_MAIN_API 148 ifdef VBOX_PYTHON26_LIB_X86 148 149 DLLS += VBoxPython2_6_x86 149 150 VBoxPython2_6_x86_EXTENDS = VBoxPythonBase_x86 … … 152 153 VBoxPython2_6_x86_INCS = $(VBOX_PYTHON26_INC) 153 154 VBoxPython2_6_x86_LIBS = $(VBOX_PYTHON26_LIB_X86) 155 endif 154 156 endif 155 157 endif … … 167 169 168 170 ifdef VBOX_WITH_32_ON_64_MAIN_API 171 ifdef VBOX_PYTHON27_LIB_X86 169 172 DLLS += VBoxPython2_7_x86 170 173 VBoxPython2_7_x86_EXTENDS = VBoxPythonBase_x86 … … 173 176 VBoxPython2_7_x86_INCS = $(VBOX_PYTHON27_INC) 174 177 VBoxPython2_7_x86_LIBS = $(VBOX_PYTHON27_LIB_X86) 178 endif 175 179 endif 176 180 endif … … 188 192 189 193 ifdef VBOX_WITH_32_ON_64_MAIN_API 194 ifdef VBOX_PYTHON31_LIB_X86 190 195 DLLS += VBoxPython3_1_x86 191 196 VBoxPython3_1_x86_EXTENDS = VBoxPythonBase_x86 … … 194 199 VBoxPython3_1_x86_INCS = $(VBOX_PYTHON31_INC) 195 200 VBoxPython3_1_x86_LIBS = $(VBOX_PYTHON31_LIB_X86) 201 endif 196 202 endif 197 203 endif … … 209 215 210 216 ifdef VBOX_WITH_32_ON_64_MAIN_API 217 ifdef VBOX_PYTHON32_LIB_X86 211 218 DLLS += VBoxPython3_2_x86 212 219 VBoxPython3_2_x86_EXTENDS = VBoxPythonBase_x86 … … 215 222 VBoxPython3_2_x86_INCS = $(VBOX_PYTHON32_INC) 216 223 VBoxPython3_2_x86_LIBS = $(VBOX_PYTHON32_LIB_X86) 224 endif 225 endif 226 endif 227 228 ifdef VBOX_PYTHON32M_INC 229 # 230 # Python 3.2 version with pymalloc 231 # 232 DLLS += VBoxPython3_2m 233 VBoxPython3_2m_EXTENDS = VBoxPythonBase 234 VBoxPython3_2m_EXTENDS_BY = appending 235 VBoxPython3_2m_TEMPLATE = XPCOM 236 VBoxPython3_2m_INCS = $(VBOX_PYTHON32M_INC) 237 VBoxPython3_2m_LIBS = $(VBOX_PYTHON32M_LIB) 238 239 ifdef VBOX_WITH_32_ON_64_MAIN_API 240 ifdef VBOX_PYTHON32M_LIB_X86 241 DLLS += VBoxPython3_2m_x86 242 VBoxPython3_2m_x86_EXTENDS = VBoxPythonBase_x86 243 VBoxPython3_2m_x86_EXTENDS_BY = appending 244 VBoxPython3_2m_x86_TEMPLATE = XPCOM 245 VBoxPython3_2m_x86_INCS = $(VBOX_PYTHON32M_INC) 246 VBoxPython3_2m_x86_LIBS = $(VBOX_PYTHON32M_LIB_X86) 247 endif 217 248 endif 218 249 endif … … 230 261 231 262 ifdef VBOX_WITH_32_ON_64_MAIN_API 263 ifdef VBOX_PYTHON33_LIB_X86 232 264 DLLS += VBoxPython3_3_x86 233 265 VBoxPython3_3_x86_EXTENDS = VBoxPythonBase_x86 … … 236 268 VBoxPython3_3_x86_INCS = $(VBOX_PYTHON33_INC) 237 269 VBoxPython3_3_x86_LIBS = $(VBOX_PYTHON33_LIB_X86) 270 endif 271 endif 272 endif 273 274 ifdef VBOX_PYTHON33M_INC 275 # 276 # Python 3.3 version with pymalloc 277 # 278 DLLS += VBoxPython3_3m 279 VBoxPython3_3m_EXTENDS = VBoxPythonBase 280 VBoxPython3_3m_EXTENDS_BY = appending 281 VBoxPython3_3m_TEMPLATE = XPCOM 282 VBoxPython3_3m_INCS = $(VBOX_PYTHON33M_INC) 283 VBoxPython3_3m_LIBS = $(VBOX_PYTHON33M_LIB) 284 285 ifdef VBOX_WITH_32_ON_64_MAIN_API 286 ifdef VBOX_PYTHON33M_LIB_X86 287 DLLS += VBoxPython3_3m_x86 288 VBoxPython3_3m_x86_EXTENDS = VBoxPythonBase_x86 289 VBoxPython3_3m_x86_EXTENDS_BY = appending 290 VBoxPython3_3m_x86_TEMPLATE = XPCOM 291 VBoxPython3_3m_x86_INCS = $(VBOX_PYTHON33M_INC) 292 VBoxPython3_3m_x86_LIBS = $(VBOX_PYTHON33M_LIB_X86) 293 endif 238 294 endif 239 295 endif … … 251 307 252 308 ifdef VBOX_WITH_32_ON_64_MAIN_API 309 ifdef VBOX_PYTHON34_LIB_X86 253 310 DLLS += VBoxPython3_4_x86 254 311 VBoxPython3_4_x86_EXTENDS = VBoxPythonBase_x86 … … 257 314 VBoxPython3_4_x86_INCS = $(VBOX_PYTHON34_INC) 258 315 VBoxPython3_4_x86_LIBS = $(VBOX_PYTHON34_LIB_X86) 316 endif 317 endif 318 endif 319 320 ifdef VBOX_PYTHON34M_INC 321 # 322 # Python 3.4 version with pymalloc 323 # 324 DLLS += VBoxPython3_4m 325 VBoxPython3_4m_EXTENDS = VBoxPythonBase 326 VBoxPython3_4m_EXTENDS_BY = appending 327 VBoxPython3_4m_TEMPLATE = XPCOM 328 VBoxPython3_4m_INCS = $(VBOX_PYTHON34M_INC) 329 VBoxPython3_4m_LIBS = $(VBOX_PYTHON34M_LIB) 330 331 ifdef VBOX_WITH_32_ON_64_MAIN_API 332 ifdef VBOX_PYTHON34M_LIB_X86 333 DLLS += VBoxPython3_4m_x86 334 VBoxPython3_4m_x86_EXTENDS = VBoxPythonBase_x86 335 VBoxPython3_4m_x86_EXTENDS_BY = appending 336 VBoxPython3_4m_x86_TEMPLATE = XPCOM 337 VBoxPython3_4m_x86_INCS = $(VBOX_PYTHON34M_INC) 338 VBoxPython3_4m_x86_LIBS = $(VBOX_PYTHON34M_LIB_X86) 339 endif 259 340 endif 260 341 endif … … 272 353 273 354 ifdef VBOX_WITH_32_ON_64_MAIN_API 355 ifdef VBOX_PYTHON35_LIB_X86 274 356 DLLS += VBoxPython3_5_x86 275 357 VBoxPython3_5_x86_EXTENDS = VBoxPythonBase_x86 … … 278 360 VBoxPython3_5_x86_INCS = $(VBOX_PYTHON35_INC) 279 361 VBoxPython3_5_x86_LIBS = $(VBOX_PYTHON35_LIB_X86) 362 endif 363 endif 364 endif 365 366 ifdef VBOX_PYTHON35M_INC 367 # 368 # Python 3.5 version with pymalloc 369 # 370 DLLS += VBoxPython3_5m 371 VBoxPython3_5m_EXTENDS = VBoxPythonBase 372 VBoxPython3_5m_EXTENDS_BY = appending 373 VBoxPython3_5m_TEMPLATE = XPCOM 374 VBoxPython3_5m_INCS = $(VBOX_PYTHON35M_INC) 375 VBoxPython3_5m_LIBS = $(VBOX_PYTHON35M_LIB) 376 377 ifdef VBOX_WITH_32_ON_64_MAIN_API 378 ifdef VBOX_PYTHON35M_LIB_X86 379 DLLS += VBoxPython3_5m_x86 380 VBoxPython3_5m_x86_EXTENDS = VBoxPythonBase_x86 381 VBoxPython3_5m_x86_EXTENDS_BY = appending 382 VBoxPython3_5m_x86_TEMPLATE = XPCOM 383 VBoxPython3_5m_x86_INCS = $(VBOX_PYTHON35M_INC) 384 VBoxPython3_5m_x86_LIBS = $(VBOX_PYTHON35M_LIB_X86) 385 endif 280 386 endif 281 387 endif … … 296 402 297 403 ifdef VBOX_WITH_32_ON_64_MAIN_API 404 ifdef VBOX_PYTHONDEF_LIB_X86 298 405 VBoxPython_x86_EXTENDS = VBoxPythonBase_x86 299 406 VBoxPython_x86_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_x86_DEFS)) … … 304 411 VBoxPython_x86_LIBS = $(VBoxPythonBase_x86_LIBS) $(VBOX_PYTHONDEF_LIB_X86) 305 412 endif 413 endif 306 414 endif 307 415 endif -
trunk/src/libs/xpcom18a4/python/gen_python_deps.py
r59836 r63775 16 16 from distutils.version import StrictVersion 17 17 18 versions = ["2.6", "2.7", "3.1", "3.2", "3. 3", "3.4", "3.5"]18 versions = ["2.6", "2.7", "3.1", "3.2", "3.2m", "3.3", "3.3m", "3.4", "3.4m", "3.5", "3.5m"] 19 19 prefixes = ["/usr", "/usr/local", "/opt", "/opt/local"] 20 20 known = {} 21 21 22 def checkPair(p, v,dllpre,dllsuff, bitness_magic): 23 file = os.path.join(p, "include", "python"+v, "Python.h") 24 if not os.path.isfile(file): 22 def checkPair(p, v, dllpre, dllsuff, bitness_magic): 23 incdir = os.path.join(p, "include", "python"+v) 24 incfile = os.path.join(incdir, "Python.h") 25 if not os.path.isfile(incfile): 25 26 return None 26 27 … … 28 29 if not os.path.isfile(lib): 29 30 lib = os.path.join(p, "lib", dllpre+"python"+v+dllsuff) 31 if not os.path.isfile(lib): 32 lib = None 30 33 31 34 if bitness_magic == 1: 32 35 lib64 = os.path.join(p, "lib", "64", dllpre+"python"+v+dllsuff) 36 if not os.path.isfile(lib64): 37 lib64 = None 33 38 elif bitness_magic == 2: 34 39 lib64 = os.path.join(p, "lib/x86_64-linux-gnu", dllpre+"python"+v+dllsuff) … … 36 41 lib64 = os.path.join(p, "lib64", dllpre+"python"+v+dllsuff) 37 42 if not os.path.isfile(lib64): 38 lib64 = lib43 lib64 = os.path.join(p, "lib", dllpre+"python"+v+dllsuff) 39 44 if not os.path.isfile(lib64): 40 return None 41 45 lib64 = None 42 46 else: 43 47 lib64 = None 44 return [os.path.join(p, "include", "python"+v), lib, lib64] 48 49 if lib is None and lib64 is None: 50 return None 51 else: 52 return [incdir, lib, lib64] 45 53 46 54 def print_vars(vers, known, sep, bitness_magic): 47 55 print("VBOX_PYTHON%s_INC=%s%s" %(vers, known[0], sep)) 48 56 if bitness_magic > 0: 49 print("VBOX_PYTHON%s_LIB=%s%s" %(vers, known[2], sep)) 50 print("VBOX_PYTHON%s_LIB_X86=%s%s" %(vers, known[1], sep)) 57 if known[2]: 58 print("VBOX_PYTHON%s_LIB=%s%s" %(vers, known[2], sep)) 59 if known[1]: 60 print("VBOX_PYTHON%s_LIB_X86=%s%s" %(vers, known[1], sep)) 51 61 else: 52 62 print("VBOX_PYTHON%s_LIB=%s%s" %(vers, known[1], sep)) … … 95 105 96 106 for v in versions: 97 if StrictVersion(v) < StrictVersion('2.6'): 107 if v.endswith("m"): 108 realversion = v[:-1] 109 else: 110 realversion = v 111 if StrictVersion(realversion) < StrictVersion('2.6'): 98 112 continue 99 113 for p in prefixes: … … 111 125 if d is None: 112 126 d = k 113 vers = k.replace('.', '') 127 vers = k.replace('.', '').upper() 114 128 print_vars(vers, known[k], sep, bitness_magic) 115 129 if d is not None: -
trunk/src/libs/xpcom18a4/python/vboxxpcom.py
r60492 r63775 34 34 'VBoxPython' + str(sys.version_info[0]), 35 35 'VBoxPython' 36 ]; 36 ] 37 38 # For Python 3.2 and later use the right ABI flag suffix for the module. 39 if sys.hexversion >= 0x030200f0 and sys.abiflags: 40 _asNew = [] 41 for sCandidate in _asVBoxPythons: 42 if isdigit(sCandidate[-1:]): 43 _asNew.append(sCandidate + sys.abiflags) 44 else: 45 _asNew.append(sCandidate) 46 _asVBoxPythons = _asNew 47 del _asNew 37 48 38 49 # On platforms where we ship both 32-bit and 64-bit API bindings, we have to 39 50 # look for the right set if we're a 32-bit process. 40 51 if platform.system() in [ 'SunOS', ] and sys.maxsize <= 2**32: 41 _asNew = [ sCandidate + '_x86' for sCandidate in _asVBoxPythons ] ;42 _asNew.extend(_asVBoxPythons) ;43 _asVBoxPythons = _asNew ;44 del _asNew ;52 _asNew = [ sCandidate + '_x86' for sCandidate in _asVBoxPythons ] 53 _asNew.extend(_asVBoxPythons) 54 _asVBoxPythons = _asNew 55 del _asNew 45 56 46 57 # On Darwin (aka Mac OS X) we know exactly where things are in a normal … … 65 76 66 77 if _oVBoxPythonMod == None: 67 raise Exception('Cannot find VBoxPython module (tried: %s)' % (', '.join(_asVBoxPythons),)) ;78 raise Exception('Cannot find VBoxPython module (tried: %s)' % (', '.join(_asVBoxPythons),)) 68 79 69 sys.modules['xpcom._xpcom'] = _oVBoxPythonMod ;70 xpcom._xpcom = _oVBoxPythonMod ;80 sys.modules['xpcom._xpcom'] = _oVBoxPythonMod 81 xpcom._xpcom = _oVBoxPythonMod 71 82
Note:
See TracChangeset
for help on using the changeset viewer.