@@ -34,35 +34,45 @@ OPENSSL_VERSION=3.0.16-2
3434XZ_VERSION =5.6.4-2
3535
3636# Supported OS
37- OS_LIST =macOS iOS tvOS watchOS visionOS
37+ OS_LIST =macOS iOS tvOS watchOS visionOS MacCatalyst
3838
3939CURL_FLAGS =--disable --fail --location --create-dirs --progress-bar
4040
4141# macOS targets
4242TARGETS-macOS =macosx.x86_64 macosx.arm64
4343TRIPLE_OS-macOS =macos
4444VERSION_MIN-macOS =11.0
45+ CONFIGFLAGS-macOS =
4546
4647# iOS targets
47- TARGETS-iOS =iphonesimulator.x86_64 iphonesimulator.arm64 iphoneos.arm64 macabi.x86_64 macabi.arm64
48+ TARGETS-iOS =iphonesimulator.x86_64 iphonesimulator.arm64 iphoneos.arm64
4849TRIPLE_OS-iOS =ios
4950VERSION_MIN-iOS =13.0
50- VERSION_MIN_OVERRIDE-macabi =14.2
51- CONFIGFLAGS-macabi=--with-catalyst-macos-version =11.2
51+ CONFIGFLAGS-iOS =
5252
5353# tvOS targets
5454TARGETS-tvOS =appletvsimulator.x86_64 appletvsimulator.arm64 appletvos.arm64
5555TRIPLE_OS-tvOS =tvos
5656VERSION_MIN-tvOS =12.0
57+ CONFIGFLAGS-tvOS =
5758
5859# watchOS targets
5960TARGETS-watchOS =watchsimulator.x86_64 watchsimulator.arm64 watchos.arm64_32
6061TRIPLE_OS-watchOS =watchos
6162VERSION_MIN-watchOS =4.0
63+ CONFIGFLAGS-watchOS =
6264
65+ # visionOS targets
6366TARGETS-visionOS =xrsimulator.arm64 xros.arm64
6467TRIPLE_OS-visionOS =xros
6568VERSION_MIN-visionOS =2.0
69+ CONFIGFLAGS-visionOS =
70+
71+ # Mac Catalyst Targets
72+ TARGETS-MacCatalyst =macabi.x86_64 macabi.arm64
73+ TRIPLE_OS-MacCatalyst =ios
74+ VERSION_MIN-MacCatalyst =14.2
75+ CONFIGFLAGS-MacCatalyst=--with-catalyst-macos-version =11.2
6676
6777# The architecture of the machine doing the build
6878HOST_ARCH =$(shell uname -m)
@@ -138,30 +148,17 @@ BASE-$(target)=$$(basename $(target))
138148SDK-$(target ) =$$(subst macabi,macosx,$$(BASE-$(target ) ) )
139149ARCH-$(target ) =$$(subst .,,$$(suffix $(target ) ) )
140150
141- # Compute version minimum for the target
142- VERSION_MIN-$(target ) =$$(VERSION_MIN-$(os ) )
143- ifdef VERSION_MIN_OVERRIDE-$$(BASE-$(target))
144- VERSION_MIN-$(target) =$$(VERSION_MIN_OVERRIDE-$$(BASE-$(target ) ) )
145- endif
146-
147- # Inherit the basename for the configure flags.
148- ifdef CONFIGFLAGS-$$(BASE-$(target))
149- CONFIGFLAGS-$(target) =$$(CONFIGFLAGS-$$(BASE-$(target ) ) )
150- else
151- CONFIGFLAGS-$(target) =
152- endif
153-
154151ifneq ($(os ) ,macOS)
155152 ifeq ($$(findstring simulator,$$(BASE-$(target))),)
156153 ifeq ($$(findstring macabi,$$(BASE-$(target))),)
157- TARGET_TRIPLE-$(target) =$$(ARCH-$(target ) ) -apple-$$(TRIPLE_OS-$(os ) )$$(VERSION_MIN-$(target ) )
154+ TARGET_TRIPLE-$(target) =$$(ARCH-$(target ) ) -apple-$$(TRIPLE_OS-$(os ) )$$(VERSION_MIN-$(os ) )
158155IS_SIMULATOR-$(target) =False
159156 else
160- TARGET_TRIPLE-$(target) =$$(ARCH-$(target ) ) -apple-$$(TRIPLE_OS-$(os ) )$$(VERSION_MIN-$(target ) ) -macabi
157+ TARGET_TRIPLE-$(target) =$$(ARCH-$(target ) ) -apple-$$(TRIPLE_OS-$(os ) )$$(VERSION_MIN-$(os ) ) -macabi
161158IS_SIMULATOR-$(target) =False
162159 endif
163160 else
164- TARGET_TRIPLE-$(target) =$$(ARCH-$(target ) ) -apple-$$(TRIPLE_OS-$(os ) )$$(VERSION_MIN-$(target ) ) -simulator
161+ TARGET_TRIPLE-$(target) =$$(ARCH-$(target ) ) -apple-$$(TRIPLE_OS-$(os ) )$$(VERSION_MIN-$(os ) ) -simulator
165162IS_SIMULATOR-$(target) =True
166163 endif
167164endif
@@ -347,7 +344,7 @@ $$(PYTHON_SRCDIR-$(target))/Makefile: \
347344 --with-openssl=" $$ (OPENSSL_INSTALL-$( target) )" \
348345 --enable-framework=" $$ (PYTHON_INSTALL-$( target) )" \
349346 --with-system-libmpdec \
350- $$(CONFIGFLAGS-$(target ) ) \
347+ $$(CONFIGFLAGS-$(os ) ) \
351348 2>&1 | tee -a ../python-$(PYTHON_VERSION ) .config.log
352349
353350$$(PYTHON_SRCDIR-$(target ) ) /python.exe : $$(PYTHON_SRCDIR-$(target ) ) /Makefile
@@ -386,7 +383,7 @@ $$(PYTHON_PLATFORM_SITECUSTOMIZE-$(target)):
386383 | sed -e " s/{{platform}}/$$ (OS_LOWER-$( target) )/g" \
387384 | sed -e " s/{{arch}}/$$ (ARCH-$( target) )/g" \
388385 | sed -e " s/{{sdk}}/$$ (SDK-$( target) )/g" \
389- | sed -e " s/{{version_min}}/$$ (VERSION_MIN-$( target ) )/g" \
386+ | sed -e " s/{{version_min}}/$$ (VERSION_MIN-$( os ) )/g" \
390387 | sed -e " s/{{is_simulator}}/$$ (IS_SIMULATOR-$( target) )/g" \
391388 > $$(PYTHON_PLATFORM_CONFIG-$(target ) ) /_cross_$$(ARCH-$(target ) ) _$$(SDK-$(target ) ) .py
392389 cat $(PROJECT_DIR ) /patch/Python/sitecustomize.py.tmpl \
@@ -407,8 +404,6 @@ vars-$(target):
407404 @echo "BASE-$(target ) : $$(BASE-$(target ) ) "
408405 @echo "SDK-$(target ) : $$(SDK-$(target ) ) "
409406 @echo "ARCH-$(target ) : $$(ARCH-$(target ) ) "
410- @echo "CONFIGFLAGS-$(target ) : $$(CONFIGFLAGS-$(target ) ) "
411- @echo "VERSION_MIN-$(target ) : $$(VERSION_MIN-$(target ) ) "
412407 @echo "TARGET_TRIPLE-$(target ) : $$(TARGET_TRIPLE-$(target ) ) "
413408 @echo "SDK_ROOT-$(target ) : $$(SDK_ROOT-$(target ) ) "
414409 @echo "BZIP2_INSTALL-$(target ) : $$(BZIP2_INSTALL-$(target ) ) "
0 commit comments