@@ -33,7 +33,7 @@ export trailer_m4=${TOOLS_PATH}/host/share/autoconf/autoconf/trailer.m4
3333
3434# The share/autoconf/autom4te.cfg file also hard-codes some paths. Rewrite
3535# those to the real tools path.
36- if [ " ${PYBUILD_PLATFORM} " = " macos" ]; then
36+ if [[ " ${PYBUILD_PLATFORM} " = macos* ] ]; then
3737 sed_args=(-i ' ' -e)
3838else
3939 sed_args=(-i)
@@ -59,7 +59,7 @@ cat Makefile.extra
5959pushd Python-${PYTHON_VERSION}
6060
6161# configure doesn't support cross-compiling on Apple. Teach it.
62- if [ " ${PYBUILD_PLATFORM} " = " macos" ]; then
62+ if [[ " ${PYBUILD_PLATFORM} " = macos* ] ]; then
6363 if [ -n " ${PYTHON_MEETS_MINIMUM_VERSION_3_13} " ]; then
6464 patch -p1 -i ${ROOT} /patch-apple-cross-3.13.patch
6565 elif [ " ${PYTHON_MAJMIN_VERSION} " = " 3.12" ]; then
159159# linked modules. But those libraries should only get linked into libpython, not the
160160# executable. This behavior is kinda suspect on all platforms, as it could be adding
161161# library dependencies that shouldn't need to be there.
162- if [ " ${PYBUILD_PLATFORM} " = " macos" ]; then
162+ if [[ " ${PYBUILD_PLATFORM} " = macos* ] ]; then
163163 if [ " ${PYTHON_MAJMIN_VERSION} " = " 3.9" ]; then
164164 patch -p1 -i ${ROOT} /patch-python-link-modules-3.9.patch
165165 elif [ " ${PYTHON_MAJMIN_VERSION} " = " 3.10" ]; then
214214# macOS. On older versions, we need to hack up readline.c to build against
215215# libedit. This patch breaks older libedit (as seen on macOS) so don't apply
216216# on macOS.
217- if [[ -n " ${PYTHON_MEETS_MAXIMUM_VERSION_3_9} " && " ${PYBUILD_PLATFORM} " != " macos" ]]; then
217+ if [[ -n " ${PYTHON_MEETS_MAXIMUM_VERSION_3_9} " && " ${PYBUILD_PLATFORM} " != macos* ]]; then
218218 # readline.c assumes that a modern readline API version has a free_history_entry().
219219 # but libedit does not. Change the #ifdef accordingly.
220220 #
@@ -317,13 +317,13 @@ CFLAGS=${CFLAGS//-fvisibility=hidden/}
317317
318318# But some symbols from some dependency libraries are still non-hidden for some
319319# reason. We force the linker to do our bidding.
320- if [ " ${PYBUILD_PLATFORM} " != " macos" ]; then
320+ if [[ " ${PYBUILD_PLATFORM} " != macos* ] ]; then
321321 LDFLAGS=" ${LDFLAGS} -Wl,--exclude-libs,ALL"
322322fi
323323
324324EXTRA_CONFIGURE_FLAGS=
325325
326- if [ " ${PYBUILD_PLATFORM} " = " macos" ]; then
326+ if [[ " ${PYBUILD_PLATFORM} " = macos* ] ]; then
327327 CFLAGS=" ${CFLAGS} -I${TOOLS_PATH} /deps/include/uuid"
328328
329329 # Prevent using symbols not supported by current macOS SDK target.
332332
333333# Always build against libedit instead of the default of readline.
334334# macOS always uses the system libedit, so no tweaks are needed.
335- if [ " ${PYBUILD_PLATFORM} " != " macos" ]; then
335+ if [[ " ${PYBUILD_PLATFORM} " != macos* ] ]; then
336336 # CPython 3.10 introduced proper configure support for libedit, so add configure
337337 # flag there.
338338 if [ -n " ${PYTHON_MEETS_MINIMUM_VERSION_3_10} " ]; then
@@ -381,7 +381,7 @@ CONFIGURE_FLAGS="
381381# this patch mildly conflicts with the macos-only patch-python-link-modules
382382# applied above, so you will need to resolve that conflict if you re-enable
383383# this for macos.
384- if [ " ${PYBUILD_PLATFORM} " != " macos" ]; then
384+ if [[ " ${PYBUILD_PLATFORM} " != macos* ] ]; then
385385 if [ -n " ${PYTHON_MEETS_MINIMUM_VERSION_3_12} " ]; then
386386 patch -p1 -i " ${ROOT} /patch-python-configure-add-enable-static-libpython-for-interpreter.patch"
387387 else
@@ -493,7 +493,7 @@ if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_11}" ]; then
493493 CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} --with-build-python=${TOOLS_PATH} /host/bin/python${PYTHON_MAJMIN_VERSION} "
494494fi
495495
496- if [ " ${PYBUILD_PLATFORM} " = " macos" ]; then
496+ if [[ " ${PYBUILD_PLATFORM} " = macos* ] ]; then
497497 # Configure may detect libintl from non-system sources, such
498498 # as Homebrew or MacPorts. So nerf the check to prevent this.
499499 CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} ac_cv_lib_intl_textdomain=no"
@@ -563,7 +563,7 @@ if [ "${PYBUILD_PLATFORM}" = "macos" ]; then
563563fi
564564
565565# ptsrname_r is only available in SDK 13.4+, but we target a lower version for compatibility.
566- if [ " ${PYBUILD_PLATFORM} " = " macos" ]; then
566+ if [[ " ${PYBUILD_PLATFORM} " = macos* ] ]; then
567567 CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} ac_cv_func_ptsname_r=no"
568568fi
569569
575575
576576# On 3.14+ `test_strftime_y2k` fails when cross-compiling for `x86_64_v2` and `x86_64_v3` targets on
577577# Linux, so we ignore it. See https://github.com/python/cpython/issues/128104
578- if [[ -n " ${PYTHON_MEETS_MINIMUM_VERSION_3_14} " && -n " ${CROSS_COMPILING} " && " ${PYBUILD_PLATFORM} " != " macos" ]]; then
578+ if [[ -n " ${PYTHON_MEETS_MINIMUM_VERSION_3_14} " && -n " ${CROSS_COMPILING} " && " ${PYBUILD_PLATFORM} " != macos* ]]; then
579579 export PROFILE_TASK=' -m test --pgo --ignore test_strftime_y2k'
580580fi
581581
582582# We use ndbm on macOS and BerkeleyDB elsewhere.
583- if [ " ${PYBUILD_PLATFORM} " = " macos" ]; then
583+ if [[ " ${PYBUILD_PLATFORM} " = macos* ] ]; then
584584 CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} --with-dbmliborder=ndbm"
585585else
586586 CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} --with-dbmliborder=bdb"
@@ -608,7 +608,7 @@ if [ -n "${CROSS_COMPILING}" ]; then
608608 # python will end up with the time.tzset function or not. All linux targets,
609609 # however, should have a working tzset function via libc. So we manually
610610 # indicate this to the configure script.
611- if [ " ${PYBUILD_PLATFORM} " != " macos" ]; then
611+ if [[ " ${PYBUILD_PLATFORM} " != macos* ] ]; then
612612 CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} ac_cv_working_tzset=yes"
613613 fi
614614
660660# This ensures we can run the binary in any location without
661661# LD_LIBRARY_PATH pointing to the directory containing libpython.
662662if [ " ${PYBUILD_SHARED} " = " 1" ]; then
663- if [ " ${PYBUILD_PLATFORM} " = " macos" ]; then
663+ if [[ " ${PYBUILD_PLATFORM} " = macos* ] ]; then
664664 # There's only 1 dylib produced on macOS and it has the binary suffix.
665665 LIBPYTHON_SHARED_LIBRARY_BASENAME=libpython${PYTHON_MAJMIN_VERSION}${PYTHON_BINARY_SUFFIX} .dylib
666666 LIBPYTHON_SHARED_LIBRARY=${ROOT} /out/python/install/lib/${LIBPYTHON_SHARED_LIBRARY_BASENAME}
@@ -1143,7 +1143,7 @@ cp -av ${TOOLS_PATH}/deps/lib/*.a ${ROOT}/out/python/build/lib/
11431143#
11441144# We copy the libclang_rt.<platform>.a library from our clang into the
11451145# distribution so it is available. See documentation in quirks.rst for more.
1146- if [ " ${PYBUILD_PLATFORM} " = " macos" ]; then
1146+ if [[ " ${PYBUILD_PLATFORM} " = macos* ] ]; then
11471147 cp -av $( dirname $( which clang) ) /../lib/clang/* /lib/darwin/libclang_rt.osx.a ${ROOT} /out/python/build/lib/
11481148fi
11491149
@@ -1158,7 +1158,7 @@ if [ -d "${TOOLS_PATH}/deps/lib/tcl8" ]; then
11581158 cp -av $source ${ROOT} /out/python/install/lib/
11591159 done
11601160
1161- if [ " ${PYBUILD_PLATFORM} " != " macos" ]; then
1161+ if [[ " ${PYBUILD_PLATFORM} " != macos* ] ]; then
11621162 cp -av ${TOOLS_PATH} /deps/lib/Tix8.4.3 ${ROOT} /out/python/install/lib/
11631163 fi
11641164fi
0 commit comments