diff --git a/scripts/build_cosmo.sh b/scripts/build_cosmo.sh index bb622ba6..3019ce65 100755 --- a/scripts/build_cosmo.sh +++ b/scripts/build_cosmo.sh @@ -194,6 +194,7 @@ mkdir python-install cd python-build cmake \ "${cmake_verbose_flags[@]}" \ + "${cmake_python_options[@]}" \ -DCMAKE_C_COMPILER=${CC} \ -DCMAKE_CXX_COMPILER=${CXX} \ -DCMAKE_CXX_FLAGS="${CXXFLAGS}" \ diff --git a/scripts/build_freebsd.sh b/scripts/build_freebsd.sh index d77a8acc..ca949dd2 100755 --- a/scripts/build_freebsd.sh +++ b/scripts/build_freebsd.sh @@ -383,6 +383,7 @@ mkdir python-install cd python-build cmake \ "${cmake_verbose_flags[@]}" \ + "${cmake_python_options[@]}" \ -DCMAKE_IGNORE_PATH=/usr/include \ -DPYTHON_VERSION=${PYTHON_FULL_VER} \ -DPORTABLE_PYTHON_BUILD=ON \ diff --git a/scripts/build_linux_zig.sh b/scripts/build_linux_zig.sh index d8c1e9ff..451b239a 100755 --- a/scripts/build_linux_zig.sh +++ b/scripts/build_linux_zig.sh @@ -576,6 +576,7 @@ mkdir python-install cd python-build LDFLAGS="${LDFLAGS} -lfontconfig -lfreetype" cmake \ "${cmake_verbose_flags[@]}" \ + "${cmake_python_options[@]}" \ -DCMAKE_SYSTEM_PROCESSOR=${ARCH} \ -DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/scripts/qemu_${ARCH}_interpreter \ -DCMAKE_IGNORE_PATH=/usr/include \ diff --git a/scripts/build_macos.sh b/scripts/build_macos.sh index b6b88bff..e97b5727 100755 --- a/scripts/build_macos.sh +++ b/scripts/build_macos.sh @@ -288,6 +288,7 @@ mkdir python-install cd python-build cmake \ "${cmake_verbose_flags[@]}" \ + "${cmake_python_options[@]}" \ -G "Unix Makefiles" \ "-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" \ -DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} \ diff --git a/scripts/build_solaris.sh b/scripts/build_solaris.sh index 1fd79de9..c9d0f72d 100755 --- a/scripts/build_solaris.sh +++ b/scripts/build_solaris.sh @@ -417,6 +417,7 @@ cd python-build # https://stackoverflow.com/a/52240320 CFLAGS="${CFLAGS} -D_XOPEN_SOURCE=500 -D__EXTENSIONS__" LDFLAGS="${LDFLAGS} -lsocket -lnsl" cmake \ "${cmake_verbose_flags[@]}" \ + "${cmake_python_options[@]}" \ -DCMAKE_IGNORE_PATH=/usr/include \ -DPYTHON_VERSION=${PYTHON_FULL_VER} \ -DPORTABLE_PYTHON_BUILD=ON \ diff --git a/scripts/build_windows.sh b/scripts/build_windows.sh index a2df681b..c8307512 100755 --- a/scripts/build_windows.sh +++ b/scripts/build_windows.sh @@ -186,6 +186,7 @@ mkdir python-install cd python-build cmake \ "${cmake_verbose_flags[@]}" \ + "${cmake_python_options[@]}" \ -G "Visual Studio 17 2022" -A x64 \ -DPYTHON_VERSION=${PYTHON_FULL_VER} \ -DPORTABLE_PYTHON_BUILD=ON \ diff --git a/scripts/utils.sh b/scripts/utils.sh index ce1e4d89..5ef109d4 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -50,6 +50,14 @@ fi ARCH=$1 PYTHON_FULL_VER=$2 + +cmake_python_options=() +# Parse Python options out of full version string +if [[ "${PYTHON_FULL_VER}" == *t ]]; then + PYTHON_FULL_VER=${PYTHON_FULL_VER%"t"} + cmake_python_options+=(-DWITH_FREE_THREADING) +fi + DISTRIBUTION=$3 PYTHON_VER=$(echo ${PYTHON_FULL_VER} | cut -d "." -f 1-2) PYTHON_MAJOR=$(echo ${PYTHON_VER} | cut -d "." -f 1)