From cd47c2446f1a9dee96610f298989848f8986a8be Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 00:55:52 +0200 Subject: Merging upstream version 7.0.16-dfsg. Signed-off-by: Daniel Baumann --- src/libs/xpcom18a4/python/Makefile.kmk | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'src/libs/xpcom18a4/python/Makefile.kmk') diff --git a/src/libs/xpcom18a4/python/Makefile.kmk b/src/libs/xpcom18a4/python/Makefile.kmk index 49653847..6495299e 100644 --- a/src/libs/xpcom18a4/python/Makefile.kmk +++ b/src/libs/xpcom18a4/python/Makefile.kmk @@ -75,7 +75,24 @@ ifeq ($(KBUILD_TARGET),darwin) # Relatively predictable, don't script. VBOX_PYTHON27_LIB = endif endif - # No Python 3.x yet as part of OSX versions including El Capitan, 10.11. + # + # Apple introduced python3 as part of the developer command tools starting with at least 10.15 (didn't go back further as it is not of interest to us). + # However the headers and libraries are now residing under /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions with 3.8 and 3.9 + # being present on Monterey. + # For now we will only provide the module for 3.8 and the version agnostic variant using the limited API. + # + if exists "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9" + VBOX_PYTHON39_INC = /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/Headers + VBOX_PYTHON39_LIB = /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/libpython3.9.dylib + endif + if exists "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8" + VBOX_PYTHON38_INC = /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/Headers + VBOX_PYTHON38_LIB = /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/libpython3.8.dylib + endif + if exists "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7" + VBOX_PYTHON37_INC = /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/Headers + VBOX_PYTHON37_LIB = /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/libpython3.8.dylib + endif else # Use the script. @@ -686,18 +703,21 @@ ifndef VBOX_ONLY_SDK # TODO: ASSUMING that we don't need a different headers for pymalloc # ('m' builds < 3.8) and CRT malloc. # - VBOX_PYTHON_LIMITED_API_VER := $(firstword $(foreach ver, 35 36 38 39 310 311 312 34 33 \ + VBOX_PYTHON_LIMITED_API_VER := $(firstword $(foreach ver, 35 36 37 38 39 310 311 312 34 33 \ ,$(if-expr defined(VBOX_PYTHON$(ver)_INC),$(ver),)$(if-expr defined(VBOX_PYTHON$(ver)M_INC),$(ver)M,))) ifneq ($(VBOX_PYTHON_LIMITED_API_VER),) DLLS += VBoxPython3 VBoxPython3_EXTENDS = VBoxPythonBase VBoxPython3_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_DEFS)) Py_LIMITED_API=0x03030000 VBoxPython3_INCS = $(VBoxPythonBase_INCS) $(VBOX_PYTHON$(VBOX_PYTHON_LIMITED_API_VER)_INC) + VBoxPython3_LDFLAGS.darwin = -undefined dynamic_lookup - DLLS += VBoxPython3m - VBoxPython3m_EXTENDS = VBoxPythonBase_m - VBoxPython3m_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_m_DEFS)) Py_LIMITED_API=0x03030000 - VBoxPython3m_INCS = $(VBoxPythonBase_m_INCS) $(VBOX_PYTHON$(VBOX_PYTHON_LIMITED_API_VER)_INC) + ifneq ($(KBUILD_TARGET),darwin) + DLLS += VBoxPython3m + VBoxPython3m_EXTENDS = VBoxPythonBase_m + VBoxPython3m_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_m_DEFS)) Py_LIMITED_API=0x03030000 + VBoxPython3m_INCS = $(VBoxPythonBase_m_INCS) $(VBOX_PYTHON$(VBOX_PYTHON_LIMITED_API_VER)_INC) + endif endif endif # VBOX_WITH_PYTHON_LIMITED_API -- cgit v1.2.3