@@ -33,7 +33,7 @@ export trailer_m4=${TOOLS_PATH}/host/share/autoconf/autoconf/trailer.m4
33
33
34
34
# The share/autoconf/autom4te.cfg file also hard-codes some paths. Rewrite
35
35
# those to the real tools path.
36
- if [ " ${PYBUILD_PLATFORM} " = " macos" ]; then
36
+ if [[ " ${PYBUILD_PLATFORM} " = macos* ] ]; then
37
37
sed_args=(-i ' ' -e)
38
38
else
39
39
sed_args=(-i)
@@ -59,7 +59,7 @@ cat Makefile.extra
59
59
pushd Python-${PYTHON_VERSION}
60
60
61
61
# configure doesn't support cross-compiling on Apple. Teach it.
62
- if [ " ${PYBUILD_PLATFORM} " = " macos" ]; then
62
+ if [[ " ${PYBUILD_PLATFORM} " = macos* ] ]; then
63
63
if [ -n " ${PYTHON_MEETS_MINIMUM_VERSION_3_13} " ]; then
64
64
patch -p1 -i ${ROOT} /patch-apple-cross-3.13.patch
65
65
elif [ " ${PYTHON_MAJMIN_VERSION} " = " 3.12" ]; then
159
159
# linked modules. But those libraries should only get linked into libpython, not the
160
160
# executable. This behavior is kinda suspect on all platforms, as it could be adding
161
161
# library dependencies that shouldn't need to be there.
162
- if [ " ${PYBUILD_PLATFORM} " = " macos" ]; then
162
+ if [[ " ${PYBUILD_PLATFORM} " = macos* ] ]; then
163
163
if [ " ${PYTHON_MAJMIN_VERSION} " = " 3.9" ]; then
164
164
patch -p1 -i ${ROOT} /patch-python-link-modules-3.9.patch
165
165
elif [ " ${PYTHON_MAJMIN_VERSION} " = " 3.10" ]; then
214
214
# macOS. On older versions, we need to hack up readline.c to build against
215
215
# libedit. This patch breaks older libedit (as seen on macOS) so don't apply
216
216
# 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
218
218
# readline.c assumes that a modern readline API version has a free_history_entry().
219
219
# but libedit does not. Change the #ifdef accordingly.
220
220
#
@@ -317,13 +317,13 @@ CFLAGS=${CFLAGS//-fvisibility=hidden/}
317
317
318
318
# But some symbols from some dependency libraries are still non-hidden for some
319
319
# reason. We force the linker to do our bidding.
320
- if [ " ${PYBUILD_PLATFORM} " != " macos" ]; then
320
+ if [[ " ${PYBUILD_PLATFORM} " != macos* ] ]; then
321
321
LDFLAGS=" ${LDFLAGS} -Wl,--exclude-libs,ALL"
322
322
fi
323
323
324
324
EXTRA_CONFIGURE_FLAGS=
325
325
326
- if [ " ${PYBUILD_PLATFORM} " = " macos" ]; then
326
+ if [[ " ${PYBUILD_PLATFORM} " = macos* ] ]; then
327
327
CFLAGS=" ${CFLAGS} -I${TOOLS_PATH} /deps/include/uuid"
328
328
329
329
# Prevent using symbols not supported by current macOS SDK target.
332
332
333
333
# Always build against libedit instead of the default of readline.
334
334
# macOS always uses the system libedit, so no tweaks are needed.
335
- if [ " ${PYBUILD_PLATFORM} " != " macos" ]; then
335
+ if [[ " ${PYBUILD_PLATFORM} " != macos* ] ]; then
336
336
# CPython 3.10 introduced proper configure support for libedit, so add configure
337
337
# flag there.
338
338
if [ -n " ${PYTHON_MEETS_MINIMUM_VERSION_3_10} " ]; then
@@ -381,7 +381,7 @@ CONFIGURE_FLAGS="
381
381
# this patch mildly conflicts with the macos-only patch-python-link-modules
382
382
# applied above, so you will need to resolve that conflict if you re-enable
383
383
# this for macos.
384
- if [ " ${PYBUILD_PLATFORM} " != " macos" ]; then
384
+ if [[ " ${PYBUILD_PLATFORM} " != macos* ] ]; then
385
385
if [ -n " ${PYTHON_MEETS_MINIMUM_VERSION_3_12} " ]; then
386
386
patch -p1 -i " ${ROOT} /patch-python-configure-add-enable-static-libpython-for-interpreter.patch"
387
387
else
@@ -493,7 +493,7 @@ if [ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_11}" ]; then
493
493
CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} --with-build-python=${TOOLS_PATH} /host/bin/python${PYTHON_MAJMIN_VERSION} "
494
494
fi
495
495
496
- if [ " ${PYBUILD_PLATFORM} " = " macos" ]; then
496
+ if [[ " ${PYBUILD_PLATFORM} " = macos* ] ]; then
497
497
# Configure may detect libintl from non-system sources, such
498
498
# as Homebrew or MacPorts. So nerf the check to prevent this.
499
499
CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} ac_cv_lib_intl_textdomain=no"
@@ -563,7 +563,7 @@ if [ "${PYBUILD_PLATFORM}" = "macos" ]; then
563
563
fi
564
564
565
565
# 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
567
567
CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} ac_cv_func_ptsname_r=no"
568
568
fi
569
569
575
575
576
576
# On 3.14+ `test_strftime_y2k` fails when cross-compiling for `x86_64_v2` and `x86_64_v3` targets on
577
577
# 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
579
579
export PROFILE_TASK=' -m test --pgo --ignore test_strftime_y2k'
580
580
fi
581
581
582
582
# We use ndbm on macOS and BerkeleyDB elsewhere.
583
- if [ " ${PYBUILD_PLATFORM} " = " macos" ]; then
583
+ if [[ " ${PYBUILD_PLATFORM} " = macos* ] ]; then
584
584
CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} --with-dbmliborder=ndbm"
585
585
else
586
586
CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} --with-dbmliborder=bdb"
@@ -608,7 +608,7 @@ if [ -n "${CROSS_COMPILING}" ]; then
608
608
# python will end up with the time.tzset function or not. All linux targets,
609
609
# however, should have a working tzset function via libc. So we manually
610
610
# indicate this to the configure script.
611
- if [ " ${PYBUILD_PLATFORM} " != " macos" ]; then
611
+ if [[ " ${PYBUILD_PLATFORM} " != macos* ] ]; then
612
612
CONFIGURE_FLAGS=" ${CONFIGURE_FLAGS} ac_cv_working_tzset=yes"
613
613
fi
614
614
660
660
# This ensures we can run the binary in any location without
661
661
# LD_LIBRARY_PATH pointing to the directory containing libpython.
662
662
if [ " ${PYBUILD_SHARED} " = " 1" ]; then
663
- if [ " ${PYBUILD_PLATFORM} " = " macos" ]; then
663
+ if [[ " ${PYBUILD_PLATFORM} " = macos* ] ]; then
664
664
# There's only 1 dylib produced on macOS and it has the binary suffix.
665
665
LIBPYTHON_SHARED_LIBRARY_BASENAME=libpython${PYTHON_MAJMIN_VERSION}${PYTHON_BINARY_SUFFIX} .dylib
666
666
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/
1143
1143
#
1144
1144
# We copy the libclang_rt.<platform>.a library from our clang into the
1145
1145
# distribution so it is available. See documentation in quirks.rst for more.
1146
- if [ " ${PYBUILD_PLATFORM} " = " macos" ]; then
1146
+ if [[ " ${PYBUILD_PLATFORM} " = macos* ] ]; then
1147
1147
cp -av $( dirname $( which clang) ) /../lib/clang/* /lib/darwin/libclang_rt.osx.a ${ROOT} /out/python/build/lib/
1148
1148
fi
1149
1149
@@ -1158,7 +1158,7 @@ if [ -d "${TOOLS_PATH}/deps/lib/tcl8" ]; then
1158
1158
cp -av $source ${ROOT} /out/python/install/lib/
1159
1159
done
1160
1160
1161
- if [ " ${PYBUILD_PLATFORM} " != " macos" ]; then
1161
+ if [[ " ${PYBUILD_PLATFORM} " != macos* ] ]; then
1162
1162
cp -av ${TOOLS_PATH} /deps/lib/Tix8.4.3 ${ROOT} /out/python/install/lib/
1163
1163
fi
1164
1164
fi
0 commit comments