VirtualBox

Changeset 86628 in vbox for trunk/src/libs/xpcom18a4/python


Ignore:
Timestamp:
Oct 19, 2020 12:29:54 PM (4 years ago)
Author:
vboxsync
Message:

xpcom/python: Build a dedicated VBoxPython2.so module, the VBoxPython.so is eliminated by VBOX_WITH_ONLY_PYTHON_LIMITED_API. bugref:9840

Location:
trunk/src/libs/xpcom18a4/python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/python/Makefile.kmk

    r86334 r86628  
    1818SUB_DEPTH = ../../../..
    1919include $(KBUILD_PATH)/subheader.kmk
    20 
    21 ifdef VBOX_WITH_MULTIVERSION_PYTHON
    22  VBOX_MULTIPYTHON = 1
    23 else
    24  VBOX_MULTIPYTHON = 0
    25 endif
    2620
    2721#
     
    8074        $(KBUILD_TARGET) \
    8175        $(KBUILD_TARGET_ARCH) \
    82         $(VBOX_MULTIPYTHON) )))
     76        $(if-expr defined(VBOX_WITH_MULTIVERSION_PYTHON),1,0))))
    8377endif
    8478
     
    209203endif
    210204
     205#
     206# Unversioned Python 2.x.
     207#
     208 if defined(VBOX_PYTHON27_INC) || defined(VBOX_PYTHON_26_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_PYTHON_26_INC)
     219VBoxPython2_INCS       = $(VBOX_PYTHON26_INC)
     220VBoxPython2_LIBS       = $(VBOX_PYTHON26_LIB)
     221  else
     222VBoxPython2_INCS       = $(VBOX_PYTHON27_INC)
     223VBoxPython2_LIBS       = $(VBOX_PYTHON27_LIB)
     224  endif
     225 endif
     226
     227 if defined(VBOX_WITH_32_ON_64_MAIN_API) && (defined(VBOX_PYTHON27_LIB_X86) || defined(VBOX_PYTHON_26_INC_X86))
     228DLLS += VBoxPython2_x86
     229VBoxPython2_x86_EXTENDS    = VBoxPythonBase_x86
     230VBoxPython2_x86_EXTENDS_BY = appending
     231VBoxPython2_x86_DEFS       = VBOX_PYXPCOM_MAJOR_VERSIONED $(VBoxPythonBase_x86_DEFS)
     232  ifdef KMK_WITH_VERSION_COMPARE
     233VBoxPython2_x86_TEMPLATE   = XPCOM$(if-expr "$(KBUILD_TARGET)" == "darwin" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" vle "10.7",OSX107,-x86)
     234  else
     235VBoxPython2_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)
     236  endif
     237  if defined(VBOX_PYTHON27_LIB_X86)
     238VBoxPython2_x86_INCS       = $(VBOX_PYTHON26_INC)
     239VBoxPython2_x86_LIBS       = $(VBOX_PYTHON26_LIB_X86)
     240  else
     241VBoxPython2_x86_INCS       = $(VBOX_PYTHON27_INC)
     242VBoxPython2_x86_LIBS       = $(VBOX_PYTHON27_LIB_X86)
     243  endif
     244 endif
     245
     246
    211247ifdef VBOX_PYTHON31_INC
    212248#
  • trunk/src/libs/xpcom18a4/python/src/module/_xpcom.cpp

    r86333 r86628  
    8484#  define MANGLE_MODULE_INIT(a_Name)    RT_CONCAT(a_Name, MODULE_NAME_SUFFIX)
    8585# endif
    86 # ifdef VBOX_PYXPCOM_VERSIONED
     86# if defined(VBOX_PYXPCOM_VERSIONED) && !defined(VBOX_PYXPCOM_MAJOR_VERSIONED)
    8787#  if   PY_VERSION_HEX >= 0x03080000 && PY_VERSION_HEX < 0x03090000
    8888#   define MODULE_NAME    MANGLE_MODULE_NAME("VBoxPython3_8")
     
    132132#  endif
    133133# else
    134 #  if PY_MAJOR_VERSION <= 2
     134#  if PY_MAJOR_VERSION <= 2 && defined(VBOX_PYXPCOM_MAJOR_VERSIONED)
     135#   define MODULE_NAME    MANGLE_MODULE_NAME("VBoxPython2")
     136#   define initVBoxPython MANGLE_MODULE_INIT(initVBoxPython2)
     137#  elif PY_MAJOR_VERSION <= 2
    135138#   define MODULE_NAME    MANGLE_MODULE_NAME("VBoxPython")
    136139#   define initVBoxPython MANGLE_MODULE_INIT(initVBoxPython)
    137 #  elif defined(Py_LIMITED_API)
     140#  elif defined(Py_LIMITED_API) || defined(VBOX_PYXPCOM_MAJOR_VERSIONED)
    138141#   define MODULE_NAME    MANGLE_MODULE_NAME("VBoxPython3")
    139142#   define initVBoxPython MANGLE_MODULE_INIT(PyInit_VBoxPython3)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette