7272# configure doesn't support cross-compiling on LoongArch. Teach it.
7373if [ " ${PYBUILD_PLATFORM} " != " macos" ]; then
7474 case " ${PYTHON_MAJMIN_VERSION} " in
75- 3.9|3. 10|3.11)
75+ 3.10|3.11)
7676 patch -p1 -i ${ROOT} /patch-configure-add-loongarch-triplet.patch
7777 ;;
7878 esac
@@ -85,12 +85,7 @@ if [ -n "${CROSS_COMPILING}" ]; then
8585 fi
8686fi
8787
88- # This patch is slightly different on Python 3.10+.
89- if [ -n " ${PYTHON_MEETS_MINIMUM_VERSION_3_10} " ]; then
90- patch -p1 -i ${ROOT} /patch-xopen-source-ios.patch
91- else
92- patch -p1 -i ${ROOT} /patch-xopen-source-ios-legacy.patch
93- fi
88+ patch -p1 -i ${ROOT} /patch-xopen-source-ios.patch
9489
9590# LIBTOOL_CRUFT is unused and breaks cross-compiling on macOS. Nuke it.
9691# Submitted upstream at https://github.com/python/cpython/pull/101048.
175170# executable. This behavior is kinda suspect on all platforms, as it could be adding
176171# library dependencies that shouldn't need to be there.
177172if [[ " ${PYBUILD_PLATFORM} " = macos* ]]; then
178- if [ " ${PYTHON_MAJMIN_VERSION} " = " 3.9" ]; then
179- patch -p1 -i ${ROOT} /patch-python-link-modules-3.9.patch
180- elif [ " ${PYTHON_MAJMIN_VERSION} " = " 3.10" ]; then
173+ if [ " ${PYTHON_MAJMIN_VERSION} " = " 3.10" ]; then
181174 patch -p1 -i ${ROOT} /patch-python-link-modules-3.10.patch
182175 else
183176 patch -p1 -i ${ROOT} /patch-python-link-modules-3.11.patch
@@ -205,43 +198,19 @@ elif [ "${PYTHON_MAJMIN_VERSION}" = "3.11" ]; then
205198 patch -p1 -i ${ROOT} /patch-tkinter-3.11.patch
206199elif [ " ${PYTHON_MAJMIN_VERSION} " = " 3.10" ]; then
207200 patch -p1 -i ${ROOT} /patch-tkinter-3.10.patch
208- else
209- patch -p1 -i ${ROOT} /patch-tkinter-3.9.patch
210201fi
211202
212203# Code that runs at ctypes module import time does not work with
213204# non-dynamic binaries. Patch Python to work around this.
214205# See https://bugs.python.org/issue37060.
215206patch -p1 -i ${ROOT} /patch-ctypes-static-binary.patch
216207
217- # Older versions of Python need patching to work with modern mpdecimal.
218- if [ -n " ${PYTHON_MEETS_MAXIMUM_VERSION_3_9} " ]; then
219- patch -p1 -i ${ROOT} /patch-decimal-modern-mpdecimal.patch
220- fi
221-
222208# We build against libedit instead of readline in all environments.
223209#
224210# On macOS, we use the system/SDK libedit, which is likely somewhat old.
225211#
226212# On Linux, we use our own libedit, which should be modern.
227213#
228- # CPython 3.10 added proper support for building against libedit outside of
229- # macOS. On older versions, we need to hack up readline.c to build against
230- # libedit. This patch breaks older libedit (as seen on macOS) so don't apply
231- # on macOS.
232- if [[ -n " ${PYTHON_MEETS_MAXIMUM_VERSION_3_9} " && " ${PYBUILD_PLATFORM} " != macos* ]]; then
233- # readline.c assumes that a modern readline API version has a free_history_entry().
234- # but libedit does not. Change the #ifdef accordingly.
235- #
236- # Similarly, we invoke configure using readline, which sets
237- # HAVE_RL_COMPLETION_SUPPRESS_APPEND improperly. So hack that. This is a bug
238- # in our build system, as we should probably be invoking configure again when
239- # using libedit.
240- #
241- # Similar workaround for on_completion_display_matches_hook.
242- patch -p1 -i ${ROOT} /patch-readline-libedit.patch
243- fi
244-
245214if [ " ${PYTHON_MAJMIN_VERSION} " = " 3.10" ]; then
246215 # Even though 3.10 is libedit aware, it isn't compatible with newer
247216 # versions of libedit. We need to backport a 3.11 patch to teach the
367336# Always build against libedit instead of the default of readline.
368337# macOS always uses the system libedit, so no tweaks are needed.
369338if [[ " ${PYBUILD_PLATFORM} " != macos* ]]; then
370- # CPython 3.10 introduced proper configure support for libedit, so add configure
371- # flag there.
372- if [ -n " ${PYTHON_MEETS_MINIMUM_VERSION_3_10} " ]; then
373- EXTRA_CONFIGURE_FLAGS=" ${EXTRA_CONFIGURE_FLAGS} --with-readline=editline"
374- fi
339+ # Add configure flag for proper configure support for libedit.
340+ EXTRA_CONFIGURE_FLAGS=" ${EXTRA_CONFIGURE_FLAGS} --with-readline=editline"
375341fi
376342
377343# On Python 3.14+, enable the tail calling interpreter which is more performant.
@@ -546,25 +512,6 @@ if [[ "${PYBUILD_PLATFORM}" = macos* ]]; then
546512 # as Homebrew or MacPorts. So nerf the check to prevent this.
547513 CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} ac_cv_lib_intl_textdomain=no"
548514
549- # CPython 3.9+ have proper support for weakly referenced symbols and
550- # runtime availability guards. CPython 3.8 will emit weak symbol references
551- # (this happens automatically when linking due to SDK version targeting).
552- # However CPython lacks the runtime availability guards for most symbols.
553- # This results in runtime failures when attempting to resolve/call the
554- # symbol.
555- if [ -n " ${PYTHON_MEETS_MAXIMUM_VERSION_3_9} " ]; then
556- if [ " ${TARGET_TRIPLE} " != " aarch64-apple-darwin" ]; then
557- for symbol in clock_getres clock_gettime clock_settime faccessat fchmodat fchownat fdopendir fstatat futimens getentropy linkat mkdirat openat preadv pwritev readlinkat renameat symlinkat unlinkat utimensat uttype; do
558- CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} ac_cv_func_${symbol} =no"
559- done
560- fi
561-
562- # mkfifoat, mknodat introduced in SDK 13.0.
563- for symbol in mkfifoat mknodat; do
564- CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} ac_cv_func_${symbol} =no"
565- done
566- fi
567-
568515 if [ -n " ${CROSS_COMPILING} " ]; then
569516 # Python's configure doesn't support cross-compiling on macOS. So we need
570517 # to explicitly set MACHDEP to avoid busted checks. The code for setting
0 commit comments